Dotty Documentation

0.4.0-bin-SNAPSHOT

object PatternMatcher

[-] Constructors

[-] Members

[+] class Translator

The pattern matching translator. Its general structure is a pipeline:

Match tree ---matchPlan---> Plan ---optimize---> Plan ---emit---> Tree

The pipeline consists of three steps:

  • build a plan, using methods matchPlan, caseDefPlan, patternPlan.
  • optimize the plan, using methods listed in optimization,
  • emit the translated tree, using methods emit, collectSwitchCases, emitSwitchCases, and emitCondition.

A plan represents the underlying decision graph. It consists of tests, let and label bindings, calls to labels and code blocks. It's represented by its own data type. Plans are optimized by inlining, hoisting, and the elimination of redundant tests and dead code.

[+] final val selfCheck : false
[+] def isPatmatGenerated ( sym: Symbol ) ( implicit ctx: Context ) : Boolean

Was symbol generated by pattern matcher?