// This file is automatically generated by DemeterJ.

CopyVisitor {
  {{
    private java.util.Stack history = new java.util.Stack();
    public CopyVisitor(Class firstClass) {
      try {
        history.push(firstClass.newInstance());
      } catch(Exception e) {
        e.printStackTrace();
      }
    }
  }}
  get copy {{ return history.peek(); }}
  return Object {{ get_copy() }}


  before -> Main, s, String {{
    Main it = (Main) history.peek();
    it.set_s(dest);
  }}

  before -> Program, adaptivemethod_l, AdaptiveMethod_L {{
    Program it = (Program) history.peek();
    AdaptiveMethod_L p = new AdaptiveMethod_L();
    it.set_adaptivemethod_l(p);
    history.push(p);
  }}

  after -> Program, adaptivemethod_l, AdaptiveMethod_L {{
    history.pop();
  }}

  before -> AdaptiveMethod, cd, CD {{
    AdaptiveMethod it = (AdaptiveMethod) history.peek();
    CD p = new CD();
    it.set_cd(p);
    history.push(p);
  }}

  after -> AdaptiveMethod, cd, CD {{
    history.pop();
  }}

  before -> AdaptiveMethod, og, OG {{
    AdaptiveMethod it = (AdaptiveMethod) history.peek();
    Class c = dest.getClass();
    Object p = null;
    try {
      p = c.newInstance();
    } catch(Exception e) {
      e.printStackTrace();
    }
    it.set_og((OG) p);
    history.push(p);
  }}

  after -> AdaptiveMethod, og, OG {{
    history.pop();
  }}

  before -> AdaptiveMethod, strategy, Strategy {{
    AdaptiveMethod it = (AdaptiveMethod) history.peek();
    Class c = dest.getClass();
    Object p = null;
    try {
      p = c.newInstance();
    } catch(Exception e) {
      e.printStackTrace();
    }
    it.set_strategy((Strategy) p);
    history.push(p);
  }}

  after -> AdaptiveMethod, strategy, Strategy {{
    history.pop();
  }}

  before -> AdaptiveMethod, visitor, Visitor {{
    AdaptiveMethod it = (AdaptiveMethod) history.peek();
    Visitor p = new Visitor();
    it.set_visitor(p);
    history.push(p);
  }}

  after -> AdaptiveMethod, visitor, Visitor {{
    history.pop();
  }}

  before -> CD, dd_pl, DD_PL {{
    CD it = (CD) history.peek();
    DD_PL p = new DD_PL();
    it.set_dd_pl(p);
    history.push(p);
  }}

  after -> CD, dd_pl, DD_PL {{
    history.pop();
  }}

  before -> DD, typename, TypeName {{
    DD it = (DD) history.peek();
    TypeName p = new TypeName();
    it.set_typename(p);
    history.push(p);
  }}

  after -> DD, typename, TypeName {{
    history.pop();
  }}

  before -> DD, alternative_l, Alternative_L {{
    DD it = (DD) history.peek();
    Alternative_L p = new Alternative_L();
    it.set_alternative_l(p);
    history.push(p);
  }}

  after -> DD, alternative_l, Alternative_L {{
    history.pop();
  }}

  before -> Alternative, alternativename, AlternativeName {{
    Alternative it = (Alternative) history.peek();
    AlternativeName p = new AlternativeName();
    it.set_alternativename(p);
    history.push(p);
  }}

  after -> Alternative, alternativename, AlternativeName {{
    history.pop();
  }}

  before -> Alternative, typedfield_l, TypedField_L {{
    Alternative it = (Alternative) history.peek();
    TypedField_L p = new TypedField_L();
    it.set_typedfield_l(p);
    history.push(p);
  }}

  after -> Alternative, typedfield_l, TypedField_L {{
    history.pop();
  }}

  before -> TypedField, fieldname, FieldName {{
    TypedField it = (TypedField) history.peek();
    FieldName p = new FieldName();
    it.set_fieldname(p);
    history.push(p);
  }}

  after -> TypedField, fieldname, FieldName {{
    history.pop();
  }}

  before -> TypedField, typename, TypeName {{
    TypedField it = (TypedField) history.peek();
    TypeName p = new TypeName();
    it.set_typename(p);
    history.push(p);
  }}

  after -> TypedField, typename, TypeName {{
    history.pop();
  }}

  before -> FieldName, ident, Ident {{
    FieldName it = (FieldName) history.peek();
    it.set_ident(dest);
  }}

  before -> TypeName, ident, Ident {{
    TypeName it = (TypeName) history.peek();
    it.set_ident(dest);
  }}

  before -> AlternativeName, ident, Ident {{
    AlternativeName it = (AlternativeName) history.peek();
    it.set_ident(dest);
  }}

  before -> Numerical, number, Number {{
    Numerical it = (Numerical) history.peek();
    it.set_number(dest);
  }}

  before -> Textual, string, String {{
    Textual it = (Textual) history.peek();
    it.set_string(dest);
  }}

  before -> ConstrCall, alternativename, AlternativeName {{
    ConstrCall it = (ConstrCall) history.peek();
    AlternativeName p = new AlternativeName();
    it.set_alternativename(p);
    history.push(p);
  }}

  after -> ConstrCall, alternativename, AlternativeName {{
    history.pop();
  }}

  before -> ConstrCall, ogs, OG_L {{
    ConstrCall it = (ConstrCall) history.peek();
    OG_L p = new OG_L();
    it.set_ogs(p);
    history.push(p);
  }}

  after -> ConstrCall, ogs, OG_L {{
    history.pop();
  }}

  before -> SimpleStrategy, source, TypeName {{
    SimpleStrategy it = (SimpleStrategy) history.peek();
    TypeName p = new TypeName();
    it.set_source(p);
    history.push(p);
  }}

  after -> SimpleStrategy, source, TypeName {{
    history.pop();
  }}

  before -> SimpleStrategy, target, TypeName {{
    SimpleStrategy it = (SimpleStrategy) history.peek();
    TypeName p = new TypeName();
    it.set_target(p);
    history.push(p);
  }}

  after -> SimpleStrategy, target, TypeName {{
    history.pop();
  }}

  before -> CompoundStrategy, sop, SOp {{
    CompoundStrategy it = (CompoundStrategy) history.peek();
    Class c = dest.getClass();
    Object p = null;
    try {
      p = c.newInstance();
    } catch(Exception e) {
      e.printStackTrace();
    }
    it.set_sop((SOp) p);
    history.push(p);
  }}

  after -> CompoundStrategy, sop, SOp {{
    history.pop();
  }}

  before -> CompoundStrategy, arg1, Strategy {{
    CompoundStrategy it = (CompoundStrategy) history.peek();
    Class c = dest.getClass();
    Object p = null;
    try {
      p = c.newInstance();
    } catch(Exception e) {
      e.printStackTrace();
    }
    it.set_arg1((Strategy) p);
    history.push(p);
  }}

  after -> CompoundStrategy, arg1, Strategy {{
    history.pop();
  }}

  before -> CompoundStrategy, arg2, Strategy {{
    CompoundStrategy it = (CompoundStrategy) history.peek();
    Class c = dest.getClass();
    Object p = null;
    try {
      p = c.newInstance();
    } catch(Exception e) {
      e.printStackTrace();
    }
    it.set_arg2((Strategy) p);
    history.push(p);
  }}

  after -> CompoundStrategy, arg2, Strategy {{
    history.pop();
  }}

  before -> Visitor, visname, VisName {{
    Visitor it = (Visitor) history.peek();
    VisName p = new VisName();
    it.set_visname(p);
    history.push(p);
  }}

  after -> Visitor, visname, VisName {{
    history.pop();
  }}

  before -> Visitor, expression, Expression {{
    Visitor it = (Visitor) history.peek();
    Class c = dest.getClass();
    Object p = null;
    try {
      p = c.newInstance();
    } catch(Exception e) {
      e.printStackTrace();
    }
    it.set_expression((Expression) p);
    history.push(p);
  }}

  after -> Visitor, expression, Expression {{
    history.pop();
  }}

  before -> Visitor, finishaction, FinishAction {{
    Visitor it = (Visitor) history.peek();
    FinishAction p = new FinishAction();
    it.set_finishaction(p);
    history.push(p);
  }}

  after -> Visitor, finishaction, FinishAction {{
    history.pop();
  }}

  before -> Visitor, action_l, Action_L {{
    Visitor it = (Visitor) history.peek();
    Action_L p = new Action_L();
    it.set_action_l(p);
    history.push(p);
  }}

  after -> Visitor, action_l, Action_L {{
    history.pop();
  }}

  before -> FinishAction, expression, Expression {{
    FinishAction it = (FinishAction) history.peek();
    Class c = dest.getClass();
    Object p = null;
    try {
      p = c.newInstance();
    } catch(Exception e) {
      e.printStackTrace();
    }
    it.set_expression((Expression) p);
    history.push(p);
  }}

  after -> FinishAction, expression, Expression {{
    history.pop();
  }}

  before -> Action, varname, VarName {{
    Action it = (Action) history.peek();
    VarName p = new VarName();
    it.set_varname(p);
    history.push(p);
  }}

  after -> Action, varname, VarName {{
    history.pop();
  }}

  before -> Action, typename, TypeName {{
    Action it = (Action) history.peek();
    TypeName p = new TypeName();
    it.set_typename(p);
    history.push(p);
  }}

  after -> Action, typename, TypeName {{
    history.pop();
  }}

  before -> Action, expression, Expression {{
    Action it = (Action) history.peek();
    Class c = dest.getClass();
    Object p = null;
    try {
      p = c.newInstance();
    } catch(Exception e) {
      e.printStackTrace();
    }
    it.set_expression((Expression) p);
    history.push(p);
  }}

  after -> Action, expression, Expression {{
    history.pop();
  }}

  before -> Compound, op, Op {{
    Compound it = (Compound) history.peek();
    Class c = dest.getClass();
    Object p = null;
    try {
      p = c.newInstance();
    } catch(Exception e) {
      e.printStackTrace();
    }
    it.set_op((Op) p);
    history.push(p);
  }}

  after -> Compound, op, Op {{
    history.pop();
  }}

  before -> Compound, args, Expression_L {{
    Compound it = (Compound) history.peek();
    Expression_L p = new Expression_L();
    it.set_args(p);
    history.push(p);
  }}

  after -> Compound, args, Expression_L {{
    history.pop();
  }}

  before -> Fetch, strategy, Strategy {{
    Fetch it = (Fetch) history.peek();
    Class c = dest.getClass();
    Object p = null;
    try {
      p = c.newInstance();
    } catch(Exception e) {
      e.printStackTrace();
    }
    it.set_strategy((Strategy) p);
    history.push(p);
  }}

  after -> Fetch, strategy, Strategy {{
    history.pop();
  }}

  before -> Fetch, expression, Expression {{
    Fetch it = (Fetch) history.peek();
    Class c = dest.getClass();
    Object p = null;
    try {
      p = c.newInstance();
    } catch(Exception e) {
      e.printStackTrace();
    }
    it.set_expression((Expression) p);
    history.push(p);
  }}

  after -> Fetch, expression, Expression {{
    history.pop();
  }}

  before -> Get, varname, VarName {{
    Get it = (Get) history.peek();
    VarName p = new VarName();
    it.set_varname(p);
    history.push(p);
  }}

  after -> Get, varname, VarName {{
    history.pop();
  }}

  before -> Get, fieldname, FieldName {{
    Get it = (Get) history.peek();
    FieldName p = new FieldName();
    it.set_fieldname(p);
    history.push(p);
  }}

  after -> Get, fieldname, FieldName {{
    history.pop();
  }}

  before -> Set, varname, VarName {{
    Set it = (Set) history.peek();
    VarName p = new VarName();
    it.set_varname(p);
    history.push(p);
  }}

  after -> Set, varname, VarName {{
    history.pop();
  }}

  before -> Set, fieldname, FieldName {{
    Set it = (Set) history.peek();
    FieldName p = new FieldName();
    it.set_fieldname(p);
    history.push(p);
  }}

  after -> Set, fieldname, FieldName {{
    history.pop();
  }}

  before -> Set, expression, Expression {{
    Set it = (Set) history.peek();
    Class c = dest.getClass();
    Object p = null;
    try {
      p = c.newInstance();
    } catch(Exception e) {
      e.printStackTrace();
    }
    it.set_expression((Expression) p);
    history.push(p);
  }}

  after -> Set, expression, Expression {{
    history.pop();
  }}

  before -> VisName, ident, Ident {{
    VisName it = (VisName) history.peek();
    it.set_ident(dest);
  }}

  before -> VarName, ident, Ident {{
    VarName it = (VarName) history.peek();
    it.set_ident(dest);
  }}

  before -> Numerical2, number, Number {{
    Numerical2 it = (Numerical2) history.peek();
    it.set_number(dest);
  }}

  before -> PrintVisitor, indent, int {{
    PrintVisitor it = (PrintVisitor) history.peek();
    it.set_indent(dest);
  }}

  before -> PrintVisitor, needSpace, boolean {{
    PrintVisitor it = (PrintVisitor) history.peek();
    it.set_needSpace(dest);
  }}

  before -> SubgraphVisitor, is_equal, boolean {{
    SubgraphVisitor it = (SubgraphVisitor) history.peek();
    it.set_is_equal(dest);
  }}

  before -> EqualVisitor, is_equal, boolean {{
    EqualVisitor it = (EqualVisitor) history.peek();
    it.set_is_equal(dest);
  }}

  before -> DisplayVisitor, indent, int {{
    DisplayVisitor it = (DisplayVisitor) history.peek();
    it.set_indent(dest);
  }}

  before -> TraceVisitor, indent, int {{
    TraceVisitor it = (TraceVisitor) history.peek();
    it.set_indent(dest);
  }}

  before -> AdaptiveMethod_L, first, Nonempty_AdaptiveMethod_L {{
    AdaptiveMethod_L it = (AdaptiveMethod_L) history.peek();
    Nonempty_AdaptiveMethod_L p = new Nonempty_AdaptiveMethod_L();
    it.set_first(p);
    history.push(p);
  }}

  after -> AdaptiveMethod_L, first, Nonempty_AdaptiveMethod_L {{
    history.pop();
  }}

  before -> DD_PL, first, Nonempty_DD_PL {{
    DD_PL it = (DD_PL) history.peek();
    Nonempty_DD_PL p = new Nonempty_DD_PL();
    it.set_first(p);
    history.push(p);
  }}

  after -> DD_PL, first, Nonempty_DD_PL {{
    history.pop();
  }}

  before -> Alternative_L, first, Nonempty_Alternative_L {{
    Alternative_L it = (Alternative_L) history.peek();
    Nonempty_Alternative_L p = new Nonempty_Alternative_L();
    it.set_first(p);
    history.push(p);
  }}

  after -> Alternative_L, first, Nonempty_Alternative_L {{
    history.pop();
  }}

  before -> TypedField_L, first, Nonempty_TypedField_L {{
    TypedField_L it = (TypedField_L) history.peek();
    Nonempty_TypedField_L p = new Nonempty_TypedField_L();
    it.set_first(p);
    history.push(p);
  }}

  after -> TypedField_L, first, Nonempty_TypedField_L {{
    history.pop();
  }}

  before -> OG_L, first, Nonempty_OG_L {{
    OG_L it = (OG_L) history.peek();
    Nonempty_OG_L p = new Nonempty_OG_L();
    it.set_first(p);
    history.push(p);
  }}

  after -> OG_L, first, Nonempty_OG_L {{
    history.pop();
  }}

  before -> Action_L, first, Nonempty_Action_L {{
    Action_L it = (Action_L) history.peek();
    Nonempty_Action_L p = new Nonempty_Action_L();
    it.set_first(p);
    history.push(p);
  }}

  after -> Action_L, first, Nonempty_Action_L {{
    history.pop();
  }}

  before -> Expression_L, first, Nonempty_Expression_L {{
    Expression_L it = (Expression_L) history.peek();
    Nonempty_Expression_L p = new Nonempty_Expression_L();
    it.set_first(p);
    history.push(p);
  }}

  after -> Expression_L, first, Nonempty_Expression_L {{
    history.pop();
  }}

  before -> Nonempty_AdaptiveMethod_L, it, AdaptiveMethod {{
    Nonempty_AdaptiveMethod_L it = (Nonempty_AdaptiveMethod_L) history.peek();
    AdaptiveMethod p = new AdaptiveMethod();
    it.set_it(p);
    history.push(p);
  }}

  after -> Nonempty_AdaptiveMethod_L, it, AdaptiveMethod {{
    history.pop();
  }}

  before -> Nonempty_AdaptiveMethod_L, next, Nonempty_AdaptiveMethod_L {{
    Nonempty_AdaptiveMethod_L it = (Nonempty_AdaptiveMethod_L) history.peek();
    Nonempty_AdaptiveMethod_L p = new Nonempty_AdaptiveMethod_L();
    it.set_next(p);
    history.push(p);
  }}

  after -> Nonempty_AdaptiveMethod_L, next, Nonempty_AdaptiveMethod_L {{
    history.pop();
  }}

  before -> Nonempty_DD_PL, it, DD {{
    Nonempty_DD_PL it = (Nonempty_DD_PL) history.peek();
    DD p = new DD();
    it.set_it(p);
    history.push(p);
  }}

  after -> Nonempty_DD_PL, it, DD {{
    history.pop();
  }}

  before -> Nonempty_DD_PL, next, Nonempty_DD_PL {{
    Nonempty_DD_PL it = (Nonempty_DD_PL) history.peek();
    Nonempty_DD_PL p = new Nonempty_DD_PL();
    it.set_next(p);
    history.push(p);
  }}

  after -> Nonempty_DD_PL, next, Nonempty_DD_PL {{
    history.pop();
  }}

  before -> Nonempty_Alternative_L, it, Alternative {{
    Nonempty_Alternative_L it = (Nonempty_Alternative_L) history.peek();
    Alternative p = new Alternative();
    it.set_it(p);
    history.push(p);
  }}

  after -> Nonempty_Alternative_L, it, Alternative {{
    history.pop();
  }}

  before -> Nonempty_Alternative_L, next, Nonempty_Alternative_L {{
    Nonempty_Alternative_L it = (Nonempty_Alternative_L) history.peek();
    Nonempty_Alternative_L p = new Nonempty_Alternative_L();
    it.set_next(p);
    history.push(p);
  }}

  after -> Nonempty_Alternative_L, next, Nonempty_Alternative_L {{
    history.pop();
  }}

  before -> Nonempty_TypedField_L, it, TypedField {{
    Nonempty_TypedField_L it = (Nonempty_TypedField_L) history.peek();
    TypedField p = new TypedField();
    it.set_it(p);
    history.push(p);
  }}

  after -> Nonempty_TypedField_L, it, TypedField {{
    history.pop();
  }}

  before -> Nonempty_TypedField_L, next, Nonempty_TypedField_L {{
    Nonempty_TypedField_L it = (Nonempty_TypedField_L) history.peek();
    Nonempty_TypedField_L p = new Nonempty_TypedField_L();
    it.set_next(p);
    history.push(p);
  }}

  after -> Nonempty_TypedField_L, next, Nonempty_TypedField_L {{
    history.pop();
  }}

  before -> Nonempty_OG_L, it, OG {{
    Nonempty_OG_L it = (Nonempty_OG_L) history.peek();
    Class c = dest.getClass();
    Object p = null;
    try {
      p = c.newInstance();
    } catch(Exception e) {
      e.printStackTrace();
    }
    it.set_it((OG) p);
    history.push(p);
  }}

  after -> Nonempty_OG_L, it, OG {{
    history.pop();
  }}

  before -> Nonempty_OG_L, next, Nonempty_OG_L {{
    Nonempty_OG_L it = (Nonempty_OG_L) history.peek();
    Nonempty_OG_L p = new Nonempty_OG_L();
    it.set_next(p);
    history.push(p);
  }}

  after -> Nonempty_OG_L, next, Nonempty_OG_L {{
    history.pop();
  }}

  before -> Nonempty_Action_L, it, Action {{
    Nonempty_Action_L it = (Nonempty_Action_L) history.peek();
    Class c = dest.getClass();
    Object p = null;
    try {
      p = c.newInstance();
    } catch(Exception e) {
      e.printStackTrace();
    }
    it.set_it((Action) p);
    history.push(p);
  }}

  after -> Nonempty_Action_L, it, Action {{
    history.pop();
  }}

  before -> Nonempty_Action_L, next, Nonempty_Action_L {{
    Nonempty_Action_L it = (Nonempty_Action_L) history.peek();
    Nonempty_Action_L p = new Nonempty_Action_L();
    it.set_next(p);
    history.push(p);
  }}

  after -> Nonempty_Action_L, next, Nonempty_Action_L {{
    history.pop();
  }}

  before -> Nonempty_Expression_L, it, Expression {{
    Nonempty_Expression_L it = (Nonempty_Expression_L) history.peek();
    Class c = dest.getClass();
    Object p = null;
    try {
      p = c.newInstance();
    } catch(Exception e) {
      e.printStackTrace();
    }
    it.set_it((Expression) p);
    history.push(p);
  }}

  after -> Nonempty_Expression_L, it, Expression {{
    history.pop();
  }}

  before -> Nonempty_Expression_L, next, Nonempty_Expression_L {{
    Nonempty_Expression_L it = (Nonempty_Expression_L) history.peek();
    Nonempty_Expression_L p = new Nonempty_Expression_L();
    it.set_next(p);
    history.push(p);
  }}

  after -> Nonempty_Expression_L, next, Nonempty_Expression_L {{
    history.pop();
  }}

}