January 2013
Intermediate to advanced
328 pages
8h 5m
English
There are two key interfaces associated with ANTLR’s syntax error mechanism: ANTLRErrorListener and ANTLRErrorStrategy. We learned about the former in Altering and Redirecting ANTLR Error Messages, and the latter in Altering ANTLR’s Error Handling Strategy. Listeners let us alter error messages and where they go. Strategy implementations alter how parsers react to errors.

ANTLR throws specific RecognitionExceptions according to the error. Note that they are unchecked runtime exceptions, so you don’t have to specify ...
Read now
Unlock full access