[antlr-interest] Lexer exception?

Martin Probst mail at martin-probst.com
Sun Feb 19 15:04:43 PST 2006


> how can I catch such an exception? I do not found something in the 
> documentation.
> 
> line 1:1: unexpected token: 111

You have to turn off the default error handler, e.g. in your options
section of the lexer "defaultErrorHandler = false". Afterwards you can
catch exceptions. All of them extend ANTLRException, the manual contains
a part called "Exception hierarchy".

Martin



More information about the antlr-interest mailing list