@Override public Node visit(ForStmt _n, Object _arg) { List<Expression> init = visit(_n.getInit(), _arg); Expression compare = cloneNodes(_n.getCompare(), _arg); List<Expression> update = visit(_n.getUpdate(), _arg); Statement body = cloneNodes(_n.getBody(), _arg); Comment comment = cloneNodes(_n.getComment(), _arg); ForStmt r = new ForStmt( _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), init, compare, update, body ); r.setComment(comment); return r; }
@Override public Boolean visit(final ForStmt n1, final Node arg) { final ForStmt n2 = (ForStmt) arg; if (!nodesEquals(n1.getInit(), n2.getInit())) { return Boolean.FALSE; } if (!nodeEquals(n1.getCompare(), n2.getCompare())) { return Boolean.FALSE; } if (!nodesEquals(n1.getUpdate(), n2.getUpdate())) { return Boolean.FALSE; } if (!nodeEquals(n1.getBody(), n2.getBody())) { return Boolean.FALSE; } return Boolean.TRUE; }
@Override public Node visit(final ForStmt n, final A arg) { final List<Expression> init = n.getInit(); if (init != null) { for (int i = 0; i < init.size(); i++) { init.set(i, (Expression) init.get(i).accept(this, arg)); } removeNulls(init); } if (n.getCompare() != null) { n.setCompare((Expression) n.getCompare().accept(this, arg)); } final List<Expression> update = n.getUpdate(); if (update != null) { for (int i = 0; i < update.size(); i++) { update.set(i, (Expression) update.get(i).accept(this, arg)); } removeNulls(update); } n.setBody((Statement) n.getBody().accept(this, arg)); return n; }
{if (true) return new ForeachStmt(line, column, token.endLine, token.endColumn,varExpr, expr, body);} ForStmt tmp = new ForStmt(line, column, token.endLine, token.endColumn,init, expr, update, body);
@Override public void visit(final ForStmt n, final A arg) { visitComment(n.getComment(), arg); if (n.getInit() != null) { for (final Expression e : n.getInit()) { e.accept(this, arg); } } if (n.getCompare() != null) { n.getCompare().accept(this, arg); } if (n.getUpdate() != null) { for (final Expression e : n.getUpdate()) { e.accept(this, arg); } } n.getBody().accept(this, arg); }
{if (true) return new ForeachStmt(line, column, token.endLine, token.endColumn,varExpr, expr, body);} {if (true) return new ForStmt(line, column, token.endLine, token.endColumn,init, expr, update, body);} throw new Error("Missing return statement in function");
@Override public R visit(final ForStmt n, final A arg) { if (n.getInit() != null) { for (final Expression e : n.getInit()) { if (n.getCompare() != null) { R result = n.getCompare().accept(this, arg); if (result != null) { return result; if (n.getUpdate() != null) { for (final Expression e : n.getUpdate()) { R result = n.getBody().accept(this, arg); if (result != null) { return result;
@Override public void visit(final ForStmt n, final Object arg) { printJavaComment(n.getComment(), arg); printer.print("for ("); if (n.getInit() != null) { for (final Iterator<Expression> i = n.getInit().iterator(); i.hasNext();) { final Expression e = i.next(); e.accept(this, arg); if (i.hasNext()) { printer.print(", "); } } } printer.print("; "); if (n.getCompare() != null) { n.getCompare().accept(this, arg); } printer.print("; "); if (n.getUpdate() != null) { for (final Iterator<Expression> i = n.getUpdate().iterator(); i.hasNext();) { final Expression e = i.next(); e.accept(this, arg); if (i.hasNext()) { printer.print(", "); } } } printer.print(") "); n.getBody().accept(this, arg); }
public void visit(ForStmt n, Object arg) { printer.print("for ("); if (n.getInit() != null) { for (Iterator<Expression> i = n.getInit().iterator(); i.hasNext();) { Expression e = i.next(); e.accept(this, arg); if (i.hasNext()) { printer.print(", "); } } } printer.print("; "); if (n.getCompare() != null) { n.getCompare().accept(this, arg); } printer.print("; "); if (n.getUpdate() != null) { for (Iterator<Expression> i = n.getUpdate().iterator(); i.hasNext();) { Expression e = i.next(); e.accept(this, arg); if (i.hasNext()) { printer.print(", "); } } } printer.print(") "); n.getBody().accept(this, arg); }