diff options
author | paltherr <paltherr@epfl.ch> | 2003-09-01 17:27:13 +0000 |
---|---|---|
committer | paltherr <paltherr@epfl.ch> | 2003-09-01 17:27:13 +0000 |
commit | 860d5686c0af6d6afc5266aded4a269cc5e104b7 (patch) | |
tree | bf873b71c86463e0ccfdb269942f89afd4fafa5a /sources/scalac/Phase.java | |
parent | cdbd9750f48ad8d3a5a8e3a7d1e4077b7a6988d7 (diff) | |
download | scala-860d5686c0af6d6afc5266aded4a269cc5e104b7.tar.gz scala-860d5686c0af6d6afc5266aded4a269cc5e104b7.tar.bz2 scala-860d5686c0af6d6afc5266aded4a269cc5e104b7.zip |
- Replaced field Global.phases by fields Phase....
- Replaced field Global.phases by fields Phase.prev and Phase.next
- Reorganized/Cleaned/Documented methods on infos, types and
- closures in Symbol Removed method CompilerPhases.remove Add mehods
- PhaseDescriptor.addXXXFlag
Diffstat (limited to 'sources/scalac/Phase.java')
-rw-r--r-- | sources/scalac/Phase.java | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/sources/scalac/Phase.java b/sources/scalac/Phase.java index eb0e87f274..d205305c86 100644 --- a/sources/scalac/Phase.java +++ b/sources/scalac/Phase.java @@ -50,6 +50,12 @@ public abstract class Phase { /** The phase identifier */ public final int id; + /** The previous phase */ + public final Phase prev; + + /** The next phase */ + public Phase next; + //######################################################################## // Public Constructors @@ -58,12 +64,19 @@ public abstract class Phase { this.global = global; this.descriptor = descriptor; this.id = descriptor.id(); - global.currentPhase = global.phases[id] = this; + this.prev = global.currentPhase; + if (prev != null) prev.next = this; + global.currentPhase = this; } //######################################################################## // Public Methods + /** Does this phase precede the given phase? */ + public boolean precedes(Phase phase) { + return id < phase.id; + } + /** * Returns the info of `sym' after the phase. Assumes that `tp' is * the info of symbol `sym' before this phase. |