Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!news.iecc.com!nerds-end From: Borneq Newsgroups: comp.compilers Subject: How detect cycle in grammar ? Date: Sun, 20 Nov 2011 08:48:47 -0800 (PST) Organization: Compilers Central Lines: 15 Sender: news@iecc.com Approved: comp.compilers@iecc.com Message-ID: <11-11-041@comp.compilers> NNTP-Posting-Host: news.iecc.com X-Trace: leila.iecc.com 1321891701 80510 64.57.183.58 (21 Nov 2011 16:08:21 GMT) X-Complaints-To: abuse@iecc.com NNTP-Posting-Date: Mon, 21 Nov 2011 16:08:21 +0000 (UTC) Keywords: parse, question Posted-Date: 21 Nov 2011 11:08:21 EST X-submission-address: compilers@iecc.com X-moderator-address: compilers-request@iecc.com X-FAQ-and-archives: http://compilers.iecc.com Xref: x330-a1.tempe.blueboxinc.net comp.compilers:343 A->B B->B This grammar is not correct, B is looped. A->B B->C C->A This another grammar, cycle can be arbitrarily long. Is cycle when First(Nonterminal) not contain any terminal, even not epsilon? A->B B-> (=B->epsilon) in first A and B is epsilon