[antlr-interest] Abstract syntax tree

Bryan Ewbank ewbank at gmail.com
Thu Feb 24 16:49:13 PST 2005


Sorry about that Marcel, hit the wrong key...

I've found the easiest way to do this is using the TreeParser model. 
You walk the tree and do what you want to.  For example:

 interf:
     #(IDENTIFIER scope body)
     {  cout << "scope is " << #scope->getText() << endl; }
     ;

 scope: ( NO_SCOPE | PUBLIC | PRIVATE ) ;

Oh.  I use C++ code; I think Java uses "." instead of "->"...


More information about the antlr-interest mailing list