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

[email protected] ("Orton, Yves")
Newsgroups perl.recdescent
Message-ID <71B318898201D311845C0008C75DAD1C06F1E45A@defra1ex2>
> From: Damian Conway [mailto:[email protected]] Sent: 2002/03/21 00:19
> 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.

Cheers. And there I was expecting to get slammed for some subtlety. :-)

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

I assumed that it did.

> 
> 	...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.

Doh! My confusion comes from misremembering (really must learn to double
check _anything_ I think I remember) the following:
(from P::RD documentation)
More subtle forms of left recursion (for example, through the second item in
a rule after a ``zero'' match of a preceding ``zero-or-more'' repetition, or
after a match of a subrule with an empty production) are not found. 

Apologies, and Ill update the node as well.

Cheers,
Yves
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.