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

  8. 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.

  9. implicit class IMainOps extends AnyRef

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

  10. class ISettings extends AnyRef

    Settings for the interpreter

    Settings for the interpreter

    Version

    1.0

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

    Reads lines from an input stream

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

    Javap command implementation.

  21. trait Logger extends AnyRef
  22. trait LoopCommands extends AnyRef
  23. trait MemberHandlers extends AnyRef
  24. trait NamedParam extends AnyRef
  25. case class NamedParamClass (name: String, tpe: String, value: Any) extends NamedParam with Product with Serializable
  26. trait NamedParamCreator extends AnyRef
  27. 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.

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

    One instance of a command buffer.

  30. 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.

  31. trait Phased extends AnyRef

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

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

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

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

    Directory to save .class files to.

  39. 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.

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

    Like ReplGlobal, a layer for ensuring extra functionality.

  43. trait ReplStrings extends AnyRef
  44. 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.

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

    Reads using standard JDK API.

  48. 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.

  49. class SplashReader extends InteractiveReader

    Reader during splash.

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

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

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

  54. class WriterOutputStream extends OutputStream
  55. 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 ILoop
  19. object IMain

    Utility methods for the Interpreter.

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

Inherited from ReplStrings

Inherited from ReplConfig

Inherited from AnyRef

Inherited from Any

Ungrouped