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