January 2013
Intermediate to advanced
328 pages
8h 5m
English
Whether we’re collecting information or computing values, it’s often most convenient and good programming practice to pass around arguments and return values, rather than using fields or other “global variables.” The problem is that ANTLR automatically generates the signature of the listener methods without application-specific return values or arguments. ANTLR also generates visitor methods without application-specific arguments.
In this section, we’re going to explore mechanisms that let event methods pass data around without altering the event method signatures. We’ll build three different implementations of the same simple calculator based upon the LExpr expression grammar from the previous section. ...
Read now
Unlock full access