summaryrefslogtreecommitdiff
path: root/docs/examples/plugintemplate/src/plugintemplate/TemplateAnnotationChecker.scala
diff options
context:
space:
mode:
authorLukas Rytz <lukas.rytz@epfl.ch>2008-06-27 08:42:40 +0000
committerLukas Rytz <lukas.rytz@epfl.ch>2008-06-27 08:42:40 +0000
commit5ca94175b3cdefc75d80e58116d3d84af6403cee (patch)
tree81b679f1dfb6597950d8caaedb28c994a94d46ee /docs/examples/plugintemplate/src/plugintemplate/TemplateAnnotationChecker.scala
parenta8edcacc4f8d676871874e67a1a1543efbddd893 (diff)
downloadscala-5ca94175b3cdefc75d80e58116d3d84af6403cee.tar.gz
scala-5ca94175b3cdefc75d80e58116d3d84af6403cee.tar.bz2
scala-5ca94175b3cdefc75d80e58116d3d84af6403cee.zip
- added AnnotationChecker and TraverseComponent
- improved the rest
Diffstat (limited to 'docs/examples/plugintemplate/src/plugintemplate/TemplateAnnotationChecker.scala')
-rw-r--r--docs/examples/plugintemplate/src/plugintemplate/TemplateAnnotationChecker.scala20
1 files changed, 20 insertions, 0 deletions
diff --git a/docs/examples/plugintemplate/src/plugintemplate/TemplateAnnotationChecker.scala b/docs/examples/plugintemplate/src/plugintemplate/TemplateAnnotationChecker.scala
new file mode 100644
index 0000000000..6cd3472675
--- /dev/null
+++ b/docs/examples/plugintemplate/src/plugintemplate/TemplateAnnotationChecker.scala
@@ -0,0 +1,20 @@
+package plugintemplate
+
+import scala.tools.nsc.Global
+
+abstract class TemplateAnnotationChecker {
+ val global: Global
+ import global._
+
+ object checker extends AnnotationChecker {
+ def annotationsConform(tpe1: Type, tpe2: Type): Boolean = {
+ println("checking: "+ tpe1 +" <: "+ tpe2)
+ true
+ }
+
+ override def addAnnotations(tree: Tree, tpe: Type): Type = {
+ println("adding annot to "+ tree.symbol)
+ tpe
+ }
+ }
+}