grappa
grappa copied to clipboard
Eliminate the uses of `ProxyMatcher` when it is not needed
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".