Antlr.Runtime.BaseRecognizer.GetErrorHeader C# (CSharp) Method

GetErrorHeader() public method

What is the error header, normally line/character position information?
public GetErrorHeader ( RecognitionException e ) : string
e RecognitionException
return string
        public virtual string GetErrorHeader( RecognitionException e )
        {
            string prefix = SourceName ?? string.Empty;
            if (prefix.Length > 0)
                prefix += ' ';

            return string.Format("{0}line {1}:{2}", prefix, e.Line, e.CharPositionInLine + 1);
        }

Usage Example

        public static SyntaxErrorException Report(BaseRecognizer source, RecognitionException e)
        {
            var input = source.Input.ToString();
            if (source.Input is ANTLRStringStream)
                input = new String((Char[])typeof(ANTLRStringStream).GetField("data", 
                    BindingFlags.NonPublic | BindingFlags.Instance).GetValue(source.Input));

            var antlrMessage = source.GetErrorHeader(e) + " " + source.GetErrorMessage(e, source.TokenNames);
            throw new SyntaxErrorException(input, antlrMessage, e);
        }