harpoon.Analysis
Interface BasicBlockInterf<HCE extends HCodeElement,BB extends BasicBlockInterf>

All Known Implementing Classes:
BasicBlock, FCFGBasicBlock

public interface BasicBlockInterf<HCE extends HCodeElement,BB extends BasicBlockInterf>

BasicBlockInterf is the interface that needs to be implemented by any "basic block"-like structure. Basic block views of the code groups together lists of consecutive instructions in basic blocks. For each basic block, we have a list of statements contained by it, a set of predecessor basic blocks and a set of successor basic blocks. Different implementations of BasicBlockInterf respect different sets of constraints.

Version:
$Id: BasicBlockInterf.java,v 1.3 2002/04/10 02:58:48 cananian Exp $
Author:
Alexandru SALCIANU <salcianu@MIT.edu>

Method Summary
 void accept(BasicBlockInterfVisitor visitor)
          Calls the appropriate visit method from visitor.
 HCE getFirst()
          Returns the first statement of the basic block.
 HCE getLast()
          Returns the last statement of the basic block.
 Set<BB> nextSet()
          Returns all the successors of the basic block, according to the normal and the exceptional control flow.
 Set<BB> prevSet()
          Returns all the predecessors of the basic block, according to the normal and the exceptional control flow.
 List<HCE> statements()
          Returns the list of the statements composing the basic block.
 

Method Detail

getFirst

HCE getFirst()
Returns the first statement of the basic block.


getLast

HCE getLast()
Returns the last statement of the basic block.


prevSet

Set<BB> prevSet()
Returns all the predecessors of the basic block, according to the normal and the exceptional control flow.


nextSet

Set<BB> nextSet()
Returns all the successors of the basic block, according to the normal and the exceptional control flow.


statements

List<HCE> statements()
Returns the list of the statements composing the basic block.


accept

void accept(BasicBlockInterfVisitor visitor)
Calls the appropriate visit method from visitor. The concept of BasicBlockInterfVisitor is similar to the concept of QuadVisitor. Both of them were introduced to allow pure object oriented programming, that is virtual methods instead of instanceof tests.