The Definitive ANTLR 4 Reference
Rate it:
Read between July 29 - December 18, 2021
2%
Flag icon
Why program by hand in five days what you can spend twenty-five years of your life automating?
5%
Flag icon
You Can’t Put Too Much Water into a Nuclear Reactor
Matthew Royal
A beautifully ambiguous statement. Does it mean you shouldn't put too much water into a nuclear reactor, or the more the better?
5%
Flag icon
an ambiguous grammar is analogous to a programming bug.
22%
Flag icon
parsers recognize grammatical structure in a token stream and lexers recognize grammatical structure in a character stream.
24%
Flag icon
When we say that the parser doesn’t need to distinguish between certain lexical structures or doesn’t care about what’s inside a structure, we really mean that our application doesn’t care. Our application performs the same action or translation on those lexical structures.
Matthew Royal
This makes sense from an efficiency standpoint, but it directly contradicts the ethos of reusable grammars via recursive descent parses events which ANTLR4 spent so much time introducing.
31%
Flag icon
Construction of our grammar begins at the coarsest level, as usual.
33%
Flag icon
Nonetheless, we’ll wrap up here because we’ve covered the R grammatical structure itself.
Matthew Royal
But have we? Both this R example and the previous CSV example were oversimplified. Neither were complete specs as used in the real world.