[antlr-interest] Sample automatic visitor
scott at javadude.com
Thu Sep 8 15:23:03 PDT 2011
Just to be pedantic (as I teach Design Patterns at JHU)... using the word
"visitor" here isn't quite correct (per GoF), and is apt to cause confusion
for people who are familiar with the GoF visitor pattern.
The TListener and its implementations are actually closer to the role of
"visitor" per GoF.
I'd recommend renaming what you're calling the "visitor" to "walker" or
something similar, and keep the TListener.
What you're doing here is much simpler to understand than the GoF visitor
pattern and more direct anyway...
On Thu, Sep 8, 2011 at 5:32 PM, Terence Parr <parrt at cs.usfca.edu> wrote:
> Hi, I have a prototype working for the automatic parse tree construction
> and automatic visitor generation, which I've described here:
> Feedback is very welcome, and now is a good time to speak up ;)
> It makes me a bit nervous to generate 2 extra files from every grammar, but
> I'm guessing it will be one of the most popular ways to use ANTLR. My goal
> is to make ANTLR very easy to use out-of-the-box while still allowing
> performance minded experts to get what they need.
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
More information about the antlr-interest