Is Fortran90 LL(1)?

Dave Lloyd <>
8 Apr 1996 23:21:40 -0400

          From comp.compilers

Related articles
Is Fortran90 LL(1)? (Christian Rutzinger) (1996-04-04)
Re: Is Fortran90 LL(1)? (1996-04-08)
Is Fortran90 LL(1)? (Dave Lloyd) (1996-04-08)
Re: Is Fortran90 LL(1)? (1996-04-16)
Re: Is Fortran90 LL(1)? Robert.Corbett@Eng.Sun.COM (1996-04-18)
| List of all articles for this month |

From: Dave Lloyd <>
Newsgroups: comp.compilers
Date: 8 Apr 1996 23:21:40 -0400
Organization: Compilers Central
References: 96-04-024
Keywords: Fortran, parse

> After taking a look on the Fortran90 Standard, I recognized at least
> one problem.

Keep looking and the problems never stop... :-(

I'm afraid you have little choice but to cook up an ad hoc parser that
handles most statements as special cases of their own (with some
occasional overlap). You will need arbitrary look ahead to the end of
statement (which you can only find once you've got past any
holleriths) and be prepared to back-track a lot. The new bits aren't
too bad, but F90 is a superset of F77, so I would advise reading up on
the grungy techniques used to parse F77 and work upwards.

This is not an easy job, and unless you have substantial resources, I
would recommend buying into an existing parser (ours, NAG's, ...?).

What are you trying to achieve ? - there are ways to fudge parsing
Fortran if, say, you are only interested in editor support for
keywords and control structures.

Dave Lloyd Email:
Oxford and Cambridge Compilers Ltd Phone: (44) 1223 572074
55 Brampton Rd, Cambridge CB1 3HJ, UK

Post a followup to this message

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