[antlr-interest] Is it a bug of BaseRecongnizer?

Terence Parr parrt at cs.usfca.edu
Thu May 31 11:02:10 PDT 2007


On May 30, 2007, at 10:08 PM, service wrote:

> Dear friends
> I am just found that BaseRecongnizer's GetErrorMessage seems strange,
>
> 	public String getErrorMessage(RecognitionException e, String[]  
> tokenNames) {
> ................
> 		else if ( e instanceof MismatchedSetException ) {
> 			MismatchedSetException mse = (MismatchedSetException)e;
> 			msg = "mismatched input "+getTokenErrorDisplay(e.token)+
> 				" expecting set "+mse.expecting;
> 		}
> 		else if ( e instanceof MismatchedNotSetException ) {
> 			MismatchedNotSetException mse = (MismatchedNotSetException)e;
> 			msg = "mismatched input "+getTokenErrorDisplay(e.token)+
> 				" expecting set "+mse.expecting;
> 		}
> ..................
> }
>
> first, MismatchedNotSetException variable use the same name mse as  
> MismatchedSetException variable, and Whether should  
> MismatchedNotSetException's error message be "expecting not set" or  
> not?

Hi. I think that I have computed the set complement already so it  
will say the correct thing when executed.  Did you see the inverse?

Thanks!
Ter



More information about the antlr-interest mailing list