edu.uci.eecs.doc.cascade.controlflow
Class DoWhileLoop
java.lang.Object
edu.uci.eecs.doc.cascade.controlflow.Node
edu.uci.eecs.doc.cascade.controlflow.Loop
edu.uci.eecs.doc.cascade.controlflow.DoWhileLoop
- All Implemented Interfaces:
- Iterable<Node>
public class DoWhileLoop
- extends Loop
Represents do-while loops in control flow graphs and trees.
- Author:
- Trevor Harmon
Methods inherited from class edu.uci.eecs.doc.cascade.controlflow.Node |
getBlock, getEnclosingLoop, getInstructions, getLastInstruction, getMethodInvocations, getNext, getOutermostLoop, getParent, getScope, getSourceCodeLineNumber, getStartAddress, getTree, iterator, lastNode, setNext |
DoWhileLoop
public DoWhileLoop(Tree tree,
int scope,
Node parent,
LoopBlock loopBlock,
List<InstructionHandle> instructions)
- Creates a new DoWhileLoop object.
- Parameters:
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 do-while loopinstructions
- the list of instructions in the loop's method (the whole method, not just the loop)
getFirstInstruction
protected InstructionHandle getFirstInstruction()
- Overrides:
getFirstInstruction
in class Node
setBody
public void setBody(Node body)
- Sets the body of the loop. This may be necessary if, for example, the loop body
is determined to be empty and needs to be "fixed up" accordingly.
- Overrides:
setBody
in class Loop
- Parameters:
body
- a control flow node representing the loop's body
toString
public String toString()
- Converts the do-while loop to a string.
- Overrides:
toString
in class Object
- Returns:
- a source-code-like string representing the do-while loop