summaryrefslogtreecommitdiff
path: root/sources/scala/tools/nsc/symtab/SymbolTable.scala
blob: 59bb30b1a636fa3a9d3bd0a809aef5ef1faab163 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/* NSC -- new scala compiler
 * Copyright 2005 LAMP/EPFL
 * @author  Martin Odersky
 */
// $Id$
package scala.tools.nsc.symtab;

import util._;

abstract class SymbolTable extends Names
			      with Symbols
			      with Types
                              with Scopes
                              with Definitions
			      with InfoTransformers
                              with StdNames {
  def settings: Settings;
  def rootLoader: LazyType;

  private var ph: Phase = NoPhase;
  def phase: Phase = ph;
  def phase_=(p: Phase): unit = {
    //System.out.println("setting phase to " + p);
    assert(p != null);
    ph = p
  }

  def atPhase[T](ph: Phase)(def op: T): T = {
    val current = phase;
    phase = ph;
    val result = op;
    phase = current;
    result
  }

  var infoTransformers = new InfoTransformer {
    val phase = NoPhase;
    def transform(sym: Symbol, tpe: Type): Type = tpe;
  }
}