nitg-s: organized and cleaned coloring module
authorAlexandre Terrasa <alexandre@moz-code.org>
Thu, 7 Feb 2013 20:10:55 +0000 (15:10 -0500)
committerAlexandre Terrasa <alexandre@moz-code.org>
Mon, 4 Mar 2013 18:20:00 +0000 (13:20 -0500)
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

src/coloring.nit

index ea5715c..eaf3808 100644 (file)
@@ -34,6 +34,8 @@ class PHTypeLayout
        var hashes: Map[MType, Map[MType, Int]] = new HashMap[MType, Map[MType, Int]]
 end
 
+# Builders
+
 abstract class TypeLayoutBuilder
 
        type LAYOUT: TypeLayout
@@ -123,7 +125,9 @@ class PHTypeLayoutBuilder
        end
 end
 
-abstract class AbstractColoring[E: Object]
+# Colorers
+
+abstract class AbstractColorer[E: Object]
 
        private var core: Set[E] = new HashSet[E]
        private var crown: Set[E] = new HashSet[E]
@@ -255,9 +259,7 @@ end
 
 # MType coloring
 private class MTypeColorer
-       super AbstractColoring[MType]
-
-       type T: MType
+       super AbstractColorer[MType]
 
        var mmodule: MModule
 
@@ -270,6 +272,8 @@ private class MTypeColorer
        redef fun reverse_linearize(elements) do return self.mmodule.reverse_linearize_mtypes(elements)
 end
 
+# Perfect hashers
+
 # MType Perfect Hashing
 private class MTypeHasher
 
@@ -350,7 +354,7 @@ end
 
 # MClass coloring
 class ClassColoring
-       super AbstractColoring[MClass]
+       super AbstractColorer[MClass]
 
        type T: MClass