public final class WhileNode extends LoopNode
body, controlFlowEscapes, test| Constructor and Description |
|---|
WhileNode(int lineNumber,
long token,
int finish,
boolean isDoWhile,
JoinPredecessorExpression test,
Block body)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
Node |
accept(LexicalContext lc,
NodeVisitor<? extends LexicalContext> visitor)
Accept function for the node given a lexical context.
|
<R> R |
accept(LexicalContext lc,
TranslatorNodeVisitor<? extends LexicalContext,R> visitor) |
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 |
getBody()
Get the body for this for node
|
boolean |
hasGoto()
|
boolean |
hasPerIterationScope()
Does this loop have a LET declaration and hence require a per-iteration scope?
|
boolean |
isBreakableWithoutLabel()
Check whether this can be broken out from without using a label, e.g.
|
boolean |
isDoWhile()
Check if this is a do while loop or a normal while loop
|
boolean |
mustEnter()
Conservative check: does this loop have to be entered?
|
WhileNode |
setBody(LexicalContext lc,
Block body) |
WhileNode |
setControlFlowEscapes(LexicalContext lc,
boolean controlFlowEscapes)
Set the control flow escapes flag for this node.
|
WhileNode |
setTest(LexicalContext lc,
JoinPredecessorExpression test)
Set the test for this for node
|
void |
toString(StringBuilder sb,
boolean printType)
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
|
getTest, isCompletionValueNeverEmpty, isLoop, isTerminalgetLineNumber, hasTerminalFlagsclone, equals, getFinish, getSourceOrder, getStart, getToken, hashCode, isAssignment, isTokenType, tokenType, toString, toStringaccept, acceptpublic WhileNode(int lineNumber,
long token,
int finish,
boolean isDoWhile,
JoinPredecessorExpression test,
Block body)
lineNumber - line numbertoken - tokenfinish - finishisDoWhile - is this a do while loop?test - test expressionbody - body of the while looppublic boolean hasGoto()
Statementpublic Node accept(LexicalContext lc, NodeVisitor<? extends LexicalContext> visitor)
LexicalContextNodelc - lexical contextvisitor - node visitorpublic <R> R accept(LexicalContext lc, TranslatorNodeVisitor<? extends LexicalContext,R> visitor)
public WhileNode setTest(LexicalContext lc, JoinPredecessorExpression test)
LoopNodepublic Block getBody()
LoopNodepublic WhileNode setBody(LexicalContext lc, Block body)
public WhileNode setControlFlowEscapes(LexicalContext lc, boolean controlFlowEscapes)
LoopNodesetControlFlowEscapes in class LoopNodelc - lexical contextcontrolFlowEscapes - control flow escapes valuepublic boolean isDoWhile()
public void toString(StringBuilder sb, boolean printType)
Nodepublic boolean mustEnter()
LoopNodepublic boolean hasPerIterationScope()
LoopNodehasPerIterationScope in class LoopNodepublic boolean isBreakableWithoutLabel()
isBreakableWithoutLabel in interface BreakableNodepublic final Node accept(NodeVisitor<? extends LexicalContext> visitor)
Nodeaccept in interface LexicalContextNodeaccept in class Nodevisitor - Node visitor.public final <R> R accept(TranslatorNodeVisitor<? extends LexicalContext,R> visitor)
Nodeaccept in interface LexicalContextNodeaccept in class Nodevisitor - Node visitor.