summaryrefslogblamecommitdiff
path: root/sources/scala/tools/nsc/typechecker/Analyzer.scala
blob: a0f3f19a8f07162b485cbb28592ce53c01f50ce4 (plain) (tree)
1
2
3
4
5
6
7
8
9




                            

                                    

                               
                       
                       





                               
 
                     


















                                                                      
 
 
/* NSC -- new scala compiler
 * Copyright 2005 LAMP/EPFL
 * @author  Martin Odersky
 */
// $Id$
package scala.tools.nsc.typechecker;

/** The main attribution phase.
 */
abstract class Analyzer
	 extends AnyRef
            with Contexts
    	    with Namers
	    with Typers
	    with Infer
	    with Variances
            with EtaExpansion {

  val global: Global;
  import global._;

  object namerFactory extends SubComponent {
    val global: Analyzer.this.global.type = Analyzer.this.global;
    val phaseName = "namer";
    def newPhase(_prev: Phase): StdPhase = new StdPhase(_prev) {
      def apply(unit: CompilationUnit): unit =
	new Namer(startContext.make(unit)).enterSym(unit.body);
    }
  }

  object typerFactory extends SubComponent {
    val global: Analyzer.this.global.type = Analyzer.this.global;
    val phaseName = "typer";
    def newPhase(_prev: Phase): StdPhase = new StdPhase(_prev) {
      def apply(unit: CompilationUnit): unit =
	unit.body = newTyper(startContext.make(unit)).typed(unit.body)
    }
  }
}