Packages

  • package root

    The Scala compiler and reflection APIs.

    The Scala compiler and reflection APIs.

    Definition Classes
    root
  • package scala
    Definition Classes
    root
  • package tools
    Definition Classes
    scala
  • package nsc
    Definition Classes
    tools
  • package interpreter
    Definition Classes
    nsc
  • class IMain extends Repl with Imports with PresentationCompilation with Closeable

    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.

    Definition Classes
    interpreter
  • ComputedImports
  • PhaseDependentOps
  • PresentationCompileResult
  • ReadEvalPrint
  • ReplTypeOps
  • Request
  • deconstruct
  • exprTyper
  • flatOp
  • naming
  • replOutput
  • typerOp

object deconstruct extends StructuredTypeStrings

Source
IMain.scala
Content Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. deconstruct
  2. StructuredTypeStrings
  3. DestructureTypes
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. trait DestructureType[Node] extends (Global.Type) => Node
    Definition Classes
    DestructureTypes
  2. case class Grouping(ldelim: String, mdelim: String, rdelim: String, labels: Boolean) extends Product with Serializable
    Definition Classes
    StructuredTypeStrings
  3. case class LabelAndType(label: String, typeName: String) extends Product with Serializable
    Definition Classes
    StructuredTypeStrings
  4. class MonoFunction extends TypeProduct
    Definition Classes
    StructuredTypeStrings
  5. class NullaryFunction extends TypeProduct

    For a NullaryMethod, in = TypeEmpty; for MethodType(Nil, _) in = TypeNil

    For a NullaryMethod, in = TypeEmpty; for MethodType(Nil, _) in = TypeNil

    Definition Classes
    StructuredTypeStrings
  6. class PolyFunction extends TypeProduct
    Definition Classes
    StructuredTypeStrings
  7. case class TypeAtom[T](atom: T) extends TypeNode with Product with Serializable
    Definition Classes
    StructuredTypeStrings
  8. class TypeList extends TypeProduct
    Definition Classes
    StructuredTypeStrings
  9. sealed abstract class TypeNode extends AnyRef
    Definition Classes
    StructuredTypeStrings
  10. case class TypeProduct(nodes: List[TypeNode]) extends TypeNode with Product with Serializable
    Definition Classes
    StructuredTypeStrings

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. val BlockGrouping: Grouping
    Definition Classes
    StructuredTypeStrings
  5. val ListGrouping: Grouping
    Definition Classes
    StructuredTypeStrings
  6. val NoGrouping: Grouping
    Definition Classes
    StructuredTypeStrings
  7. val ProductGrouping: Grouping
    Definition Classes
    StructuredTypeStrings
  8. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  9. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  10. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  11. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  12. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  13. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  14. val global: IMain.global.type
  15. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  16. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  17. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  18. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  19. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  20. def show(tp: Global.Type): String
    Definition Classes
    StructuredTypeStrings
  21. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  22. def toString(): String
    Definition Classes
    AnyRef → Any
  23. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  24. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  25. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  26. object LabelAndType extends java.io.Serializable
    Definition Classes
    StructuredTypeStrings
  27. object TypeEmpty extends TypeNode
    Definition Classes
    StructuredTypeStrings
  28. object intoNodes extends DestructureType[TypeNode]
    Definition Classes
    StructuredTypeStrings

Inherited from StructuredTypeStrings

Inherited from DestructureTypes

Inherited from AnyRef

Inherited from Any

Ungrouped