public abstract class LoopNode extends Statement
| Modifier and Type | Field and Description |
|---|---|
protected Block |
body
Loop body
|
protected boolean |
controlFlowEscapes
Can control flow escape from loop, e.g.
|
protected JoinPredecessorExpression |
test
Loop test node, null if infinite
|
| Modifier | Constructor and Description |
|---|---|
protected |
LoopNode(int lineNumber,
long token,
int finish,
Block body,
JoinPredecessorExpression test,
boolean controlFlowEscapes)
Constructor
|
protected |
LoopNode(LoopNode loopNode,
JoinPredecessorExpression test,
Block body,
boolean controlFlowEscapes)
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.
|
abstract Block |
getBody()
Get the body for this for node
|
JoinPredecessorExpression |
getTest()
Get the test for this for node
|
abstract 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 |
isCompletionValueNeverEmpty() |
boolean |
isLoop()
Is this a loop node?
|
boolean |
isTerminal()
Is this a terminal statement, i.e.
|
abstract boolean |
mustEnter()
Conservative check: does this loop have to be entered?
|
abstract LoopNode |
setBody(LexicalContext lc,
Block body) |
abstract LoopNode |
setControlFlowEscapes(LexicalContext lc,
boolean controlFlowEscapes)
Set the control flow escapes flag for this node.
|
abstract LoopNode |
setTest(LexicalContext lc,
JoinPredecessorExpression test)
Set the test for this for node
|
getLineNumber, hasGoto, hasTerminalFlagsclone, equals, getFinish, getSourceOrder, getStart, getToken, hashCode, isAssignment, isTokenType, tokenType, toString, toString, toStringfinalize, getClass, notify, notifyAll, wait, wait, waitaccept, accept, accept, acceptprotected final JoinPredecessorExpression test
protected final Block body
protected final boolean controlFlowEscapes
protected LoopNode(int lineNumber,
long token,
int finish,
Block body,
JoinPredecessorExpression test,
boolean controlFlowEscapes)
lineNumber - lineNumbertoken - tokenfinish - finishbody - loop bodytest - testcontrolFlowEscapes - controlFlowEscapesprotected LoopNode(LoopNode loopNode, JoinPredecessorExpression test, Block body, boolean controlFlowEscapes)
loopNode - loop nodetest - new testbody - new bodycontrolFlowEscapes - controlFlowEscapespublic boolean isTerminal()
StatementisTerminal in interface TerminalisTerminal in class Statementpublic abstract boolean mustEnter()
public boolean isLoop()
Nodepublic abstract Block getBody()
public abstract LoopNode setBody(LexicalContext lc, Block body)
lc - lexical contextbody - new bodypublic final JoinPredecessorExpression getTest()
public abstract LoopNode setTest(LexicalContext lc, JoinPredecessorExpression test)
lc - lexical contexttest - new testpublic abstract LoopNode setControlFlowEscapes(LexicalContext lc, boolean controlFlowEscapes)
lc - lexical contextcontrolFlowEscapes - control flow escapes valuepublic abstract boolean hasPerIterationScope()
public boolean isCompletionValueNeverEmpty()
isCompletionValueNeverEmpty in class Statementemptypublic 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.