Example { traversal all(AppendVisitor av) { to {Symbol, LabeledSymbol}; } (@ Names Find_Name() { AppendVisitor av = new AppendVisitor(new Names()); this.all(av); return av.get_names(); } @) } Symbol { (@ Ident slot_name() { return symbolName; } @) } LabeledSymbol { (@ Ident slot_name() { return labelName; } @) } Names { (@ public boolean s_equals(Names result2) { Enumeration a = this.elements(); Enumeration b = result2.elements(); boolean r = false; while (a.hasMoreElements()) { if(b.hasMoreElements()) r = true; else { r = false; break; } if(b.nextElement().toString().equals(a.nextElement().toString())) r = true; else { r = false; break; } } return r; } @) } Main { (@ static public void main (String args[]) throws Exception { InputStream in1, in2; in1 = new FileInputStream(args[0]); in2 = new FileInputStream(args[1]); Example in_put = Example.parse(in1); Example ex = Example.parse(in2); Names result1 = in_put.Find_Name(); Names result2 = ex.Find_Name(); if(result1.s_equals(result2)) System.out.println("SUCCESS!"); else System.out.println("FAILURE!"); } @) } AppendVisitor { before Symbol (@ this.get_names().addElement(host.slot_name()); @) }