| Constructor and Description |
|---|
IfNode(int lineNumber,
long token,
int finish,
Expression test,
Block pass,
Block fail)
Constructor
|
| 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.
|
Block |
getFail()
Get the else block of this IfNode
|
Block |
getPass()
Get the then block for this IfNode
|
Expression |
getTest()
Get the test expression for this IfNode
|
boolean |
isCompletionValueNeverEmpty() |
boolean |
isTerminal()
Is this a terminal statement, i.e.
|
IfNode |
setTest(Expression test)
Reset the test expression for this IfNode
|
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
|
getLineNumber, hasGoto, hasTerminalFlagsclone, equals, getFinish, getSourceOrder, getStart, getToken, hashCode, isAssignment, isLoop, isTokenType, tokenType, toString, toStringpublic IfNode(int lineNumber,
long token,
int finish,
Expression test,
Block pass,
Block fail)
lineNumber - line numbertoken - tokenfinish - finishtest - testpass - block to execute when test passesfail - block to execute when test fails or nullpublic boolean isTerminal()
StatementisTerminal in interface TerminalisTerminal in class Statementpublic Node accept(NodeVisitor<? extends LexicalContext> visitor)
Nodepublic <R> R accept(TranslatorNodeVisitor<? extends LexicalContext,R> visitor)
Nodepublic void toString(StringBuilder sb, boolean printTypes)
Nodepublic Block getFail()
public Block getPass()
public Expression getTest()
public IfNode setTest(Expression test)
test - a new test expressionpublic boolean isCompletionValueNeverEmpty()
isCompletionValueNeverEmpty in class Statementempty