Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news.iecc.com!.POSTED!nerds-end From: Stefan Monnier Newsgroups: comp.compilers Subject: Re: LR(1) Parsing : Error Handling & Recovery Date: Fri, 18 Jul 2014 21:09:58 -0400 Organization: A noiseless patient Spider Lines: 14 Sender: news@iecc.com Approved: comp.compilers@iecc.com Message-ID: <14-07-034@comp.compilers> References: <14-07-023@comp.compilers> <14-07-024@comp.compilers> <14-07-026@comp.compilers> <14-07-027@comp.compilers> <14-07-029@comp.compilers> <14-07-032@comp.compilers> NNTP-Posting-Host: news.iecc.com Mime-Version: 1.0 Content-Type: text/plain X-Trace: miucha.iecc.com 1405733000 29285 2001:470:1f07:1126:0:676f:7373:6970 (19 Jul 2014 01:23:20 GMT) X-Complaints-To: abuse@iecc.com NNTP-Posting-Date: Sat, 19 Jul 2014 01:23:20 +0000 (UTC) Keywords: parse Posted-Date: 18 Jul 2014 21:23:20 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:1324 > 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