Show / Hide Table of Contents

    Class TokenMgrError

    Token Manager Error.

    Inheritance
    System.Object
    TokenMgrError
    Namespace: Lucene.Net.QueryParsers.Classic
    Assembly: Lucene.Net.QueryParser.dll
    Syntax
    public class TokenMgrError : Exception

    Constructors

    | Improve this Doc View Source

    TokenMgrError()

    No arg constructor.

    Declaration
    public TokenMgrError()
    | Improve this Doc View Source

    TokenMgrError(Boolean, Int32, Int32, Int32, String, Char, Int32)

    Full Constructor.

    Declaration
    public TokenMgrError(bool eofSeen, int lexState, int errorLine, int errorColumn, string errorAfter, char curChar, int reason)
    Parameters
    Type Name Description
    System.Boolean eofSeen
    System.Int32 lexState
    System.Int32 errorLine
    System.Int32 errorColumn
    System.String errorAfter
    System.Char curChar
    System.Int32 reason
    | Improve this Doc View Source

    TokenMgrError(String, Int32)

    Constructor with message and reason.

    Declaration
    public TokenMgrError(string message, int reason)
    Parameters
    Type Name Description
    System.String message
    System.Int32 reason

    Properties

    | Improve this Doc View Source

    Message

    You can also modify the body of this method to customize your error messages. For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not of end-users concern, so you can return something like :

    "Internal Error : Please file a bug report .... "

    from this method for such cases in the release version of your parser.

    Declaration
    public override string Message { get; }
    Property Value
    Type Description
    System.String

    Methods

    | Improve this Doc View Source

    AddEscapes(String)

    Replaces unprintable characters by their escaped (or unicode escaped) equivalents in the given string

    Declaration
    protected static string AddEscapes(string str)
    Parameters
    Type Name Description
    System.String str
    Returns
    Type Description
    System.String
    | Improve this Doc View Source

    LexicalError(Boolean, Int32, Int32, Int32, String, Char)

    Returns a detailed message for the Error when it is thrown by the token manager to indicate a lexical error.

    Declaration
    protected static string LexicalError(bool eofSeen, int lexState, int errorLine, int errorColumn, string errorAfter, char curChar)
    Parameters
    Type Name Description
    System.Boolean eofSeen

    indicates if EOF caused the lexical error

    System.Int32 lexState

    lexical state in which this error occurred

    System.Int32 errorLine

    line number when the error occurred

    System.Int32 errorColumn

    column number when the error occurred

    System.String errorAfter

    prefix that was seen before this error occurred

    System.Char curChar

    the offending character

    Returns
    Type Description
    System.String

    Detailed error message

    Remarks

    You can customize the lexical error message by modifying this method.

    • Improve this Doc
    • View Source
    Back to top Copyright © 2020 Licensed to the Apache Software Foundation (ASF)