| Modifier and Type | Field and Description |
|---|---|
protected List<Statement> |
statements
Statements.
|
| Constructor and Description |
|---|
CaseNode(long token,
int finish,
Expression test,
List<Statement> statements)
Constructors
|
| Modifier and Type | Method and Description |
|---|---|
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<Statement> |
getStatements()
Get the body for this case node
|
Expression |
getTest()
Get the test expression for this case node
|
boolean |
isTerminal()
Returns true if this AST node is (or contains) a statement that terminates function control
flow.
|
CaseNode |
setStatements(List<Statement> statements) |
CaseNode |
setTest(Expression test)
Reset the test expression for this case node
|
void |
toString(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 value
|
clone, equals, getFinish, getSourceOrder, getStart, getToken, hashCode, isAssignment, isLoop, isTokenType, tokenType, toString, toStringpublic CaseNode(long token,
int finish,
Expression test,
List<Statement> statements)
token - tokenfinish - finishtest - case test node, can be any node in JavaScriptstatements - case body statementspublic Node accept(NodeVisitor<? extends LexicalContext> visitor)
public <R> R accept(TranslatorNodeVisitor<? extends LexicalContext,R> visitor)
Nodepublic void toString(StringBuilder sb, boolean printTypes)
Nodepublic boolean isTerminal()
TerminalisTerminal in interface Terminalpublic List<Statement> getStatements()
public Expression getTest()
public CaseNode setTest(Expression test)
test - new test expression