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

service service at sharpplus.com
Wed May 30 22:08:17 PDT 2007


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?

best regards
chinshou
Sqlite Developer
SharpPlus Software Corp. Yokohama, Japan


More information about the antlr-interest mailing list