|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object joeq.Compiler.Quad.QuadIterator
public class QuadIterator
Field Summary | |
---|---|
protected ControlFlowGraph |
cfg
A reference to the control flow graph that we are iterating over. |
protected BasicBlock |
currentBasicBlock
References to the previous non-empty basic block, the current basic block, and the next non-empty basic block. |
protected int |
lastIndex
The index of the last quad that was returned. |
protected Quad |
lastQuad
The last quad that was returned. |
protected BasicBlock |
nextBasicBlock
References to the previous non-empty basic block, the current basic block, and the next non-empty basic block. |
protected BasicBlock |
previousBasicBlock
References to the previous non-empty basic block, the current basic block, and the next non-empty basic block. |
protected ListIterator.Quad |
quadsInCurrentBasicBlock
An iteration of the quads in the current basic block. |
protected ListIterator.BasicBlock |
rpoBasicBlocks
The reverse post order iteration of basic blocks in the control flow graph. |
Constructor Summary | |
---|---|
QuadIterator(ControlFlowGraph cfg)
Initialize the iterator to iterate over the quads in the given control flow graph in reverse post order. |
|
QuadIterator(ControlFlowGraph cfg,
boolean direction)
Initialize the iterator to iterate over the quads in the given control flow graph. |
Method Summary | |
---|---|
void |
add(Object obj)
Adds a quad to the underlying quad list. |
BasicBlock |
getCurrentBasicBlock()
|
Quad |
getCurrentQuad()
|
protected Quad |
getFirstQuad(BasicBlock bb)
Returns the first quad reachable from the start of the given basic block. |
protected Quad |
getLastQuad(BasicBlock bb)
Returns the last quad reachable from the end of the given basic block. |
jwutil.graphs.Navigator |
getNavigator()
|
boolean |
hasNext()
Returns whether there is a next quad in this iteration. |
boolean |
hasPrevious()
Returns whether this iteration has a previous quad. |
Object |
next()
Return the next quad in the iteration. |
int |
nextIndex()
Returns the index of the next quad to be returned. |
Quad |
nextQuad()
Return the next quad in the iteration. |
Iterator |
predecessors()
|
Collection |
predecessors1()
|
Object |
previous()
Returns the previous quad in the iteration. |
int |
previousIndex()
Returns the index of the previous quad. |
Quad |
previousQuad()
Returns the previous quad in the iteration. |
void |
remove()
Removes the last-returned-quad from the underlying list. |
boolean |
searchBackward(Object node)
|
boolean |
searchForward(Object node)
|
void |
set(Object obj)
Sets the current quad. |
Iterator |
successors()
Return an iterator of the possible successor quads of the most recently returned quad. |
Collection |
successors1()
|
protected void |
updateNextBB()
Update the nextBasicBlock field to point to the next non-empty basic block from the reverse post order, or null if there are no more non-empty basic blocks. |
protected void |
updatePreviousBB()
Update the previousBasicBlock field to point to the previous non-empty basic block from the reverse post order, or null if there are no more previous non-empty basic blocks. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final ControlFlowGraph cfg
protected final ListIterator.BasicBlock rpoBasicBlocks
protected BasicBlock previousBasicBlock
protected BasicBlock currentBasicBlock
protected BasicBlock nextBasicBlock
protected ListIterator.Quad quadsInCurrentBasicBlock
protected int lastIndex
protected Quad lastQuad
Constructor Detail |
---|
public QuadIterator(ControlFlowGraph cfg)
cfg
- the control flow graphpublic QuadIterator(ControlFlowGraph cfg, boolean direction)
direction
- the direction to iterate, forward==truecfg
- the control flow graphMethod Detail |
---|
protected void updateNextBB()
protected void updatePreviousBB()
public BasicBlock getCurrentBasicBlock()
public Quad getCurrentQuad()
public Quad nextQuad()
nextQuad
in interface ListIterator.Quad
public Object next()
next
in interface Iterator
next
in interface ListIterator
public boolean hasNext()
hasNext
in interface Iterator
hasNext
in interface ListIterator
protected Quad getFirstQuad(BasicBlock bb)
protected Quad getLastQuad(BasicBlock bb)
public void set(Object obj)
set
in interface ListIterator
public int nextIndex()
nextIndex
in interface ListIterator
public Quad previousQuad()
previousQuad
in interface ListIterator.Quad
public Object previous()
previous
in interface ListIterator
public void remove()
remove
in interface Iterator
remove
in interface ListIterator
public int previousIndex()
previousIndex
in interface ListIterator
public boolean hasPrevious()
hasPrevious
in interface ListIterator
public void add(Object obj)
add
in interface ListIterator
public Iterator successors()
IllegalStateException
- if the nextQuad method has not yet been called.public Collection successors1()
public Iterator predecessors()
public Collection predecessors1()
public jwutil.graphs.Navigator getNavigator()
public boolean searchForward(Object node)
public boolean searchBackward(Object node)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |