@Test public void accept() throws Exception { new StandardVisitor() { @Override public void visitMemberLookupExpr(MemberLookupExpr memberLookupExpr) { super.visitMemberLookupExpr(memberLookupExpr); assertEquals("foo", memberLookupExpr.getMember()); assertTrue(memberLookupExpr.getStructure() instanceof VariableIdentifierExpr); assertEquals("v", ((VariableIdentifierExpr) memberLookupExpr.getStructure()).getName()); } }.visit(new MemberLookupExpr(new VariableIdentifierExpr("v"), "foo")); }
@Override public void accept(IAstVisitor visitor) { visitor.visitMemberLookupExpr(this); }
MemberLookupExpr extends Expr { @Override public void accept(IAstVisitor visitor) { visitor.visitMemberLookupExpr(this); } }
MemberLookupExpr extends Expr { @Override public void accept(IAstVisitor visitor) { visitor.visitMemberLookupExpr(this); } MemberLookupExpr(Expr structure, String member); }
MemberLookupExpr extends Expr { @Override public void accept(IAstVisitor visitor) { visitor.visitMemberLookupExpr(this); } 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(); }
MemberLookupExpr extends Expr { @Override public void accept(IAstVisitor visitor) { visitor.visitMemberLookupExpr(this); } 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();  }