Re: Lexical Analyzer for F77

jwe@emx.cc.utexas.edu (John W. Eaton)
Wed, 21 Apr 1993 00:25:39 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: jwe@emx.cc.utexas.edu (John W. Eaton)
Keywords: Fortran, lex
Organization: The University of Texas at Austin, Austin, Texas
References: 93-04-073
Date: Wed, 21 Apr 1993 00:25:39 GMT

beaver@broue.rot.qc.ca (Andre Boivert) writes:
> I am looking for a lexical analyzer for Fortran 77 (!!!).


The paper


    J. K. Slape and P. J. L. Wallis, A Modification of Sale's Algorithm
    to Accomodate Fortran 77, The Computer Journal, Volume 34 Number 4,
    1991.


describes a technique for classifying Fortran statements and includes code
(about 350 lines of of Fortran) to do it.


Unfortunately, it isn't complete -- it classifies statement functions as
assignments, and there are several restrictions, such as requiring that
simple goto's must have at least the first digit of the label on the
initial line, and that a logical if statement which has an executable
statement part that begins with the letters `then' must have at least one
more non-blank character on the initial line.


Depending on what you need to do, these restrictions may be acceptable,
and you might be able to use this technique to greatly simplify your
parser.


Another possibility might be to use the GNU Fortran front end. It's in
alpha test now and isn't generally available yet -- ask
fortran@gnu.ai.mit.edu for more information.
--
John W. Eaton, jwe@che.utexas.edu
--


Post a followup to this message

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