|
|||||||||
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 edu.uci.eecs.doc.cascade.controlflow.ForLoop
public class ForLoop
Represents for loops in control flow graphs and trees.
Field Summary | |
---|---|
protected Goto |
gotoNode
|
Fields inherited from class edu.uci.eecs.doc.cascade.controlflow.Loop |
---|
body, instructions |
Fields inherited from class edu.uci.eecs.doc.cascade.controlflow.Node |
---|
block, nextNode, parent, scope, tree |
Constructor Summary | |
---|---|
ForLoop(Tree tree,
int scope,
Node parent,
LoopBlock loopBlock,
List<InstructionHandle> instructions)
Creates a new ForLoop object. |
Method Summary | |
---|---|
protected InstructionHandle |
getFirstInstruction()
|
Goto |
getGoto()
Returns a handle to the goto instruction that is executed immediately after the for loop's increment expression. |
Statement |
getIncrStatement()
Returns the increment statement of the for loop. |
Statement |
getInitStatement()
Returns the intialization statement of the for loop. |
protected InstructionHandle |
getLastInstruction()
|
int |
getStartAddress()
Returns the starting address, relative to the method, of this loop. |
String |
toString()
Converts the for loop to a string. |
Methods inherited from class edu.uci.eecs.doc.cascade.controlflow.Loop |
---|
getBody, getCondition, getMethodInvocations, hasBody, setBody |
Methods inherited from class edu.uci.eecs.doc.cascade.controlflow.Node |
---|
getBlock, getEnclosingLoop, getInstructions, getMethodInvocations, getNext, getOutermostLoop, getParent, getScope, getSourceCodeLineNumber, getTree, iterator, lastNode, setNext |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected Goto gotoNode
Constructor Detail |
---|
public ForLoop(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 int getStartAddress()
getStartAddress
in class Node
public Statement getInitStatement()
for(i=0;i<10;i++)
, the initialization statement is
i=0
. Note that for loops might not have an initialization statement,
and in such cases, this method returns null. Example:
for ( ; val < 10; val++) ...
public Statement getIncrStatement()
for(i=0;i<10;i++)
, the initialization statement is
i++
.
public Goto getGoto()
protected InstructionHandle getFirstInstruction()
getFirstInstruction
in class Node
protected InstructionHandle getLastInstruction()
getLastInstruction
in class Node
public String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |