Re: Fortran 77 parser
- From: Jon Harrop <jon@xxxxxxxxxxxxxxxxx>
- Date: Fri, 04 Apr 2008 14:12:34 +0100
Tobias Burnus wrote:
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.
Yes. Fortunately, the code I am translating is almost very cleanly
written. :-)
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
No. This could be fixed by lexing keywords directly rather than via
identifiers.
realprint
No. Same solution.
logicalif
No.
end=5
Yes.
if=.true.
Yes.
if(if)read(*,*)print,integer
Yes.
end
Yes.
Having said that, the generated code would be broken anyway. :-)
--
Dr Jon D Harrop, Flying Frog Consultancy
http://www.ffconsultancy.com/products/?u
.
- Follow-Ups:
- Re: Fortran 77 parser
- From: glen herrmannsfeldt
- Re: Fortran 77 parser
- References:
- Re: Fortran 77 parser
- From: Jon Harrop
- Re: Fortran 77 parser
- From: Tobias Burnus
- Re: Fortran 77 parser
- Prev by Date: Re: glibc detected *** ./run.out: munmap_chunk(): invalid pointer:
- Next by Date: Re: Fortran 77 parser
- Previous by thread: Re: Fortran 77 parser
- Next by thread: Re: Fortran 77 parser
- Index(es):
Relevant Pages
|
|