nitc :: MPropDef :: _full_name
The full-name of mpropdefs combine the information about theclassdef
and the mproperty
.
nitc :: MPropDef :: _has_contract
flag to indicate is theMPropDef
has a contract
nitc :: MPropDef :: _has_supercall
Does the MPropDef contains a call to super or a call of a super-constructor?nitc :: MPropDef :: _is_after_all
nitc :: MPropDef :: _is_after_all
Does self have theafter_all
annotation?
nitc :: MPropDef :: _is_before
nitc :: MPropDef :: _is_before_all
nitc :: MPropDef :: _is_before_all
Does self have thebefore_all
annotation?
nitc :: MPropDef :: _mclassdef
The class definition where the property definition isnitc :: MPropDef :: defaultinit
nitc :: MPropDef :: full_name=
The full-name of mpropdefs combine the information about theclassdef
and the mproperty
.
nitc :: MPropDef :: has_contract
flag to indicate is theMPropDef
has a contract
nitc :: MPropDef :: has_contract=
flag to indicate is theMPropDef
has a contract
nitc :: MPropDef :: has_supercall
Does the MPropDef contains a call to super or a call of a super-constructor?nitc :: MPropDef :: has_supercall=
Does the MPropDef contains a call to super or a call of a super-constructor?nitc :: MPropDef :: is_after_all=
Does self have theafter_all
annotation?
nitc :: MPropDef :: is_before=
Does self have thebefore
annotation?
nitc :: MPropDef :: is_before_all=
Does self have thebefore_all
annotation?
nitc :: MPropDef :: lookup_next_definition
Return the next definition in linearization ofmtype
.
nitc :: MPropDef :: mclassdef=
The class definition where the property definition isnitc :: MPropDef :: mproperty=
The associated global propertynitc :: model_collect $ MPropDef :: collect_children
Collect all children definitions that directly depend onself
nitc :: model_collect $ MPropDef :: collect_linearization
Collectself
linearization anchored on mainmodule
nitc :: model_collect $ MPropDef :: collect_modifiers
Collect modifier keywords likeredef
, private
etc
nitc :: model_collect $ MPropDef :: collect_parents
Collect only the next definition ofself
nitc :: json_model $ MPropDef :: core_serialize_to
Actual serialization ofself
to serializer
nitc :: astbuilder $ MPropDef :: create_ast_representation
Build a ANode fromself
nitc :: html_model $ MPropDef :: css_classes
CSS classes used to decorateself
nitc :: html_model $ MPropDef :: html_namespace
Returnsfull_name
decorated with HTML links
nitc :: parse_annotations $ MPropDef :: is_after_all
Does self have theafter_all
annotation?
nitc :: parse_annotations $ MPropDef :: is_after_all=
Does self have theafter_all
annotation?
nitc :: parse_annotations $ MPropDef :: is_before=
Does self have thebefore
annotation?
nitc :: parse_annotations $ MPropDef :: is_before_all
Does self have thebefore_all
annotation?
nitc :: parse_annotations $ MPropDef :: is_before_all=
Does self have thebefore_all
annotation?
nitc :: json_model $ MPropDef :: json_namespace
Returnself.full_name
as an object that can be serialized to json.
nitc $ MPropDef :: mdoc_or_fallback
The documentation associated to the entity or their main nested entity.nitc :: model_index $ MPropDef :: mentity_kind_rank
Compare MEntity class kindnitc :: AnnotatedMEntity :: _annotations
Names of the annotations found onself
declaration
nitc :: MEntity :: _const_color
nitc :: MEntity :: _css_classes
CSS classes used to decorateself
nitc :: MEntity :: _deprecation
Is the entity deprecated?nitc :: MPropDef :: _full_name
The full-name of mpropdefs combine the information about theclassdef
and the mproperty
.
nitc :: MPropDef :: _has_contract
flag to indicate is theMPropDef
has a contract
nitc :: MPropDef :: _has_supercall
Does the MPropDef contains a call to super or a call of a super-constructor?nitc :: MEntity :: _html_full_name
The MEntityfull_name
escaped for HTML
nitc :: MPropDef :: _is_after_all
nitc :: MPropDef :: _is_after_all
Does self have theafter_all
annotation?
nitc :: MPropDef :: _is_before
nitc :: MPropDef :: _is_before_all
nitc :: MPropDef :: _is_before_all
Does self have thebefore_all
annotation?
nitc :: MEntity :: _is_broken
The indication that the entity did not pass some semantic verifications.nitc :: MPropDef :: _mclassdef
The class definition where the property definition isserialization :: Serializable :: accept_inspect_serializer_core
serialization :: Serializable :: accept_json_serializer
Refinable service to customize the serialization of this class to JSONserialization :: Serializable :: accept_msgpack_attribute_counter
Hook to customize the behavior of theAttributeCounter
serialization :: Serializable :: accept_msgpack_serializer
Hook to customize the serialization of this class to MessagePacknitc :: MEntity :: add_doc_to_infobox
Append an entry for the doc in the given infoboxserialization :: Serializable :: add_to_bundle
Called by[]=
to dynamically choose the appropriate method according
nitc :: AnnotatedMEntity :: annotations
Names of the annotations found onself
declaration
nitc :: AnnotatedMEntity :: annotations=
Names of the annotations found onself
declaration
core :: Object :: class_factory
Implementation used byget_class
to create the specific class.
nitc :: MEntity :: collect_ancestors
Collectself
ancestors (direct and indirect)
nitc :: MEntity :: collect_children
Collectself
children (direct descendants)
nitc :: MEntity :: collect_descendants
Collectself
descendants (direct and direct)
nitc :: MEntity :: collect_linearization
Collectself
linearization anchored on mainmodule
nitc :: MEntity :: collect_metrics
nitc :: MEntity :: collect_modifiers
Collect modifier keywords likeredef
, private
etc
nitc :: MEntity :: collect_parents
Collectself
parents (direct ancestors)
nitc :: MEntity :: const_color
nitc :: MEntity :: const_color=
nitc :: MEntity :: core_serialize_base
serialization :: Serializable :: core_serialize_to
Actual serialization ofself
to serializer
nitc :: MEntity :: create_ast_representation
Build a ANode fromself
nitc :: MEntity :: cs_comment
Returns the comment of this MEntity formatted for console.nitc :: MEntity :: cs_declaration
Returns the complete MEntity declaration (modifiers + name + signature).nitc :: MEntity :: cs_full_name
Returnsself.full_name
formatted for console
nitc :: MEntity :: cs_list_item
Returnsself
as a list element that can be displayed in console.
nitc :: MEntity :: cs_location
Source code location of this MEntity formatted for consolenitc :: MEntity :: cs_short_comment
Returns the comment of this MEntity formatted for console.nitc :: MEntity :: cs_signature
Returnsself
signature formatted for console.
nitc :: MEntity :: cs_source_code
Source code associated to this MEntity.nitc :: MEntity :: css_classes=
CSS classes used to decorateself
nitc :: MPropDef :: defaultinit
nitc :: HInfoBoxable :: defaultinit
nitc :: MEntity :: defaultinit
nitc :: AnnotatedMEntity :: defaultinit
core :: Object :: defaultinit
nitc :: MEntity :: deprecation=
Is the entity deprecated?nitc :: MEntity :: field_separator
serialization :: Serializable :: from_deserializer
Create an instance of this class from thedeserializer
nitc :: MPropDef :: full_name=
The full-name of mpropdefs combine the information about theclassdef
and the mproperty
.
nitc :: AnnotatedMEntity :: has_annotation
Doesself
contains annotation
in its declaration?
nitc :: MPropDef :: has_contract
flag to indicate is theMPropDef
has a contract
nitc :: MPropDef :: has_contract=
flag to indicate is theMPropDef
has a contract
nitc :: MPropDef :: has_supercall
Does the MPropDef contains a call to super or a call of a super-constructor?nitc :: MPropDef :: has_supercall=
Does the MPropDef contains a call to super or a call of a super-constructor?nitc :: MEntity :: hierarchy_poset
Build a poset representingself
in it's own hierarchy
nitc :: MEntity :: html_declaration
Returns the complete MEntity declaration decorated with HTMLnitc :: MEntity :: html_full_name=
The MEntityfull_name
escaped for HTML
nitc :: MEntity :: html_name=
The MEntity name escaped for HTMLnitc :: MEntity :: html_namespace
Returnsfull_name
decorated with HTML links
nitc :: MEntity :: html_signature
Returns the MEntity signature decorated with HTMLnitc :: HInfoBoxable :: infobox
An new infobox documenting the entitynitc :: MPropDef :: is_after_all=
Does self have theafter_all
annotation?
nitc :: MPropDef :: is_before=
Does self have thebefore
annotation?
nitc :: MPropDef :: is_before_all=
Does self have thebefore_all
annotation?
nitc :: MEntity :: is_broken=
The indication that the entity did not pass some semantic verifications.nitc :: MEntity :: is_fictive=
Isself
created for internal purpose?
core :: Object :: is_same_instance
Return true ifself
and other
are the same instance (i.e. same identity).
core :: Object :: is_same_serialized
Isself
the same as other
in a serialization context?
core :: Object :: is_same_type
Return true ifself
and other
have the same dynamic type.
nitc :: MEntity :: json_namespace
Returnself.full_name
as an object that can be serialized to json.
nitc :: MEntity :: line_separator
nitc :: MEntity :: linkto_text
Link to theself
with a specific text.
nitc :: MPropDef :: lookup_next_definition
Return the next definition in linearization ofmtype
.
nitc :: MPropDef :: mclassdef=
The class definition where the property definition isnitc :: MEntity :: mdoc_or_fallback
The documentation associated to the entity or their main nested entity.nitc :: MPropDef :: mproperty=
The associated global propertyserialization :: Serializable :: msgpack_extra_array_items
Hook to request a larger than usual metadata arraycore :: Object :: native_class_name
The class name of the object in CString format.core :: Object :: output_class_name
Display class name on stdout (debug only).mentity
nitc :: MEntity :: ratings_by_dimension
Get the ratings of adimension
serialization :: Serializable :: serialize_msgpack
Serializeself
to MessagePack bytes
serialization :: Serializable :: serialize_to
Serializeself
to serializer
serialization :: Serializable :: serialize_to_json
Serializeself
to JSON
serialization :: Serializable :: serialize_to_or_delay
Accept references or force direct serialization (usingserialize_to
)
nitc :: MEntity :: source_url
Render a HTML link for the MEntity locationserialization :: Serializable :: to_pretty_json
Serializeself
to plain pretty JSON
nitc :: MEntity :: tpl_module
Builds a dot UML package diagram entity fromself
v.enter_visit
on all nested entities.
nitc :: MEntity :: write_extra_doc
Extra auto documentation to append to thestream
nitc :: MEntity :: write_location
Location (file and line when available) of related declarationsSerializer::serialize
# A definition of a property (local property)
#
# Unlike `MProperty`, a `MPropDef` is a local definition that belong to a
# specific class definition (which belong to a specific module)
abstract class MPropDef
super MEntity
# The associated `MProperty` subclass.
# the two specialization hierarchy are symmetric
type MPROPERTY: MProperty
# Self class
type MPROPDEF: MPropDef
# The class definition where the property definition is
var mclassdef: MClassDef
# The associated global property
var mproperty: MPROPERTY
redef var location
redef fun visibility do return mproperty.visibility
init
do
mclassdef.mpropdefs.add(self)
mproperty.mpropdefs.add(self)
mclassdef.mpropdefs_by_property[mproperty] = self
if mproperty.intro_mclassdef == mclassdef then
assert not isset mproperty._intro
mproperty.intro = self
end
self.to_s = "{mclassdef}${mproperty}"
end
# 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.mpackage != mproperty.intro_mclassdef.mmodule.mpackage then
# precise "p::m" only if "p" != "r"
res.append mproperty.intro_mclassdef.mmodule.namespace_for(mproperty.visibility)
res.append "::"
else if mproperty.visibility <= private_visibility then
# Same package ("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.mpackage then
res.append "::"
res.append mproperty.intro_mclassdef.mmodule.name
res.append "::"
end
end
# precise "B" because it is not the same class than "A"
res.append mproperty.intro_mclassdef.name
res.append "::"
# 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
res.append mproperty.intro_mclassdef.name.to_cmangle
res.append "__"
res.append mproperty.name.to_cmangle
end
return res.to_s
end
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 is noinit
# Is self the definition that introduce the property?
fun is_intro: Bool do return isset mproperty._intro and mproperty.intro == self
# Return the next definition in linearization of `mtype`.
#
# This method is used to determine what method is called by a super.
#
# REQUIRE: `not mtype.need_anchor`
fun lookup_next_definition(mmodule: MModule, mtype: MType): MPROPDEF
do
assert not mtype.need_anchor
var mpropdefs = self.mproperty.lookup_all_definitions(mmodule, mtype)
var i = mpropdefs.iterator
while i.is_ok and i.item != self do i.next
assert has_property: i.is_ok
i.next
assert has_next_property: i.is_ok
return i.item
end
redef fun mdoc_or_fallback do return mdoc or else mproperty.mdoc_or_fallback
# Does self have the `before` annotation?
var is_before = false is writable
# Does self have the `before_all` annotation?
var is_before_all = false is writable
# Does self have the `after` annotation?
var is_after = false is writable
# Does self have the `after_all` annotation?
var is_after_all = false is writable
end
src/model/model.nit:2504,1--2648,3
redef class MPropDef
# Does the MPropDef contains a call to super or a call of a super-constructor?
# Subsequent phases of the frontend (esp. typing) set it if required
var has_supercall: Bool = false is writable
end
src/modelize/modelize_property.nit:511,1--515,3
redef class MPropDef
redef fun to_node(nodes: HashMap[MEntity, NeoNode], model_name: nullable String): NeoNode do
if nodes.has_key(self) then return nodes[self]
var node = make_node(nodes, model_name)
node.labels.add "MPropDef"
node.out_edges.add(new NeoEdge(node, "DEFINES", mproperty.to_node(nodes, model_name)))
node.labels.add self.class_name
return node
end
end
src/neo.nit:798,1--807,3
redef class MPropDef
type VISITOR: AbstractCompilerVisitor
end
src/compiler/abstract_compiler.nit:2524,1--2526,3
redef class MPropDef
super AnnotatedMEntity
redef var is_test is lazy do return has_annotation("test")
redef var is_before is lazy do return has_annotation("before")
redef var is_before_all is lazy do return has_annotation("before_all")
redef var is_after is lazy do return has_annotation("after")
redef var is_after_all is lazy do return has_annotation("after_all")
end
src/frontend/parse_annotations.nit:119,1--131,3
redef class MPropDef
redef fun create_ast_representation(astbuilder: nullable ASTBuilder): APropdef is abstract
end
src/astbuilder.nit:956,1--958,3
redef class MPropDef
super PropertyLayoutElement
end
src/compiler/separate_compiler.nit:2652,1--2654,3
redef class MPropDef
redef fun collect_modifiers do
var res = super
if not is_intro then
res.add "redef"
else
if mproperty.visibility != public_visibility then
res.add mproperty.visibility.to_s
end
end
var mprop = self
if mprop isa MVirtualTypeDef then
res.add "type"
else if mprop isa MMethodDef then
if mprop.is_abstract then
res.add "abstract"
else if mprop.is_intern then
res.add "intern"
end
if mprop.mproperty.is_init then
res.add "init"
else
res.add "fun"
end
else if mprop isa MAttributeDef then
res.add "var"
end
return res
end
redef fun collect_linearization(mainmodule) do
var mpropdefs = new Array[MPropDef]
var mentity = self
while not mentity.is_intro do
mpropdefs.add mentity
mentity = mentity.lookup_next_definition(mainmodule, mentity.mclassdef.bound_mtype)
end
mpropdefs.add mentity
mainmodule.linearize_mpropdefs(mpropdefs)
return mpropdefs
end
# Collect only the next definition of `self`
redef fun collect_parents(mainmodule, filter) do
var res = new HashSet[MENTITY]
var mpropdef = self
while not mpropdef.is_intro do
mpropdef = mpropdef.lookup_next_definition(mclassdef.mmodule, mclassdef.bound_mtype)
res.add mpropdef
end
return res
end
# Collect all children definitions that directly depend on `self`
redef fun collect_children(mainmodule, filter) do
var res = new HashSet[MENTITY]
for mpropdef in mproperty.collect_mpropdefs(filter) do
if mpropdef.collect_parents(mainmodule, filter).has(self) then res.add mpropdef
end
return res
end
end
src/model/model_collect.nit:1117,1--1179,3
redef class MPropDef
redef fun cs_icon(no_color) do
if is_intro then return visibility.cs_icon(no_color)
return visibility.cs_visibility_color("*", no_color)
end
end
src/doc/templates/term_model.nit:181,1--186,3
redef class MPropDef
redef fun mentity_kind_rank do return 7
end
src/model/model_index.nit:670,1--672,3
redef class MPropDef
redef fun infobox(v)
do
var res = new HInfoBox(v, to_s)
res.href = v.hrefto(self)
if not v.show_infobox then return res
if self isa MMethodDef then
var msignature = self.msignature
if msignature != null then res.new_field("fun").append(mproperty.name).add msignature.linkto(v)
else if self isa MAttributeDef then
var static_mtype = self.static_mtype
if static_mtype != null then res.new_field("fun").append(mproperty.name).add static_mtype.linkto(v)
else if self isa MVirtualTypeDef then
var bound = self.bound
if bound != null then res.new_field("add").append(mproperty.name).add bound.linkto(v)
else
res.new_field("wat?").append(mproperty.name)
end
if is_intro then
else
res.new_field("intro").add mproperty.intro.linkto_text(v, "in {mproperty.intro.mclassdef}")
end
add_doc_to_infobox(res)
if mproperty.mpropdefs.length > 1 then
var c = res.new_dropdown("redef", "redefinitions")
for x in mproperty.mpropdefs do
c.open("li").add x.linkto_text(v, "in {x.mclassdef}")
end
end
return res
end
end
src/htmlight.nit:540,1--573,3
redef class MPropDef
redef fun css_classes do return super + mproperty.css_classes
redef fun html_namespace do
var tpl = new Template
tpl.add mclassdef.html_namespace
tpl.add " :: "
tpl.add html_link
return tpl
end
redef fun html_icon do
if is_intro then
return new BSIcon("plus", css_classes)
end
return new BSIcon("asterisk", css_classes)
end
end
src/doc/templates/html_model.nit:221,1--238,3
redef class MPropDef
redef fun core_serialize_to(v) do
super
if is_intro then
v.serialize_attribute("is_intro", true)
end
end
redef fun json_namespace do
var res = new JsonNamespace
res.add_all mclassdef.json_namespace
res.add "$"
if mclassdef.mclass == mproperty.intro_mclassdef.mclass then
res.add to_json_ref
else
if mclassdef.mmodule.mpackage != mproperty.intro_mclassdef.mmodule.mpackage then
res.add_all mproperty.intro_mclassdef.mmodule.ns_for(mproperty.visibility)
res.add "::"
else if mproperty.visibility <= private_visibility then
if mclassdef.mmodule.namespace_for(mclassdef.mclass.visibility) != mproperty.intro_mclassdef.mmodule.mpackage then
res.add "::"
res.add mproperty.intro_mclassdef.mmodule.to_json_ref
res.add "::"
end
end
if mclassdef.mclass != mproperty.intro_mclassdef.mclass then
res.add mproperty.intro_mclassdef.to_json_ref
res.add "::"
end
res.add to_json_ref
end
return res
end
end
src/doc/templates/json_model.nit:247,1--281,3