Re: LL(1) vs LALR(1) parsers

will@ccs.neu.edu (William D Clinger)
Tue, 28 Nov 1995 16:36:52 GMT

          From comp.compilers

Related articles
[4 earlier articles]
Re: LL(1) vs LALR(1) parsers parrt@lonewolf.parr-research.com (1995-11-14)
Re: LL(1) vs LALR(1) parsers simmons@bnr.ca (steve (s.s.) simmons) (1995-11-15)
Re: LL(1) vs LALR(1) parsers parrt@parr-research.com (Terence John Parr) (1995-11-20)
Re: LL(1) vs LALR(1) parsers bill@amber.ssd.hcsc.com (1995-11-22)
Re: LL(1) vs LALR(1) parsers elliottc@logica.com (1995-11-24)
Re: LL(1) vs LALR(1) parsers jgj@ssd.hcsc.com (1995-11-28)
Re: LL(1) vs LALR(1) parsers will@ccs.neu.edu (1995-11-28)
Re: LL(1) vs LALR(1) parsers ddean@dynastar.cs.princeton.edu (1995-11-28)
Re: LL(1) vs LALR(1) parsers napi@ms.mimos.my (1995-11-28)
Re: LL(1) vs LALR(1) parsers ok@cs.rmit.edu.au (1995-11-29)
Re: LL(1) vs LALR(1) parsers mparks@oz.net (1995-11-29)
Re: LL(1) vs LALR(1) parsers jmccarty@spdmail.spd.dsccc.com (1995-11-29)
Re: LL(1) vs LALR(1) parsers pardo@cs.washington.edu (1995-11-29)
[11 later articles]
| List of all articles for this month |
Newsgroups: comp.compilers
From: will@ccs.neu.edu (William D Clinger)
Keywords: parse, LL(1), LALR
Organization: College of CS, Northeastern University
References: 95-11-051 95-11-086 95-11-201
Date: Tue, 28 Nov 1995 16:36:52 GMT

elliottc@logica.com writes:
>LR parsers have many other advantages over LL(1) parsers....
>.... an LR parser can recognise a syntax error in the input
>stream as soon as it is possible to do so....


LL(k) parsers also have this ``viable prefix'' property.


By the way, I use a parser generator to generate recursive descent
LL(1) parsers. The parsers generated by my parser generator have
an even stronger property that Fischer and LeBlanc call the
``immediate error-detection'' property. That is, the parser
not only detects the error after reading the shortest possible
prefix of the input, it also detects the error before making any
internal state transitions. This allows for the best possible
error reporting and recovery.


To take advantage of this requires a lot of hand tuning, as
previously noted. But the parser generator guarantees that
you're starting with an LL(1) parser that is known to be correct
and is known to have the immediate error-detection property.


William D Clinger
--


Post a followup to this message

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