// This file is automatically generated by DemeterJ.

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

  before -> BusRoute, brn, BRN {{
    if (is_equal) {
      BusRoute obj = (BusRoute) history.peek();
      Object temp1 = obj.get_brn();
      if(temp1==null) { is_equal = false; return; }
      history.push(temp1);
    }
  }}
  after -> BusRoute, brn, BRN {{
    if (is_equal) history.pop();
  }}

  before -> BusRoute, buses, Bus_List {{
    if (is_equal) {
      BusRoute obj = (BusRoute) history.peek();
      Object temp2 = obj.get_buses();
      if(temp2==null) { is_equal = false; return; }
      history.push(temp2);
    }
  }}
  after -> BusRoute, buses, Bus_List {{
    if (is_equal) history.pop();
  }}

  before -> BusRoute, busStops, BusStop_List {{
    if (is_equal) {
      BusRoute obj = (BusRoute) history.peek();
      Object temp3 = obj.get_busStops();
      if(temp3==null) { is_equal = false; return; }
      history.push(temp3);
    }
  }}
  after -> BusRoute, busStops, BusStop_List {{
    if (is_equal) history.pop();
  }}

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

  before -> Bus, bn, BN {{
    if (is_equal) {
      Bus obj = (Bus) history.peek();
      Object temp4 = obj.get_bn();
      if(temp4==null) { is_equal = false; return; }
      history.push(temp4);
    }
  }}
  after -> Bus, bn, BN {{
    if (is_equal) history.pop();
  }}

  before -> Bus, passengers, Person_List {{
    if (is_equal) {
      Bus obj = (Bus) history.peek();
      Object temp5 = obj.get_passengers();
      if(temp5==null) { is_equal = false; return; }
      history.push(temp5);
    }
  }}
  after -> Bus, passengers, Person_List {{
    if (is_equal) history.pop();
  }}

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

  before -> BusStop, bsn, BSN {{
    if (is_equal) {
      BusStop obj = (BusStop) history.peek();
      Object temp6 = obj.get_bsn();
      if(temp6==null) { is_equal = false; return; }
      history.push(temp6);
    }
  }}
  after -> BusStop, bsn, BSN {{
    if (is_equal) history.pop();
  }}

  before -> BusStop, waiting, Person_List {{
    if (is_equal) {
      BusStop obj = (BusStop) history.peek();
      Object temp7 = obj.get_waiting();
      if(temp7==null) { is_equal = false; return; }
      history.push(temp7);
    }
  }}
  after -> BusStop, waiting, Person_List {{
    if (is_equal) history.pop();
  }}

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

  before -> Person, pn, PN {{
    if (is_equal) {
      Person obj = (Person) history.peek();
      Object temp8 = obj.get_pn();
      if(temp8==null) { is_equal = false; return; }
      history.push(temp8);
    }
  }}
  after -> Person, pn, PN {{
    if (is_equal) history.pop();
  }}

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

  before BRN {{
    Object obj = history.peek();
    is_equal = is_equal && obj.getClass().equals(host.getClass());
    if(!is_equal) return;
    Object temp9 = host.get_string();
    Object temp10 = ((BRN) obj).get_string();
    if(temp9 == null && temp10 == null) {}
    else if(temp9 == null ||
            temp10 == null ||
            !temp9.equals(temp10)) { is_equal = false; return; }
  }}

  before BSN {{
    Object obj = history.peek();
    is_equal = is_equal && obj.getClass().equals(host.getClass());
    if(!is_equal) return;
    Object temp11 = host.get_string();
    Object temp12 = ((BSN) obj).get_string();
    if(temp11 == null && temp12 == null) {}
    else if(temp11 == null ||
            temp12 == null ||
            !temp11.equals(temp12)) { is_equal = false; return; }
  }}

  before BN {{
    Object obj = history.peek();
    is_equal = is_equal && obj.getClass().equals(host.getClass());
    if(!is_equal) return;
    Object temp13 = host.get_string();
    Object temp14 = ((BN) obj).get_string();
    if(temp13 == null && temp14 == null) {}
    else if(temp13 == null ||
            temp14 == null ||
            !temp13.equals(temp14)) { is_equal = false; return; }
  }}

  before PN {{
    Object obj = history.peek();
    is_equal = is_equal && obj.getClass().equals(host.getClass());
    if(!is_equal) return;
    Object temp15 = host.get_string();
    Object temp16 = ((PN) obj).get_string();
    if(temp15 == null && temp16 == null) {}
    else if(temp15 == null ||
            temp16 == null ||
            !temp15.equals(temp16)) { is_equal = false; return; }
  }}

  before Main {{
    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 temp17 = host.get_copy();
    Object temp18 = ((CopyVisitor) obj).get_copy();
    if(temp17 == null && temp18 == null) {}
    else if(temp17 == null ||
            temp18 == null ||
            !temp17.equals(temp18)) { 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;
  }}

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

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

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

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

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

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

  before -> Nonempty_Bus_List, it, Bus {{
    if (is_equal) {
      Nonempty_Bus_List obj = (Nonempty_Bus_List) history.peek();
      Object temp22 = obj.get_it();
      if(temp22==null) { is_equal = false; return; }
      history.push(temp22);
    }
  }}
  after -> Nonempty_Bus_List, it, Bus {{
    if (is_equal) history.pop();
  }}

  before -> Nonempty_Bus_List, next, Nonempty_Bus_List {{
    if (is_equal) {
      Nonempty_Bus_List obj = (Nonempty_Bus_List) history.peek();
      Object temp23 = obj.get_next();
      if(temp23==null) { is_equal = false; return; }
      history.push(temp23);
    }
  }}
  after -> Nonempty_Bus_List, next, Nonempty_Bus_List {{
    if (is_equal) history.pop();
  }}

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

  before -> Nonempty_BusStop_List, it, BusStop {{
    if (is_equal) {
      Nonempty_BusStop_List obj = (Nonempty_BusStop_List) history.peek();
      Object temp24 = obj.get_it();
      if(temp24==null) { is_equal = false; return; }
      history.push(temp24);
    }
  }}
  after -> Nonempty_BusStop_List, it, BusStop {{
    if (is_equal) history.pop();
  }}

  before -> Nonempty_BusStop_List, next, Nonempty_BusStop_List {{
    if (is_equal) {
      Nonempty_BusStop_List obj = (Nonempty_BusStop_List) history.peek();
      Object temp25 = obj.get_next();
      if(temp25==null) { is_equal = false; return; }
      history.push(temp25);
    }
  }}
  after -> Nonempty_BusStop_List, next, Nonempty_BusStop_List {{
    if (is_equal) history.pop();
  }}

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

  before -> Nonempty_Person_List, it, Person {{
    if (is_equal) {
      Nonempty_Person_List obj = (Nonempty_Person_List) history.peek();
      Object temp26 = obj.get_it();
      if(temp26==null) { is_equal = false; return; }
      history.push(temp26);
    }
  }}
  after -> Nonempty_Person_List, it, Person {{
    if (is_equal) history.pop();
  }}

  before -> Nonempty_Person_List, next, Nonempty_Person_List {{
    if (is_equal) {
      Nonempty_Person_List obj = (Nonempty_Person_List) history.peek();
      Object temp27 = obj.get_next();
      if(temp27==null) { is_equal = false; return; }
      history.push(temp27);
    }
  }}
  after -> Nonempty_Person_List, next, Nonempty_Person_List {{
    if (is_equal) history.pop();
  }}

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

  return boolean {{ is_equal }}
}