Re: is P::RD LL(1) LL(N) LR(1) LR(N) ?

[email protected] (Damian Conway)
Newsgroups perl.recdescent
Message-ID <[email protected]>
Yves wrote:

A really excellent summary of the various classes of parser and why RecDescent
doesn't quite fit in any of them. Thanks, Yves.


Only one bug in the earlier discussion (and on the PerlMonks node):

	Left recusion is when you have a rule that calls itself as its very first 
	subrule. Ie: 


  		expr: expr '+' term | term

	When Parse::RecDescent encounters something like this it should error
	(its documented that it will, but I haven't checked)...

It definitely does.

	...as it will go into an endless loop on the 'expr' rule. Unfortunately 
	however TheDamian hasnt implemented multi level left recursion checking...

Oh, yes he has! RecDescent does a complete graph traversal looking for n-ary
left-recursion loops and fails to compile the grammar if it finds any
left-recursive loop involving any number of rules. It has done this since its
earliest versions.

Damian
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.