// This aspect just overrides the main method and generates // a class graph of the running program. Good way of reverse // engineering the program. The output is a class dictionary. import edu.neu.ccs.demeter.dj.*; import edu.neu.ccs.demeter.daj.*; import edu.neu.ccs.demeter.daj.ClassGraphListener; import edu.neu.ccs.demeter.daj.ClassGraphListenerFactory; aspect CreateClassGraph { pointcut mainpc(String [] args) : call( * main(..) ) && args(args); void around(String [] args) : mainpc(args){ ClassGraph cg = new ClassGraph(true, false); ClassGraphListener newCgListener = ClassGraphListenerFactory.getNew(); newCgListener.ClassGraphEvent(args, cg); // System.out.println(args[0]); // System.out.println("class graph "); // System.out.println(cg); // TraversalGraph tg1 = new TraversalGraph("from Basket to *", cg); // System.out.println(tg1); // TraversalGraph tg2 = new TraversalGraph("from Basket to Weight", cg); // System.out.println(tg2); // try { // AspectJTraversal at = new AspectJTraversal("t1", tg1); // AspectJTraversal at2 = new AspectJTraversal("t2", tg2); // } catch (edu.neu.ccs.demeter.aplib.NoSuchClassGraphNodeException ex) { // } } }