public Tree transform(Tree tree) { switch(tree) { case PackageDef(Tree packaged, Template impl): return copy.PackageDef( tree, transform(packaged), transform(impl, packaged.symbol()));  case ClassDef(int mods, Name name, TypeDef[] tparams, ValDef[][] vparams, Tree tpe, Template impl): return copy.ClassDef( tree, mods, name, transform(tparams, tree.symbol()), transform(vparams, tree.symbol()), transform(tpe), transform(impl, tree.symbol()));  case ModuleDef(int mods, Name name, Tree tpe, Template impl): return copy.ModuleDef( tree, mods, name, transform(tpe), transform(impl, tree.symbol().moduleClass()));  case DefDef(int mods, Name name, TypeDef[] tparams, ValDef[][] vparams, Tree tpe, Tree rhs): return copy.DefDef( tree, mods, name, transform(tparams, tree.symbol()), transform(vparams, tree.symbol()), transform(tpe, tree.symbol()), transform(rhs, tree.symbol()));  case ValDef(int mods, Name name, Tree tpe, Tree rhs): return copy.ValDef( tree, mods, name, transform(tpe), transform(rhs, tree.symbol()));  case TypeDef(int mods, Name name, Tree rhs): return copy.TypeDef( tree, mods, name, transform(rhs, tree.symbol()));  default: return super.transform(tree); }
public Tree transform(Tree tree, Symbol owner) { Symbol prevOwner = currentOwner; currentOwner = owner; Tree tree1 = transform(tree); currentOwner = prevOwner; return tree1;
    public Tree transform(Tree tree) {	switch(tree) {	case PackageDef(Tree packaged, Template impl):	    return copy.PackageDef(		tree, transform(packaged), transform(impl, packaged.symbol()));	case ClassDef(int mods, Name name, TypeDef[] tparams, ValDef[][] vparams, Tree tpe, Template impl):	    return copy.ClassDef(		tree, mods, name, 		transform(tparams, tree.symbol()), 		transform(vparams, tree.symbol()),		transform(tpe),		transform(impl, tree.symbol()));			case ModuleDef(int mods, Name name, Tree tpe, Template impl):	    return copy.ModuleDef(		tree, mods, name, transform(tpe), 		transform(impl, tree.symbol().moduleClass()));	case DefDef(int mods, Name name, TypeDef[] tparams, ValDef[][] vparams, Tree tpe, Tree rhs):	    return copy.DefDef(		tree, mods, name, 		transform(tparams, tree.symbol()), 		transform(vparams, tree.symbol()),		transform(tpe, tree.symbol()),		transform(rhs, tree.symbol()));	case ValDef(int mods, Name name, Tree tpe, Tree rhs):	    return copy.ValDef(		tree, mods, name, transform(tpe),		transform(rhs, tree.symbol()));	case TypeDef(int mods, Name name, Tree rhs):	    return copy.TypeDef(		tree, mods, name, transform(rhs, tree.symbol()));	default:	    return super.transform(tree);	}    }