public GetParserErrorMessage ( Antlr.Runtime.Parser parser, Antlr.Runtime.RecognitionException e ) : string | ||
parser | Antlr.Runtime.Parser | |
e | Antlr.Runtime.RecognitionException | |
리턴 | string |
public virtual string GetParserErrorMessage(Parser parser, RecognitionException e)
{
string msg;
if (e is NoViableAltException)
{
string name = parser.GetTokenErrorDisplay(e.Token);
msg = name + " came as a complete surprise to me";
}
else if (e is v4ParserException)
{
msg = ((v4ParserException)e).msg;
}
else
{
msg = parser.GetErrorMessage(e, parser.TokenNames);
}
return msg;
}