Class ParserRuleCallResult
Captures an immutable passive snapshot of a successfully completed child parser rule invocation. Return names remain ordinal metadata; no type conversion, implicit variable, or ANTLR attribute syntax is provided.
public sealed class ParserRuleCallResult : IParserExecutionStateHashable
- Inheritance
-
ParserRuleCallResult
- Implements
- Inherited Members
- Extension Methods
Properties
Depth
Gets the zero-based call-stack depth of the completed rule invocation.
public required int Depth { get; init; }
Property Value
Descriptor
Gets the passive rule metadata descriptor attached to the completed invocation, when available.
public ParserRuleInvocationDescriptor? Descriptor { get; init; }
Property Value
InputPosition
Gets the token-stream position at the time of rule entry.
public required int InputPosition { get; init; }
Property Value
LabelKind
Gets the current call-site label kind.
public ParserRuleReferenceLabelKind LabelKind { get; init; }
Property Value
LabelName
Gets the current call-site label name, or null for an unlabeled reference.
public string? LabelName { get; init; }
Property Value
RawArguments
Gets raw call-site argument text without its outer brackets, or null.
public string? RawArguments { get; init; }
Property Value
Returns
Gets an immutable snapshot of return values present after successful child execution and its @after hook.
An absent key and a key whose value is null remain distinguishable.
public IReadOnlyDictionary<string, object?> Returns { get; init; }
Property Value
RuleName
Gets the name of the parser rule that produced this call result.
public required string RuleName { get; init; }
Property Value
Methods
GetParserExecutionStateHash()
Computes a deterministic managed-state hash. Unsupported arbitrary return objects contribute a fresh nonce, conservatively preventing unsafe completed-result memoization instead of using unstable object identity hashes.
public ulong GetParserExecutionStateHash()
Returns
- ulong
The managed execution-state hash.
TryGetReturn(string, out object?)
Attempts to retrieve a return value by ordinal metadata name without conversion.
public bool TryGetReturn(string returnName, out object? value)
Parameters
returnNamestringReturn metadata name.
valueobjectReceives the value, including
nullwhen the key is present-null.
Returns
- bool
truewhen the return key is present; otherwise,false.