Path: csiph.com!newsfeed.xs4all.nl!newsfeed7.news.xs4all.nl!178.20.174.218.MISMATCH!feeder5.feed.usenet.farm!feed.usenet.farm!feeder.usenetexpress.com!tr2.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news.iecc.com!.POSTED.news.iecc.com!nerds-end From: Andy Newsgroups: comp.compilers Subject: How change grammar to equivalent LL(1) ? Date: Sun, 22 Dec 2019 15:55:12 -0800 (PST) Organization: Compilers Central Lines: 17 Sender: news@iecc.com Approved: comp.compilers@iecc.com Message-ID: <19-12-019@comp.compilers> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="47742"; mail-complaints-to="abuse@iecc.com" Keywords: LL(1), comment Posted-Date: 22 Dec 2019 19:06:42 EST 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:2400 Obviously if is possible. In Polish Wikipedia can we read, that even very simple grammar: expr->number '+' expr expr->number is not LL(1) bacause we must see '+' to distinguish But is posssible equivalent grammar: expr -> number optPlusExpr optPlusExpr -> epsilon optPlusExpr ->'+' expr What are general rules to change grammar to equivalent LL(1) grammar if possible? [This topic is covered in every compiler textbooks. Or you can start with this Wikipedia article https://en.wikipedia.org/wiki/Left_recursion#Removing_left_recursion -John]