help-flex
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fortran


From: Hans-Bernhard Broeker
Subject: Re: Fortran
Date: Mon, 17 Feb 2003 16:19:45 +0100 (MET)

On Mon, 17 Feb 2003, Mhaxx wrote:

> Could someone tell me if there is a free Fortran grammar to use to develop a
> simple scanner/parser with Flex/Bison or other resources that could help me
> for my project?

AFAIK, there can't be such a thing --- FORTRAN is notorious for being
impossible to parse by a LALR(1) parser, the type YACC and Bison generate.
The problem is that some constructs like

        DO ing=1,10

as opposed to

        DO ING = 1.5

need more than one token look-ahead to be parseable.  

Same goes for scanning --- all thanks to the blasted craziness of FORTRAN
ignoring all blanks, *everywhere*, even in the middle of a reserved word
or identifier, so DOING and D O  I N   G  are the same thing, to F77.

-- 
Hans-Bernhard Broeker (address@hidden)
Even if all the snow were burnt, ashes would remain.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]