[antlr-interest] Exiting on parser errors

Bryan Ewbank ewbank at gmail.com
Mon May 23 13:07:55 PDT 2005


This is also a good technique if you want to attempt to recover at the
/statement/ level, rather than the /production/ level.  Disable
default error handlers, but then force a few key productions to have
error handling.

This gives the user more than one syntax error, but also provides you
the ability to quit after any are seen.

On 5/23/05, Chris Black <chris at lotuscat.com> wrote:
> Try putting "defaultErrorHandler=false;" in the options block of your
> grammar file. This will prevent ANTLR from catching the
> ReconitionExceptions and other Exceptions itself and just allow the
> exception to propagate back up to the method that is actually calling
> the parsers.
> 
> Hope this helps,
> Chris
>


More information about the antlr-interest mailing list