[antlr-interest] Check out TreeWizard

Micheal J open.zone at virgin.net
Tue Jul 3 14:07:41 PDT 2007


Now that the link is accessible, I find I'm looking forward to Andy Tripp's
opinion of this. I wonder if he reckons it will be a help - were the need to
arise - to port his current tranlation system to v3.

I haven't tried it but it seems very useful from reading your article.
Incidentally, I didn't see any attached code (although that may have a lot
to do with my system).


> howdy,
> Added an entry to my "blog" (which has moved to the wiki):
After talking with Don Bradshaw at http://www.quipoz.com in Sydney  
and after trying to convert ANTLR v3's grammar (written in v2) into  
v3, I decided to build TreeWizard. You can create, navigate, and  
match trees very easily using tree patterns that are like interpreted  
ANTLR patterns (er...well, they pretty much are).  If people find it  
useful etc..., it will make it's way into ANTLR after we've groomed  
it etc...  Please try it out and let me know if it's useful for ya...  
It's pretty damn cool.  The following executes a method in action  
object for every subtree that matches the indicated pattern.

atreewizard.visit(t, "(VARDECL %type:. %id:ID)", mylistener);

'.' (dot) is the wildcard; type and id are labels that appear in a  
hashtable for the mylistener's visit() method to chew on.

All the code is attached to the wiki page.


More information about the antlr-interest mailing list