import java.lang.*; import java.io.*; import java.util.*; import EDU.neu.ccs.demeter.*; class CopyVisitor extends UniversalVisitor { public CopyVisitor() { super(); } private java.util.Stack history = new java.util.Stack(); public CopyVisitor(Class firstClass) { try { history.push(firstClass.newInstance()); } catch(Exception e) { e.printStackTrace(); } } public Object get_copy() { return history.peek(); } Object get_return_val() { return get_copy() ; } public void before_service_list(WebScript source, Service_List dest) { WebScript it = (WebScript) history.peek(); Service_List p = new Service_List(); it.set_service_list(p); history.push(p); } public void after_service_list(WebScript source, Service_List dest) { history.pop(); } public void before_url(Url source, String dest) { Url it = (Url) history.peek(); it.set_url(dest); } public void before_timeout(TimeOut source, float dest) { TimeOut it = (TimeOut) history.peek(); it.set_timeout(dest); } public void before_service(TimeOut source, Service dest) { TimeOut it = (TimeOut) history.peek(); Class c = dest.getClass(); Object p = null; try { p = c.newInstance(); } catch(Exception e) { e.printStackTrace(); } it.set_service((Service) p); history.push(p); } public void after_service(TimeOut source, Service dest) { history.pop(); } public void before_service(Repeat source, Service dest) { Repeat it = (Repeat) history.peek(); Class c = dest.getClass(); Object p = null; try { p = c.newInstance(); } catch(Exception e) { e.printStackTrace(); } it.set_service((Service) p); history.push(p); } public void after_service(Repeat source, Service dest) { history.pop(); } public void before_main(Alternative source, Service dest) { Alternative it = (Alternative) history.peek(); Class c = dest.getClass(); Object p = null; try { p = c.newInstance(); } catch(Exception e) { e.printStackTrace(); } it.set_main((Service) p); history.push(p); } public void after_main(Alternative source, Service dest) { history.pop(); } public void before_alternate(Alternative source, Service dest) { Alternative it = (Alternative) history.peek(); Class c = dest.getClass(); Object p = null; try { p = c.newInstance(); } catch(Exception e) { e.printStackTrace(); } it.set_alternate((Service) p); history.push(p); } public void after_alternate(Alternative source, Service dest) { history.pop(); } public void before_service1(Concurrent source, Service dest) { Concurrent it = (Concurrent) history.peek(); Class c = dest.getClass(); Object p = null; try { p = c.newInstance(); } catch(Exception e) { e.printStackTrace(); } it.set_service1((Service) p); history.push(p); } public void after_service1(Concurrent source, Service dest) { history.pop(); } public void before_service2(Concurrent source, Service dest) { Concurrent it = (Concurrent) history.peek(); Class c = dest.getClass(); Object p = null; try { p = c.newInstance(); } catch(Exception e) { e.printStackTrace(); } it.set_service2((Service) p); history.push(p); } public void after_service2(Concurrent source, Service dest) { history.pop(); } public void before_indent(PrintVisitor source, int dest) { PrintVisitor it = (PrintVisitor) history.peek(); it.set_indent(dest); } public void before_needSpace(PrintVisitor source, boolean dest) { PrintVisitor it = (PrintVisitor) history.peek(); it.set_needSpace(dest); } public void before_is_equal(SubgraphVisitor source, boolean dest) { SubgraphVisitor it = (SubgraphVisitor) history.peek(); it.set_is_equal(dest); } public void before_is_equal(EqualVisitor source, boolean dest) { EqualVisitor it = (EqualVisitor) history.peek(); it.set_is_equal(dest); } public void before_indent(DisplayVisitor source, int dest) { DisplayVisitor it = (DisplayVisitor) history.peek(); it.set_indent(dest); } public void before_indent(TraceVisitor source, int dest) { TraceVisitor it = (TraceVisitor) history.peek(); it.set_indent(dest); } public void before_first(Service_List source, Nonempty_Service_List dest) { Service_List it = (Service_List) history.peek(); Nonempty_Service_List p = new Nonempty_Service_List(); it.set_first(p); history.push(p); } public void after_first(Service_List source, Nonempty_Service_List dest) { history.pop(); } public void before_it(Nonempty_Service_List source, Service dest) { Nonempty_Service_List it = (Nonempty_Service_List) history.peek(); Class c = dest.getClass(); Object p = null; try { p = c.newInstance(); } catch(Exception e) { e.printStackTrace(); } it.set_it((Service) p); history.push(p); } public void after_it(Nonempty_Service_List source, Service dest) { history.pop(); } public void before_next(Nonempty_Service_List source, Nonempty_Service_List dest) { Nonempty_Service_List it = (Nonempty_Service_List) history.peek(); Nonempty_Service_List p = new Nonempty_Service_List(); it.set_next(p); history.push(p); } public void after_next(Nonempty_Service_List source, Nonempty_Service_List dest) { history.pop(); } void universal_trv0_bef(UniversalVisitor _v_) { super.universal_trv0_bef(_v_); } void universal_trv0_aft(UniversalVisitor _v_) { super.universal_trv0_aft(_v_); } void universal_trv0(UniversalVisitor _v_) { universal_trv0_bef(_v_); Object copy = get_copy(); super.universal_trv0(_v_); universal_trv0_aft(_v_); } }