ParserContext

class ParserContext(val input: List<Token>)

Provides context for parsing operations and manages the Rule invocation stack.

ParserContext is used as a context receiver in Rule.parse and PatternElement.captureAt implementations, providing access to the Token stream and parser state. It maintains a stack of active rule frames to detect and prevent infinite recursion in recursive grammars.

Constructors

Link copied to clipboard
constructor(input: List<Token>)

Types

Link copied to clipboard
data class Frame

Represents a single frame in the parser's Rule invocation stack.

Properties

Link copied to clipboard

The list of tokens being parsed

Functions

Link copied to clipboard

Returns a snapshot of the current Rule invocation stack.