aboutsummaryrefslogblamecommitdiff
path: root/src/dotty/tools/dotc/Compiler.scala
blob: 6f5e162eed7bc145abb09e5a485b4601cb7c2579 (plain) (tree)
1
2
3
4
5
6
7
8
9




                   


                              
                                


                
                                 
 





                                                      
                                                                                        



                                          
 
package dotty.tools
package dotc

import core._
import Contexts._
import Periods._
import Symbols._
import typer.{FrontEnd, Typer}
import reporting.ConsoleReporter

class Compiler {

  def phases = List(new FrontEnd)

  def rootContext(implicit ctx: Context): Context = {
    ctx.usePhases(phases)
    ctx.fresh
      .withPeriod(Period(ctx.runId + 1, FirstPhaseId))
      .withOwner(defn.RootClass)
      .withTyper(new Typer)
      .withTyperState(new MutableTyperState(ctx.typerState, new ConsoleReporter()(ctx)))
  }

  def newRun(implicit ctx: Context): Run =
    new Run(this)(rootContext)
}