[antlr-interest] Collecting disparate subtrees into one tree?
J. Stephen Riley Silber
jsrs701 at yahoo.com
Wed Jul 1 05:00:21 PDT 2009
Hi Damien,
> doesn't something like this work?
>
> code: procs* funcs*
> -> ^(CODE ^(PROCS procs*) ^(FUNCS funcs*))
>
I don't think it would, because it still requires that procs be grouped together in the source code, as well as funcs. Something like
code: (proc | func)*
would be more accurate, but then I still have my same tree problem.
Though your idea did trigger some vague notion in my brain meaties that maybe I can do a combo top-down and bottom-up visitor to bubble procs and funcs apart... I'll have to think about this.
Other ideas?
--S
More information about the antlr-interest
mailing list