Search Results for

    Show / Hide Table of Contents

    Class ParseException

    The error raised when a document does not parse, carrying the position the parser stopped at.

    Inheritance
    object
    Exception
    SystemException
    FormatException
    ParseException
    Implements
    ISerializable
    Inherited Members
    Exception.GetBaseException()
    Exception.GetType()
    Exception.ToString()
    Exception.Data
    Exception.HelpLink
    Exception.HResult
    Exception.InnerException
    Exception.Message
    Exception.Source
    Exception.StackTrace
    Exception.TargetSite
    Exception.SerializeObjectState
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: Link.Foundation.Links.Notation
    Assembly: Link.Foundation.Links.Notation.dll
    Syntax
    public class ParseException : FormatException, ISerializable
    Remarks

    The position is the furthest one the parser reached, which is the character the document stops making sense at rather than the point the last alternative gave up on. It derives from FormatException, the exception the generated parser raised on its own, so code that catches that keeps working. A document nested deeper than MaxDepth is refused with this exception too; then MaxDepth says how deep the nesting may go, and the position is the group or the line that is one level too deep.

    Constructors

    | Edit this page View Source

    ParseException(string, int, Exception?)

    Creates an exception describing where subject stopped parsing.

    Declaration
    public ParseException(string subject, int offset, Exception? innerException = null)
    Parameters
    Type Name Description
    string subject

    The document that failed to parse.

    int offset

    Offset of the position the parser stopped at.

    Exception innerException

    The error the generated parser raised, if any.

    | Edit this page View Source

    ParseException(string, int, int, Exception?)

    Creates an exception saying that subject nests deeper than maxDepth at offset.

    Declaration
    public ParseException(string subject, int offset, int maxDepth, Exception? innerException = null)
    Parameters
    Type Name Description
    string subject

    The document that nests too deeply.

    int offset

    Offset of the group or the line that is one level too deep.

    int maxDepth

    The deepest nesting allowed.

    Exception innerException

    The error the parser raised, if any.

    Properties

    | Edit this page View Source

    Column

    Column the offending position is at, counted from 1.

    Declaration
    public int Column { get; }
    Property Value
    Type Description
    int
    | Edit this page View Source

    Found

    The character found instead, or null at the end of the document.

    Declaration
    public char? Found { get; }
    Property Value
    Type Description
    char?
    | Edit this page View Source

    Line

    Line the offending position is on, counted from 1.

    Declaration
    public int Line { get; }
    Property Value
    Type Description
    int
    | Edit this page View Source

    LineText

    The offending line, as written, without its line ending.

    Declaration
    public string LineText { get; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    MaxDepth

    The deepest nesting allowed, when the document is nested deeper than that; null for any other error.

    Declaration
    public int? MaxDepth { get; }
    Property Value
    Type Description
    int?
    | Edit this page View Source

    Offset

    Offset of the offending position from the start of the document.

    Declaration
    public int Offset { get; }
    Property Value
    Type Description
    int
    | Edit this page View Source

    Snippet

    The offending line with a caret under the offending column, quoted the way a compiler quotes source. A long line is shown as a window around the caret, so the message stays the same size whether the document has ten lines or fifteen hundred.

    Declaration
    public string Snippet { get; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    Summary

    The one-line summary: where the parser stopped and what stands there, or that the nesting is too deep there.

    Declaration
    public string Summary { get; }
    Property Value
    Type Description
    string

    Implements

    ISerializable
    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX