TINMAN 3D / REALTIME TERRAIN
Software Development Kit - User Manual

class ParserContext in Tinman.Core.Parsing

sealed class ParserContext extends Disposable

Public / Attributes

IsEof

Has the end of the input token sequence been reached?

public property IsEof { get }
type bool
value true if there are no more input tokens following the current position, false if at least one more token will follow.

LifecycleState

Returns the lifecycle state of this object.

public virtual property LifecycleState { get }
type LifecycleState
value The lifecycle state.
inherited Disposable.LifecycleState

Position

Returns the current position.

public property Position { get }
type int32
value [>=0] The current position.

Remaining

Returns the number of remaining input tokens.

public property Remaining { get }
type int32
value [>=0] The number of remaining input tokens.

Public / Methods

AcquireTry

Acquires a strong reference to this disposable object.

[OwnerReturn, ThreadSafe]
public method AcquireTry ()
type IDisposable
returns this if a new strong reference has been acquired, null if this object is already being disposed.
inherited Disposable.AcquireTry

Remarks:

The object will not be actually disposed by calls to Dispose when there is at least one strong reference left. Code that calls the AcquireTry method is responsible for calling the Dispose method accordingly.

This method is not intended to be used in performance-critical code. It should only be used to high-level resource management.

Begin

public method Begin ()

public method Begin (int32 astCommand)
params astCommand

Commit

public method Commit ()

Consume

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

public method Consume (int32 n = 1)
params n Number of input tokens to consume. Defaults to 1.

CreateAst

public method CreateAst (IGrammarRule rule)
type AstNode
params rule

Dispose

Releases all resources held by this object if there are no more strong references to it, decrements the reference counter by one otherwise.

[Dispose, OwnerThis, ThreadSafe]
public method Dispose ()
inherited Disposable.Dispose

Remarks:

The Dispose method silently returns if the object has already been disposed.

GetParserErrors

public method GetParserErrors ()
type ValidateResult

Peek

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

public method Peek (int32 offset = 0)
type char
params offset The relative offset. Defaults to 0.
returns The token or '\0' for out-of-range offsets.

Remarks:

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

Rollback

public method Rollback ()

RulePositionStack

Returns the position stack for the given rule.

public method RulePositionStack (IRule rule)
type ParserContextStack
params rule The rule object.
returns [not-null] The position stack.

Skip

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

public method Skip ()
type bool
returns true if at least one input character has been skipped, false if not.