grappa icon indicating copy to clipboard operation
grappa copied to clipboard

Eliminate the uses of `ProxyMatcher` when it is not needed

Open fge opened this issue 11 years ago • 0 comments

Right now, the code for all rules in the generated parser class delegates rule "resolution" to a ProxyMatcher.

But this is not needed for many of them; let us call them the "terminal rules". Terminal in the sense that they do not have any delegates at all. A primary example of that is CharMatcher.

Example of what I mean here. In this case, well, a rule method in the parent class should not be generated at all, there's no point.

The problem is, how to detect that? At a first glance, this would mean adding a new method to Matcher determining whether the rule is indeed "terminal".

fge avatar May 20 '14 08:05 fge