help-flex
[Top][All Lists]
Advanced

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

Re: Fortran Code Scanner with Flex


From: Hans-Bernhard Broeker
Subject: Re: Fortran Code Scanner with Flex
Date: Fri, 18 Jul 2003 11:29:34 +0200 (MET DST)

On Fri, 18 Jul 2003, Leor V wrote:

> I’m an Undergraduate and as a project I’m creating a Fortran code scanner
> using flex. I’m in fact modifying an existing C scanner in flex (around 1500
> lines of code) to do the same task for Fortran.

I would advise against that approach.  You can certainly look at that C
scanner (which one?), sure, but you should not try to morph it into one
for Fortran.  The two languages are just *too* different.  Lexing C is
quite simple, but Fortran is an absolute bitch of a language
as far as lexers are concerned, if only because of crazy stuff like the
distinction between

        DOI=1.10
and     DOI=1,10

One is a loop statement, the other is assignment, and they should be
parsed in entirely different ways.

> Do you have any idea how long it would take complete such a task?

For a newbie?  Well, it depends on your background, but I'd expect more
than 3 months, up to virtually forever.

-- 
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]