@Test(expected = IndexOutOfBoundsException.class) public void setChildBad() { VariableIdentifierExpr y = new VariableIdentifierExpr("y"); pe.setChild(1, y); }
@Override public void setChild(int index, Expr expr) { if (index == 0) { this.expr = expr; return; } throw new IndexOutOfBoundsException("Index for ParenExpr must be 0"); }
ParenExpr extends Expr { @Override public void setChild(int index, Expr expr) { if (index == 0) { this.expr = expr; return; } throw new IndexOutOfBoundsException("Index for ParenExpr must be 0"); } }
ParenExpr extends Expr { @Override public void setChild(int index, Expr expr) { if (index == 0) { this.expr = expr; return; } throw new IndexOutOfBoundsException("Index for ParenExpr must be 0"); } ParenExpr(Expr expr); }
ParenExpr extends Expr { @Override public void setChild(int index, Expr expr) { if (index == 0) { this.expr = expr; return; } throw new IndexOutOfBoundsException("Index for ParenExpr must be 0"); } ParenExpr(Expr expr); Expr getExpr(); @Override void accept(IAstVisitor visitor); @Override ParenExpr clone(); @Override boolean hasChild(IAstNode candidateChild); @Override Expr getChild(int index); @Override void setChild(int index, Expr expr); @Override int getNumChildren(); }
ParenExpr extends Expr { @Override public void setChild(int index, Expr expr) { if (index == 0) { this.expr = expr; return; } throw new IndexOutOfBoundsException("Index for ParenExpr must be 0"); } ParenExpr(Expr expr); Expr getExpr(); @Override void accept(IAstVisitor visitor); @Override ParenExpr clone(); @Override boolean hasChild(IAstNode candidateChild); @Override Expr getChild(int index); @Override void setChild(int index, Expr expr); @Override int getNumChildren();  }