home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.compilers
- Path: sparky!uunet!think.com!spdcc!iecc!compilers-sender
- From: ejy@hrmsc.att.com (Eugene Yurek)
- Subject: Re: A Non-LALR(1) Parser Generator
- Reply-To: ejy@hrmsc.att.com (Eugene Yurek)
- Organization: AT&T
- Date: Tue, 18 Aug 1992 17:50:36 GMT
- Approved: compilers@iecc.cambridge.ma.us
- Message-ID: <92-08-104@comp.compilers>
- References: <92-08-090@comp.compilers>
- Keywords: LR(1)
- Sender: compilers-sender@iecc.cambridge.ma.us
- Lines: 42
-
- 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]
- --
- Send compilers articles to compilers@iecc.cambridge.ma.us or
- {ima | spdcc | world}!iecc!compilers. Meta-mail to compilers-request.
-