[antlr-interest] How to extend the CommonTree without getting a classcastexcpetion in the generated code?

Marwan Ajraoui marwan.alephn at gmail.com
Mon Aug 3 13:47:14 PDT 2009


Hi there;

I did define a customized node, extending a commonTree, defined an
adaptor extending a  CommonTreeAdaptor, for my semantic analysis.
Nevertheless, I'm getting a classCastException, when the parser find
the first sintax error.

The reason is that it can not cast CommonErrorNode to my customized
node, since both extend CommonTree.

I'm interested on reporting all parser errores no just the first one.
What is the better aproach, dealing with this expcetion so it doesn't
stop the execution?

Thx in advance for any help,

Cheers

-- 
Marouane


More information about the antlr-interest mailing list