summaryrefslogtreecommitdiff
path: root/docs/examples
diff options
context:
space:
mode:
authornielsen <nielsen@epfl.ch>2009-02-05 14:08:22 +0000
committernielsen <nielsen@epfl.ch>2009-02-05 14:08:22 +0000
commitb85f33beb78cfbf480acee353f5b5ed83980b3fc (patch)
tree99a14e414c35f070c86a93202e49d39ec0cec1f3 /docs/examples
parentf9d6f834b6700ce90f2235604e7f269748c92276 (diff)
downloadscala-b85f33beb78cfbf480acee353f5b5ed83980b3fc.tar.gz
scala-b85f33beb78cfbf480acee353f5b5ed83980b3fc.tar.bz2
scala-b85f33beb78cfbf480acee353f5b5ed83980b3fc.zip
Updated example compiler plugin for SIP 00002
Diffstat (limited to 'docs/examples')
-rw-r--r--docs/examples/plugintemplate/src/plugintemplate/TemplateComponent.scala2
-rw-r--r--docs/examples/plugintemplate/src/plugintemplate/TemplateInfoTransformComponent.scala2
-rw-r--r--docs/examples/plugintemplate/src/plugintemplate/TemplatePlugin.scala2
-rw-r--r--docs/examples/plugintemplate/src/plugintemplate/TemplateTransformComponent.scala2
-rw-r--r--docs/examples/plugintemplate/src/plugintemplate/TemplateTraverseComponent.scala2
-rw-r--r--docs/examples/plugintemplate/src/plugintemplate/standalone/PluginRunner.scala19
6 files changed, 18 insertions, 11 deletions
diff --git a/docs/examples/plugintemplate/src/plugintemplate/TemplateComponent.scala b/docs/examples/plugintemplate/src/plugintemplate/TemplateComponent.scala
index d740395cc8..b63f3203b5 100644
--- a/docs/examples/plugintemplate/src/plugintemplate/TemplateComponent.scala
+++ b/docs/examples/plugintemplate/src/plugintemplate/TemplateComponent.scala
@@ -14,7 +14,7 @@ import scala.tools.nsc.plugins.PluginComponent
class TemplateComponent(val global: Global) extends PluginComponent {
import global._
- val runsAfter = "refchecks"
+ val runsAfter = List[String]("refchecks")
/** The name of this plugin phase
* @todo Adapt to specific plugin.
diff --git a/docs/examples/plugintemplate/src/plugintemplate/TemplateInfoTransformComponent.scala b/docs/examples/plugintemplate/src/plugintemplate/TemplateInfoTransformComponent.scala
index 60f56ba30a..71069aed6f 100644
--- a/docs/examples/plugintemplate/src/plugintemplate/TemplateInfoTransformComponent.scala
+++ b/docs/examples/plugintemplate/src/plugintemplate/TemplateInfoTransformComponent.scala
@@ -22,7 +22,7 @@ class TemplateInfoTransformComponent(val global: Global) extends PluginComponent
import global._
import global.definitions._
- val runsAfter = "refchecks"
+ val runsAfter = List[String]("refchecks")
/** The phase name of the compiler plugin
* @todo Adapt to specific plugin.
*/
diff --git a/docs/examples/plugintemplate/src/plugintemplate/TemplatePlugin.scala b/docs/examples/plugintemplate/src/plugintemplate/TemplatePlugin.scala
index 658b38e58e..b241072301 100644
--- a/docs/examples/plugintemplate/src/plugintemplate/TemplatePlugin.scala
+++ b/docs/examples/plugintemplate/src/plugintemplate/TemplatePlugin.scala
@@ -12,7 +12,7 @@ class TemplatePlugin(val global: Global) extends Plugin {
/** The name of this plugin. Extracted from the properties file. */
val name = PluginProperties.pluginName
- val runsAfter = "refchecks"
+ val runsAfter = List[String]("refchecks")
/** A short description of the plugin, read from the properties file */
val description = PluginProperties.pluginDescription
diff --git a/docs/examples/plugintemplate/src/plugintemplate/TemplateTransformComponent.scala b/docs/examples/plugintemplate/src/plugintemplate/TemplateTransformComponent.scala
index 06afedad97..7c2630dc16 100644
--- a/docs/examples/plugintemplate/src/plugintemplate/TemplateTransformComponent.scala
+++ b/docs/examples/plugintemplate/src/plugintemplate/TemplateTransformComponent.scala
@@ -19,7 +19,7 @@ class TemplateTransformComponent(val global: Global) extends PluginComponent
import global._
import global.definitions._
- val runsAfter = "refchecks"
+ val runsAfter = List[String]("refchecks")
/** The phase name of the compiler plugin
* @todo Adapt to specific plugin.
*/
diff --git a/docs/examples/plugintemplate/src/plugintemplate/TemplateTraverseComponent.scala b/docs/examples/plugintemplate/src/plugintemplate/TemplateTraverseComponent.scala
index e87d4d18b0..400daf7437 100644
--- a/docs/examples/plugintemplate/src/plugintemplate/TemplateTraverseComponent.scala
+++ b/docs/examples/plugintemplate/src/plugintemplate/TemplateTraverseComponent.scala
@@ -9,7 +9,7 @@ class TemplateTraverseComponent (val global: Global) extends PluginComponent {
import global._
import global.definitions._
- val runsAfter = "refchecks"
+ val runsAfter = List[String]("refchecks")
/** The phase name of the compiler plugin
* @todo Adapt to specific plugin.
*/
diff --git a/docs/examples/plugintemplate/src/plugintemplate/standalone/PluginRunner.scala b/docs/examples/plugintemplate/src/plugintemplate/standalone/PluginRunner.scala
index 16b6ce2259..979437c8c2 100644
--- a/docs/examples/plugintemplate/src/plugintemplate/standalone/PluginRunner.scala
+++ b/docs/examples/plugintemplate/src/plugintemplate/standalone/PluginRunner.scala
@@ -19,10 +19,17 @@ extends Global(settings, reporter) {
*
* @todo: Adapt to specific plugin implementation
*/
- override def phaseDescriptors: List[SubComponent] = List(
- analyzer.namerFactory,
- analyzer.typerFactory,
- superAccessors,
- pickler,
- refchecks) ::: TemplatePlugin.components(this)
+ override protected def computeInternalPhases() : Unit = {
+ phasesSet += syntaxAnalyzer
+ phasesSet += (analyzer.namerFactory: SubComponent) // note: types are there because otherwise
+ phasesSet += (analyzer.typerFactory: SubComponent) // consistency check after refchecks would fail.
+ phasesSet += superAccessors // add super accessors
+ phasesSet += pickler // serialize symbol tables
+ phasesSet += refchecks // perform reference and override checking, translate nested objects
+
+ for (phase <- TemplatePlugin.components(this)) {
+ phasesSet += phase
+ }
+ }
+
}