I am working on a domain language (DSL) for non-programmers. Non-programmers make many grammatical errors: they skip keywords, do not close parentheses, they do not interrupt blocks, etc.
I use ANTLR to generate my parser; it provides an excellent mechanism for processing RecognitionExceptions to improve error handling. But it is very difficult for me to develop good error handling code for my DSL.
At this point, I am considering ways to simplify the language to make it easier for me to provide users with high-quality error messages, but I'm not quite sure how to do this. I think I want to somehow reduce the ambiguity of errors, but I'm not sure how to implement this idea in grammar.
How can I simplify my language to improve parsing messages for my users?
EDIT: Updated to clarify that I'm interested in ways to simplify my language, not just tips for handling ANTLR errors in general. (Although, thanks for that!)
error-handling antlr dsl
Dan fabulich
source share