alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Scala example source code file (PluginRunner.scala)

This example Scala source code file (PluginRunner.scala) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Scala tags/keywords

consolereporter, global, global, pluginrunner, pluginrunner, reporter, settings, settings, templateannotationchecker, templateannotationchecker

The Scala PluginRunner.scala source code

package plugintemplate.standalone

import plugintemplate.{TemplateAnnotationChecker, TemplatePlugin}
import scala.tools.nsc.{Global, Settings, SubComponent}
import scala.tools.nsc.reporters.{ConsoleReporter, Reporter}

/** This class is a compiler that will be used for running
 *  the plugin in standalone mode.
 */
class PluginRunner(settings: Settings, reporter: Reporter)
extends Global(settings, reporter) {
  def this(settings: Settings) = this(settings, new ConsoleReporter(settings))

  val annotChecker = new TemplateAnnotationChecker {
    val global: PluginRunner.this.type = PluginRunner.this
  }
  addAnnotationChecker(annotChecker.checker)

  /** The phases to be run.
   *
   *  @todo: Adapt to specific plugin implementation
   */
  override protected def computeInternalPhases() {
    phasesSet += syntaxAnalyzer
    phasesSet += analyzer.namerFactory
    phasesSet += analyzer.typerFactory
    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
    }
  }

}

Other Scala examples (source code examples)

Here is a short list of links related to this Scala PluginRunner.scala source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.