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

Scala example source code file (MSILPlatform.scala)

This example Scala source code file (MSILPlatform.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

assemrefs, boxednumberclass, boxednumberclass, comparatorclass, genmsil, list, list, msilplatform, none, none, platform, symbol, symbol

The Scala MSILPlatform.scala source code

/* NSC -- new Scala compiler
 * Copyright 2005-2011 LAMP/EPFL
 * @author  Paul Phillips
 */

package scala.tools.nsc
package backend

import ch.epfl.lamp.compiler.msil.{ Type => MSILType }
import util.MsilClassPath
import msil.GenMSIL

trait MSILPlatform extends Platform[MSILType] {
  import global._
  import definitions.{ ComparatorClass, BoxedNumberClass, getMember, getClass }

  if (settings.verbose.value)
    inform("[AssemRefs = " + settings.assemrefs.value + "]")
  
  // phaseName = "msil"
  object genMSIL extends {
    val global: MSILPlatform.this.global.type = MSILPlatform.this.global
    val runsAfter = List[String]("dce")
    val runsRightAfter = None
  } with GenMSIL
  
  lazy val classPath = MsilClassPath.fromSettings(settings)
  def rootLoader = new loaders.NamespaceLoader(classPath)
  
  def platformPhases = List(
    genMSIL   // generate .msil files
  )  
  
  lazy val externalEquals = getMember(ComparatorClass.companionModule, nme.equals_)
  def isMaybeBoxed(sym: Symbol) = sym isNonBottomSubClass BoxedNumberClass
}

Other Scala examples (source code examples)

Here is a short list of links related to this Scala MSILPlatform.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.