//for debugging i have commented out the check for undefined parts. Cd_graph{ void flatten(ClassGraph cg){{ Strategy sg = new Strategy("from Cd_graph to Neighbors_wc"); TraversalGraph tg = new TraversalGraph(sg, cg); if(checkUndefined(cg) == true){ System.out.println("Flattening ClassGraph. . ."); tg.traverse(this, new Visitor(){ Any_vertex_List common; Ident currentSource; HashMap adjacency_wc = new HashMap(); void before(Adjacency adj){ currentSource = adj.get_source().get_vertex_name(); } void before(Neighbors_wc neighbor){ common = neighbor.get_construct_ns(); if(adjacency_wc.containsKey(currentSource)){ Any_vertex_List tempList = (Any_vertex_List)adjacency_wc.get(currentSource); while(tempList.hasMoreElements()){ common.addElement((Any_vertex)tempList.nextElement()); } neighbor.set_construct_ns(common); } } void before(Alternat_ns alt){ Enumeration en = alt.get_alternat_ns().elements(); while(en.hasMoreElements()){ adjacency_wc.put(((Term)en.nextElement()). get_vertex().get_vertex_name(),common); } } } ); } }} }