com.togethersoft.sca.dataflow.flowgraph
Interface IBasicBlock


public interface IBasicBlock

Basic Block for Control Flow Graph. Refers to chain of Tuples. All basic blocks of a given method are linked into list


Method Summary
 IControlFlowGraph getCFG()
          get control flow graph, the basic block is part of
 AstObject getFirstAST()
          get first nontrivial AST object belonging to the basic block Ignore Label Tuples.
 ITuple getFirstTuple()
          Get first tuple in the basic block.
 ITuple getLastTuple()
          Get last tuple in the basic block.
 IBasicBlock getNext()
          Access next block in list of all basic blocks for a method returns null if the current block is last (END) basic block
 IBasicBlock[] getPredecessors()
          Get array of predecessors of the basic block.
 IBasicBlock[] getSuccessors()
          Get array of successors of the basic block.
 boolean isReachable()
          is the basic block reachable
 void setAsReachable()
          sets the basic block to be known as reachable.
 

Method Detail

getCFG

public IControlFlowGraph getCFG()
get control flow graph, the basic block is part of

getFirstAST

public AstObject getFirstAST()
get first nontrivial AST object belonging to the basic block Ignore Label Tuples. Returns null if no AST is available in this basic block and all of it's successors.

getFirstTuple

public ITuple getFirstTuple()
Get first tuple in the basic block. Returns null if basic block is empty

getLastTuple

public ITuple getLastTuple()
Get last tuple in the basic block. Returns null if basic block is empty

getNext

public IBasicBlock getNext()
Access next block in list of all basic blocks for a method returns null if the current block is last (END) basic block

getPredecessors

public IBasicBlock[] getPredecessors()
Get array of predecessors of the basic block. Returns null if there is no known predecesors for this basic block

getSuccessors

public IBasicBlock[] getSuccessors()
Get array of successors of the basic block. Returns null if there is no known succesors for this basic block

isReachable

public boolean isReachable()
is the basic block reachable

setAsReachable

public void setAsReachable()
sets the basic block to be known as reachable. Do the same to all reachable successor blocks.