Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class TokenMgrError

    Token Manager Error.

    Inheritance
    object
    Exception
    TokenMgrError
    Implements
    ISerializable
    Inherited Members
    Exception.GetBaseException()
    Exception.GetType()
    Exception.ToString()
    Exception.Data
    Exception.HelpLink
    Exception.HResult
    Exception.InnerException
    Exception.Source
    Exception.StackTrace
    Exception.TargetSite
    Exception.SerializeObjectState
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: Lucene.Net.QueryParsers.Surround.Parser
    Assembly: Lucene.Net.QueryParser.dll
    Syntax
    [Serializable]
    public class TokenMgrError : Exception, ISerializable

    Constructors

    TokenMgrError()

    No arg constructor.

    Declaration
    public TokenMgrError()

    TokenMgrError(bool, int, int, int, string, char, int)

    Full Constructor.

    Declaration
    public TokenMgrError(bool EOFSeen, int lexState, int errorLine, int errorColumn, string errorAfter, char curChar, int reason)
    Parameters
    Type Name Description
    bool EOFSeen
    int lexState
    int errorLine
    int errorColumn
    string errorAfter
    char curChar
    int reason

    TokenMgrError(string, int)

    Constructor with message and reason.

    Declaration
    public TokenMgrError(string message, int reason)
    Parameters
    Type Name Description
    string message
    int reason

    Properties

    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
    string
    Overrides
    Exception.Message

    Methods

    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
    string str
    Returns
    Type Description
    string

    LexicalError(bool, int, int, int, 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
    bool eofSeen

    indicates if EOF caused the lexical error

    int lexState

    lexical state in which this error occurred

    int errorLine

    line number when the error occurred

    int errorColumn

    column number when the error occurred

    string errorAfter

    prefix that was seen before this error occurred

    char curChar

    the offending character

    Returns
    Type Description
    string

    Detailed error message

    Remarks

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

    Implements

    ISerializable
    Back to top Copyright © 2024 The Apache Software Foundation, Licensed under the Apache License, Version 2.0
    Apache Lucene.Net, Lucene.Net, Apache, the Apache feather logo, and the Apache Lucene.Net project logo are trademarks of The Apache Software Foundation.
    All other marks mentioned may be trademarks or registered trademarks of their respective owners.