Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!border2.nntp.dca1.giganews.com!border1.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: Thu, 17 Jul 2014 20:15:31 +0300 Organization: An OTEnet S.A. customer Lines: 22 Sender: news@iecc.com Approved: comp.compilers@iecc.com Message-ID: <14-07-026@comp.compilers> References: <14-07-023@comp.compilers> <14-07-024@comp.compilers> NNTP-Posting-Host: news.iecc.com Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: miucha.iecc.com 1405619166 49980 2001:470:1f07:1126:0:676f:7373:6970 (17 Jul 2014 17:46:06 GMT) X-Complaints-To: abuse@iecc.com NNTP-Posting-Date: Thu, 17 Jul 2014 17:46:06 +0000 (UTC) Keywords: parse, errors, LR(1) Posted-Date: 17 Jul 2014 13:46:06 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:1316 Hello, On 7/16/14, 11:39 PM, Ivan Godard wrote: > FWIW, I recall hearing that GCC switched from LR1 (LALR?) to > recursive-descent a few years back. Yes, gcc switched to a hand-coded parser; the gcc team claimed that one of the benefits was diagnostic location improvements (and potentially other diagnostic improvements);see https://gcc.gnu.org/wiki/New_C_Parser But, I guess they could say the same thing if they replaced the hand coded Fortran parser with a LALR parser. Ibve compared recently an enhanced LALRb parser with gfortran; the former has better error recovery and in many cases more accurate error messages whereas the latter sometimes just prints the clichC) bUnclassifiable Statementb. Anyway, other implementers (e.g. clang team) also confirm that C++ is best parsed by a recursive descent parser; Ibve not created a C++ parser and cannot comment on it. Regards, Ev. Drikos