tests: use alterner.pl
[nit.git] / src / compiling / table_computation.nit
index b3c909e..6138e85 100644 (file)
 package table_computation
 
 import mmloader
-import primitive_info
+private import primitive_info
 import program
 
 # Something that store color of table elements
-class ColorContext
+abstract class ColorContext
        var _colors: HashMap[TableElt, Int] = new HashMap[TableElt, Int]
 
        # The color of a table element.
@@ -112,6 +112,9 @@ redef class MMConcreteClass
                                        ilt.add(new TableEltAttr(p))
                                else if p isa MMMethod then
                                        clt.add(new TableEltMeth(p))
+                               else if p isa MMTypeProperty then
+                                       clt.add(new TableEltVTClassId(p))
+                                       clt.add(new TableEltVTClassColor(p))
                                end
                        end
                        if p isa MMMethod and p.need_super then
@@ -408,12 +411,12 @@ end
 ###############################################################################
 
 # An element of a class, an instance or a module table
-abstract class AbsTableElt
+interface AbsTableElt
 end
 
 # An element of a class or an instance table
 # Such an elements represent method function pointers, attribute values, etc.
-abstract class TableElt
+interface TableElt
        super AbsTableElt
        # Is the element conflict to class `c' (used for coloring)
        fun is_related_to(c: MMLocalClass): Bool is abstract
@@ -427,7 +430,7 @@ end
 
 # An element of a module table
 # Such an elements represent colors or identifiers
-abstract class ModuleTableElt
+interface ModuleTableElt
        super AbsTableElt
 end
 
@@ -453,6 +456,16 @@ class TableEltMeth
        super TableEltProp
 end
 
+# An element that represents a class color value for a virtual type
+class TableEltVTClassColor
+       super TableEltProp
+end
+
+# An element that represents a class id value for a virtual type
+class TableEltVTClassId
+       super TableEltProp
+end
+
 # An element that represents a function pointer to the super method of a local method
 class TableEltSuper
        super TableEltProp
@@ -464,7 +477,7 @@ class TableEltAttr
 end
 
 # An element representing a class information
-class AbsTableEltClass
+abstract class AbsTableEltClass
        super AbsTableElt
        # The local class where the information comes from
        readable var _local_class: MMLocalClass
@@ -476,7 +489,7 @@ class AbsTableEltClass
 end
 
 # An element of a class table representing a class information
-class TableEltClass
+abstract class TableEltClass
        super TableElt
        super AbsTableEltClass
        redef fun is_related_to(c)