Class ExpressionFact
What the static pass found out about one expression.
public sealed record ExpressionFact : IEquatable<ExpressionFact>
- Inheritance
-
ExpressionFact
- Implements
- Inherited Members
Remarks
A fact is a description of the expression, not an opinion of it: whether a late-bound member, a name written in the wrong case or a constant condition is worth a diagnostic is for an analyzer to say.
Constructors
ExpressionFact(SyntaxNodeId, SourceLocation, VBType?, ExpressionClassification, SemanticId?, ValueExpressionSemanticFlags, VBCompileErrorInfo?)
What the static pass found out about one expression.
public ExpressionFact(SyntaxNodeId Node, SourceLocation Location, VBType? DeclaredType, ExpressionClassification Classification, SemanticId? Binding, ValueExpressionSemanticFlags Flags, VBCompileErrorInfo? Error = null)
Parameters
NodeSyntaxNodeIdThe expression the fact describes.
LocationSourceLocationWhere the expression is written.
DeclaredTypeVBTypeThe declared type of the expression (RD-VBAL §5.0.1), or null when it is an error.
ClassificationExpressionClassificationWhat the expression names.
BindingSemanticId?The symbol the expression refers to, when it refers to one that resolved.
FlagsValueExpressionSemanticFlagsWhat else is the case of it.
ErrorVBCompileErrorInfoThe compile error of the expression itself or of the first of its operands that has one, when it has.
Remarks
A fact is a description of the expression, not an opinion of it: whether a late-bound member, a name written in the wrong case or a constant condition is worth a diagnostic is for an analyzer to say.
Properties
Accessors
The accessors of the property the expression names (MS-VBAL §5.3.1.7): those its module declares under the name, or, for a member of an object, those its class declares. None for an expression that names no property.
public PropertyAccessors Accessors { get; init; }
Property Value
Binding
The symbol the expression refers to, when it refers to one that resolved.
public SemanticId? Binding { get; init; }
Property Value
Classification
What the expression names.
public ExpressionClassification Classification { get; init; }
Property Value
ConstantValue
The constant binding of the constant the expression names (MS-VBAL §5.2.3.2): the value of its constant expression, Let-coerced to
its declared type. DEV is 1 with Const DEV = 1, and True with Const DEV As Boolean = 1. It is known where the
constant expression is a literal, a negated literal, or the name of another constant whose binding is known. null for an expression
that names no constant, and for a constant whose binding is not known.
public VBTypedValue? ConstantValue { get; init; }
Property Value
Creates
The class of the object the expression creates, when it is a CreateObject call given a constant programmatic identifier of a class that is
described: a fact for tooling only, never a declaration (ObjectCreationFact). null otherwise.
public ObjectCreationFact? Creates { get; init; }
Property Value
DeclaredType
The declared type of the expression (RD-VBAL §5.0.1), or null when it is an error.
public VBType? DeclaredType { get; init; }
Property Value
DefaultMember
The default member of the class the expression's declared type is (DefaultMemberFact); null for an expression of any other type, and of a class that has no default member.
public DefaultMemberFact? DefaultMember { get; init; }
Property Value
Error
The compile error of the expression itself or of the first of its operands that has one, when it has.
public VBCompileErrorInfo? Error { get; init; }
Property Value
Flags
What else is the case of it.
public ValueExpressionSemanticFlags Flags { get; init; }
Property Value
IsLetCoerced
Whether the expression's value is taken and Let-coerced to a declared type (MS-VBAL §5.5.1.1): it is an operand of an operator other
than Is, the value of a Let assignment, or an argument given to a parameter declared with a value type. An object stands there for the
value of its default member. An argument given to a parameter declared Variant is passed as it is, and a variable of a ByRef parameter's
own type is passed by reference (MS-VBAL §5.3.1.11): neither is Let-coerced.
public bool IsLetCoerced { get; init; }
Property Value
LetValueType
The declared type of the value parameter of the Property Let of the property the expression names: its last parameter, which a Let of the
property gives the value. null for an expression that names no property with a Property Let.
public VBType? LetValueType { get; init; }
Property Value
Location
Where the expression is written.
public SourceLocation Location { get; init; }
Property Value
NativeCall
For an expression bound to a procedure declared by a Declare statement (MS-VBAL §5.2.3.5), the platforms the expression is
compiled on and those the procedure is declared on, in all and by each of its statements (CompiledOn,
StatementsCompiledOn). An analyzer of the module the call is in needs both, and is given neither the module the procedure
is declared in nor its #If blocks.
public NativeCallPlatforms? NativeCall { get; init; }
Property Value
Remarks
The host finds both as it finds CompiledOn: by evaluating the #If and #ElseIf conditions of each module
once for each platform of Each, with that platform's predefined constants, not only under the constants of the
session that analyzed the code. null for an expression bound to anything else, and where a condition either depends on cannot be
evaluated.
Node
The expression the fact describes.
public SyntaxNodeId Node { get; init; }