Class WithNode
java.lang.Object
com.oracle.js.parser.ir.Node
com.oracle.js.parser.ir.Statement
com.oracle.js.parser.ir.WithNode
- All Implemented Interfaces:
LexicalContextNode, Terminal, Cloneable
IR representation for
with statements.-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionWithNode(int lineNumber, long token, int finish, Expression expression, Block body) Constructor -
Method Summary
Modifier and TypeMethodDescriptionaccept(LexicalContext lc, NodeVisitor<? extends LexicalContext> visitor) Assist in IR navigation.<R> Raccept(LexicalContext lc, TranslatorNodeVisitor<? extends LexicalContext, R> visitor) final Nodeaccept(NodeVisitor<? extends LexicalContext> visitor) Provides a means to navigate the IR.final <R> Raccept(TranslatorNodeVisitor<? extends LexicalContext, R> visitor) Provides a means to navigate the IR.getBody()Get the body of this WithNodeGet the expression of this WithNodebooleanbooleanIs this a terminal statement, i.e.setBody(LexicalContext lc, Block body) Reset the body of this with nodesetExpression(LexicalContext lc, Expression expression) Reset the expression of this with nodevoidtoString(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 valueMethods inherited from class Statement
getLineNumber, hasGoto, hasTerminalFlagsMethods inherited from class Node
clone, equals, getFinish, getSourceOrder, getStart, getToken, hashCode, isAssignment, isLoop, isTokenType, tokenType, toString, toString
-
Constructor Details
-
WithNode
Constructor- Parameters:
lineNumber- Line number of the headertoken- First tokenfinish- Character index of the last tokenexpression- With expressionbody- Body of with node
-
-
Method Details
-
accept
Assist in IR navigation.- Parameters:
lc- lexical contextvisitor- IR navigating visitor.- Returns:
- new node or same node depending on state change
-
accept
-
isTerminal
public boolean isTerminal()Description copied from class:StatementIs this a terminal statement, i.e. does it end control flow like a throw or return?- Specified by:
isTerminalin interfaceTerminal- Overrides:
isTerminalin classStatement- Returns:
- true if this node statement is terminal
-
toString
Description copied from class:NodePrint 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 -
getBody
-
setBody
Reset the body of this with node- Parameters:
lc- lexical contextbody- new body- Returns:
- new or same withnode
-
getExpression
-
setExpression
Reset the expression of this with node- Parameters:
lc- lexical contextexpression- new expression- Returns:
- new or same withnode
-
isCompletionValueNeverEmpty
public boolean isCompletionValueNeverEmpty()- Overrides:
isCompletionValueNeverEmptyin classStatement- Returns:
- true if the completion value of this statement is never the value
empty
-
accept
Description copied from class:NodeProvides a means to navigate the IR.- Specified by:
acceptin interfaceLexicalContextNode- Specified by:
acceptin classNode- Parameters:
visitor- Node visitor.- Returns:
- node the node or its replacement after visitation, null if no further visitations are required
-
accept
Description copied from class:NodeProvides a means to navigate the IR.- Specified by:
acceptin interfaceLexicalContextNode- Specified by:
acceptin classNode- Parameters:
visitor- Node visitor.- Returns:
- node the node or its replacement after visitation, null if no further visitations are required
-