org.quilt.cl
Class GraphTalker

java.lang.Object
  |
  +--org.quilt.cl.GraphTalker
All Implemented Interfaces:
GraphXformer, Visitor

public class GraphTalker
extends java.lang.Object
implements GraphXformer, Visitor

Walks through a control flow graph, displaying information about each vertex and edge. Useful for debugging and as a model GraphXformer implementation.

Author:
Jim Dixon

Constructor Summary
GraphTalker()
           
 
Method Summary
 void discoverEdge(Edge e)
          Called when initially visiting edge.
 void discoverGraph(Directed graph)
          Called at beginning of visiting a graph or subgraph.
 void discoverVertex(Vertex v)
          Called when beginning visit to vertex.
 void finishEdge(Edge e)
          Called at end of visit to edge.
 void finishGraph(Directed graph)
          Called at end of visiting a graph or subgraph.
 void finishVertex(Vertex v)
          Called at end of vertex visit.
static java.lang.String getName()
           
static void setName(java.lang.String s)
           
 void xform(org.apache.bcel.generic.ClassGen cg, org.apache.bcel.generic.MethodGen method, ControlFlowGraph cfg)
          Apply the transformation to the graph.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GraphTalker

public GraphTalker()
Method Detail

discoverGraph

public void discoverGraph(Directed graph)
Description copied from interface: Visitor
Called at beginning of visiting a graph or subgraph.

Specified by:
discoverGraph in interface Visitor

finishGraph

public void finishGraph(Directed graph)
Description copied from interface: Visitor
Called at end of visiting a graph or subgraph.

Specified by:
finishGraph in interface Visitor

discoverVertex

public void discoverVertex(Vertex v)
Description copied from interface: Visitor
Called when beginning visit to vertex. If the vertex is the entry point for a subgraph, discoverGraph for that subgraph must be called during the visit.

Specified by:
discoverVertex in interface Visitor

finishVertex

public void finishVertex(Vertex v)
Description copied from interface: Visitor
Called at end of vertex visit. If the vertex is an exit point for a subgraph, finishGraph for the subgraph must be called during the visit.

Specified by:
finishVertex in interface Visitor

discoverEdge

public void discoverEdge(Edge e)
Description copied from interface: Visitor
Called when initially visiting edge.

Specified by:
discoverEdge in interface Visitor

finishEdge

public void finishEdge(Edge e)
Description copied from interface: Visitor
Called at end of visit to edge.

Specified by:
finishEdge in interface Visitor

xform

public void xform(org.apache.bcel.generic.ClassGen cg,
                  org.apache.bcel.generic.MethodGen method,
                  ControlFlowGraph cfg)
Description copied from interface: GraphXformer
Apply the transformation to the graph.

Specified by:
xform in interface GraphXformer
Parameters:
cg - The class being transformed.
method - MethodGen for the method being transformed.
cfg - The method's control flow graph.

getName

public static java.lang.String getName()

setName

public static void setName(java.lang.String s)


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