Main { {{ static ClassGraph cg; static String FIdent = " edu.neu.ccs.demeter.Ident "; public static void main(String args[]) throws Exception { AspectJFragment fr = AspectJFragment.parse(System.in); // fr.print(); System.out.println(); fr.display(); System.out.println(); ClassGraph cgTemp = new ClassGraph(true, false); cg = new ClassGraph(cgTemp, "from AspectJFragment bypassing -> *,tail,* to *"); fr.process(); System.out.println(); System.out.println(" Used Variables"); HashSet used = fr.getUsedVars(); // iterator() // Returns an iterator over the elements in this set. Iterator it = used.iterator(); while (it.hasNext()){ Variable curvar = (Variable) it.next(); System.out.println(); curvar.print(); } System.out.println(); System.out.println(" Defined Variables"); HashSet defined = fr.getDefinedVars(); it = defined.iterator(); while (it.hasNext()){ Variable curvar = (Variable) it.next(); System.out.println(); curvar.print(); } System.out.println(); show(used); show(defined); System.out.println("done"); } static void show(java.util.Collection h) { Iterator it = h.iterator(); while (it.hasNext()){ Variable curvar = (Variable) it.next(); System.out.println(); curvar.print(); } System.out.println(); } }} }