Class ParserActionExecutionOutcome
Represents a parser action execution outcome with optional diagnostic metadata.
public sealed record ParserActionExecutionOutcome : IEquatable<ParserActionExecutionOutcome>
- Inheritance
-
ParserActionExecutionOutcome
- Implements
- Inherited Members
- Extension Methods
Constructors
ParserActionExecutionOutcome(ParserActionExecutionStatus, ParserDiagnosticDescriptor?, Exception?, IReadOnlyList<object?>?)
Initializes a new parser action execution outcome.
public ParserActionExecutionOutcome(ParserActionExecutionStatus status, ParserDiagnosticDescriptor? diagnostic = null, Exception? exception = null, IReadOnlyList<object?>? diagnosticArguments = null)
Parameters
statusParserActionExecutionStatusExecution status.
diagnosticParserDiagnosticDescriptorOptional diagnostic descriptor to emit from parser runtime.
exceptionExceptionOptional exception associated with the execution attempt.
diagnosticArgumentsIReadOnlyList<object>Optional diagnostic formatting arguments.
Properties
Diagnostic
Gets an optional diagnostic descriptor.
public ParserDiagnosticDescriptor? Diagnostic { get; }
Property Value
DiagnosticArguments
Gets optional diagnostic arguments. Never null.
public IReadOnlyList<object?> DiagnosticArguments { get; }
Property Value
Exception
Gets an optional exception that can be attached to diagnostics.
public Exception? Exception { get; }
Property Value
Executed
Gets an executed action outcome.
public static ParserActionExecutionOutcome Executed { get; }
Property Value
Status
Gets the execution status.
public ParserActionExecutionStatus Status { get; }
Property Value
Methods
NotExecuted()
Creates a conservative non-executed outcome with no detailed diagnostic metadata.
public static ParserActionExecutionOutcome NotExecuted()
Returns
- ParserActionExecutionOutcome
Non-executed outcome without explicit diagnostic.
NotExecuted(ParserDiagnosticDescriptor, Exception?, params object?[])
Creates a non-executed outcome with explicit diagnostic metadata.
public static ParserActionExecutionOutcome NotExecuted(ParserDiagnosticDescriptor diagnostic, Exception? exception, params object?[] diagnosticArguments)
Parameters
diagnosticParserDiagnosticDescriptorDiagnostic descriptor to emit.
exceptionExceptionOptional execution exception.
diagnosticArgumentsobject[]Optional diagnostic formatting arguments.
Returns
- ParserActionExecutionOutcome
Non-executed outcome with detailed diagnostic metadata.