Fortran Parser Question

Mark Jackson mjackson at wc.eso.mc.xerox.com
Fri Apr 13 16:40:58 EDT 2001


"Hassan Aurag" <aurag at geocities.com> writes:

>  I am trying to write a Fortran parser in python.
> 
>  What I need is really simple. Given a fortran file, get all variables
> with their type and decompose arthmetic operations. Stuff like a = b+c
> ..... and check their types to see if those ops can be dangerous when
> ported on various platforms.
> 
>  So, I won't need a full fledged compiler, but really something simple. I
> am new to regular exps and friends, so if anyone can help with something
> simple I can start with, please drop me a note!

Either this is a usage of "really simple" with which I was previously
unfamiliar, or you have seriously underestimated the difficulty of the
task described.

Comparatively minor example:  as whitespace is not significant in Fortran
a statement that begins "DO 50 I =" could be either the beginning of
a do-loop that extends through statement 50, or the beginning of an
assignment to the variable do50i.

-- 
Mark Jackson - http://www.alumni.caltech.edu/~mjackson
    Popular memory may be short, but it is nothing
    compared with the amnesia of experts.
			- Adam Gopnik





More information about the Python-list mailing list