@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; }
@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); } }
public void visit(IfStmt n, Object arg) { printer.print("if ("); n.getCondition().accept(this, arg); printer.print(") "); n.getThenStmt().accept(this, arg); if (n.getElseStmt() != null) { printer.print(" else "); n.getElseStmt().accept(this, arg); } }
@Override public R visit(final IfStmt n, final A arg) { { R result = n.getCondition().accept(this, arg); if (result != null) { return result; } } { R result = n.getThenStmt().accept(this, arg); if (result != null) { return result; } } if (n.getElseStmt() != null) { { R result = n.getElseStmt().accept(this, arg); if (result != null) { return result; } } } return null; }
@Override public Node visit(final IfStmt n, final A arg) { n.setCondition((Expression) n.getCondition().accept(this, arg)); n.setThenStmt((Statement) n.getThenStmt().accept(this, arg)); if (n.getElseStmt() != null) { n.setElseStmt((Statement) n.getElseStmt().accept(this, arg)); } return n; }
@Override public Node visit(IfStmt _n, Object _arg) { Expression condition = cloneNodes(_n.getCondition(), _arg); Statement thenStmt = cloneNodes(_n.getThenStmt(), _arg); Statement elseStmt = cloneNodes(_n.getElseStmt(), _arg); Comment comment = cloneNodes(_n.getComment(), _arg); IfStmt r = new IfStmt( _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), condition, thenStmt, elseStmt ); r.setComment(comment); return r; }
@Override public void visit(final IfStmt n, final Object arg) { printJavaComment(n.getComment(), arg); printer.print("if ("); n.getCondition().accept(this, arg); final boolean thenBlock = n.getThenStmt() instanceof BlockStmt; if (thenBlock) // block statement should start on the same line