Class VariableDeclarationNode
- Namespace
- RDCore.SDK.Model.AST.Declarations
- Assembly
- RDCore.SDK.dll
An AST node representing a variable declaration — a procedure-local Dim/Static
(child of a member node) or a module-level field (child of the module node). An
ArrayBoundsNode child, when present, carries the (…) array-dimension clause.
public record VariableDeclarationNode : SyntaxNode, IEquatable<SyntaxNode>, IEquatable<VariableDeclarationNode>
- Inheritance
-
VariableDeclarationNode
- Implements
- Inherited Members
- Extension Methods
Constructors
VariableDeclarationNode(SyntaxNodeId, SourceLocation, string, ImmutableArray<SyntaxNode>, AccessModifier, string?, bool, bool, SourceRange?)
An AST node representing a variable declaration — a procedure-local Dim/Static
(child of a member node) or a module-level field (child of the module node). An
ArrayBoundsNode child, when present, carries the (…) array-dimension clause.
public VariableDeclarationNode(SyntaxNodeId Identity, SourceLocation SourceLocation, string Name, ImmutableArray<SyntaxNode> Children, AccessModifier AccessModifier = AccessModifier.Implicit, string? TypeHint = null, bool IsWithEvents = false, bool IsStatic = false, SourceRange? NameRange = null)
Parameters
IdentitySyntaxNodeIdA unique identifier for this specific syntax node.
SourceLocationSourceLocationThe declaration as it is written. A statement that declares several variables (
Dim a As Long, b As String) has the keywords in front of the first of them, so the first one's range begins withDim(orStatic, or the visibility), and the others' begin with their names.NamestringThe declared identifier name of the member.
ChildrenImmutableArray<SyntaxNode>AccessModifierAccessModifierThe access modifier, if one was supplied.
TypeHintstringThe type hint token, if one was supplied.
IsWithEventsbooltrueif the variable is aWithEventsfield.IsStaticbooltrueif the declaration has an explicitStatictoken (MS-VBAL §5.4.3.1).NameRangeSourceRange?Where the name is written, with its type-declaration character; null when it is not known.
Properties
AccessModifier
The access modifier, if one was supplied.
public AccessModifier AccessModifier { get; init; }
Property Value
IsStatic
true if the declaration has an explicit Static token (MS-VBAL §5.4.3.1).
public bool IsStatic { get; init; }
Property Value
IsWithEvents
true if the variable is a WithEvents field.
public bool IsWithEvents { get; init; }
Property Value
Name
The declared identifier name of the member.
public string Name { get; init; }
Property Value
NameRange
Where the name is written, with its type-declaration character; null when it is not known.
public SourceRange? NameRange { get; init; }
Property Value
TypeHint
The type hint token, if one was supplied.
public string? TypeHint { get; init; }