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: Chris Dodd Newsgroups: comp.compilers Subject: Re: LR(1) Parsing : Error Handling & Recovery Date: Mon, 21 Jul 2014 06:07:55 +0000 (UTC) Organization: A noiseless patient Spider Lines: 20 Sender: news@iecc.com Approved: comp.compilers@iecc.com Message-ID: <14-07-046@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-041@comp.compilers> NNTP-Posting-Host: news.iecc.com X-Trace: miucha.iecc.com 1405951761 14097 2001:470:1f07:1126:0:676f:7373:6970 (21 Jul 2014 14:09:21 GMT) X-Complaints-To: abuse@iecc.com NNTP-Posting-Date: Mon, 21 Jul 2014 14:09:21 +0000 (UTC) Keywords: parse, theory Posted-Date: 21 Jul 2014 10:09:21 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:1336 George Neuner wrote in news:14-07-041@comp.compilers: > LL(k) always can be refactored to single token lookahead, but it > causes an explosion of grammar states. E.g., given a single LL(3) > rule, an equivalent set of LL(1) rules must match every valid > combination of tokens at +1, +2 and +3. Not true -- LL(k+1) languages are a strict superset of LL(k) languages, so there exist LL(k) grammars that cannot be refactored to a smaller k. LR(k) languages are equivalent the LR(1), so every LR(k) grammar can be refactored to LR(1) A useful summary of the relationships between various types of languages and grammars can be found at Chris Dodd cdodd@acm.org