[antlr-interest] Supplying my on (Homogeneous) Tree Class

Terence Parr parrt at cs.usfca.edu
Fri Aug 15 11:41:44 PDT 2008


On Aug 14, 2008, at 2:29 PM, John B. Brodie wrote:
> But CommonErrorNode extends CommonTree and can not be cast to my tree
> node type (which the generated code does when errorNode() is not
> overridden in the supplied tree adapter) because my node also extends
> CommonTree and casting between siblings in the inheritance hiearchy is
> not permissible in Java (i guess).

Just make your own error node that subclasses your tree :)

Ter


More information about the antlr-interest mailing list