3 ms·
Started noodling with ANTLR 2.x. Still consider myself a noob. FWIW, IMHO, two aspects of ANTLR 4.0 dramatically lowered the implementation barriers. Practical
by specialist 5y ago
Started noodling with ANTLR 2.x. Still consider myself a noob.
FWIW, IMHO, two aspects of ANTLR 4.0 dramatically lowered the implementation barriers. Practical stuff that doesn't get much attention.
With L(*) grammars (inspired by packrat, IIRC), parse trees and ASTs can be merged into one. Makes post-processing so much easier.
API now supports interpreting, vs iterating, over the parse tree. Think XML-SAX vs a Visitor. Then you craft your Interpreter to drive a Builder. This simple conceptual change greatly simplifies everything.