Table of Contents

Class SemanticContextFlagsBuilder<TContext, TFlags>

Namespace
RDCore.SDK.Semantics.Builders
Assembly
RDCore.SDK.dll

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

TContext

The type of SemanticContext to build.

TFlags

A [Flags] enum type with bit-shifted members that can be composed to encode the semantic flags of the context.

Inheritance
SemanticContextFlagsBuilder<TContext, TFlags>
Implements
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

flags TFlags

The 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

flags ConversionSemanticFlags

The semantic flag values.

operand InputIndex

The 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

error TError

Holds information about an error.

Returns

ISemanticContextFlagsBuilder<TContext, TFlags>

Type Parameters

TError

The 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

flags TFlags

The semantic flag value(s) to compose into the semantic context.

Returns

ISemanticFlagsAccumulator<TFlags>