Re: Fortran 77 parser



On Apr 4, 2:46 pm, Jon Harrop <j...@xxxxxxxxxxxxxxxxx> wrote:
Steven G. Kargl wrote:
If all you really care about is Fortran 77, then grab f2c
from netlib. Otherwise, I think you severely under estimate
the difficult involved with one person writing a Fortran 77
compiler.

Actually I have now completed the compiler and it was fiddly but really not
that difficult (~1 week full-time work using OCaml). I processed the code
in several stages:

I think both statements are true. Writing a full parser of Fortran 77
which supports all syntax is extremely demanding. Writing a parser
which converts a "typical" Fortran code or even better a Fortran code
following a special style much less demanding.

Does it parse the following?

integerinteger,end
realprint
logicalif
end=5
if=.true.
if(if)read(*,*)print,integer
end

Tobias

--
"Consistently separating words by spaces became a general custom about
the tenth century A.D., and lasted until about 1957, when FORTRAN
abandoned the practice." -- Sun FORTRAN Reference Manual
.



Relevant Pages

  • Re: Calling a fortran subroutine from Visual C++
    ... lets me compile fortran code along with the C++ program to be able to call the fortran code as a subroutine. ... have you tried Windows Services for Unix? ... compiler, they sold the product and it became the DEC Fortran compiler for Windows, which became the Compaq Fortran compiler for Windows, and then Compaq or HP sold the product and now it's the Intel Fortran compiler for Windows. ...
    (microsoft.public.dotnet.languages.vc)
  • Re: Calling a fortran subroutine from Visual C++
    ... >I have a C++ program written and compiled on Solaris 8 with gcc. ... > lets me compile fortran code along with the C++ program to be able to call ... > the fortran code as a subroutine. ... I don't believe that MS sells a Fortran compiler. ...
    (microsoft.public.dotnet.languages.vc)
  • Re: trailing double underscores
    ... and appears to consider g77 as THE STANDARD FORTRAN. ... Off-topic, but many open-source projects using Fortran code, such as ... arguably g77 is still the standard Fortran ... compiler for the standard version of Fortran, ...
    (comp.lang.fortran)
  • Re: Reading MS-FORTRAN unformatted binary files *efficiently*
    ... > Jeff Godfrey wrote: ... >>>consider writing a small FORTRAN program to read the files and write ... >>>long time since I used that particular FORTRAN compiler), ... The format rings all kinds of bells. ...
    (comp.lang.tcl)
  • Re: Bit Concatenation
    ... use a current compiler, it's generally a F95 compiler, But that really is ... I try to write "standard" Fortran. ... you mention below have nothing to do with F90 versus F77. ... Only about writing new interfaces for nearly two hundred modules. ...
    (comp.lang.fortran)