[antlr-interest] API change for "recoverFromMismatchedSet"?

Gerz, Michael Gerz at fgan.de
Mon May 26 03:21:45 PDT 2008


Hello,

 

I use the following code to suppress any kind of error handling

 

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 

 

@rulecatch { 

            catch (RecognitionException e) {

                        throw e;

            }

}

 

@members {

            @Override

            protected void mismatch(IntStream input, int ttype, BitSet follow)

                        throws RecognitionException

            {

                        throw new MismatchedTokenException(ttype, input);

            }

 

            @Override

            public void recoverFromMismatchedSet(IntStream input, RecognitionException e, BitSet follow)

                        throws RecognitionException

            {

                        throw e;

            }

}

 

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 

 

With the latest ANTLR snapshot as of 2008-05-25, the Java compiler complains about the following problem:

 

   The return type is incompatible with BaseRecognizer.recoverFromMismatchedSet(IntStream, RecognitionException, BitSet)

 

It seems that I have to return an "Object". What is the proper way of overwriting this method to suppress errors? 

 

Kind regards, 

 

Michael

 

************************************************************************

Dr. Michael Gerz 

FGAN e.V.                                       Phone:  +49 228 9435-414

Department FKIE/ITF                             Fax:    +49 228 9435-685

Neuenahrer Straße 20                            E-Mail: gerz at fgan.de 

53343 Wachtberg-Werthhoven, Germany             WWW:    www.fgan.de 

 

Forschungsgesellschaft für Angewandte Naturwissenschaften e. V. (FGAN) 

Sitz der Gesellschaft: Bonn 

Registergericht: Amtsgericht Bonn VR 2530 

Vorstand: Dr.rer.nat. R. Dornhaus (Vorst.), Prof. Dr. J. Ender (Stellv.)

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080526/ea9c902e/attachment.html 


More information about the antlr-interest mailing list