Antlr4.Parse.ToolANTLRParser.GetParserErrorMessage C# (CSharp) Method

GetParserErrorMessage() public method

public GetParserErrorMessage ( Antlr.Runtime.Parser parser, Antlr.Runtime.RecognitionException e ) : string
parser Antlr.Runtime.Parser
e Antlr.Runtime.RecognitionException
return 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;
        }