Hi,

I've just migrated from 3.0.1 to 3.1.1 and the new use of CommonErrorNode to
handle errors is giving some pain. I use my own AST tree type, so in my
grammar I have:

options {
    output=AST;
    language=Java;
    ASTLabelType=LinkedListTree;
}

But it seems that ANTLR casts a little too generously in the generated
parser as I end up with code like this in all catch blocks:

        retval.tree = (LinkedListTree)adaptor.errorNode(input, retval.start,
input.LT(-1), re);

The method call returns a CommonErrorNode which can't be cast to my tree
implementation, resulting in a ClassCastException. I'm wondering wheter my
tree should extend CommonErrorNode instead of BaseTree but the
CommonErrorNode implementation (especially the constructors) look fairly
specific to error handling.

What would be the recommended solution here?

Thanks!
Matthieu

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en
-~----------~----~----~----~------~----~------~--~---

List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

Reply via email to