[antlr-interest] Strange bug in ANTLR version higher than 3.1.2
FranklinChen at cmu.edu
FranklinChen at cmu.edu
Thu Nov 5 18:12:37 PST 2009
> > So I think the right thing for me to do is to study the generated code
> > for rewrites and mimic the use of the adaptor APIs to link up the
> > trees correctly.
>
> Yes - this is what I was getting at basically.
>
> Jim
It turned out that it was not useful studying the generated code.
However, I ended up solving my problems by using
adaptor.addChild(parent, adaptor.dupTree(child)) whenever splicing a
tree created earlier in a parse into a new parent. This is probably
overkill, with a lot of extra copying of subtrees, but it seemed
cleanest and guaranteed to work correctly.
--
Franklin
More information about the antlr-interest
mailing list