Table of Contents

Class ParserRuleLifecycleContext

Namespace
Utils.Parser.Runtime
Assembly
Utils.Parser.dll

Immutable context passed to parser rule lifecycle hook executors. Provides positional metadata for rule entry and exit without granting parse-control authority.

public sealed class ParserRuleLifecycleContext
Inheritance
ParserRuleLifecycleContext
Inherited Members
Extension Methods

Constructors

ParserRuleLifecycleContext(string, int)

Initializes a parser rule lifecycle context.

public ParserRuleLifecycleContext(string ruleName, int inputPosition)

Parameters

ruleName string

Name of the parser rule being entered or exited.

inputPosition int

Token-stream position at the time of rule entry.

ParserRuleLifecycleContext(string, int, ParserRuleInvocationFrame?)

Initializes a parser rule lifecycle context with an optional invocation frame.

public ParserRuleLifecycleContext(string ruleName, int inputPosition, ParserRuleInvocationFrame? invocationFrame)

Parameters

ruleName string

Name of the parser rule being entered or exited.

inputPosition int

Token-stream position at the time of rule entry.

invocationFrame ParserRuleInvocationFrame

Passive parser rule invocation frame, or null when no frame is available.

Properties

InputPosition

Gets the token-stream position at the time of rule entry.

public int InputPosition { get; }

Property Value

int

InvocationFrame

Gets the passive invocation frame associated with this lifecycle event when available.

public ParserRuleInvocationFrame? InvocationFrame { get; }

Property Value

ParserRuleInvocationFrame

RuleName

Gets the name of the parser rule associated with this lifecycle event.

public string RuleName { get; }

Property Value

string