Is there a fort2c?

Roger Christman DVL at PSUVM.BITNET
Fri Dec 8 14:28:25 AEST 1989


My Masters thesis here at Penn State U is to write a Fortran/C
translator.  I'm doing it mostly off the top of my head.
It is a bit more complex (and therefore better) than simple
line-by-line translation.  It is designed to accept any Fortran 66
program and translate it into an equivalent C source.  Program flow
structure is analyzed so that even the messiest GOTO arrangements
should find themselves better approximating such things as loops
and switches.

The program is not yet completed -- I am in the middle of handling
subroutine parameters.  It will determine which parameters are more
appropriate as call by value, instead of Fortran's default to call
by reference.

The upshot of all this is that the resulting program will be more
intuitively structured, as well as more efficient than the original.
As an example of current benchmarks, using the F77 and CC compilers
on a Sun Workstation Unix machine, my program is doing quite well.
The time required to translate into C and compile there is less than
the original Fortran compilation time.  Also, the object code in C
executes faster than the original Fortran.

If you would like to find out more later on, when I approach the end
of the project, please send me mail at this address.  I must warn you
that this project is for academic reasons alone, and is not designed
with production-scale error-checking.  If your program will not compile
in Fortran 66, don't expect this translator to give you very meaningful
results.

To quote from my finger plan:
Plan:
        Make sense of the most inscrutable Fortran code.
        To translate such code into a C source which will ru
^^}}---^^^^ggggggggg`````
Segmentation fault (core dumped)

Roger Christman
No Sig



More information about the Comp.lang.c mailing list