Class RedimDeclarationNode
- Namespace
- RDCore.SDK.Model.AST.Declarations
- Assembly
- RDCore.SDK.dll
A single target of a body-level ReDim statement (MS-VBAL §5.4.3.3) — one node per
comma-separated declaration, child of the enclosing member node.
public record RedimDeclarationNode : SyntaxNode, IEquatable<SyntaxNode>, IEquatable<RedimDeclarationNode>
- Inheritance
-
RedimDeclarationNode
- Implements
- Inherited Members
Remarks
A ReDim always re-dimensions a dynamic array. It re-dimensions an existing array
(a local, a parameter, or a module field) when the target name already resolves; an unqualified
name that resolves to nothing implicitly declares a local, which stays legal under
Option Explicit (a later analysis pass flags it, and turns it into an error under
Option Strict).
The ArrayBoundsNode child carries the new dimensions; unlike a Dim array
clause these bounds are ordinary run-time expressions, not constant expressions. An
AsTypeExpressionNode child, when present, carries the optional As clause.
Constructors
RedimDeclarationNode(SyntaxNodeId, SourceLocation, string, string?, ImmutableArray<SyntaxNode>, bool, string?)
A single target of a body-level ReDim statement (MS-VBAL §5.4.3.3) — one node per
comma-separated declaration, child of the enclosing member node.
public RedimDeclarationNode(SyntaxNodeId Identity, SourceLocation Location, string Name, string? QualifierName, ImmutableArray<SyntaxNode> Children, bool IsPreserve = false, string? TypeHint = null)
Parameters
IdentitySyntaxNodeIdA unique identifier for this specific syntax node.
LocationSourceLocationThe source location of the
ReDimtarget.NamestringThe target identifier name.
QualifierNamestringThe qualifier when the target is a member access (
obj.Buffer,Me.Buffer,.Buffer);nullfor a simple name.ChildrenImmutableArray<SyntaxNode>The ArrayBoundsNode, and the AsTypeExpressionNode when an
Asclause is present.IsPreservebooltruewhen theReDimstatement has thePreservekeyword.TypeHintstringThe type-declaration character on the target name (e.g.
%inReDim n%(2)), if one was supplied.
Remarks
A ReDim always re-dimensions a dynamic array. It re-dimensions an existing array
(a local, a parameter, or a module field) when the target name already resolves; an unqualified
name that resolves to nothing implicitly declares a local, which stays legal under
Option Explicit (a later analysis pass flags it, and turns it into an error under
Option Strict).
The ArrayBoundsNode child carries the new dimensions; unlike a Dim array
clause these bounds are ordinary run-time expressions, not constant expressions. An
AsTypeExpressionNode child, when present, carries the optional As clause.
Properties
IsPreserve
true when the ReDim statement has the Preserve keyword.
public bool IsPreserve { get; init; }
Property Value
Location
The source location of the ReDim target.
public SourceLocation Location { get; init; }
Property Value
Name
The target identifier name.
public string Name { get; init; }
Property Value
QualifierName
The qualifier when the target is a member access (obj.Buffer, Me.Buffer, .Buffer); null for a simple name.
public string? QualifierName { get; init; }
Property Value
TypeHint
The type-declaration character on the target name (e.g. % in ReDim n%(2)), if one was supplied.
public string? TypeHint { get; init; }