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: Tue, 29 Jul 2014 19:38:48 +0000 (UTC) Organization: A noiseless patient Spider Lines: 25 Sender: news@iecc.com Approved: comp.compilers@iecc.com Message-ID: <14-07-065@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> <14-07-046@comp.compilers> <14-07-060@comp.compilers> <14-07-062@comp.compilers> <14-07-063@comp.compilers> NNTP-Posting-Host: news.iecc.com X-Trace: miucha.iecc.com 1406662939 2869 2001:470:1f07:1126:0:676f:7373:6970 (29 Jul 2014 19:42:19 GMT) X-Complaints-To: abuse@iecc.com NNTP-Posting-Date: Tue, 29 Jul 2014 19:42:19 +0000 (UTC) Keywords: LL(1), parse Posted-Date: 29 Jul 2014 15:42:18 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:1355 Hans-Peter Diettrich wrote in > Unfortunately I couldn't get the article, so here's what I don't understand: > >> is: >> >> S ::= aSA | \epsilon >> A ::= aabS | c >> >> This grammar (and the language) is LL(2), but there does not exist an >> equivalent LL(1) grammar. > > IMO this grammar is LL(3), not LL(2). There might be a typo in A, which > might originally read as: > A ::= abS | c > resulting in an LL(2) grammar. Yes, my fault for not carefully checking my post. As written, it's an LL(3) grammar for a language that is not LL(2). Remove one 'a' from the 'A' rule to get an LL(2) grammar for a language that is not LL(1). Add 'a's to get an LL(k) grammar for a language that is not LL(k-1) for any k... Chris Dodd cdodd@acm.org