Re: A Non-LALR(1) Parser Generator

ejy@hrmsc.att.com (Eugene Yurek)
Tue, 18 Aug 1992 17:50:36 GMT

          From comp.compilers

Related articles
A Non-LALR(1) Parser Generator dan%npt1@uunet.UU.NET (1992-08-03)
Re: A Non-LALR(1) Parser Generator Peter.Breuer@prg.oxford.ac.uk (1992-08-05)
Re: A Non-LALR(1) Parser Generator bromage@mullauna.cs.mu.oz.au (1992-08-17)
Re: A Non-LALR(1) Parser Generator ejy@hrmsc.att.com (1992-08-18)
Re: A Non-LALR(1) Parser Generator pakstas@idt.unit.no (1992-08-17)
Re: A Non-LALR(1) Parser Generator bromage@mullauna.cs.mu.OZ.AU (1992-08-20)
Re: A Non-LALR(1) Parser Generator steveh@psg.com (1992-08-22)
Re: A Non-LALR(1) Parser Generator fm04@rummelplatz.uni-mannheim.de (1992-08-25)
| List of all articles for this month |

Newsgroups: comp.compilers
From: ejy@hrmsc.att.com (Eugene Yurek)
Organization: AT&T
Date: Tue, 18 Aug 1992 17:50:36 GMT
References: 92-08-090
Keywords: LR(1)

bromage@mullauna.cs.mu.oz.au (Andrew Bromage):
>[are there non-LALR parser generators?]
> D Pager has produced a few algorithms which may be of some use.
> ...
> The first (ie simpler) algorithm was used in a parser compiler called
> "LR", the availability of which I know nothing about.
>
> It was reviewed in:
> Wetherell and Shannon, "LR - automatic parser generator and LR(1) parser",
> IEEE Transactions on Software Engineering, SE-7, pp 274-278, 1981.


I, at one time (I may still have the source laying around somewhere)
played with a copy of the LR parser generator. It is all written in
Fortran (as I remember). It accepts a somewhat preprocessed BNF
(cannibalized) notation.


Charlie Wetherell originally wrote LR along with Shannon for some
government entity they were either employed for or were working on a
contract for, so, consequently, the entire source is in the public domain.


The source tape is available from the government (some program repository,
though I can't remember which one). It comes with a sample parser for the
tables it generates.


This generator is not easy to use compared to YACC. You cannot provide
semantic actions within the grammar. They must be handled in a separate
source file, and manually tied back to the productions in the BNF (yuk!!).
Basically, I'm saying that LR works well, however, its not that easy to
use (though this is a subjective observation on my part). And as I said
above, you're going to need a Fortran compiler, and some patience to use
it. It is, however, the only LR(1) parser generator that I've ever come
across (please, no flames!!!).
--
Gene Yurek
ejy@hrmsg.att.com AT&T Bell Laboratories, Middletown, NJ
[One of the reasons that yacc became so popular is that it let you put the
action code next to the grammar rule to which it applies. Until then all the
parser generators I knew of required that you match up the rules and the code
yourself. -John]
--


Post a followup to this message

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