[antlr-interest] Tree construction with loops, children at same level
Marko Simovic
markobarko at gmail.com
Fri Apr 18 10:25:32 PDT 2008
So, given a rule like this:
unionFunction
: (byFunction -> byFunction)
(opNode=UnionOp b=byFunction -> ^(Function[$opNode] $unionFunction
$b) )*;
the following input:
a union b union c
creates a tree which consists of a union node with two children, one of
which is another union node (essentially "(a union b) union c").
what i want in such scenarios is to output a single union node with
three children. how is this done?
Thanks,
Marko
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080418/1a2f70cd/attachment.html
More information about the antlr-interest
mailing list