Class ExpressionStatement
java.lang.Object
com.oracle.js.parser.ir.Node
com.oracle.js.parser.ir.Statement
com.oracle.js.parser.ir.ExpressionStatement
IR representation for executing bare expressions. Basically, an expression node means "this code
will be executed" and evaluating it results in statements being added to the IR
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionExpressionStatement(int lineNumber, long token, int finish, Expression expression) Constructor -
Method Summary
Modifier and TypeMethodDescriptionaccept(NodeVisitor<? extends LexicalContext> visitor) Provides a means to navigate the IR.<R> Raccept(TranslatorNodeVisitor<? extends LexicalContext, R> visitor) Provides a means to navigate the IR.Return the expression to be executedbooleansetExpression(Expression expression) Reset the expression to be executedvoidtoString(StringBuilder sb, boolean printTypes) 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, hasTerminalFlags, isTerminalMethods inherited from class Node
clone, equals, getFinish, getSourceOrder, getStart, getToken, hashCode, isAssignment, isLoop, isTokenType, tokenType, toString, toString
-
Constructor Details
-
ExpressionStatement
Constructor- Parameters:
lineNumber- line numbertoken- tokenfinish- finishexpression- the expression to execute
-
-
Method Details
-
accept
Description copied from class:NodeProvides a means to navigate the IR. -
accept
Description copied from class:NodeProvides a means to navigate the IR. -
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 -
getExpression
-
setExpression
Reset the expression to be executed- Parameters:
expression- the expression- Returns:
- new or same execute node
-
isCompletionValueNeverEmpty
public boolean isCompletionValueNeverEmpty()- Overrides:
isCompletionValueNeverEmptyin classStatement- Returns:
- true if the completion value of this statement is never the value
empty
-