Class ParserLabeledRuleCallResultStore
Stores immutable snapshots of successful labeled child parser-rule call results for one invocation frame. Assignment labels and list labels use separate namespaces because grammar ingestion currently permits the same lexical label with both operators; callers must use the helper matching the call-site label kind.
public sealed class ParserLabeledRuleCallResultStore : ICloneable, IParserExecutionStateHashable
- Inheritance
-
ParserLabeledRuleCallResultStore
- Implements
- Inherited Members
- Extension Methods
Properties
Empty
Gets the shared empty labeled-result store.
public static ParserLabeledRuleCallResultStore Empty { get; }
Property Value
Methods
AppendList(string, ParserRuleCallResult)
Returns a new store with the supplied successful result appended to a list label.
public ParserLabeledRuleCallResultStore AppendList(string labelName, ParserRuleCallResult result)
Parameters
labelNamestringList label name.
resultParserRuleCallResultSuccessful completed call result.
Returns
- ParserLabeledRuleCallResultStore
A new immutable store snapshot.
Clone()
Returns this immutable store instance.
public object Clone()
Returns
- object
The current immutable store.
GetList(string)
Gets the successful results retained for a list label in execution order.
public IReadOnlyList<ParserRuleCallResult> GetList(string labelName)
Parameters
labelNamestringList label name.
Returns
- IReadOnlyList<ParserRuleCallResult>
An immutable ordered result list, or a shared empty list when absent.
GetParserExecutionStateHash()
Computes a deterministic state hash for assignment labels, list labels, and ordered call results. Call results conservatively produce volatile hashes when they contain unsupported arbitrary return objects.
public ulong GetParserExecutionStateHash()
Returns
- ulong
The managed execution-state hash.
SetAssignment(string, ParserRuleCallResult)
Returns a new store whose assignment label contains the supplied successful result. A repeated assignment label uses last-successful-result-wins semantics.
public ParserLabeledRuleCallResultStore SetAssignment(string labelName, ParserRuleCallResult result)
Parameters
labelNamestringAssignment label name.
resultParserRuleCallResultSuccessful completed call result.
Returns
- ParserLabeledRuleCallResultStore
A new immutable store snapshot.
TryGetAssignment(string, out ParserRuleCallResult)
Attempts to retrieve the last successful result retained for an assignment label.
public bool TryGetAssignment(string labelName, out ParserRuleCallResult result)
Parameters
labelNamestringAssignment label name.
resultParserRuleCallResultReceives the retained result when present.
Returns
- bool
truewhen an assignment result is present; otherwise,false.