[antlr-interest] Collecting disparate subtrees into one tree?

J. Stephen Riley Silber jsrs701 at yahoo.com
Tue Jul 7 06:44:01 PDT 2009


And if it doesn't, you can try the more explicit variant:

code : (p+=proc | f+=func)*
  -> ^(CODE ^(PROCS $p*) ^(FUNCS $f*))
  ;

(Or leave out the PROCS/FUNCS nodes if you just want to reorder the procedures/functions without actually grouping them in a subtree.)
The Real World interfered for a bit, so it took me a while to try this out, but it worked like a champ.  Thanks, Gavin!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20090707/d6a26c5a/attachment.html 


More information about the antlr-interest mailing list