end
end
+ redef fun model do return intro_mmodule.model
+
# All class definitions (introduction and refinements)
var mclassdefs: Array[MClassDef] = new Array[MClassDef]
# Actually the name of the `mclass`
redef fun name do return mclass.name
+ redef fun model do return mmodule.model
+
# All declared super-types
# FIXME: quite ugly but not better idea yet
var supertypes: Array[MClassType] = new Array[MClassType]
abstract class MType
super MEntity
- # The model of the type
- fun model: Model is abstract
+ redef fun name do return to_s
# Return true if `self` is an subtype of `sup`.
# The typing is done using the standard typing policy of Nit.
# A parameter in a signature
class MParameter
+ super MEntity
+
# The name of the parameter
- var name: String
+ redef var name: String
# The static type of the parameter
var mtype: MType
# Is the parameter a vararg?
var is_vararg: Bool
+ init(name: String, mtype: MType, is_vararg: Bool) do
+ self.name = name
+ self.mtype = mtype
+ self.is_vararg = is_vararg
+ end
+
redef fun to_s
do
if is_vararg then
var res = new MParameter(self.name, newtype, self.is_vararg)
return res
end
+
+ redef fun model do return mtype.model
end
# A service (global property) that generalize method, attribute, etc.
# associated definition, this method will abort
fun intro: MPROPDEF do return mpropdefs.first
+ redef fun model do return intro.model
+
# Alias for `name`
redef fun to_s do return name
# Actually the name of the `mproperty`
redef fun name do return mproperty.name
+ redef fun model do return mclassdef.model
+
# Internal name combining the module, the class and the property
# Example: "mymodule#MyClass#mymethod"
redef var to_s: String