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

Terence Parr parrt at cs.usfca.edu
Mon May 26 09:54:48 PDT 2008


actually, that's v2 to v3. this is v3.0.1 to v3.1 issue. i had a note  
in backward incomp. with match; guess I need to add for this method too.
Ter
On May 26, 2008, at 3:33 AM, Gerz, Michael wrote:

> Hello,
>
> with the recent API changes, I think that the “error handling”  
> section at
>
> http://www.antlr.org/wiki/display/ANTLR3/Migrating+from+ANTLR+2+to+ANTLR+3
>
> needs be revised.
>
> 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.)
>
> Von: Gerz, Michael
> Gesendet: Montag, 26. Mai 2008 12:22
> An: 'antlr-interest at antlr.org'
> Betreff: API change for "recoverFromMismatchedSet"?
>
> 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/75ac0f4b/attachment-0001.html 


More information about the antlr-interest mailing list