ParseResult

Description

sealed class Tinman.Core.Parsing.ParseResult

Represents the result of a parsing process.

Public / Methods

To​String


public method ToString → (2)

input in : string

The input to use for generating nice error messages or null.

additionalInfo opt : bool = true

Output additional information (terminal matches, non-terminal matches, left recursion)?

returns → string

The human-readable string representation.

Returns a human-readable string representation of this parse result.

Validate


public method Validate → ()

Validates that parsing has succeeded.

ValidatingException

If the validation has failed.

Public / Attributes

Ast


public readonly attribute Ast → (AstNode)

The root AST node.

Will be null if parsing has failed.

Count​Left​Recursion


public readonly attribute CountLeftRecursion → (int32)

The number of left-recursive grammar rules invocations.

Handling of left-recursion requires additional work and should be avoided by refactoring the grammar.

Count​Non​Terminal


public readonly attribute CountNonTerminal → (int64)

The number of non-terminal rule invocations.

See also

IRule.IsTerminal

Count​Terminal


public readonly attribute CountTerminal → (int64)

The number of terminal rule invocations.

See also

IRule.IsTerminal

Errors


public readonly attribute Errors → (ValidateResult)

The syntax errors.

Is​Failure


public attribute IsFailure → (get)

value : bool

true if parsing has failed, false if not.

Has parsing failed?

Is​Success


public attribute IsSuccess → (get)

value : bool

true if parsing has succeeded, false if not.

Has parsing succeeded?

See also

ParseResult.Ast