Class SemanticContextFlagsBuilder<TContext, TFlags>
Builds the semantic flags of a specific semantic operation.
public record SemanticContextFlagsBuilder<TContext, TFlags> : ISemanticContextFlagsBuilder<TContext, TFlags>, ISemanticFlagsAccumulator<TFlags>, IEquatable<SemanticContextFlagsBuilder<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>
- Implements
-
ISemanticContextFlagsBuilder<TContext, TFlags>ISemanticFlagsAccumulator<TFlags>IEquatable<SemanticContextFlagsBuilder<TContext, TFlags>>
- Derived
- Inherited Members
Properties
Flags
Builds the current aggregate flags and returns the result.
public TFlags Flags { get; }
Property Value
- TFlags
Remarks
🧩 This property enumerates and casts all flags to compute the current aggregate flags value every time it is invoked. Avoid calling it repeatedly.
Methods
AddFlags(TFlags)
Adds the specified semantic flag(s) to the context.
public ISemanticFlagsAccumulator<TFlags> AddFlags(TFlags flags)
Parameters
flagsTFlagsThe semantic flag values.
Returns
- ISemanticFlagsAccumulator<TFlags>
AddLetCoercionFlags(ConversionSemanticFlags, InputIndex)
Adds the specified conversion semantic flags to the context of the specified operand.
public ISemanticFlagsAccumulator<TFlags> AddLetCoercionFlags(ConversionSemanticFlags flags, InputIndex operand)
Parameters
flagsConversionSemanticFlagsThe semantic flag values.
operandInputIndexThe index of the operand to add let-coercion (implicit conversion) semantic flags for.
Returns
- ISemanticFlagsAccumulator<TFlags>
AddOnError<TError>(TError?)
Adds the specified error to the semantic context if it isn't null.
public ISemanticContextFlagsBuilder<TContext, TFlags> AddOnError<TError>(TError? error) where TError : VBErrorInfo
Parameters
errorTErrorHolds information about an error.
Returns
- ISemanticContextFlagsBuilder<TContext, TFlags>
Type Parameters
TErrorThe specific type of VBErrorInfo encapsulating the error metadata.
Build()
Builds and returns an immutable SemanticContext instance from the current builder state.
public virtual TContext Build()
Returns
- TContext
WithFlags(TFlags)
Adds the specified semantic flag(s) to the context and returns the builder instance.
protected ISemanticFlagsAccumulator<TFlags> WithFlags(TFlags flags)
Parameters
flagsTFlagsThe semantic flag value(s) to compose into the semantic context.
Returns
- ISemanticFlagsAccumulator<TFlags>