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

Evangelos Drikos <drikosev@otenet.gr>
Sun, 20 Jul 2014 00:40:48 +0300

          From comp.compilers

Related articles
[6 earlier articles]
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)
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)
[13 later articles]
| List of all articles for this month |
From: Evangelos Drikos <drikosev@otenet.gr>
Newsgroups: comp.compilers
Date: Sun, 20 Jul 2014 00:40:48 +0300
Organization: An OTEnet S.A. customer
References: 14-07-023 14-07-024 14-07-030 14-07-031 14-07-038
Keywords: parse
Posted-Date: 19 Jul 2014 18:20:24 EDT

Hello,


On 7/19/14, 4:29 PM, Hans Aberg wrote:
> A GLR parser splits the parses in face of an ambiguity, which might be
> used instead. Bison supports this, but currently the actions during a
> parse split are not executed, and so cannot set context variables for
> the lexer, until the merge.


A GLR parser splits on conflicts and thus needs two different types of
actions. I recall that DParser uses the terms speculative and final.
In my GLR Builder I use the terms semantic checks & actions.


Semantic checks are not delayed when the parser splits but they should
not have side effects. In general, it is unsafe to notify the scanner
that the parser has just reached a particular state.


In contrast, you can query a symbol table to reject an active parser or
just create a node for the AST of the current parse. BTW, its my
impression that Elkhound and Elsa parse C++ with actions that actually
are immediate; but i have not read their code to be sure.


To conclude, in a deterministic LALR parser semantic actions are both
immediate and final but in a GLR parser this principle doesn't hold.


Hope this helps,
Ev. Drikos


Post a followup to this message

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