summaryrefslogblamecommitdiff
path: root/src/compiler/scala/tools/nsc/SubComponent.scala
blob: 556b6538ad17c827c26915f5dda156f8c2282496 (plain) (tree)
1
2
3
4
5
6
7
8
9
10









                             

                                                                       
                     

                              
                        




                                                                  
                                   

                                  

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

/** An nsc sub-component.
 */
abstract class SubComponent {

  /** The global environment; overridden by instantiation in Global. */
  val global: Global;

  /** The name of the phase */
  val phaseName: String;

  /** New flags defined by the phase which are not valid before */
  def phaseNewFlags: long = 0;

  /** The phase factory */
  def newPhase(prev: Phase): Phase;

  /** A standard phase template */
  abstract class StdPhase(prev: Phase) extends global.GlobalPhase(prev) {
    def name = phaseName;
    override def newFlags = phaseNewFlags;
  }
}