summaryrefslogblamecommitdiff
path: root/src/compiler/scala/tools/nsc/Main.scala
blob: 00c6c37dfdc240197377d37b9a2c2709cb006ff6 (plain) (tree)
1
2
3
4
5
6
7
8
9
                            
                                

                          

                   
 
                                                          
                   
   




                                                                                          
   
 
                                                                 
                                            
                                                   

                                  
 

                                 
/* NSC -- new Scala compiler
 * Copyright 2005-2013 LAMP/EPFL
 * @author  Martin Odersky
 */
package scala.tools
package nsc

/** The main class for NSC, a compiler for the programming
 *  language Scala.
 */
class MainClass extends Driver with EvalLoop {
  def resident(compiler: Global): Unit = loop { line =>
    val command = new CompilerCommand(line split "\\s+" toList, new Settings(scalacError))
    compiler.reporter.reset()
    new compiler.Run() compile command.files
  }

  override def newCompiler(): Global = Global(settings, reporter)
  override def doCompile(compiler: Global) {
    if (settings.resident.value) resident(compiler)
    else super.doCompile(compiler)
  }
}

object Main extends MainClass { }