Class StaticSemantics
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
resolverISymbolResolverThe static context containing the available static memory space.
expressionBoundExpressionThe expression node being evaluated.
operandDeclaredTypesVBType[]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
expressionBoundExpressionThe statically invalid expression.
operandDeclaredTypesVBType[]The declared types of the inputs of the expression.
Returns
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
expressionBoundExpressionThe statically invalid expression.
operandDeclaredTypesVBType[]The declared types of the inputs of the expression.