[antlr-interest] Improving ANTLR DSL parse-error messages

Dan Fabulich dan at fabulich.com
Sun Feb 14 16:02:34 PST 2010


I'm working on a domain-specific language (DSL) for non-programmers. 
Non-programmers make a lot of grammar mistakes: they misspell keywords, they 
don't close parentheses, they don't terminate blocks, etc.

I'm handling RecognitionExceptions to try to improve error handling. But I'm 
finding it pretty hard to develop good error-handling code for my DSL.

At this point, I'm considering ways to simplify the language to make it easier 
for me to provide users with high-quality error messages, but I'm not really 
sure how to go about this. I think I want to reduce the ambiguity of errors 
somehow, but I'm not sure how to implement that idea in a grammar.

What techniques can I use to improve parse-error messages for my users?
(Alternately, can anyone point me to a good book or article on this topic?)

-Dan


More information about the antlr-interest mailing list