// This file is automatically generated by DemeterJ.

SubgraphVisitor {
  {{
    private java.util.Stack history = new java.util.Stack();
    public SubgraphVisitor(Object obj) {
      history.push(obj);
    }
  }}

  before Main {{
    Object obj = history.peek();
    is_equal = is_equal && obj.getClass().equals(host.getClass());
    if(!is_equal) return;
    Object temp1 = host.get_s();
    Object temp2 = ((Main) obj).get_s();
    if(temp1 == null && temp2 == null) {}
    else if(temp1 == null ||
            temp2 == null ||
            !temp1.equals(temp2)) { is_equal = false; return; }
  }}

  before AppleList {{
    Object obj = history.peek();
    is_equal = is_equal && obj.getClass().equals(host.getClass());
    if(!is_equal) return;
  }}

  before -> Mycons, first, Apple {{
    if (is_equal) {
      Mycons obj = (Mycons) history.peek();
      Object temp3 = obj.get_first();
      if(temp3==null) { is_equal = false; return; }
      history.push(temp3);
    }
  }}
  after -> Mycons, first, Apple {{
    if (is_equal) history.pop();
  }}

  before -> Mycons, rest, AppleList {{
    if (is_equal) {
      Mycons obj = (Mycons) history.peek();
      Object temp4 = obj.get_rest();
      if(temp4==null) { is_equal = false; return; }
      history.push(temp4);
    }
  }}
  after -> Mycons, rest, AppleList {{
    if (is_equal) history.pop();
  }}

  before Mycons {{
    Object obj = history.peek();
    is_equal = is_equal && obj.getClass().equals(host.getClass());
    if(!is_equal) return;
  }}

  before Apple {{
    Object obj = history.peek();
    is_equal = is_equal && obj.getClass().equals(host.getClass());
    if(!is_equal) return;
    is_equal = is_equal && host.get_weight() == ((Apple) obj).get_weight();
  }}

  before Myempty {{
    Object obj = history.peek();
    is_equal = is_equal && obj.getClass().equals(host.getClass());
    if(!is_equal) return;
  }}

  before PrintVisitor {{
    Object obj = history.peek();
    is_equal = is_equal && obj.getClass().equals(host.getClass());
    if(!is_equal) return;
    is_equal = is_equal && host.get_indent() == ((PrintVisitor) obj).get_indent();
    is_equal = is_equal && host.get_needSpace() == ((PrintVisitor) obj).get_needSpace();
  }}

  before CopyVisitor {{
    Object obj = history.peek();
    is_equal = is_equal && obj.getClass().equals(host.getClass());
    if(!is_equal) return;
    Object temp5 = host.get_copy();
    Object temp6 = ((CopyVisitor) obj).get_copy();
    if(temp5 == null && temp6 == null) {}
    else if(temp5 == null ||
            temp6 == null ||
            !temp5.equals(temp6)) { is_equal = false; return; }
  }}

  before SubgraphVisitor {{
    Object obj = history.peek();
    is_equal = is_equal && obj.getClass().equals(host.getClass());
    if(!is_equal) return;
    is_equal = is_equal && host.get_is_equal() == ((SubgraphVisitor) obj).get_is_equal();
  }}

  before EqualVisitor {{
    Object obj = history.peek();
    is_equal = is_equal && obj.getClass().equals(host.getClass());
    if(!is_equal) return;
    is_equal = is_equal && host.get_is_equal() == ((EqualVisitor) obj).get_is_equal();
  }}

  before DisplayVisitor {{
    Object obj = history.peek();
    is_equal = is_equal && obj.getClass().equals(host.getClass());
    if(!is_equal) return;
    is_equal = is_equal && host.get_indent() == ((DisplayVisitor) obj).get_indent();
  }}

  before TraceVisitor {{
    Object obj = history.peek();
    is_equal = is_equal && obj.getClass().equals(host.getClass());
    if(!is_equal) return;
    is_equal = is_equal && host.get_indent() == ((TraceVisitor) obj).get_indent();
  }}

  before UniversalVisitor {{
    Object obj = history.peek();
    is_equal = is_equal && obj.getClass().equals(host.getClass());
    if(!is_equal) return;
  }}

  return boolean {{ is_equal }}
}