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
IdentitySyntaxNodeIdA unique identifier for this specific syntax node.
LocationSourceLocationThe document location (
Uri+Range) of the whole construct.KindArrayBoundKindWhether the lower or the upper bound is read.
ArrayExpressionNodeThe expression yielding the array whose bound is read.
DimensionExpressionNodeThe 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
Dimension
The expression naming the dimension, counted from 1; null when it is omitted, which means 1.
public ExpressionNode? Dimension { get; init; }
Property Value
Kind
Whether the lower or the upper bound is read.
public ArrayBoundKind Kind { get; init; }