public void accept(IInstanceVisitor visitor) { visitor.visit(this); if (visitor is ITreeVisitor) { root.accept((ITreeVisitor)visitor); } }