Class CaseNode
java.lang.Object
com.oracle.js.parser.ir.Node
com.oracle.js.parser.ir.CaseNode
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCaseNode(long token, int finish, Expression test, List<Statement> statements) Constructors -
Method Summary
Modifier and TypeMethodDescriptionaccept(NodeVisitor<? extends LexicalContext> visitor) Assist in IR navigation.<R> Raccept(TranslatorNodeVisitor<? extends LexicalContext, R> visitor) Provides a means to navigate the IR.Get the body for this case nodegetTest()Get the test expression for this case nodebooleanReturns true if this AST node is (or contains) a statement that terminates function control flow.setStatements(List<Statement> statements) setTest(Expression test) Reset the test expression for this case nodevoidtoString(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 Node
clone, equals, getFinish, getSourceOrder, getStart, getToken, hashCode, isAssignment, isLoop, isTokenType, tokenType, toString, toString
-
Field Details
-
statements
-
-
Constructor Details
-
CaseNode
Constructors- Parameters:
token- tokenfinish- finishtest- case test node, can be any node in JavaScriptstatements- case body statements
-
-
Method Details
-
accept
Assist in IR navigation. -
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 -
isTerminal
public boolean isTerminal()Description copied from interface:TerminalReturns true if this AST node is (or contains) a statement that terminates function control flow.- Specified by:
isTerminalin interfaceTerminal
-
getStatements
-
getTest
-
setTest
Reset the test expression for this case node- Parameters:
test- new test expression- Returns:
- new or same CaseNode
-
setStatements
-