diff options
author | paltherr <paltherr@epfl.ch> | 2004-02-19 13:08:48 +0000 |
---|---|---|
committer | paltherr <paltherr@epfl.ch> | 2004-02-19 13:08:48 +0000 |
commit | d19cd4e6791347cfbcd161c02a49eebef4aab686 (patch) | |
tree | c8cc3229b42c7656e9148765b0fac3f22e21252b /sources/scalac/typechecker/AnalyzerPhase.java | |
parent | 3b4e70e1bdf4dcf237d398157b13cbd941e1001e (diff) | |
download | scala-d19cd4e6791347cfbcd161c02a49eebef4aab686.tar.gz scala-d19cd4e6791347cfbcd161c02a49eebef4aab686.tar.bz2 scala-d19cd4e6791347cfbcd161c02a49eebef4aab686.zip |
- Removed java version of files translated to s...
- Removed java version of files translated to scala
Diffstat (limited to 'sources/scalac/typechecker/AnalyzerPhase.java')
-rw-r--r-- | sources/scalac/typechecker/AnalyzerPhase.java | 69 |
1 files changed, 8 insertions, 61 deletions
diff --git a/sources/scalac/typechecker/AnalyzerPhase.java b/sources/scalac/typechecker/AnalyzerPhase.java index d2a2ec2c41..d64a99d896 100644 --- a/sources/scalac/typechecker/AnalyzerPhase.java +++ b/sources/scalac/typechecker/AnalyzerPhase.java @@ -8,74 +8,21 @@ package scalac.typechecker; -import ch.epfl.lamp.util.Position; -import scalac.*; -import scalac.util.*; -import scalac.ast.*; -import scalac.symtab.*; -import scalac.checkers.*; -import java.util.HashMap; -import java.util.ArrayList; +import scalac.Global; +import scalac.Phase; +import scalac.PhaseDescriptor; +import scalac.Unit; +import scalac.symtab.Symbol; -public class AnalyzerPhase extends Phase { - - final Context startContext; - final Context consoleContext; - final HashMap/*<Unit,Context>*/ contexts = new HashMap(); - final ArrayList/*<Unit>*/ newSources = new ArrayList(); +public abstract class AnalyzerPhase extends Phase { /** Initializes this instance. */ public AnalyzerPhase(Global global, PhaseDescriptor descriptor) { super(global, descriptor); - Definitions definitions = global.definitions; - this.startContext = new Context( - Tree.Empty, - definitions.ROOT_CLASS, - definitions.ROOT_CLASS.members(), - Context.NONE); - this.startContext.enclClass = this.startContext; - - if (!global.noimports) { - addImport(startContext, definitions.getModule(Names.java_lang)); - addImport(startContext, definitions.getModule(Names.scala)); - } - - if (!global.noimports && !global.nopredefs) { - addImport(startContext, definitions.getModule(Names.scala_Predef)); - } - - this.consoleContext = new Context( - Tree.Empty, - definitions.ROOT_CLASS, - definitions.ROOT_CLASS.members(), - startContext); } - public void addConsoleImport(Symbol module) { - addImport(consoleContext, module); - } + public abstract void addConsoleImport(Symbol module); - private void addImport(Context context, Symbol module) { - global.prevPhase(); - Tree tree = global.treeGen.mkImportAll(Position.NOPOS, module); - global.nextPhase(); - context.imports = new ImportList(tree, new Scope(), context.imports); - } + public abstract void lateEnter(Global global, Unit unit, Symbol symbol); - public void apply(Unit[] units) { - new Analyzer(global, this).apply(units); - } - - public void lateEnter(Global global, Unit unit, Symbol symbol) { - new Analyzer(global, this).lateEnter(unit, symbol); - } - - public Checker[] postCheckers(Global global) { - return new Checker[] { - new CheckSymbols(global), - new CheckTypes(global), - new CheckOwners(global), - new CheckNames(global) - }; - } } |