Packages

p

scala.tools.nsc

interpreter

package interpreter

The main REPL related classes and values are as follows. In addition to standard compiler classes Global and Settings, there are:

History: an interface for session history. Completion: an interface for tab completion. ILoop (formerly InterpreterLoop): The umbrella class for a session. IMain (formerly Interpreter): Handles the evolving state of the session and handles submitting code to the compiler and handling the output. InteractiveReader: how ILoop obtains input. History: an interface for session history. Completion: an interface for tab completion. Power: a repository for more advanced/experimental features.

ILoop contains { in: InteractiveReader, intp: IMain, settings: Settings, power: Power } InteractiveReader contains { history: History, completion: Completion } IMain contains { global: Global }

Source
package.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. interpreter
  2. ReplStrings
  3. ReplConfig
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. class AbstractOrMissingHandler [T] extends PartialFunction[Throwable, T]
  2. class CommandLine extends CompilerCommand

    A command line for the interpreter.

  3. trait Completion extends AnyRef

    An implementation-agnostic completion interface which makes no reference to the jline classes.

  4. trait Delimited extends AnyRef
  5. trait EchoReader extends SimpleReader
  6. trait ExprTyper extends AnyRef
  7. class Formatting extends AnyRef
  8. class ILoop extends LoopCommands

    The Scala interactive shell.

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

    If no in0 is specified, then input will come from the console, and the class will attempt to provide input editing feature such as input history.

    Version

    1.2

  9. class IMain extends Imports with PresentationCompilation

    An interpreter for Scala code.

    An interpreter for Scala code.

    The main public entry points are compile(), interpret(), and bind(). The compile() method loads a complete Scala file. The interpret() method executes one line of Scala code at the request of the user. The bind() method binds an object to a variable that can then be used by later interpreted code.

    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 member(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 members called "$eval" and "$print". 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.

  10. implicit class IMainOps extends AnyRef

    This class serves to trick the compiler into treating a var (intp, in ILoop) as a stable identifier.

  11. class ISettings extends AnyRef

    Settings for the interpreter

    Settings for the interpreter

    Version

    1.0

  12. trait Imports extends AnyRef
  13. type InputStream = java.io.InputStream
  14. trait InteractiveReader extends AnyRef

    Reads lines from an input stream

  15. type JClass = Class[_]
  16. type JCollection[T] = Collection[T]
  17. type JFile = File
  18. type JList[T] = java.util.List[T]
  19. type JPrintWriter = PrintWriter
  20. abstract class Javap extends AnyRef
  21. class JavapClass extends Javap

    Javap command implementation.

  22. trait Logger extends AnyRef
  23. trait LoopCommands extends AnyRef
  24. trait MemberHandlers extends AnyRef
  25. trait NamedParam extends AnyRef
  26. case class NamedParamClass (name: String, tpe: String, value: Any) extends NamedParam with Product with Serializable
  27. trait NamedParamCreator extends AnyRef
  28. trait Naming extends AnyRef

    This is for name logic which is independent of the compiler (notice there's no Global.) That includes at least generating, metaquoting, mangling, and unmangling.

  29. type OutputStream = java.io.OutputStream
  30. class Parsed extends Delimited

    One instance of a command buffer.

  31. abstract class Pasted extends AnyRef

    If it looks like they're pasting in a scala interpreter transcript, remove all the formatting we inserted so we can make some sense of it.

    If it looks like they're pasting in a scala interpreter transcript, remove all the formatting we inserted so we can make some sense of it.

    Most of the interesting code in here is due to my goal of "paste idempotence" i.e. the transcript resulting from pasting a transcript should itself be pasteable and should achieve the same result.

  32. trait Phased extends AnyRef

    Mix this into an object and use it as a phasing Swiss Army knife.

  33. class Power [ReplValsImpl <: ReplVals] extends AnyRef

    A class for methods to be injected into the intp in power mode.

  34. trait PresentationCompilation extends AnyRef
  35. class PresentationCompilerCompleter extends Completion
  36. class ProcessResult extends AnyRef
  37. trait ReplConfig extends AnyRef
  38. class TapMaker [T] extends AnyRef
    Definition Classes
    ReplConfig
  39. trait ReplDir extends AbstractFile with Clearable

    Directory to save .class files to.

  40. trait ReplGlobal extends Global

    A layer on top of Global so I can guarantee some extra functionality for the repl.

    A layer on top of Global so I can guarantee some extra functionality for the repl. It doesn't do much yet.

  41. class ReplOutput extends AnyRef
  42. class ReplProps extends AnyRef
  43. class ReplReporter extends ConsoleReporter

    Like ReplGlobal, a layer for ensuring extra functionality.

  44. trait ReplStrings extends AnyRef
  45. abstract class ReplVals extends AnyRef

    A class which the repl utilizes to expose predefined objects.

    A class which the repl utilizes to expose predefined objects. The base implementation is empty; the standard repl implementation is StdReplVals.

  46. class RichClass [T] extends AnyRef
  47. class Scripted extends AbstractScriptEngine with Compilable
  48. class SimpleReader extends InteractiveReader

    Reads using standard JDK API

  49. class SplashLoop extends Runnable

    Collect one line of user input from the supplied reader.

    Collect one line of user input from the supplied reader. Runs on a new thread while the REPL is initializing on the main thread.

    The user can enter text or a :paste command.

  50. class SplashReader extends InteractiveReader

    Reader during splash.

    Reader during splash. Handles splash-completion with a stub, otherwise delegates.

  51. trait StdReplTags extends StdTags
  52. class StdReplVals extends ReplVals
  53. trait Tabulator extends AnyRef
  54. trait VariColumnTabulator extends Tabulator

    Adjust the column width and number of columns to minimize the row count.

  55. class WriterOutputStream extends OutputStream
  56. class AbstractFileClassLoader extends util.AbstractFileClassLoader
    Annotations
    @deprecated
    Deprecated

    (Since version 2.11.0) Use scala.tools.nsc.util.AbstractFileClassLoader

Value Members

  1. val IR: Results.type
  2. def any2stringOf(x: Any, maxlen: Int): String
    Definition Classes
    ReplStrings
  3. def isAcross: Boolean
    Definition Classes
    ReplConfig
  4. def isPaged: Boolean
    Definition Classes
    ReplConfig
  5. def isReplDebug: Boolean
    Definition Classes
    ReplConfig
  6. def isReplInfo: Boolean
    Definition Classes
    ReplConfig
  7. def isReplPower: Boolean
    Definition Classes
    ReplConfig
  8. def isReplTrace: Boolean
    Definition Classes
    ReplConfig
  9. implicit def postfixOps: postfixOps
  10. lazy val replProps: ReplProps
    Definition Classes
    ReplConfig
  11. def staticTypeTag[T](implicit arg0: ClassTag[T]): reflect.api.JavaUniverse.TypeTag[T]
  12. def string2code(str: String): String

    Convert a string into code that can recreate the string.

    Convert a string into code that can recreate the string. This requires replacing all special characters by escape codes. It does not add the surrounding " marks.

    Definition Classes
    ReplStrings
  13. def string2codeQuoted(str: String): String
    Definition Classes
    ReplStrings
  14. def unquoted(s: String): String
    Definition Classes
    ReplStrings
  15. def words(s: String): List[String]
    Definition Classes
    ReplStrings
  16. object AbstractOrMissingHandler
  17. object Completion
  18. object Formatting
  19. object ILoop
  20. object IMain

    Utility methods for the Interpreter.

  21. object InteractiveReader
  22. object Javap
  23. object JavapClass
  24. object NamedParam extends NamedParamCreator
  25. object NoCompletion extends Completion
  26. object NoJavap extends Javap
  27. object Parsed
  28. object PresentationCompilerCompleter
  29. object ReplVals
  30. object Results
  31. object Scripted
  32. object SimpleReader
  33. object SplashLoop
  34. object SplashReader
  35. object StdReplTags extends StdTags with StdReplTags

Inherited from ReplStrings

Inherited from ReplConfig

Inherited from AnyRef

Inherited from Any

Ungrouped