3 ms·
As the author says: > because the parser generator knows about all patterns you want to match in advance, it will match longer terminals before shorter—more am
by vorg 7y ago
As the author says:
> because the parser generator knows about all patterns you want to match in advance, it will match longer terminals before shorter—more ambiguous—terminals
If you don't mind manually ordering your choices in your alt operators, then PEG and parser combinators are OK.
Oh, and you often need to restructure your grammar to avoid left recursion.