Xref: utzoo comp.lang.c:24377 comp.lang.fortran:2725 comp.lang.misc:3726 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!cica!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!uwm.edu!psuvax1!psuvm!dvl From: DVL@PSUVM.BITNET (Roger Christman) Newsgroups: comp.lang.c,comp.lang.fortran,comp.lang.misc Subject: Re: Is there a fort2c? Message-ID: <89341.222825DVL@PSUVM.BITNET> Date: 8 Dec 89 03:28:25 GMT References: <6258@cbnewsh.ATT.COM> Distribution: usa Organization: Penn State University Lines: 38 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