Table of Contents

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

Identity SyntaxNodeId

A unique identifier for this specific syntax node.

Location SourceLocation

The source location of the ReDim target.

Name string

The target identifier name.

QualifierName string

The qualifier when the target is a member access (obj.Buffer, Me.Buffer, .Buffer); null for a simple name.

Children ImmutableArray<SyntaxNode>

The ArrayBoundsNode, and the AsTypeExpressionNode when an As clause is present.

IsPreserve bool

true when the ReDim statement has the Preserve keyword.

TypeHint string

The type-declaration character on the target name (e.g. % in ReDim 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

bool

Location

The source location of the ReDim target.

public SourceLocation Location { get; init; }

Property Value

SourceLocation

Name

The target identifier name.

public string Name { get; init; }

Property Value

string

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

string

TypeHint

The type-declaration character on the target name (e.g. % in ReDim n%(2)), if one was supplied.

public string? TypeHint { get; init; }

Property Value

string