|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.uci.eecs.doc.cascade.controlflow.Node edu.uci.eecs.doc.cascade.controlflow.Loop
public class Loop
A base class to represent loop constructs in control flow graphs and trees.
Field Summary | |
---|---|
protected Node |
body
|
protected List<InstructionHandle> |
instructions
|
Fields inherited from class edu.uci.eecs.doc.cascade.controlflow.Node |
---|
block, nextNode, parent, scope, tree |
Constructor Summary | |
---|---|
protected |
Loop(Tree tree,
int scope,
Node parent,
LoopBlock loopBlock,
List<InstructionHandle> instructions)
Creates a new Loop object. |
Method Summary | |
---|---|
Node |
getBody()
Returns the control flow of the loop body, or null if the loop body is empty. |
protected Expression |
getCondition()
Returns the conditional expression of the loop (e.g., i<10 ) |
List<MethodInvocation> |
getMethodInvocations()
Returns the methods invoked by the loop's conditional expression in the order in which they are invoked. |
boolean |
hasBody()
Returns true if the loop has a body. |
void |
setBody(Node body)
Sets the body of the loop. |
Methods inherited from class edu.uci.eecs.doc.cascade.controlflow.Node |
---|
getBlock, getEnclosingLoop, getFirstInstruction, getInstructions, getLastInstruction, getMethodInvocations, getNext, getOutermostLoop, getParent, getScope, getSourceCodeLineNumber, getStartAddress, getTree, iterator, lastNode, setNext |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Node body
protected List<InstructionHandle> instructions
Constructor Detail |
---|
protected Loop(Tree tree, int scope, Node parent, LoopBlock loopBlock, List<InstructionHandle> instructions)
tree
- the control flow tree to which this node belongsscope
- the lexical scope of the node (0 = top-level scope)parent
- the node's parent (null if the node has no parent)loopBlock
- a JODE object representing the for loopinstructions
- the list of instructions in the loop's method (the whole
method, not just the loop)Method Detail |
---|
public List<MethodInvocation> getMethodInvocations()
getMethodInvocations
in class Node
public Node getBody()
public void setBody(Node body)
body
- a control flow node representing the loop's bodypublic boolean hasBody()
protected Expression getCondition()
i<10
)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |