Table of Contents

Name

fixfortran - final processing for the SUIF Fortran 77 front end

Synopsis

fixfortran infile outfile

Description

The fixfortran program forms the last of four passes that constitute the SUIF front end for Fortran 77. The first three passes are sf2c, cpp (the standard C pre-processor, not SUIF specific), and snoot. The process is as follows: The sf2c pass converts from Fortran to a special form of C that retains some special Fortran information, including the Fortran array types, encoded in C constructs such as variables with special names. The cpp and snoot passes convert from this C code directly to the corresponding SUIF representation. These two C passes have no knowledge of the Fortran information. Then fixfortran converts from the SUIF representation of C code to a representation of Fortran that reconstructs critical Fortran information that was encoded in the C representation.

This scheme allows us to take advantage of an existing Cto-SUIF converter and most of an existing Fortran-to-C converter. By making some modifications to the Fortranto-C converter and adding this pass, we can get back the most important Fortran information while re-using all the existing code.

It is essential that fixfortran is run immediately after snoot. Any other pass might change the code in such a way that fixfortran will not find the very specially patterned code sf2c uses to encode the Fortran information. fixfor_tran will also be entirely confused and unable to function if run on code that was originally C not produced by sf2c. In either case, fixfortran will likely fail with an error message and even if it does produce an output file, the resulting code is likely to be incorrect.

See Also

sf2c(1) , cpp(1) , snoot(1)

History

This program was written by Chris Wilson. Before it existed, some of its functionality was implemented in earlier versions of the C front end, snoot and snout.


Table of Contents