VertexVisitor{ (@ HashSet nodes = new HashSet(); void before(Vertex host) { nodes.add(host.get_vertex_name()); } public Object getReturnValue(){ return nodes; } @) } ConstructVisitor{ (@ private HashSet dupSet = new HashSet(); private HashSet aSet = new HashSet(); void before (Labeled host) { Ident id = host.get_label_name(); if(!aSet.contains(id)) aSet.add(id); else dupSet.add(id); } void before (Regular host) { Ident part = (Ident) Main.cg1.fetch(host, "from Regular to edu.neu.ccs.demeter.Ident"); Ident partLower = new Ident (part.toString().toLowerCase()); if(!aSet.contains(partLower)) aSet.add(partLower); else dupSet.add(partLower); } public HashSet get_dup() {return dupSet;} @) } HelpVisitor { (@ String s = "from Construct_ns to {Labeled, Regular} "; TraversalGraph tg =new TraversalGraph(s, Main.cg1); private Ident current_class; boolean pass = true; void before (Adjacency host){ current_class = host.get_source().get_vertex_name(); } void before (Construct_ns host){ ConstructVisitor cv = new ConstructVisitor(); tg.traverse(host, cv); Iterator dup = cv.get_dup().iterator(); while (dup.hasNext()) { System.out.println("part "+dup.next() +" of class "+current_class+" is not unique"); pass = false; } } boolean isPassed() {return pass;} @) }