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

Stefan Monnier <monnier@iro.umontreal.ca>
Fri, 18 Jul 2014 21:09:58 -0400

          From comp.compilers

Related articles
[3 earlier articles]
Re: LR(1) Parsing : Error Handling & Recovery drikosev@otenet.gr (Evangelos Drikos) (2014-07-17)
Re: LR(1) Parsing : Error Handling & Recovery ivan@ootbcomp.com (Ivan Godard) (2014-07-17)
Re: LR(1) Parsing : Error Handling & Recovery ivan@ootbcomp.com (Ivan Godard) (2014-07-17)
Re: LR(1) Parsing : Error Handling & Recovery gneuner2@comcast.net (George Neuner) (2014-07-17)
Re: LR(1) Parsing : Error Handling & Recovery wclodius@earthlink.net (2014-07-18)
Re: LR(1) Parsing : Error Handling & Recovery wclodius@earthlink.net (2014-07-18)
Re: LR(1) Parsing : Error Handling & Recovery monnier@iro.umontreal.ca (Stefan Monnier) (2014-07-18)
Re: LR(1) Parsing : Error Handling & Recovery DrDiettrich1@aol.com (Hans-Peter Diettrich) (2014-07-19)
Re: LR(1) Parsing : Error Handling & Recovery haberg-news@telia.com (Hans Aberg) (2014-07-19)
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)
[15 later articles]
| List of all articles for this month |

From: Stefan Monnier <monnier@iro.umontreal.ca>
Newsgroups: comp.compilers
Date: Fri, 18 Jul 2014 21:09:58 -0400
Organization: A noiseless patient Spider
References: 14-07-023 14-07-024 14-07-026 14-07-027 14-07-029 14-07-032
Keywords: parse
Posted-Date: 18 Jul 2014 21:23:20 EDT

> This sort of comment has appeared frequently in the past and to some
> extent I find it puzzing. A recursive descent translation of an LL(k)
> (with k small) grammar is straightforward, and should readilly match the
> grammar, and give you the parse you desire. Is the problem that error


This is misleading. Take your BNF and pass it to a PEG parser: a PEG
parser can accept pretty much the same input syntax as a BNF parser, and
can be considered as a kind of RD parser, so you'd think the result is
necessarily correct.
Well, not so, because the semantics of the language is not the same:
The PEG/RD parser will "silently resolve ambiguities".




                Stefan


Post a followup to this message

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