[antlr-interest] How to disable recovery in antlr3 ?

Ilia Kantor ilia at obnovlenie.ru
Sun Sep 3 04:27:46 PDT 2006


В сообщении от 3 сентября 2006 02:14 Ilia Kantor написал(a):
> I don't want parser to 'recover' from errors. How can I disable recovery
> and just let exception slip out ?

Seems found the solution. Hope that helps someone.


@rulecatch { }

@parser::members {
    // override it to disable recovery
    protected void mismatch(IntStream input, int ttype, BitSet follow) throws 
RecognitionException
    { 
        MismatchedTokenException mte = new MismatchedTokenException(ttype, 
input);
        throw mte;
    }
}
	


More information about the antlr-interest mailing list