[antlr-interest] Getting feedback from grammar errors

Patrick Petermair patrick.petermair at openforce.com
Tue Aug 3 10:22:51 PDT 2010


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


More information about the antlr-interest mailing list