STRUCT(1) COMMAND REFERENCE STRUCT(1)
NAME
struct - structure FORTRAN programs
SYNOPSIS
struct [ -a ][ -b ][ -cn ][ -en ][ -i ][ -n ][ -s ][ -tn ]
filename
DESCRIPTION
Struct translates the FORTRAN program specified by filename
(standard input default) into a Ratfor program. Wherever
possible, Ratfor control constructs replace the original
FORTRAN. Statement numbers appear only where still
necessary. Cosmetic changes are made, including changing
Hollerith strings into quoted strings and relational
operators into symbols (for example, .GT. into >). The
output is appropriately indented.
OPTIONS
-a Turn sequences of else-if's into a non-Ratfor switch of
the form
switch
{ case pred1: code
case pred2: code
case pred3: code
default: code
}
The case predicates are tested in order; the code
appropriate to only one case is executed. This
generalized form of switch statement does not occur in
Ratfor.
-b Generate goto's instead of multilevel break statements.
-cn Increment successive labels in the output program by
the nonzero integer n (default 1).
-en If n is 0 (default), place code within a loop only if
it can lead to an iteration of the loop. If n is
nonzero, admit a small code segments to a loop if
otherwise the loop would have exits to several places
including the segment, and the segment can be reached
only from the loop. Small is near, but not equal to,
the number of statements in the code segment. Values
of n under 10 are suggested.
-i Do not turn computed goto statements into switches.
(Ratfor does not turn switches back into computed goto
statements.)
Printed 10/17/86 1
STRUCT(1) COMMAND REFERENCE STRUCT(1)
-n Generate goto's instead of multilevel next statements.
-s Input is accepted in standard format; for example,
comments are specified by a c, C, or * in column one,
and continuation lines are specified by a nonzero,
nonblank character in column six. Normally input is in
the form accepted by f77(1).
-tn Make the nonzero integer n the lowest valued label in
the output program (default 10).
FILES
/tmp/struct* Temporary storage
/usr/lib/struct/* Various optional programs
CAVEATS
Struct knows FORTRAN 66 syntax, but not full FORTRAN 77.
If an input FORTRAN program contains identifiers, which are
reserved words in Ratfor, the structured version of the
program will not be a valid Ratfor program.
The labels generated cannot go above 32767.
If you get a goto without a target, try -e.
SEE ALSO
f77(1).
Printed 10/17/86 2
%%index%%
na:72,71;
sy:143,290;
de:433,629;
op:1062,1522;2728,580;
fi:3308,188;
ca:3496,461;
se:3957,95;
%%index%%000000000128