[antlr-interest] Is dupTree( ) completely recursive?

Brian DeVries contingencyplan at gmail.com
Sat Nov 25 19:28:56 PST 2006


I'm looking at the code in BaseTree.dupTree( ) and CommonTree.dupNode(), and
the comment says it recursively walks the tree, but the code only calls
dupNode( ) for each child node, not dupTree( ). Thus, this only does a
one-level down duplication, rather than duplicating the entire tree all the
way down. As a result, I'm having to subclass CommonTree and write a
dupTree( ) that recursively invokes dupTree( ) for every child to grab the
whole tree.

Is there an easier way to do this? Am I missing something? I would think
that BaseTree.dupTree( ) would do this for me, but it doesn't seem to.

Thanks,
~Brian DeVries
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20061125/4279f40e/attachment.html 


More information about the antlr-interest mailing list