+ # Actually the name of the `mproperty`
+ redef fun name do return mproperty.name
+
+ # The full-name of mpropdefs combine the information about the `classdef` and the `mproperty`.
+ #
+ # Therefore the combination of identifiers is awful,
+ # the worst case being
+ #
+ # * a property "p::m::A::x"
+ # * redefined in a refinement of a class "q::n::B"
+ # * in a module "r::o"
+ # * so "r::o#q::n::B#p::m::A::x"
+ #
+ # Fortunately, the full-name is simplified when entities are repeated.
+ # For the previous case, the simplest form is "p#A#x".
+ redef var full_name is lazy do
+ var res = new FlatBuffer
+
+ # The first part is the mclassdef. Worst case is "r::o#q::n::B"
+ res.append mclassdef.full_name
+
+ res.append "#"
+
+ if mclassdef.mclass == mproperty.intro_mclassdef.mclass then
+ # intro are unambiguous in a class
+ res.append name
+ else
+ # Just try to simplify each part
+ if mclassdef.mmodule.mproject != mproperty.intro_mclassdef.mmodule.mproject then
+ # precise "p::m" only if "p" != "r"
+ res.append mproperty.intro_mclassdef.mmodule.full_name
+ res.append "::"
+ else if mproperty.visibility <= private_visibility then
+ # Same project ("p"=="q"), but private visibility,
+ # does the module part ("::m") need to be displayed
+ if mclassdef.mmodule.namespace_for(mclassdef.mclass.visibility) != mproperty.intro_mclassdef.mmodule.mproject then
+ res.append "::"
+ res.append mproperty.intro_mclassdef.mmodule.name
+ res.append "::"
+ end
+ end
+ if mclassdef.mclass != mproperty.intro_mclassdef.mclass then
+ # precise "B" only if not the same class than "A"
+ res.append mproperty.intro_mclassdef.name
+ res.append "::"
+ end
+ # Always use the property name "x"
+ res.append mproperty.name
+ end
+ return res.to_s
+ end
+
+ redef var c_name is lazy do
+ var res = new FlatBuffer
+ res.append mclassdef.c_name
+ res.append "___"
+ if mclassdef.mclass == mproperty.intro_mclassdef.mclass then
+ res.append name.to_cmangle
+ else
+ if mclassdef.mmodule != mproperty.intro_mclassdef.mmodule then
+ res.append mproperty.intro_mclassdef.mmodule.c_name
+ res.append "__"
+ end
+ if mclassdef.mclass != mproperty.intro_mclassdef.mclass then
+ res.append mproperty.intro_mclassdef.name.to_cmangle
+ res.append "__"
+ end
+ res.append mproperty.name.to_cmangle
+ end
+ return res.to_s
+ end
+
+ redef fun model do return mclassdef.model
+