[antlr-interest] HOW To catch error (no exception is thown)

jabon elekis at gmail.com
Mon Apr 21 13:21:44 PDT 2008


hi all, 

it's been 2 days, I try to catch error from the parser.
I would like to try a simple méthod  like that

public void testDocument(){
       
        try {
            parser.document();
        }
        catch (RecognitionException e) {
            System.err.println("SOMETHING HERE");
            System.exit(1);
        }
       
    }

but that only print
    BR.recoverFromMismatchedToken
    line 11:3 mismatched input ';' expecting T_Ident

nothing arrive in the catch block


I ve try the rulecatch option. but that doesent change anything

and I find no documentation on that

thnks


a++





More information about the antlr-interest mailing list