A-ha! Now I see. I was only missing the recursion part...in a paper about recursion. :)
Thank you very much, Chris
(Here's what I think you missed.) If R is left-recursive, then evaluating its body will make the parser do another Apply-Rule(R, P) -- with the same R and P as before. This time around, m won't be nil; it will instead be a MemoEntry whose ans field holds the LR we memoized above. So we set that LR's detected = true, and return a Fail so that the seed parse can be computed. Now we're back to the original call to ApplyRule, where we'll look at lr's detected field to figure out whether to just return the non-left-recursive result, or grow the seed parse (the latter, in this example). I hope this helps. Cheers, Alex
_______________________________________________ fonc mailing list [email protected] http://vpri.org/mailman/listinfo/fonc
