Dotty Documentation

0.7.0-bin-SNAPSHOT

class ReplCompiler
extends Compiler

This subclass of Compiler replaces the appropriate phases in order to facilitate the REPL

Specifically it replaces the front end with REPLFrontEnd, and adds a custom subclass of GenBCode. The custom GenBCode, REPLGenBCode, works in conjunction with a specialized class loader in order to load virtual classfiles.

[-] Constructors

ReplCompiler ( directory: AbstractFile )

[-] Members

[+] private case class Definitions
[+] private object Definitions
[+] private class REPLGenBCode

A GenBCode phase that outputs to a virtual directory

[+] val directory : AbstractFile
[+] private var objectNames : Map [ Int, TermName ]
[+] protected override def backendPhases : List [ List [ Phase ] ]

Generate the output of the compilation

[+] def compile ( parsed: Parsed ) ( implicit state: State ) : Result [ ( CompilationUnit, State ) ]
[+] private def createUnit ( defs: Definitions , sourceCode: String ) : CompilationUnit
[+] private def definitions ( trees: List [ Tree ] , state: State ) : Definitions
[+] protected override def frontendPhases : List [ List [ Phase ] ]

Phases dealing with the frontend up to trees ready for TASTY pickling

[+] def newRun ( initCtx: Context , objectIndex: Int ) : Run
[+] private def objectName ( state: State ) : TermName
[+] private def runCompilationUnit ( unit: CompilationUnit , state: State ) : Result [ ( CompilationUnit, State ) ]
[+] def typeCheck ( expr: String , errorsAllowed: Boolean ) ( implicit state: State ) : Result [ ValDef ]
[+] def typeOf ( expr: String ) ( implicit state: State ) : Result [ String ]
[+] private def wrapped ( defs: Definitions ) : PackageDef

Wrap trees in an object and add imports from the previous compilations

The resulting structure is something like:

package <none> {
  object rs$line$nextId {
    import rs$line${i <- 0 until nextId}._
    import dotty.Show._

    <trees>
  }
}