Open akirschbaum opened 9 years ago
Such rules are currently not possible because the generated caching code never finds a match and therefore causes an infinite recursion during parser generation.
Yes, that's what happens.
Unfortunately this is not curable with the current system; the day when indy is used I can probably fix this... But I'm far from being done with indy at all!
When using rules that have parameters, @Cached can be used to allow recursive calls. The generated caching code then checks all parameters for equality when reusing rules.
This mechanism works fine for rules like
(Please ignore that this rule does not make much sense; I just needed a simple example for a rule definition with a structure that depends on the method's parameter.)
Quite often I need code like
That is: a recursion where the rule definition structure does NOT depend on the method's parameter but in which a different parameter is passed in each recursion level.
Such rules are currently not possible because the generated caching code never finds a match and therefore causes an infinite recursion during parser generation.