Table of Contents

Class StaticSemantics

Namespace
RDCore.SDK.Semantics.Static.Abstract
Assembly
RDCore.SDK.dll

The class at the base of the static semantics type hierarchy that implements all the static semantic rules defined in MS-VBAL.

public abstract record StaticSemantics : IStaticSemantics, IEquatable<StaticSemantics>
Inheritance
StaticSemantics
Implements
Derived
Inherited Members

Constructors

StaticSemantics()

The class at the base of the static semantics type hierarchy that implements all the static semantic rules defined in MS-VBAL.

protected StaticSemantics()

Methods

DetermineDeclaredType(ISymbolResolver, BoundExpression, params VBType[])

Determines a static VBType from specified operands.

public abstract StaticSemanticsEvaluationResult DetermineDeclaredType(ISymbolResolver resolver, BoundExpression expression, params VBType[] operandDeclaredTypes)

Parameters

resolver ISymbolResolver

The static context containing the available static memory space.

expression BoundExpression

The expression node being evaluated.

operandDeclaredTypes VBType[]

The declared type of each operand involved in the evaluation.

Returns

StaticSemanticsEvaluationResult

A StaticSemanticsEvaluationResult encapsulating the resulting VBType if successful, or VBCompileErrorInfo error metadata otherwise.

GetStaticCoercionTypeMismatchErrorInfo(BoundExpression, VBType[])

Gets the error metadata for a type mismatch compile-time error.

protected static VBCompileErrorInfo GetStaticCoercionTypeMismatchErrorInfo(BoundExpression expression, VBType[] operandDeclaredTypes)

Parameters

expression BoundExpression

The statically invalid expression.

operandDeclaredTypes VBType[]

The declared types of the inputs of the expression.

Returns

VBCompileErrorInfo

Remarks

👉 A different verbose message differenciates this error from a static type mismatch error; they are the same compile-time error, but with distincly different causes that a verbose message should explain.

GetStaticTypeMismatchErrorInfo(BoundExpression, VBType[])

Gets the error metadata for a type mismatch compile-time error.

protected static VBCompileErrorInfo GetStaticTypeMismatchErrorInfo(BoundExpression expression, VBType[] operandDeclaredTypes)

Parameters

expression BoundExpression

The statically invalid expression.

operandDeclaredTypes VBType[]

The declared types of the inputs of the expression.

Returns

VBCompileErrorInfo