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,  a  statement  whose  first  nonblank  character  is  not
25              alphanumeric is treated as a continuation.
26
27       -i     Do not turn computed goto  statements  into  switches.   (Ratfor
28              does not turn switches back into computed goto statements.)
29
30       -a     Turn sequences of else ifs into a non-Ratfor switch of the form
31
32              switch {
33                     case pred1: code
34                     case pred2: code
35                     case pred3: code
36                     default: code
37                   }
38
39              The case predicates are tested in order; the code appropriate to
40              only one case is executed.   This  generalized  form  of  switch
41              statement does not occur in Ratfor.
42
43       -b     Generate goto's instead of multilevel break statements.
44
45       -n     Generate goto's instead of multilevel next statements.
46
47
48       -en    If  n is 0 (default), place code within a loop only if it
49              can lead to an iteration of the loop.  If n  is  nonzero,
50              admit  code  segments  with  fewer than n statements to a
51              loop if otherwise the loop would have  exits  to  several
52              places  including  the  segment,  and  the segment can be
53              reached only from the loop.
54

FILES

56       /tmp/struct*
57       /usr/lib/struct/*
58

SEE ALSO

60       f77(1)
61

BUGS

63       Struct knows Fortran 66 syntax, but not full Fortran 77  (alter‐
64       nate returns, IF...THEN...ELSE, etc.)
65       If  an  input  Fortran  program  contains  identifiers which are
66       reserved words in Ratfor, the structured version of the  program
67       will not be a valid Ratfor program.
68       Extended range DO's generate cryptic errors.
69       Columns 73-80 are not special even when -s is in effect.
70       Will not generate Ratfor FOR statements.
71
72
73
74                                                                     STRUCT(1)
Impressum