MemberLookupExpr extends Expr { public void setStructure(Expr structure) { if (structure == null) { throw new IllegalArgumentException("Member lookup expression canno have null structure"); } this.structure = structure; } MemberLookupExpr(Expr structure, String member); Expr getStructure(); void setStructure(Expr structure); String getMember(); void setMember(String member); @Override void accept(IAstVisitor visitor); @Override MemberLookupExpr clone(); @Override boolean hasChild(IAstNode candidateChild); @Override Expr getChild(int index); @Override void setChild(int index, Expr expr); @Override int getNumChildren();  }
@Test public void setStructure() throws Exception { VariableIdentifierExpr v = new VariableIdentifierExpr("v"); VariableIdentifierExpr w = new VariableIdentifierExpr("w"); MemberLookupExpr mle = new MemberLookupExpr( v, "foo"); mle.setStructure(w); assertEquals(w, mle.getStructure()); }