Table of Contents

Class ArrayBoundExpressionNode

Namespace
RDCore.SDK.Model.AST.Expressions
Assembly
RDCore.SDK.dll

MS-VBAL 3.3.5.2 The LBound and UBound special forms — LBound(<array>[, <dimension>]) — which read the bound of one dimension of an array.

public sealed record ArrayBoundExpressionNode : ExpressionNode, IEquatable<SyntaxNode>, IExecutableNode, IEquatable<ExpressionNode>, IEquatable<ArrayBoundExpressionNode>
Inheritance
ArrayBoundExpressionNode
Implements
Inherited Members

Remarks

MS-VBAL reserves the names as special-form identifiers, "used in an expression as if [they were] a program defined procedure name but which has special syntactic rules for its argument", and defines no semantics for them. They are keywords, not members of the standard library, and so are a node of their own the way the ReDim statement is: the argument is an array the construct reads the dimensions of and leaves as it is, which is a rule about the construct's own syntax and not about how a procedure's arguments are passed.

The grammar lets the keyword through as an identifier, so UBound(a) reaches the parse listener as an index expression on a name. The listener recognizes the keyword token followed by one or two positional arguments and builds this node instead; any other shape stays an index expression.

Constructors

ArrayBoundExpressionNode(SyntaxNodeId, SourceLocation, ArrayBoundKind, ExpressionNode, ExpressionNode?)

MS-VBAL 3.3.5.2 The LBound and UBound special forms — LBound(<array>[, <dimension>]) — which read the bound of one dimension of an array.

public ArrayBoundExpressionNode(SyntaxNodeId Identity, SourceLocation Location, ArrayBoundKind Kind, ExpressionNode Array, ExpressionNode? Dimension = null)

Parameters

Identity SyntaxNodeId

A unique identifier for this specific syntax node.

Location SourceLocation

The document location (Uri+Range) of the whole construct.

Kind ArrayBoundKind

Whether the lower or the upper bound is read.

Array ExpressionNode

The expression yielding the array whose bound is read.

Dimension ExpressionNode

The expression naming the dimension, counted from 1; null when it is omitted, which means 1.

Remarks

MS-VBAL reserves the names as special-form identifiers, "used in an expression as if [they were] a program defined procedure name but which has special syntactic rules for its argument", and defines no semantics for them. They are keywords, not members of the standard library, and so are a node of their own the way the ReDim statement is: the argument is an array the construct reads the dimensions of and leaves as it is, which is a rule about the construct's own syntax and not about how a procedure's arguments are passed.

The grammar lets the keyword through as an identifier, so UBound(a) reaches the parse listener as an index expression on a name. The listener recognizes the keyword token followed by one or two positional arguments and builds this node instead; any other shape stays an index expression.

Properties

Array

The expression yielding the array whose bound is read.

public ExpressionNode Array { get; init; }

Property Value

ExpressionNode

Dimension

The expression naming the dimension, counted from 1; null when it is omitted, which means 1.

public ExpressionNode? Dimension { get; init; }

Property Value

ExpressionNode

Kind

Whether the lower or the upper bound is read.

public ArrayBoundKind Kind { get; init; }

Property Value

ArrayBoundKind