Class SemanticContextBuilder<TContext, TFlags>
Builds an immutable SemanticContext encapsulating the context of a semantic operation.
public sealed record SemanticContextBuilder<TContext, TFlags> : SemanticContextFlagsBuilder<TContext, TFlags>, ISemanticContextFlagsBuilder<TContext, TFlags>, IEquatable<SemanticContextFlagsBuilder<TContext, TFlags>>, ISemanticContextBuilder<TContext, TFlags>, ISemanticContextAccumulator<TFlags>, ISemanticFlagsAccumulator<TFlags>, IEquatable<SemanticContextBuilder<TContext, TFlags>> where TContext : SemanticContext<TFlags>, new() where TFlags : struct, Enum
Type Parameters
TContextThe type of
SemanticContextto build.TFlagsA
[Flags]enumtype with bit-shifted members that can be composed to encode the semantic flags of the context.
- Inheritance
-
SemanticContextFlagsBuilder<TContext, TFlags>SemanticContextBuilder<TContext, TFlags>
- Implements
-
ISemanticContextFlagsBuilder<TContext, TFlags>IEquatable<SemanticContextFlagsBuilder<TContext, TFlags>>ISemanticContextBuilder<TContext, TFlags>ISemanticContextAccumulator<TFlags>ISemanticFlagsAccumulator<TFlags>IEquatable<SemanticContextBuilder<TContext, TFlags>>
- Inherited Members
Constructors
SemanticContextBuilder(ICoreDiagnosticsFactory)
Builds an immutable SemanticContext encapsulating the context of a semantic operation.
public SemanticContextBuilder(ICoreDiagnosticsFactory CoreDiagnostics)
Parameters
CoreDiagnosticsICoreDiagnosticsFactory
Properties
CoreDiagnostics
public ICoreDiagnosticsFactory CoreDiagnostics { get; init; }
Property Value
Methods
AddDiagnostic(Diagnostic)
Adds the specified Diagnostic to the semantic context.
public ISemanticContextAccumulator<TFlags> AddDiagnostic(Diagnostic diagnostic)
Parameters
diagnosticDiagnosticThe LSP
Diagnosticto include in the operation's semantic context.
Returns
- ISemanticContextAccumulator<TFlags>
AddDiagnosticOnError(VBApplicationErrorInfo?)
Creates and adds a new Diagnostic to the context from the specified VBApplicationErrorInfo.
public ISemanticContextAccumulator<TFlags> AddDiagnosticOnError(VBApplicationErrorInfo? applicationError)
Parameters
applicationErrorVBApplicationErrorInfo
Returns
- ISemanticContextAccumulator<TFlags>
Remarks
Does nothing given a null reference.
AddDiagnosticOnError(VBCompileErrorInfo?)
Creates and adds a new Diagnostic to the context from the specified VBCompileErrorInfo.
public ISemanticContextAccumulator<TFlags> AddDiagnosticOnError(VBCompileErrorInfo? compileError)
Parameters
compileErrorVBCompileErrorInfoThe
VBCompileErrorInfo(static semantics) compile-time error metadata.
Returns
- ISemanticContextAccumulator<TFlags>
Remarks
Does nothing given a null reference.
AddDiagnosticOnError(VBRuntimeErrorInfo?)
Creates and adds a new Diagnostic to the context from the specified VBRuntimeErrorInfo.
public ISemanticContextAccumulator<TFlags> AddDiagnosticOnError(VBRuntimeErrorInfo? runtimeError)
Parameters
runtimeErrorVBRuntimeErrorInfoThe
VBRuntimeErrorInfo(runtime semantics) run-time error metadata.
Returns
- ISemanticContextAccumulator<TFlags>
Remarks
Does nothing given a null reference.
AddDiagnosticOnError(VBSyntaxErrorInfo?)
Creates and adds a new Diagnostic to the context from the specified VBSyntaxErrorInfo.
public ISemanticContextAccumulator<TFlags> AddDiagnosticOnError(VBSyntaxErrorInfo? syntaxError)
Parameters
syntaxErrorVBSyntaxErrorInfoThe
VBSyntaxErrorInfo(static token semantics) compile-time error metadata.
Returns
- ISemanticContextAccumulator<TFlags>
Remarks
Does nothing given a null reference.
AddDiagnosticsOnError(IEnumerable<VBApplicationErrorInfo?>)
Creates and adds a new Diagnostic to the context for each supplied non-null error info.
public ISemanticContextAccumulator<TFlags> AddDiagnosticsOnError(IEnumerable<VBApplicationErrorInfo?> errors)
Parameters
errorsIEnumerable<VBApplicationErrorInfo>The
VBApplicationErrorInfo(application/domain semantics) run-time error metadata.
Returns
- ISemanticContextAccumulator<TFlags>
AddDiagnosticsOnError(IEnumerable<VBCompileErrorInfo?>)
Creates and adds a new Diagnostic to the context for each supplied non-null error info.
public ISemanticContextAccumulator<TFlags> AddDiagnosticsOnError(IEnumerable<VBCompileErrorInfo?> errors)
Parameters
errorsIEnumerable<VBCompileErrorInfo>The
VBCompileErrorInfo(symbol static semantics) compile-time error metadata.
Returns
- ISemanticContextAccumulator<TFlags>
AddDiagnosticsOnError(IEnumerable<VBRuntimeErrorInfo?>)
Creates and adds a new Diagnostic to the context for each supplied non-null error info.
public ISemanticContextAccumulator<TFlags> AddDiagnosticsOnError(IEnumerable<VBRuntimeErrorInfo?> errors)
Parameters
errorsIEnumerable<VBRuntimeErrorInfo>The
VBRuntimeErrorInfo(symbol runtime semantics) run-time error metadata.
Returns
- ISemanticContextAccumulator<TFlags>
AddDiagnosticsOnError(IEnumerable<VBSyntaxErrorInfo?>)
Creates and adds a new Diagnostic to the context for each supplied non-null error info.
public ISemanticContextAccumulator<TFlags> AddDiagnosticsOnError(IEnumerable<VBSyntaxErrorInfo?> errors)
Parameters
errorsIEnumerable<VBSyntaxErrorInfo>The
VBSyntaxErrorInfo(token static semantics) compile-time error metadata.
Returns
- ISemanticContextAccumulator<TFlags>
AddErrorInfo<TError>(TError)
public ISemanticContextFlagsBuilder<TContext, TFlags> AddErrorInfo<TError>(TError error) where TError : VBErrorInfo
Parameters
errorTError
Returns
- ISemanticContextFlagsBuilder<TContext, TFlags>
Type Parameters
TError
Build()
Builds and returns an immutable SemanticContext instance from the current builder state.
public override TContext Build()
Returns
- TContext