Beispiel #1
0
  /** Reconstruct the statement. */
  protected For_c reconstruct(List inits, Expr cond, List iters, Stmt body) {
    if (!CollectionUtil.equals(inits, this.inits)
        || cond != this.cond
        || !CollectionUtil.equals(iters, this.iters)
        || body != this.body) {
      For_c n = (For_c) copy();
      n.inits = TypedList.copyAndCheck(inits, ForInit.class, true);
      n.cond = cond;
      n.iters = TypedList.copyAndCheck(iters, ForUpdate.class, true);
      n.body = body;
      return n;
    }

    return this;
  }
Beispiel #2
0
 /** Set the body of the statement. */
 public For body(Stmt body) {
   For_c n = (For_c) copy();
   n.body = body;
   return n;
 }
Beispiel #3
0
 /** Set the conditional of the statement. */
 public For cond(Expr cond) {
   For_c n = (For_c) copy();
   n.cond = cond;
   return n;
 }
Beispiel #4
0
 /** Set the iterator expressions of the statement. */
 public For iters(List iters) {
   For_c n = (For_c) copy();
   n.iters = TypedList.copyAndCheck(iters, ForUpdate.class, true);
   return n;
 }
Beispiel #5
0
 /** Set the inits of the statement. */
 public For inits(List inits) {
   For_c n = (For_c) copy();
   n.inits = TypedList.copyAndCheck(inits, ForInit.class, true);
   return n;
 }