示例#1
0
 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;
 }
示例#2
0
 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;
 }
示例#3
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;
  }
示例#4
0
 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;
 }
示例#5
0
 /** 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;
 }
示例#6
0
 /** 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;
 }
示例#7
0
 public void setDefAnnotations(List<Ref<? extends Type>> annotations) {
   this.annotations = TypedList.<Ref<? extends Type>>copyAndCheck(annotations, Ref.class, true);
 }
示例#8
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;
 }
示例#9
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;
 }