Class EmbeddedCodePreparationResult<TArtifact>
- Namespace
- Utils.Parser.EmbeddedCode
- Assembly
- Utils.Parser.dll
Represents the result of preparing ANTLR embedded-code source for a specific execution or generation path.
public sealed record EmbeddedCodePreparationResult<TArtifact> : IEquatable<EmbeddedCodePreparationResult<TArtifact>>
Type Parameters
TArtifactType of the prepared artifact produced on success.
- Inheritance
-
EmbeddedCodePreparationResult<TArtifact>
- Implements
-
IEquatable<EmbeddedCodePreparationResult<TArtifact>>
- Inherited Members
- Extension Methods
Constructors
EmbeddedCodePreparationResult(EmbeddedCodePreparationStatus, TArtifact?, ParserDiagnosticDescriptor?, Exception?, IReadOnlyList<object?>?)
Initializes a new instance of the EmbeddedCodePreparationResult<TArtifact> record.
public EmbeddedCodePreparationResult(EmbeddedCodePreparationStatus status, TArtifact? artifact = default, ParserDiagnosticDescriptor? diagnosticDescriptor = null, Exception? exception = null, IReadOnlyList<object?>? diagnosticArguments = null)
Parameters
statusEmbeddedCodePreparationStatusPreparation outcome category.
artifactTArtifactOptional prepared artifact when preparation succeeded.
diagnosticDescriptorParserDiagnosticDescriptorOptional diagnostic descriptor associated with the outcome.
exceptionExceptionOptional exception associated with a failed preparation attempt.
diagnosticArgumentsIReadOnlyList<object>Optional diagnostic message arguments associated with the outcome.
Properties
Artifact
Gets the optional prepared artifact when preparation succeeded.
public TArtifact? Artifact { get; }
Property Value
- TArtifact
DiagnosticArguments
Gets the optional diagnostic message arguments associated with the outcome.
public IReadOnlyList<object?> DiagnosticArguments { get; }
Property Value
DiagnosticDescriptor
Gets the optional diagnostic descriptor associated with the outcome.
public ParserDiagnosticDescriptor? DiagnosticDescriptor { get; }
Property Value
Exception
Gets the optional exception associated with a failed preparation attempt.
public Exception? Exception { get; }
Property Value
Status
Gets the preparation outcome category.
public EmbeddedCodePreparationStatus Status { get; }
Property Value
Methods
CompilationFailed(Exception?, IEnumerable<object?>?)
Creates a failed compilation preparation result.
public static EmbeddedCodePreparationResult<TArtifact> CompilationFailed(Exception? exception = null, IEnumerable<object?>? diagnosticArguments = null)
Parameters
exceptionExceptionOptional exception associated with the failed compilation.
diagnosticArgumentsIEnumerable<object>Optional diagnostic message arguments associated with the outcome.
Returns
- EmbeddedCodePreparationResult<TArtifact>
A failed compilation preparation result.
CompilerNotConfigured(IEnumerable<object?>?)
Creates a compiler-not-configured preparation result.
public static EmbeddedCodePreparationResult<TArtifact> CompilerNotConfigured(IEnumerable<object?>? diagnosticArguments = null)
Parameters
diagnosticArgumentsIEnumerable<object>Optional diagnostic message arguments associated with the outcome.
Returns
- EmbeddedCodePreparationResult<TArtifact>
A compiler-not-configured preparation result.
PreservedNotCompiled(IEnumerable<object?>?)
Creates a preserved-without-compilation preparation result.
public static EmbeddedCodePreparationResult<TArtifact> PreservedNotCompiled(IEnumerable<object?>? diagnosticArguments = null)
Parameters
diagnosticArgumentsIEnumerable<object>Optional diagnostic message arguments associated with the outcome.
Returns
- EmbeddedCodePreparationResult<TArtifact>
A preserved-without-compilation preparation result.
Success(TArtifact)
Creates a successful preparation result with an artifact.
public static EmbeddedCodePreparationResult<TArtifact> Success(TArtifact artifact)
Parameters
artifactTArtifactPrepared artifact produced by the preparation path.
Returns
- EmbeddedCodePreparationResult<TArtifact>
A successful preparation result.
Unsupported(IEnumerable<object?>?)
Creates an unsupported preparation result.
public static EmbeddedCodePreparationResult<TArtifact> Unsupported(IEnumerable<object?>? diagnosticArguments = null)
Parameters
diagnosticArgumentsIEnumerable<object>Optional diagnostic message arguments associated with the outcome.
Returns
- EmbeddedCodePreparationResult<TArtifact>
An unsupported preparation result.