fun do_property_coloring do
var mclasses = new HashSet[MClass].from(modelbuilder.model.mclasses)
+ # Layouts
+ var method_layout_builder: PropertyLayoutBuilder[MMethod]
+ var attribute_layout_builder: PropertyLayoutBuilder[MAttribute]
+ if modelbuilder.toolcontext.opt_bm_typing.value then
+ method_layout_builder = new MMethodBMizer(self.mainmodule)
+ attribute_layout_builder = new MAttributeBMizer(self.mainmodule)
+ else if modelbuilder.toolcontext.opt_phmod_typing.value then
+ method_layout_builder = new MMethodHasher(new PHModOperator, self.mainmodule)
+ attribute_layout_builder = new MAttributeHasher(new PHModOperator, self.mainmodule)
+ else if modelbuilder.toolcontext.opt_phand_typing.value then
+ method_layout_builder = new MMethodHasher(new PHAndOperator, self.mainmodule)
+ attribute_layout_builder = new MAttributeHasher(new PHAndOperator, self.mainmodule)
+ else
+ method_layout_builder = new MMethodColorer(self.mainmodule)
+ attribute_layout_builder = new MAttributeColorer(self.mainmodule)
+ end
+
# methods coloration
- var method_coloring = new CLPropertyLayoutBuilder[MMethod](new MMethodColorer(mainmodule))
- var method_layout = method_coloring.build_layout(mclasses)
+ var method_layout = method_layout_builder.build_layout(mclasses)
self.method_tables = build_method_tables(mclasses, method_layout)
self.compile_color_consts(method_layout.pos)
self.method_layout = method_layout
# attributes coloration
- var attribute_coloring = new CLPropertyLayoutBuilder[MAttribute](new MAttributeColorer(mainmodule))
- var attr_layout = attribute_coloring.build_layout(mclasses)
+ var attr_layout = attribute_layout_builder.build_layout(mclasses)
self.attr_tables = build_attr_tables(mclasses, attr_layout)
self.compile_color_consts(attr_layout.pos)
self.attr_layout = attr_layout
return res
end
+ redef fun supercall(m: MMethodDef, recvtype: MClassType, args: Array[RuntimeVariable]): nullable RuntimeVariable
+ do
+ # FIXME implements a polymorphic access in tables
+ m = m.lookup_next_definition(m.mclassdef.mmodule, m.mclassdef.bound_mtype)
+ return self.call(m, recvtype, args)
+ end
+
redef fun vararg_instance(mpropdef, recv, varargs, elttype)
do
# A vararg must be stored into an new array