Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!border1.nntp.dca1.giganews.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news.iecc.com!.POSTED!nerds-end From: Evangelos Drikos Newsgroups: comp.compilers Subject: Re: LR(1) Parsing : Error Handling & Recovery Date: Sun, 20 Jul 2014 00:40:48 +0300 Organization: An OTEnet S.A. customer Lines: 26 Sender: news@iecc.com Approved: comp.compilers@iecc.com Message-ID: <14-07-039@comp.compilers> References: <14-07-023@comp.compilers> <14-07-024@comp.compilers> <14-07-030@comp.compilers> <14-07-031@comp.compilers> <14-07-038@comp.compilers> NNTP-Posting-Host: news.iecc.com Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: miucha.iecc.com 1405808424 31428 2001:470:1f07:1126:0:676f:7373:6970 (19 Jul 2014 22:20:24 GMT) X-Complaints-To: abuse@iecc.com NNTP-Posting-Date: Sat, 19 Jul 2014 22:20:24 +0000 (UTC) Keywords: parse Posted-Date: 19 Jul 2014 18:20:24 EDT X-submission-address: compilers@iecc.com X-moderator-address: compilers-request@iecc.com X-FAQ-and-archives: http://compilers.iecc.com Xref: csiph.com comp.compilers:1329 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