I'd like to report errors from rules because I want to reuse existing,
non-ANTLR parsers and make the lexer rules a bit more lenient than
what's actually in the language. For instance, in
IPV4_ADDRESS : ('0' .. '9' | '.')+;
address returns [IPv4Address address]
: IPV4_ADDRESS
{
try {
$address = new IPv4Address($IPV4_ADDRESS.text);
} catch (IllegalArgumentException e) {
???
}
};
I want to report an error at the location of the IPV4_ADDRESS token if
the token is not actually an IPv4 address.
Do I have to throw a special exception to achieve this?
List: http://www.antlr.org:8080/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org:8080/mailman/options/antlr-interest/your-email-address
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---