XMLVisitor { {{ void before(ClassDef host){ //String hostname = host.get_paramclassname().get_classname().toString(); //PlainSyntax xmlfname = new PlainSyntax("<"+hostname+">"); //PlainSyntax xmlename = new PlainSyntax(""); ClassParts tPart = host.get_classparts(); if (tPart instanceof ConstOrAltClass){ PartOrSyntax_List hlist = ((ConstOrAltClass) tPart).get_parts(); Nonempty_PartOrSyntax_List contents = hlist.get_first(); Nonempty_PartOrSyntax_List prev = null; for(int i=0; i < hlist.size();i++){ PartOrSyntax keep = (PartOrSyntax) contents.get_it(); // If it is found reconstruct the linked list // depending on where it is in the structure if (keep instanceof Syntax){ if (prev == null){ if (contents.get_next() == null){ contents = null; hlist.set_first(contents); } else { contents = contents.get_next(); hlist.set_first(contents); } } else { if(contents.get_next() != null) { contents = contents.get_next(); prev.set_next(contents); } else prev.set_next(null); } } // If not found yet and can go to next do it if (contents.get_next() != null){ prev = contents; contents = contents.get_next(); } } host.print(); } } }} }