org.quilt.cl
Class TryStacks

java.lang.Object
  |
  +--org.quilt.cl.TryStacks

public class TryStacks
extends java.lang.Object

Manages try/catch blocks. Adds subgraphs to the method graph for each exception handler, building the graph that GraphTransformer hangs bytecode off. This module must cope with the fact that the compiler allocates exception handlers in no particular order. Hacked from earlier 0.5-compatible code.

Author:
< a href="jdd@dixons.org">Jim Dixon

Constructor Summary
TryStacks(org.apache.bcel.generic.CodeExceptionGen[] handlers, SortedBlocks blocks, ControlFlowGraph g)
          Constructor setting up try/catch arrays.
 
Method Summary
 CatchData[] getCatchData()
          Return an array of CatchData, with vertices for the beginning and end of the try block, a vertex for the handler, and the exception handled.
 java.util.Comparator getComparator()
          Return the class TryStack uses to sort exception handlers.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TryStacks

public TryStacks(org.apache.bcel.generic.CodeExceptionGen[] handlers,
                 SortedBlocks blocks,
                 ControlFlowGraph g)
Constructor setting up try/catch arrays. Sorts the exception handlers and then builds a nested control flow graph, including the first code vertex in each try block who first vertex is a code vertex.

Parameters:
handlers - Array of exception handlers for a method.
blocks - Vertices indexed by position in bytecode (?).
g - Graph for the method.
Method Detail

getCatchData

public CatchData[] getCatchData()
Return an array of CatchData, with vertices for the beginning and end of the try block, a vertex for the handler, and the exception handled.

Returns:
Catch handler descriptions for the graph.

getComparator

public java.util.Comparator getComparator()
Return the class TryStack uses to sort exception handlers.

Returns:
The comparator used to sort handlers.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
Newline-terminated string description of try blocks and handlers.


Copyright © 2001-2003 Apache Software Foundation. All Rights Reserved.