Beispiel #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;
 }
Beispiel #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;
 }
Beispiel #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;
  }
Beispiel #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;
 }
Beispiel #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;
 }
Beispiel #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;
 }
Beispiel #7
0
 public void setDefAnnotations(List<Ref<? extends Type>> annotations) {
   this.annotations = TypedList.<Ref<? extends Type>>copyAndCheck(annotations, Ref.class, true);
 }
Beispiel #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;
 }
Beispiel #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;
 }