Main { {{ static ClassGraph cg; public static void main(String args[]) throws Exception { Formula csp1 = Formula.parse(System.in); cg = new ClassGraph(true, false); csp1.print(); System.out.println(); Integer cI = (Integer) cg.traverse(csp1,"from Formula to Variable", new Visitor() { int c; public void start() {c=0;} public void before (Variable host) { c++;} public Object getReturnValue() {return new Integer(c);} }); System.out.println("number of Variables = " + cI + " done "); TraversalGraph tg = new TraversalGraph("from Formula to Variable", cg); System.out.println(tg); } }} } Formula { void print() to * (PrintVisitor); }