dotty.tools.dotc

repl

package repl

Visibility
  1. Public
  2. All

Type Members

  1. class AbstractFileClassLoader extends ClassLoader

    A class loader that loads files from a scala.tools.nsc.io.AbstractFile.

  2. class AmmoniteReader extends InteractiveReader

  3. class CompilingInterpreter extends Compiler with Interpreter

    An interpreter for Scala code which is based on the dotc compiler.

    An interpreter for Scala code which is based on the dotc compiler.

    The overall approach is based on compiling the requested code and then using a Java classloader and Java reflection to run the code and access its results.

    In more detail, a single compiler instance is used to accumulate all successfully compiled or interpreted Scala code. To "interpret" a line of code, the compiler generates a fresh object that includes the line of code and which has public definition(s) to export all variables defined by that code. To extract the result of an interpreted line to show the user, a second "result object" is created which imports the variables exported by the above object and then exports a single definition named "result". To accommodate user expressions that read from variables or methods defined in previous statements, "import" statements are used.

    This interpreter shares the strengths and weaknesses of using the full compiler-to-Java. The main strength is that interpreted code behaves exactly as does compiled code, including running at full speed. The main weakness is that redefining classes and methods is not handled properly, because rebinding at the Java level is technically difficult.

  4. class ConsoleWriter extends Writer

    A Writer that writes onto the Scala Console.

    A Writer that writes onto the Scala Console.

    Version

    1.0

  5. trait InteractiveReader extends AnyRef

    Reads lines from an input stream

  6. trait Interpreter extends AnyRef

    The exported functionality of the interpreter

  7. class InterpreterLoop extends AnyRef

    The interactive shell.

    The interactive shell. It provides a read-eval-print loop around the Interpreter class. After instantiation, clients should call the run method.

  8. class NewLinePrintWriter extends PrintWriter

  9. class REPL extends Driver

    A compiler which stays resident between runs.

    A compiler which stays resident between runs. Usage:

    > scala dotty.tools.dotc.Resident <options> <initial files>

    dotc> "more options and files to compile"

    ...

    dotc> :reset // reset all options to the ones passed on the command line

    ...

    dotc> :q // quit

  10. class SimpleReader extends InteractiveReader

    Reads using standard JDK API

Value Members

  1. object CompilingInterpreter

    Utility methods for the Interpreter.

  2. object InteractiveReader

    The current Scala REPL know how to do this flexibly.

  3. object Interpreter

    This object defines the type of interpreter results

  4. object Main extends REPL

    The main entry point of the REPL

  5. object ManifestInfo

  6. object REPL

  7. package ammonite

Ungrouped