Re: LR(1) Parsing : Error Handling & Recovery

Chris Dodd <cdodd@acm.org>
Mon, 21 Jul 2014 06:07:55 +0000 (UTC)

          From comp.compilers

Related articles
[12 earlier articles]
Re: LR(1) Parsing : Error Handling & Recovery drikosev@otenet.gr (Evangelos Drikos) (2014-07-20)
Re: LR(1) Parsing : Error Handling & Recovery haberg-news@telia.com (Hans Aberg) (2014-07-20)
Re: LR(1) Parsing : Error Handling & Recovery gneuner2@comcast.net (George Neuner) (2014-07-20)
Re: LR(1) Parsing : Error Handling & Recovery arnold@skeeve.com (2014-07-20)
Re: LR(1) Parsing : Error Handling & Recovery monnier@iro.umontreal.ca (Stefan Monnier) (2014-07-20)
Re: LR(1) Parsing : Error Handling & Recovery wclodius@earthlink.net (2014-07-20)
Re: LR(1) Parsing : Error Handling & Recovery cdodd@acm.org (Chris Dodd) (2014-07-21)
Re: LR(1) Parsing : Error Handling & Recovery DrDiettrich1@netscape.net (Hans-Peter Diettrich) (2014-07-21)
Re: LR(1) Parsing : Error Handling & Recovery drikosev@otenet.gr (Evangelos Drikos) (2014-07-21)
Re: LR(1) Parsing : Error Handling & Recovery haberg-news@telia.com (Hans Aberg) (2014-07-21)
Re: LR(1) Parsing : Error Handling & Recovery wclodius@earthlink.net (2014-07-21)
Re: LR(1) Parsing : Error Handling & Recovery gneuner2@comcast.net (George Neuner) (2014-07-25)
Re: LR(1) Parsing : Error Handling & Recovery cdodd@acm.org (Chris Dodd) (2014-07-26)
[6 later articles]
| List of all articles for this month |
From: Chris Dodd <cdodd@acm.org>
Newsgroups: comp.compilers
Date: Mon, 21 Jul 2014 06:07:55 +0000 (UTC)
Organization: A noiseless patient Spider
References: 14-07-023 14-07-024 14-07-030 14-07-031 14-07-041
Keywords: parse, theory
Posted-Date: 21 Jul 2014 10:09:21 EDT

George Neuner <gneuner2@comcast.net> wrote in news:14-07-041@comp.compilers:
> LL(k) always can be refactored to single token lookahead, but it
> causes an explosion of grammar states. E.g., given a single LL(3)
> rule, an equivalent set of LL(1) rules must match every valid
> combination of tokens at +1, +2 and +3.


Not true -- LL(k+1) languages are a strict superset of LL(k) languages, so
there exist LL(k) grammars that cannot be refactored to a smaller k.


LR(k) languages are equivalent the LR(1), so every LR(k) grammar can be
refactored to LR(1)


A useful summary of the relationships between various types of languages and
grammars can be found at


<http://cs.stackexchange.com/questions/43/language-theoretic-comparison-of-ll-and-lr-grammars>


Chris Dodd
cdodd@acm.org



Post a followup to this message

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