Table of Contents

Class TypeOfIsExpressionStaticSemantics

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

MS-VBAL 5.6.7 TypeOf...Is Expressions (static semantics). Always classified as a value with a declared type of Boolean; Operand must have a declared type of a specific UDT, a specific class, Object, or Variant, and TypeExpression must name a type.

public sealed record TypeOfIsExpressionStaticSemantics : IStaticSemantics, IEquatable<TypeOfIsExpressionStaticSemantics>
Inheritance
TypeOfIsExpressionStaticSemantics
Implements
Inherited Members

Remarks

What MS-VBA accepts as the type (Excel-verified, oracle\s29): the name of a class, an interface, a user-defined type or an enumeration, bare or qualified, and Object. An intrinsic type other than Object, or anything that is no name - Nothing, Object(), String * 2 - is a syntax error. A name that binds no type is the error a declared type of that name would be (DeclarationStaticSemanticsEvaluator): a module, a library's module or a project is no type, and any other name, a variable's or a procedure's included, is a user-defined type that is not defined.

Properties

Instance

The shared instance — this rule has no state of its own.

public static TypeOfIsExpressionStaticSemantics Instance { get; }

Property Value

TypeOfIsExpressionStaticSemantics

Methods

DetermineDeclaredType(StaticEvaluationContext, ExpressionNode, params VBType[])

Determines the declared type of a TypeOfIsExpressionNode — always VBBooleanType, provided Operand's declared type satisfies MS-VBAL 5.6.7's classification requirement, and TypeExpression names a type.

public StaticSemanticsEvaluationResult DetermineDeclaredType(StaticEvaluationContext context, ExpressionNode expression, params VBType[] operandDeclaredTypes)

Parameters

context StaticEvaluationContext

The compile-time context this expression is evaluated against: the type is resolved from its scope.

expression ExpressionNode

The TypeOfIsExpressionNode being evaluated.

operandDeclaredTypes VBType[]

Operand's already-determined declared type, at TypeOfIsOperand. TypeExpression names a type, not a value, and has no declared type of its own.

Returns

StaticSemanticsEvaluationResult

Exceptions

ArgumentException

expression is not a TypeOfIsExpressionNode.