Table of Contents

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

Identity SyntaxNodeId

A unique identifier for this specific syntax node.

SourceLocation SourceLocation

The 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 with Dim (or Static, or the visibility), and the others' begin with their names.

Name string

The declared identifier name of the member.

Children ImmutableArray<SyntaxNode>
AccessModifier AccessModifier

The access modifier, if one was supplied.

TypeHint string

The type hint token, if one was supplied.

IsWithEvents bool

true if the variable is a WithEvents field.

IsStatic bool

true if the declaration has an explicit Static token (MS-VBAL §5.4.3.1).

NameRange SourceRange?

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

AccessModifier

IsStatic

true if the declaration has an explicit Static token (MS-VBAL §5.4.3.1).

public bool IsStatic { get; init; }

Property Value

bool

IsWithEvents

true if the variable is a WithEvents field.

public bool IsWithEvents { get; init; }

Property Value

bool

Name

The declared identifier name of the member.

public string Name { get; init; }

Property Value

string

NameRange

Where the name is written, with its type-declaration character; null when it is not known.

public SourceRange? NameRange { get; init; }

Property Value

SourceRange?

TypeHint

The type hint token, if one was supplied.

public string? TypeHint { get; init; }

Property Value

string