Read the wiki articles on displayRecognitionError() and look at the source
code for that method. You basically override it with your own method that
can do anything it likes with the information. The default message is just
for grammar developers.

Jim

> -----Original Message-----
> From: [email protected] [mailto:antlr-interest-
> [email protected]] On Behalf Of Patrick Petermair
> Sent: Tuesday, August 03, 2010 10:23 AM
> To: [email protected]
> Subject: [antlr-interest] Getting feedback from grammar errors
> 
> Hey list!
> 
> We are in the process of developing a timetracking application. One part
of it
> is some kind of "powerstring" that enables users to execute complex
> commands. The powerstring has to follow certain rules / grammar
> definitions.
> 
> This is where antlr comes in. We were able to write a grammar that follows
all
> those rules. Unfortunately we just get an exception with no meaningful
> description when something went wrong (= the provided string didn't match
> the grammar definition).
> 
> Is there a way to get some more feedback from antlr? If so, what would be
> the way to do it?
> 
> We want to provide the user with more information than just "Syntax error"
> or "MismatchedTokenException(-1!=6)" which isn't very helpful. If we could
> get at least the position in the String where the error occured...
> 
> Cheers,
> Patrick
> 
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-
> email-address


List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/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.

Reply via email to