Class SymbolDescriptor
A transport-friendly projection of one declared member Symbol. Declared types
travel as names, not resolved VBTypes — the environment host is the resolution authority.
public record SymbolDescriptor : IEquatable<SymbolDescriptor>
- Inheritance
-
SymbolDescriptor
- Implements
- Inherited Members
Properties
AccessModifier
The declared access modifier; Implicit when none was written.
public AccessModifier AccessModifier { get; init; }
Property Value
Array
What is declared is an array of DeclaredTypeName: how it is sized, which a type name has no room for.
null for anything that is not an array.
public ArrayDescriptor? Array { get; init; }
Property Value
Constants
The procedure-local Const declarations the member owns, for the procedure, function and
property kinds — and, for a ModuleConstant descriptor, the
single entry that is the module-level constant's own value.
public ImmutableArray<ConstantDescriptor> Constants { get; init; }
Property Value
Remarks
A constant is not a variable: it has no storage, so it cannot ride on Locals, whose every entry an activation allocates frame storage for. It travels instead because it has no storage — with nowhere to read a value back from, the host can only substitute the declaration's own expression at each use site, and needs that expression to do it.
DeclaredTypeName
The declared type's name — from an As clause or a type-declaration character — or
null when there is none, or the type reference is not a simple name (a qualified name
or an array definition needs a later semantic pass). For an array, the name of its element type, and
Array says what kind of array it is.
public string? DeclaredTypeName { get; init; }
Property Value
Definitions
The declaration sites of this member, in source order — populated only when the same name is declared in more than one conditional-compilation branch. Empty for the common single-declaration case, in which Range/SelectionRange are the sole site. A consumer that does not support multi-branch symbols can ignore this and use Range.
public ImmutableArray<DefinitionDescriptor> Definitions { get; init; }
Property Value
External
Declare-statement metadata; null unless Kind is
ExternalProcedure or ExternalFunction.
public ExternalDescriptor? External { get; init; }
Property Value
IsAutoInstantiated
Whether a module field is an automatic instantiation variable (MS-VBAL §2.5.1): declared
As New, so that referring to it while it is Nothing creates the object.
public bool IsAutoInstantiated { get; init; }
Property Value
IsWithEvents
Whether a module field is declared WithEvents (MS-VBAL §5.2.3.1.2): the procedures of its
module named for it and an event of its class handle that event of the object it holds.
public bool IsWithEvents { get; init; }
Property Value
Kind
Which kind of member symbol to reconstruct.
public SymbolDescriptorKind Kind { get; init; }
Property Value
Locals
The procedure-extent variables the member declares — one per Dim or Static — for
the procedure, function and property kinds.
public ImmutableArray<LocalDescriptor> Locals { get; init; }
Property Value
Remarks
A local is not a member of the module and is never resolvable from outside its procedure, so it rides on its own procedure's descriptor rather than appearing beside it. It has to travel at all because the procedure symbol is what an invocation allocates frame storage from (MS-VBAL §5.4.3 step 4): a procedure reconstructed without its locals has a body that cannot assign to any of them.
Members
Members parented to this descriptor rather than the module: Enum constants and
user-defined-Type fields.
public ImmutableArray<SymbolDescriptor> Members { get; init; }
Property Value
Name
The member's identifier name.
public string Name { get; init; }
Property Value
Parameters
Parameters, for the procedure, function, property and event kinds.
public ImmutableArray<ParameterDescriptor> Parameters { get; init; }
Property Value
Range
The source span of the whole declaration — the primary site (the first branch) when the member has multiple Definitions.
public SourceRange Range { get; init; }
Property Value
Scope
The allocation scope the symbol is defined in.
public ScopeKind Scope { get; init; }
Property Value
SelectionRange
The source span to select when navigating to the symbol (typically its name token) — the primary site when the member has multiple Definitions.
public SourceRange SelectionRange { get; init; }
Property Value
UserMemId
The member's VB_UserMemId (MS-VBAL §5.2.1), when its module says one: 0 marks the default member of a class, -4 its enumeration
member (_NewEnum). null for a member with none.
public int? UserMemId { get; init; }
Property Value
- int?
Remarks
It travels because the host finds the default member and the enumeration member of a class by it - for c(1) and for For Each - and the host reads no
source of its own to find the attribute in.