Class ParserRuleLifecycleContext
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
ruleNamestringName of the parser rule being entered or exited.
inputPositionintToken-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
ruleNamestringName of the parser rule being entered or exited.
inputPositionintToken-stream position at the time of rule entry.
invocationFrameParserRuleInvocationFramePassive parser rule invocation frame, or
nullwhen no frame is available.
Properties
InputPosition
Gets the token-stream position at the time of rule entry.
public int InputPosition { get; }
Property Value
InvocationFrame
Gets the passive invocation frame associated with this lifecycle event when available.
public ParserRuleInvocationFrame? InvocationFrame { get; }
Property Value
RuleName
Gets the name of the parser rule associated with this lifecycle event.
public string RuleName { get; }