3 ms·
The fact that this file is long doesn't say much about parser generators. There are two components there: recognition (the grammar), and the "actions", i.e. em
by chubot 12y ago
The fact that this file is long doesn't say much about parser generators.
There are two components there: recognition (the grammar), and the "actions", i.e. embedded Java code.
The embedded Java isn't going to get any shorter if you write it out (it's already "written out"). And the recognition part is definitely shorter with the grammar.
ANTLR perhaps has a mode where it will output only the grammar in a compact form. In any case, it's an implementation detail. It's perfectly possible to write a parser generator where recognition is in a separate file from the actions. But yes this is sort of an annoyance of mine and one of the reasons I wrote my own :)