scala.tools.nsc.typechecker

PatMatVirtualiser

trait PatMatVirtualiser extends TreeDSL

Translate pattern matching into method calls (these methods form a zero-plus monad), similar in spirit to how for-comprehensions are compiled.

For each case, express all patterns as extractor calls, guards as 0-ary extractors, and sequence them using flatMap (lifting the body of the case into the monad using one).

Cases are combined into a pattern match using the orElse combinator (the implicit failure case is expressed using the monad's zero).

TODO:

(longer-term) TODO:

Self Type
Analyzer
Source
PatMatVirtualiser.scala
Linear Supertypes
TreeDSL, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. PatMatVirtualiser
  2. TreeDSL
  3. AnyRef
  4. Any
Visibility
  1. Public
  2. All

Type Members

  1. trait CodegenCore extends MatchMonadInterface

  2. trait CommonSubconditionElimination extends TreeMakerApproximation

  3. trait DeadCodeElimination extends TreeMakers

  4. trait MatchMonadInterface extends AnyRef

    Interface with user-defined match monad? if there's a match in scope, we use this as the match strategy, assuming it conforms to MatchStrategy as defined below:

  5. trait MatchOptimizations extends CommonSubconditionElimination with DeadCodeElimination with SwitchEmission with OptimizedCodegen

  6. trait MatchTranslation extends MatchMonadInterface

  7. trait OptimizedCodegen extends CodegenCore with TypedSubstitution with OptimizedMatchMonadInterface

  8. trait OptimizedMatchMonadInterface extends MatchMonadInterface

  9. class OptimizingMatchTranslator extends MatchTranslation with TreeMakers with MatchOptimizations

  10. trait PureCodegen extends CodegenCore with PureMatchMonadInterface

  11. trait PureMatchMonadInterface extends MatchMonadInterface

  12. class PureMatchTranslator extends MatchTranslation with TreeMakers with PureCodegen

  13. trait SwitchEmission extends TreeMakers with OptimizedMatchMonadInterface

  14. trait TreeMakerApproximation extends TreeMakers

  15. trait TreeMakers extends TypedSubstitution

  16. trait TypedSubstitution extends MatchMonadInterface

Abstract Value Members

  1. abstract val global: Global

    Definition Classes
    TreeDSL

Concrete Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. object CODE extends AnyRef

  7. object MatchTranslator extends AnyRef

  8. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  9. def clone(): AnyRef

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  10. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  11. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  12. def finalize(): Unit

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  13. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  14. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  15. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  16. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  17. final def notify(): Unit

    Definition Classes
    AnyRef
  18. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  19. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  20. def toString(): String

    Definition Classes
    AnyRef → Any
  21. object vpmName extends AnyRef

  22. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  23. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  24. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()

Inherited from TreeDSL

Inherited from AnyRef

Inherited from Any