Bell 32V development
[unix-history] / usr / man / man1 / struct.1
CommitLineData
c1030a02
TL
1.TH STRUCT 1
2.SH NAME
3struct \- structure Fortran programs
4.SH SYNOPSIS
5.B struct
6[ option ] ...
7file
8.SH DESCRIPTION
9.LP
10.I Struct
11translates the Fortran program specified by
12.I file
13(standard input default)
14into a Ratfor program.
15Wherever possible, Ratfor control constructs
16replace the original Fortran.
17Statement numbers appear only where still necessary.
18Cosmetic changes are made, including changing Hollerith strings
19into quoted strings
20and relational operators into symbols (.e.g. ".GT." into ">").
21The output is appropriately indented.
22.PP
23The following options may occur in any order.
24.TP
25.B \-s
26Input is accepted in standard format, i.e.
27comments are specified by a c, C, or * in column 1, and continuation lines
28are specified by a nonzero, nonblank character in column 6.
29Normally input is in the form accepted by
30.IR f77 (1)
31.TP
32.B \-i
33Do not turn computed goto statements into
34switches.
35(Ratfor does not turn switches back
36into computed goto statements.)
37.TP
38.B \-a
39Turn sequences of else ifs into a
40non-Ratfor switch of the form
41.IP
42.nf
43.ta 5 7
44switch
45 { case pred1: code
46 case pred2: code
47 case pred3: code
48 default: code
49 }
50.fi
51.DT
52.IP
53The case predicates are tested in order;
54the code appropriate to only one case is executed.
55This generalized form of switch statement does not
56occur in Ratfor.
57.TP
58.B \-b
59Generate goto's instead of multilevel break statements.
60.TP
61.B \-n
62Generate goto's instead of multilevel next statements.
63.TP
64.BI \-t n
65Make
66the nonzero integer
67.I n
68the lowest valued label in the output program
69(default 10).
70.TP
71.BI \-c n
72Increment successive labels
73in the output program
74by the nonzero integer
75.I n
76(default 1).
77.TP
78.BI \-e n
79If
80.I n
81is 0 (default),
82place code within a loop only if it can
83lead to an iteration of the loop.
84If
85.I n
86is nonzero,
87admit a small code segments to a loop
88if otherwise the loop would have exits to several places including the segment,
89and the segment can be reached only from the loop.
90`Small' is close to, but not equal to, the
91number of statements in the code segment.
92Values of n under 10 are suggested.
93.SH FILES
94/tmp/struct*
95.br
96/usr/lib/struct/*
97.SH SEE ALSO
98f77(1)
99.SH BUGS
100Struct knows Fortran 66 syntax, but not full Fortran 77.
101.br
102If an input Fortran program contains identifiers which
103are reserved words in Ratfor, the structured
104version of the program
105will not be a valid Ratfor program.
106.br
107The labels generated cannot go above 32767.
108.br
109If you get a goto without a target, try
110.B \-e .