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, hasTerminalFlags
clone, equals, getFinish, getSourceOrder, getStart, getToken, hashCode, isAssignment, isLoop, isTokenType, tokenType, toString, toString
public 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()
Statement
isTerminal
in interface Terminal
isTerminal
in class Statement
public Node accept(NodeVisitor<? extends LexicalContext> visitor)
Node
public <R> R accept(TranslatorNodeVisitor<? extends LexicalContext,R> visitor)
Node
public void toString(StringBuilder sb, boolean printTypes)
Node
public Block getFail()
public Block getPass()
public Expression getTest()
public IfNode setTest(Expression test)
test
- a new test expressionpublic boolean isCompletionValueNeverEmpty()
isCompletionValueNeverEmpty
in class Statement
empty