Table of Contents

Class SemanticPredicateEvaluationOutcome

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

Represents a semantic predicate evaluation outcome with optional diagnostic metadata.

public sealed record SemanticPredicateEvaluationOutcome : IEquatable<SemanticPredicateEvaluationOutcome>
Inheritance
SemanticPredicateEvaluationOutcome
Implements
Inherited Members
Extension Methods

Constructors

SemanticPredicateEvaluationOutcome(SemanticPredicateEvaluationStatus, ParserDiagnosticDescriptor?, Exception?, IReadOnlyList<object?>?)

Initializes a new semantic predicate evaluation outcome.

public SemanticPredicateEvaluationOutcome(SemanticPredicateEvaluationStatus status, ParserDiagnosticDescriptor? diagnostic = null, Exception? exception = null, IReadOnlyList<object?>? diagnosticArguments = null)

Parameters

status SemanticPredicateEvaluationStatus

Evaluation status.

diagnostic ParserDiagnosticDescriptor

Optional diagnostic descriptor to emit from parser runtime.

exception Exception

Optional exception associated with the evaluation attempt.

diagnosticArguments IReadOnlyList<object>

Optional diagnostic formatting arguments.

Properties

Diagnostic

Gets an optional diagnostic descriptor.

public ParserDiagnosticDescriptor? Diagnostic { get; }

Property Value

ParserDiagnosticDescriptor

DiagnosticArguments

Gets optional diagnostic arguments. Never null.

public IReadOnlyList<object?> DiagnosticArguments { get; }

Property Value

IReadOnlyList<object>

Exception

Gets an optional exception that can be attached to diagnostics.

public Exception? Exception { get; }

Property Value

Exception

Rejected

Gets a rejected predicate outcome.

public static SemanticPredicateEvaluationOutcome Rejected { get; }

Property Value

SemanticPredicateEvaluationOutcome

Satisfied

Gets a successful predicate outcome.

public static SemanticPredicateEvaluationOutcome Satisfied { get; }

Property Value

SemanticPredicateEvaluationOutcome

Status

Gets the evaluation status.

public SemanticPredicateEvaluationStatus Status { get; }

Property Value

SemanticPredicateEvaluationStatus

Methods

NotEvaluated()

Creates a conservative non-evaluated outcome with no detailed diagnostic metadata.

public static SemanticPredicateEvaluationOutcome NotEvaluated()

Returns

SemanticPredicateEvaluationOutcome

Non-evaluated outcome without explicit diagnostic.

NotEvaluated(ParserDiagnosticDescriptor, Exception?, params object?[])

Creates a non-evaluated outcome with explicit diagnostic metadata.

public static SemanticPredicateEvaluationOutcome NotEvaluated(ParserDiagnosticDescriptor diagnostic, Exception? exception, params object?[] diagnosticArguments)

Parameters

diagnostic ParserDiagnosticDescriptor

Diagnostic descriptor to emit.

exception Exception

Optional evaluation exception.

diagnosticArguments object[]

Optional diagnostic formatting arguments.

Returns

SemanticPredicateEvaluationOutcome

Non-evaluated outcome with detailed diagnostic metadata.