Class BoxArrayLiteral
java.lang.Object
ortus.boxlang.compiler.ast.BoxNode
ortus.boxlang.compiler.ast.BoxExpression
ortus.boxlang.compiler.ast.expression.BoxArrayLiteral
- All Implemented Interfaces:
IBoxLiteral
,BoxVisitable
AST Node representing an array literal.
An array literal is surrounded by square braces []
and contains zero or more comma-delimited expressions.
Example
[] [1,2,3] ["foo","bar"] [ [1,2], [3,4], "brad" ]
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionBoxArrayLiteral
(List<BoxExpression> values, Position position, String sourceText) Creates the AST node for an anonymous argument -
Method Summary
Modifier and TypeMethodDescriptionAccept method for replacing visitor support.void
Accept method for visitor support.boolean
Utility method to detect if an expression node is a terminal Literalvoid
setValues
(List<BoxExpression> values) toMap()
Methods inherited from class ortus.boxlang.compiler.ast.BoxNode
addComment, associateComments, endsOnSameLineAs, enumToMap, getAncestors, getChildren, getComments, getDescendants, getDescendantsOfType, getDocComment, getFirstAncestorOfType, getFirstAncestorOfType, getFirstNodeOfType, getFirstNodeOfType, getFirstNodeOfTypes, getParent, getPosition, getSourceText, isAfter, isBefore, isInside, replaceChildren, replaceChildren, setComments, setParent, setPosition, setSourceText, startsOnEndLineOf, toJSON, toString
-
Constructor Details
-
BoxArrayLiteral
Creates the AST node for an anonymous argument- Parameters:
values
- initialization valuesposition
- position of the statement in the source codesourceText
- source code that originated the Node
-
-
Method Details
-
getValues
-
setValues
-
isLiteral
public boolean isLiteral()Description copied from class:BoxExpression
Utility method to detect if an expression node is a terminal Literal- Overrides:
isLiteral
in classBoxExpression
- Returns:
- true if it is false otherwise
-
toMap
-
accept
Description copied from interface:BoxVisitable
Accept method for visitor support.- Specified by:
accept
in interfaceBoxVisitable
- Parameters:
v
- the visitor implementation
-
accept
Description copied from interface:BoxVisitable
Accept method for replacing visitor support. Each accept returns the node, or a replacement node.- Specified by:
accept
in interfaceBoxVisitable
- Parameters:
v
- the visitor implementation
-