diff options
author | mihaylov <mihaylov@epfl.ch> | 2003-12-08 10:30:49 +0000 |
---|---|---|
committer | mihaylov <mihaylov@epfl.ch> | 2003-12-08 10:30:49 +0000 |
commit | 4931ca305940a728c5d632aba9f2a3a84c397acf (patch) | |
tree | 04b7f0d1c440bab6ee71d23de3fae6fd14ec7d84 /sources/scalac/symtab/classfile/PackageParser.java | |
parent | 17b8ac4bf4ed723c1606a6b3419870fd3acfe1bb (diff) | |
download | scala-4931ca305940a728c5d632aba9f2a3a84c397acf.tar.gz scala-4931ca305940a728c5d632aba9f2a3a84c397acf.tar.bz2 scala-4931ca305940a728c5d632aba9f2a3a84c397acf.zip |
- added common superclass (MetadataParser) for ...
- added common superclass (MetadataParser) for PackageParser and
ClassParser that handles switching and restoring the compiler phase
Diffstat (limited to 'sources/scalac/symtab/classfile/PackageParser.java')
-rw-r--r-- | sources/scalac/symtab/classfile/PackageParser.java | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/sources/scalac/symtab/classfile/PackageParser.java b/sources/scalac/symtab/classfile/PackageParser.java index 346272230b..fa0940e379 100644 --- a/sources/scalac/symtab/classfile/PackageParser.java +++ b/sources/scalac/symtab/classfile/PackageParser.java @@ -15,30 +15,28 @@ import scalac.util.*; import java.io.*; import java.util.HashMap; -public class PackageParser extends Type.LazyType { - - /** the global compilation environment - */ - protected Global global; +public class PackageParser extends MetadataParser { /** the class parser */ public ClassParser classCompletion; public SymblParser symblCompletion; // provisional + protected final CLRPackageParser importer; + public PackageParser(Global global) { - this.global = global; + super(global); this.classCompletion = new ClassParser(global); this.symblCompletion = new SymblParser(global); // provisional if (global.reporter.verbose) System.out.println("classpath = " + global.classPath);//debug + importer = (global.target == global.TARGET_MSIL) + ? CLRPackageParser.create(global) : null; } /** complete package type symbol p by loading all package members */ - public void complete(Symbol p) { - Phase phase = global.currentPhase; - global.currentPhase = global.getFirstPhase(); + protected void doComplete(Symbol p) { long msec = System.currentTimeMillis(); Scope members = new Scope(); String dirname = null; @@ -54,12 +52,13 @@ public class PackageParser extends Type.LazyType { AbstractFile.open(base[i], dirname), p, members, symFile); } + if (global.target == global.TARGET_MSIL) + importer.importCLRTypes(p, members, this); p.setInfo(Type.compoundType(Type.EMPTY_ARRAY, members, p)); if (dirname == null) dirname = "anonymous package"; global.operation("scanned " + dirname + " in " + (System.currentTimeMillis() - msec) + "ms"); - global.currentPhase = phase; } private boolean isMostRecent(AbstractFile f, Symbol previous, HashMap symFile) { @@ -144,4 +143,6 @@ public class PackageParser extends Type.LazyType { } catch (IOException e) { } } + + } |