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, ExpressionNode, params VBType[])
Determines a static VBType from specified operands.
public abstract StaticSemanticsEvaluationResult DetermineDeclaredType(ISymbolResolver resolver, ExpressionNode expression, params VBType[] operandDeclaredTypes)
Parameters
resolverISymbolResolverThe static context containing the available static memory space.
expressionExpressionNodeThe 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(ExpressionNode, VBType[])
Gets the error metadata for a type mismatch compile-time error.
protected static VBCompileErrorInfo GetStaticCoercionTypeMismatchErrorInfo(ExpressionNode expression, VBType[] operandDeclaredTypes)
Parameters
expressionExpressionNodeThe 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(ExpressionNode, VBType[])
Gets the error metadata for a type mismatch compile-time error.
protected static VBCompileErrorInfo GetStaticTypeMismatchErrorInfo(ExpressionNode expression, VBType[] operandDeclaredTypes)
Parameters
expressionExpressionNodeThe statically invalid expression.
operandDeclaredTypesVBType[]The declared types of the inputs of the expression.