1 /* GraphSpy.java */
2 package org.quilt.cl;
3
4 import org.apache.bcel.generic.*;
5 import org.quilt.graph.*;
6
7 /***
8 * Makes the control flow graph available to a wider audience.
9 * Used in testing.
10 *
11 * @author <a href="jddixon@users.sourceforge.net">Jim Dixon</a>
12 */
13
14 public class GraphSpy implements GraphXformer {
15
16 private static String name;
17
18 public static ControlFlowGraph theGraph = null;
19
20 public GraphSpy () { }
21
22 public static ControlFlowGraph getTheGraph() {
23 return theGraph;
24 }
25 // INTERFACE GRAPHXFORMER ///////////////////////////////////
26 public void xform (final ClassGen cg, final MethodGen method,
27 ControlFlowGraph cfg) {
28 // System.out.println(
29 // "==================\n"
30 // + "Hello from " + name
31 // + "\n==================" );
32 theGraph = cfg;
33 }
34 public static String getName() {
35 return name;
36 }
37 public static void setName (String s) {
38 name = s;
39 }
40 }
This page was automatically generated by Maven