aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/Compiler.scala
blob: e094cc06cab761ab3c39665935597553044246ac (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
package dotty.tools
package dotc

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

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)
  }

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