/* ____ ____ ____ ____ ______ *\ ** / __// __ \/ __// __ \/ ____/ SOcos COmpiles Scala ** ** __\_ \/ /_/ / /__/ /_/ /\_ \ (c) 2002, LAMP/EPFL ** ** /_____/\____/\___/\____/____/ ** \* */ // $Id$ package scalac.symtab; import java.util.Map; import java.util.HashMap; import scalac.util.FreshNameCreator; import scalac.util.Debug; /** * This class implements a symbol cloner. It automatically determines * the new owner of cloned symbols and keeps track of all cloned * symbols. */ public class SymbolCloner { //######################################################################## // Public Fields /** The fresh name generator used to rename cloned symbols */ public final FreshNameCreator renamer; /** A table that maps owners of symbols to owners of cloned symbols */ public final Map/* into which cloned symbols are stored */ public final Map/* " + Debug.show(clones.get(symbol)); Symbol clone = symbol.cloneSymbol(getOwnerFor(symbol)); if (rename) clone.name = renamer.newName(symbol.name); clones.put(symbol, clone); return clone; } //######################################################################## }