@Test public void testClone() { BinaryExpr be = new BinaryExpr(new VariableIdentifierExpr("x"), new VariableIdentifierExpr("y"), BinOp.ADD); BinaryExpr be2 = be.clone(); assertFalse(be == be2); assertFalse(be.getLhs() == be2.getLhs()); assertEquals(((VariableIdentifierExpr) be.getLhs()).getName(), ((VariableIdentifierExpr) be2.getLhs()).getName()); assertEquals(((VariableIdentifierExpr) be.getRhs()).getName(), ((VariableIdentifierExpr) be2.getRhs()).getName()); }
@Override public BinaryExpr clone() { return new BinaryExpr(lhs.clone(), rhs.clone(), op); }
BinaryExpr extends Expr { @Override public BinaryExpr clone() { return new BinaryExpr(lhs.clone(), rhs.clone(), op); } }
BinaryExpr extends Expr { @Override public BinaryExpr clone() { return new BinaryExpr(lhs.clone(), rhs.clone(), op); } BinaryExpr(Expr lhs, Expr rhs, BinOp op); }
BinaryExpr extends Expr { @Override public BinaryExpr clone() { return new BinaryExpr(lhs.clone(), rhs.clone(), op); } BinaryExpr(Expr lhs, Expr rhs, BinOp op); Expr getLhs(); void setLhs(Expr lhs); Expr getRhs(); void setRhs(Expr rhs); BinOp getOp(); @Override void accept(IAstVisitor visitor); @Override BinaryExpr clone(); @Override boolean hasChild(IAstNode candidateChild); @Override Expr getChild(int index); @Override void setChild(int index, Expr expr); @Override int getNumChildren(); }
BinaryExpr extends Expr { @Override public BinaryExpr clone() { return new BinaryExpr(lhs.clone(), rhs.clone(), op); } BinaryExpr(Expr lhs, Expr rhs, BinOp op); Expr getLhs(); void setLhs(Expr lhs); Expr getRhs(); void setRhs(Expr rhs); BinOp getOp(); @Override void accept(IAstVisitor visitor); @Override BinaryExpr clone(); @Override boolean hasChild(IAstNode candidateChild); @Override Expr getChild(int index); @Override void setChild(int index, Expr expr); @Override int getNumChildren();  }