Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ struct(1) — Duplix 5.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

f77(1)

STRUCT(1)  —  Unix Programmer’s Manual

NAME

struct − structure Fortran programs

SYNOPSIS

struct [ options ] file

DESCRIPTION

Struct translates the Fortran program specified by file (standard input default) into a Ratfor program.  Wherever possible, Ratfor control constructs replace the original Fortran.  Statement numbers appear only where still necessary.  Ratfor makes cosmetic changes, including changing Hollerith strings into quoted strings and relational operators into symbols (.e.g. ".GT." into ">").  Ratfor indents the output appropriately. 

OPTIONS

−a Turns sequences of else ifs into a non-ratfor switch of the form

switch
{case pred1: code
case pred2: code
case pred3: code
default: code
}

Struct tests the case predicates in order and executes the code appropriate to only one case.  This generalized form of switch statement does not occur in Ratfor. 

−b Generates goto’s instead of multilevel break statements. 

−cn Increments successive labels in the output program by the nonzero integer n (1 by default). 

−en If n is 0 (default), places code within a loop only if it can lead to an iteration of the loop.  If n is nonzero, −e admits 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 close to, but not equal to, the number of statements in the code segment.  Values of n under 10 are suggested. 

−i Does not turn computed goto statements into switches.  (Ratfor does not turn switches back into computed goto statements.) 

−n Generates goto’s instead of multilevel next statements. 

−s Accepts input in standard format, i.e., comments are specified by a c, C, or ∗ in column 1, and continuation lines are specified by a nonzero, nonblank character in column 6.  Normally input is in the form accepted by f77(1). 

−tn Makes the nonzero integer n the lowest valued label in the output program (default 10). 

FILES

/tmp/struct∗
/usr/lib/struct/∗

SEE ALSO

f77(1)

BUGS

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 . 

INTEGRATED SOLUTIONS 4.3 BSD  —  April 29, 1985

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026