sealed class Tinman.Core.Parsing.ParserContext

Derived from

Disposable abstract

Represents the context while parsing the content of a ICodeInput object.

Public / Methods


public method Begin → (1)

right opt : bool = false

Calling from the ast-if-right rule?

Begins a new parser context frame.


public method BeginNoAst → ()

Begins a new parser context frame (no AST modification).


public method Commit → ()

Commits the current parser context frame.


public method CommitNoAst → ()

Commits the current parser context frame (no AST modification).


public method Consume → (1)

opt : int32 = 1

Number of input tokens to consume.

Consumes the next opt input tokens and advances the position accordingly.


public method CreateAst → (1)

rule in : IGrammarRule

The enclosing grammar rule.

returns → AstNode

The created AstNode object.

Creates an AstNode object from the current parser content.


public method GetParserErrors → ()

returns → ValidateResult

The parser errors.

Returns the collected parser errors.


public method Peek → (1)

offset opt : int32 = 0

The relative offset.

returns → char

The token or '\0' for out-of-range offsets.

Peeks a token relative to the current position without modifying the current position.

If the resulting token offset lies outside the valid range, the default value of the token type will be returned.


public method Rollback → ()

Rolls back the current parser context frame.


public method RollbackNoAst → ()

Rolls back the current parser context frame (no AST modification).


public method RulePositionStack → (1)

rule in : IRule

The rule object.

returns → ParserContextStack

The position stack.

Returns the position stack for the given rule.


public method Skip → ()

returns → bool

true if at least one input character has been skipped, false if not.

Skips subsequent input according to the skip rule of the current grammar of the top-most grammar rule.

Public / Attributes


public attribute IsEof → (get)

value : bool

true if there are no more input tokens following the current position, false if at least one more token will follow.

Has the end of the input token sequence been reached?


public attribute Position → (get)

value : int32

The current position.

Returns the current position.


public attribute Remaining → (get)

value : int32

The number of remaining input tokens.

Returns the number of remaining input tokens.