org.apache.bcel.verifier.structurals

Class ControlFlowGraph


public class ControlFlowGraph
extends java.lang.Object

This class represents a control flow graph of a method.
Version:
$Id: ControlFlowGraph.java 386056 2006-03-15 11:31:56Z tcurdt $
Author:
Enver Haase

Nested Class Summary

private class
ControlFlowGraph.InstructionContextImpl
Objects of this class represent a node in a ControlFlowGraph.

Field Summary

private ExceptionHandlers
exceptionhandlers
The ExceptionHandlers object for the method whose control flow is represented by this ControlFlowGraph.
private Hashtable
instructionContexts
All InstructionContext instances of this ControlFlowGraph.
private MethodGen
method_gen
The MethodGen object we're working on.
private Subroutines
subroutines
The Subroutines object for the method whose control flow is represented by this ControlFlowGraph.

Constructor Summary

ControlFlowGraph(MethodGen method_gen)
A Control Flow Graph.

Method Summary

InstructionContext
contextOf(InstructionHandle inst)
Returns the InstructionContext of a given instruction.
InstructionContext[]
contextsOf(InstructionHandle[] insts)
Returns the InstructionContext[] of a given InstructionHandle[], in a naturally ordered manner.
InstructionContext[]
getInstructionContexts()
Returns an InstructionContext[] with all the InstructionContext instances for the method whose control flow is represented by this ControlFlowGraph (NOT ORDERED!).
boolean
isDead(InstructionHandle i)
Returns true, if and only if the said instruction is not reachable; that means, if it is not part of this ControlFlowGraph.

Field Details

exceptionhandlers

private final ExceptionHandlers exceptionhandlers
The ExceptionHandlers object for the method whose control flow is represented by this ControlFlowGraph.

instructionContexts

private Hashtable instructionContexts
All InstructionContext instances of this ControlFlowGraph.

method_gen

private final MethodGen method_gen
The MethodGen object we're working on.

subroutines

private final Subroutines subroutines
The Subroutines object for the method whose control flow is represented by this ControlFlowGraph.

Constructor Details

ControlFlowGraph

public ControlFlowGraph(MethodGen method_gen)
A Control Flow Graph.

Method Details

contextOf

public InstructionContext contextOf(InstructionHandle inst)
Returns the InstructionContext of a given instruction.

contextsOf

public InstructionContext[] contextsOf(InstructionHandle[] insts)
Returns the InstructionContext[] of a given InstructionHandle[], in a naturally ordered manner.

getInstructionContexts

public InstructionContext[] getInstructionContexts()
Returns an InstructionContext[] with all the InstructionContext instances for the method whose control flow is represented by this ControlFlowGraph (NOT ORDERED!).

isDead

public boolean isDead(InstructionHandle i)
Returns true, if and only if the said instruction is not reachable; that means, if it is not part of this ControlFlowGraph.