public final class IndexNode extends BaseNode
| Constructor and Description |
|---|
IndexNode(long token,
int finish,
Expression base,
Expression index) |
IndexNode(long token,
int finish,
Expression base,
Expression index,
boolean isSuper,
boolean optional,
boolean optionalChain)
Constructors
|
| Modifier and Type | Method and Description |
|---|---|
Node |
accept(NodeVisitor<? extends LexicalContext> visitor)
Provides a means to navigate the IR.
|
<R> R |
accept(TranslatorNodeVisitor<? extends LexicalContext,R> visitor)
Provides a means to navigate the IR.
|
Expression |
getIndex()
Get the index expression for this IndexNode
|
IndexNode |
setIndex(Expression index)
Set the index expression for this node
|
IndexNode |
setIsSuper()
Mark this node as being a SuperProperty access.
|
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
|
getBase, isFunction, isIndex, isOptional, isOptionalChain, isSupergetFinish, getFinishWithoutParens, getStart, getStartWithoutParens, isAlwaysFalse, isAlwaysTrue, isParenthesized, isSelfModifying, makeParenthesizedclone, equals, getSourceOrder, getToken, hashCode, isAssignment, isLoop, isTokenType, tokenType, toString, toStringpublic IndexNode(long token,
int finish,
Expression base,
Expression index,
boolean isSuper,
boolean optional,
boolean optionalChain)
token - tokenfinish - finishbase - base node for accessindex - index for accesspublic IndexNode(long token,
int finish,
Expression base,
Expression index)
public Node accept(NodeVisitor<? extends LexicalContext> visitor)
Nodepublic <R> R accept(TranslatorNodeVisitor<? extends LexicalContext,R> visitor)
Nodepublic void toString(StringBuilder sb, boolean printType)
Nodepublic Expression getIndex()
public IndexNode setIndex(Expression index)
index - new index expressionpublic IndexNode setIsSuper()
BaseNodesetIsSuper in class BaseNode