public For_c(Position pos, List inits, Expr cond, List iters, Stmt body) { super(pos); this.inits = TypedList.copyAndCheck(inits, ForInit.class, true); this.cond = cond; this.iters = TypedList.copyAndCheck(iters, ForUpdate.class, true); this.body = body; }
protected JL5Call_c reconstruct(Receiver target, List arguments, List typeArgs) { if (target != this.target || !CollectionUtil.equals(arguments, this.arguments) || !CollectionUtil.equals(typeArgs, this.typeArguments)) { JL5Call_c n = (JL5Call_c) copy(); n.target = target; n.arguments = TypedList.copyAndCheck(arguments, Expr.class, true); n.typeArguments = TypedList.copyAndCheck(typeArgs, TypeNode.class, false); return n; } return this; }
/** 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; }
public StmtExpr_c(Position pos, List<Stmt> statements, Expr result) { super(pos); assert (statements != null); // assert(result != null); // result can be null, if the type is Void -- Bowen this.statements = TypedList.copyAndCheck(statements, Stmt.class, true); this.result = result; }
/** Reconstruct the statement expression. */ protected StmtExpr_c reconstruct(List<Stmt> statements, Expr result) { if (!CollectionUtil.allEqual(statements, this.statements) || result != this.result) { StmtExpr_c n = (StmtExpr_c) copy(); n.statements = TypedList.copyAndCheck(statements, Stmt.class, true); n.result = result; return n; } return this; }
/** Set the statements of the statement expression. */ public Block statements(List<Stmt> statements) { StmtExpr_c n = (StmtExpr_c) copy(); n.statements = TypedList.copyAndCheck(statements, Stmt.class, true); return n; }
public void setDefAnnotations(List<Ref<? extends Type>> annotations) { this.annotations = TypedList.<Ref<? extends Type>>copyAndCheck(annotations, Ref.class, true); }
/** 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; }
/** 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; }