coins.ir.hir
Class HirIteratorImpl

java.lang.Object
  extended bycoins.ir.hir.HirIteratorImpl
All Implemented Interfaces:
HirIterator

public class HirIteratorImpl
extends java.lang.Object
implements HirIterator

HirIteratorImpl class Traverse HIR node in depth first order.


Field Summary
protected  int fDbgLevel
           
protected  int fDebLevel
           
protected  int fNodeCount
           
protected  java.util.ArrayList fNodeList
           
protected  java.util.Iterator fNodeListIterator
           
protected  int fStmtCount
           
protected  java.util.ArrayList fStmtList
           
protected  java.util.Iterator fStmtListIterator
           
 HirRoot hirRoot
           
 IoRoot ioRoot
           
 
Constructor Summary
HirIteratorImpl(HirRoot pHirRoot, IR pSubtree, boolean pGoUpward)
          HirIteratorImpl Create an itrerator that traverses nodes of HIR subtree.
 
Method Summary
 HIR getNextExecutableNode()
          next Get the node that refer/set data or change control flow directly.
 Stmt getNextStmt()
           
 boolean hasNext()
           
 boolean hasNextStmt()
           
 HIR next()
          next Get the next node and advance current point for iteration.
 Stmt nextStmt()
          nextStmt Get the next statement skipping other nodes that are not Stmt.
protected  void recordNodes(HIR pHir)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

hirRoot

public final HirRoot hirRoot

ioRoot

public final IoRoot ioRoot

fDbgLevel

protected int fDbgLevel

fNodeList

protected java.util.ArrayList fNodeList

fStmtList

protected java.util.ArrayList fStmtList

fNodeCount

protected int fNodeCount

fStmtCount

protected int fStmtCount

fNodeListIterator

protected java.util.Iterator fNodeListIterator

fStmtListIterator

protected java.util.Iterator fStmtListIterator

fDebLevel

protected int fDebLevel
Constructor Detail

HirIteratorImpl

public HirIteratorImpl(HirRoot pHirRoot,
                       IR pSubtree,
                       boolean pGoUpward)
HirIteratorImpl Create an itrerator that traverses nodes of HIR subtree.

Parameters:
pSubtree - Subtree to be traversed.
pGoUpward - true if traverse of nodes positioned higher than the root of pSubtree is permitted. Normally this is false; true is used in BBlockNodeIterator.
Method Detail

next

public HIR next()
Description copied from interface: HirIterator
next Get the next node and advance current point for iteration. If the next node is IrList or HirList or ExpListExp, the elements of the list are traversed.

Specified by:
next in interface HirIterator

hasNext

public boolean hasNext()
Specified by:
hasNext in interface HirIterator

hasNextStmt

public boolean hasNextStmt()
Specified by:
hasNextStmt in interface HirIterator

getNextExecutableNode

public HIR getNextExecutableNode()
Description copied from interface: HirIterator
next Get the node that refer/set data or change control flow directly. If the next node is IrList or HirList, the elements of the list are traversed.

Specified by:
getNextExecutableNode in interface HirIterator

nextStmt

public Stmt nextStmt()
Description copied from interface: HirIterator
nextStmt Get the next statement skipping other nodes that are not Stmt. In compound statements, statements contained in the compound statements are get in depth-first order.

Specified by:
nextStmt in interface HirIterator
Returns:
the next statement.

getNextStmt

public Stmt getNextStmt()
Specified by:
getNextStmt in interface HirIterator

recordNodes

protected void recordNodes(HIR pHir)