@Override
 public void visit(final IfStmt n, final A arg) {
   visitComment(n.getComment(), arg);
   n.getCondition().accept(this, arg);
   n.getThenStmt().accept(this, arg);
   if (n.getElseStmt() != null) {
     n.getElseStmt().accept(this, arg);
   }
 }
Example #2
0
  @Override
  public Boolean visit(final IfStmt n1, final Node arg) {
    final IfStmt n2 = (IfStmt) arg;

    if (!nodeEquals(n1.getCondition(), n2.getCondition())) {
      return Boolean.FALSE;
    }

    if (!nodeEquals(n1.getThenStmt(), n2.getThenStmt())) {
      return Boolean.FALSE;
    }

    if (!nodeEquals(n1.getElseStmt(), n2.getElseStmt())) {
      return Boolean.FALSE;
    }

    return Boolean.TRUE;
  }