[antlr-interest] Method equals in class ParseTree

Claude Moulin claude.moulin at hds.utc.fr
Sat Oct 13 12:02:17 PDT 2012


Hi all,

Thank you Terence for the new version Antlr v4.

I want to display a ParseTree in a Java swing JTree.

For that I create a class that implements TreeModel.

But some nodes are not displayed in the JTree because the method
equals() is called for comparing two child nodes of the same parent.

If two nodes are considered "equals" using this method
(ParseTree.equals()) only one is displayed (the second and the last when
more nodes are considered equal).

Is there any reason why two different ParseTree may be "equals" ?

Is there an elegant solution to this problem ?

 

Thank you.

Claude



More information about the antlr-interest mailing list