1STRUCT(1)                   General Commands Manual                  STRUCT(1)
2
3
4

NAME

6       struct - structure Fortran programs
7

SYNOPSIS

9       struct [ option ] ...  file
10

DESCRIPTION

12       Struct translates the Fortran program specified by file (standard input
13       default) into a Ratfor program.  Wherever possible, Ratfor control con‐
14       structs  replace  the  original Fortran.  Statement numbers appear only
15       where still necessary.  Cosmetic changes are made,  including  changing
16       Hollerith  strings  into  quoted  strings and relational operators into
17       symbols (.e.g. ".GT." into ">").  The output is appropriately indented.
18
19       The following options may occur in any order.
20
21       -s     Input is accepted in standard format, i.e.  comments are  speci‐
22              fied  by  a  c,  C, or * in column 1, and continuation lines are
23              specified by a nonzero, nonblank character in  column  6.   Nor‐
24              mally input is in the form accepted by f77(1)
25
26       -i     Do  not  turn  computed  goto statements into switches.  (Ratfor
27              does not turn switches back into computed goto statements.)
28
29       -a     Turn sequences of else ifs into a non-Ratfor switch of the form
30
31              switch
32                   { case pred1: code
33                     case pred2: code
34                     case pred3: code
35                     default: code
36                   }
37
38              The case predicates are tested in order; the code appropriate to
39              only  one  case  is  executed.   This generalized form of switch
40              statement does not occur in Ratfor.
41
42       -b     Generate goto's instead of multilevel break statements.
43
44       -n     Generate goto's instead of multilevel next statements.
45
46       -tn    Make the nonzero integer n the lowest valued label in the output
47              program (default 10).
48
49       -cn    Increment successive labels in the output program by the nonzero
50              integer n (default 1).
51
52       -en    If n is 0 (default), place code within a loop  only  if  it  can
53              lead  to  an  iteration  of  the loop.  If n is nonzero, admit a
54              small code segments to a loop if otherwise the loop  would  have
55              exits  to  several places including the segment, and the segment
56              can be reached only from the loop.  `Small' is close to, but not
57              equal  to, the number of statements in the code segment.  Values
58              of n under 10 are suggested.
59

FILES

61       /tmp/struct*
62       /usr/libexec/struct/*
63

SEE ALSO

65       f77(1)
66

BUGS

68       Struct knows Fortran 66 syntax, but not full Fortran 77.
69       If an input Fortran program contains  identifiers  which  are  reserved
70       words  in  Ratfor,  the structured version of the program will not be a
71       valid Ratfor program.
72       The labels generated cannot go above 32767.
73       If you get a goto without a target, try -e .
74
75
76
777th Edition                    October 22, 1996                      STRUCT(1)
Impressum