Table of Contents

Class ParserRuleCallResult

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

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

int

Descriptor

Gets the passive rule metadata descriptor attached to the completed invocation, when available.

public ParserRuleInvocationDescriptor? Descriptor { get; init; }

Property Value

ParserRuleInvocationDescriptor

InputPosition

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

public required int InputPosition { get; init; }

Property Value

int

LabelKind

Gets the current call-site label kind.

public ParserRuleReferenceLabelKind LabelKind { get; init; }

Property Value

ParserRuleReferenceLabelKind

LabelName

Gets the current call-site label name, or null for an unlabeled reference.

public string? LabelName { get; init; }

Property Value

string

RawArguments

Gets raw call-site argument text without its outer brackets, or null.

public string? RawArguments { get; init; }

Property Value

string

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

IReadOnlyDictionary<string, object>

RuleName

Gets the name of the parser rule that produced this call result.

public required string RuleName { get; init; }

Property Value

string

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

returnName string

Return metadata name.

value object

Receives the value, including null when the key is present-null.

Returns

bool

true when the return key is present; otherwise, false.