ParserContextStack

Description

sealed class Tinman.Core.Parsing.ParserContextStack

Stack of parse position per grammar rule.

Position stacks are used to detect left-recursion.

Public / Methods

Pop


public method Pop → ()

returns → int32

The maximum stack depth (only for informational purposes).

Pops the topmost parse position from the stack.

Push


public method Push → (1)

position in : int32

The zero-based parse position.

returns → bool

true if parsing shall continue,
false if a left-recursion has been detected and the current rule shall be skipped.

Pushes the given parse position onto the stack.

The Pop method must be called once for each call to the Push method that has returned true.