Lexical Analyzer for F77

beaver@broue.rot.qc.ca (Andre Boivert)
Tue, 20 Apr 1993 16:44:21 GMT

          From comp.compilers

Related articles
Lexical Analyzer for F77 beaver@broue.rot.qc.ca (1993-04-20)
Re: Lexical Analyzer for F77 jwe@emx.cc.utexas.edu (1993-04-21)
| List of all articles for this month |
Newsgroups: comp.compilers
From: beaver@broue.rot.qc.ca (Andre Boivert)
Keywords: Fortran, lex, question, comment
Organization: Compilers Central
Date: Tue, 20 Apr 1993 16:44:21 GMT

I am looking for a lexical analyzer for Fortran 77 (!!!). I started to
write one using Lex, but it seems that it is not best way to go (is that
right?).


I heard of a program called 'fortlex' that could do the job.


If you have any sources (preferably in C), algorithms, references that
could help me, I would greatly appreciate.


Thank you.


Andre Boisvert
beaver@rot.qc.ca
[My Fortran subset parser in the compilers archives does a fairly respectable
job of tokenizing Fortran. You can't tokenize it without doing a certain
amount of parsing as well, e.g., "10e5" is a floating point number except
in the context "do 10e5 = 1,100" where it is the statement number 10 and
the variable name e5, or "do 10e5 = 1.100" where do10e5 is a variable name.
I'd say it's not as bad as it sounds, but it is. In the full F77 parser I
wrote for INfort 15 years ago there were at least 12 separate lexical kludges
like that. -John]
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.