public static final class LiteralNode.ArrayLiteralNode extends LiteralNode<Expression[]> implements LexicalContextNode
LiteralNode.ArrayLiteralNode, LiteralNode.PrimitiveLiteralNode<T>value| Modifier | Constructor and Description |
|---|---|
protected |
ArrayLiteralNode(long token,
int finish,
Expression[] value)
Constructor
|
protected |
ArrayLiteralNode(long token,
int finish,
Expression[] value,
boolean hasSpread,
boolean hasTrailingComma)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
Node |
accept(LexicalContext lc,
NodeVisitor<? extends LexicalContext> visitor)
Accept function for the node given a lexical context.
|
<R> R |
accept(LexicalContext lc,
TranslatorNodeVisitor<? extends LexicalContext,R> visitor) |
Node |
accept(NodeVisitor<? extends LexicalContext> visitor)
Assist in IR navigation.
|
<R> R |
accept(TranslatorNodeVisitor<? extends LexicalContext,R> visitor)
Provides a means to navigate the IR.
|
List<Expression> |
getElementExpressions()
Returns a list of array element expressions.
|
boolean |
hasSpread() |
boolean |
hasTrailingComma() |
boolean |
isArray()
Test if the value is an array
|
void |
toString(StringBuilder sb,
boolean printType)
Print logic that decides whether to show the optimistic type or not - for example it should
not be printed after just parse, when it hasn't been computed, or has been set to a trivially
provable value
|
getObject, getString, getValue, isString, newInstance, newInstance, newInstance, newInstance, newInstance, newInstance, newInstance, newInstance, newInstancegetFinish, getFinishWithoutParens, getStart, getStartWithoutParens, isAlwaysFalse, isAlwaysTrue, isParenthesized, isSelfModifying, makeParenthesizedclone, equals, getSourceOrder, getToken, hashCode, isAssignment, isLoop, isTokenType, tokenType, toString, toStringprotected ArrayLiteralNode(long token,
int finish,
Expression[] value)
token - tokenfinish - finishvalue - array literal value, a Node arrayprotected ArrayLiteralNode(long token,
int finish,
Expression[] value,
boolean hasSpread,
boolean hasTrailingComma)
token - tokenfinish - finishvalue - array literal value, a Node arrayhasSpread - true if the array has a spread elementhasTrailingComma - true if the array literal has a comma after the last elementpublic boolean isArray()
LiteralNodeisArray in class LiteralNode<Expression[]>public boolean hasSpread()
public boolean hasTrailingComma()
public List<Expression> getElementExpressions()
getElementExpressions in class LiteralNode<Expression[]>public Node accept(NodeVisitor<? extends LexicalContext> visitor)
LiteralNodeaccept in interface LexicalContextNodeaccept in class LiteralNode<Expression[]>visitor - IR navigating visitor.public <R> R accept(TranslatorNodeVisitor<? extends LexicalContext,R> visitor)
Nodeaccept in interface LexicalContextNodeaccept in class LiteralNode<Expression[]>visitor - Node visitor.public Node accept(LexicalContext lc, NodeVisitor<? extends LexicalContext> visitor)
LexicalContextNodeaccept in interface LexicalContextNodelc - lexical contextvisitor - node visitorpublic <R> R accept(LexicalContext lc, TranslatorNodeVisitor<? extends LexicalContext,R> visitor)
accept in interface LexicalContextNodepublic void toString(StringBuilder sb, boolean printType)
NodetoString in class LiteralNode<Expression[]>sb - string builderprintType - print type?