[antlr-interest] ANTLR v3 Tree Interface request

Oliver Wong owong at castortech.com
Mon Apr 3 14:37:54 PDT 2006


	Not sure if this is the right place to discuss this, but I'd
like to request a change to the org.antlr.runtime.tree.Tree interface
before ANTLR v3 is officially released.

	One of the methods defined in the Tree interface is dupNode().
I'm guessing that the intended behaviour of this method is to duplicate
"this" node only, and not to recursively duplicate the children.
However, this is very inconvenient for me, because my Tree
implementation uses parent-pointers, and if I dupe a node, without
duping its children, then the child would either need to support
pointing to multiple parents, or have its parent-reference be
inconsistent.

	I've looked around at all the usages of dupNode(), and it seems
its always used as part of a recursive descent to duplicate the whole
tree. Is it possible to remove this method from the Tree interface? You
can just have it as an abstract method on
org.antlr.runtime.tree.BaseTree, which looks like the only place that
method is used.

	- Oliver


More information about the antlr-interest mailing list