nitc :: MModule :: _compiled_callbacks
nitc :: MModule :: _compiled_ffi_methods
Avoid the compile a ffi propdef more than oncenitc :: MModule :: _extra_java_files
Extra Java files to compile with the modulenitc :: MModule :: _ffi_callbacks
Callbacks used by this module, classified by languagenitc :: MModule :: _ffi_files
All FFI files linked to this modulenitc :: MModule :: _first_real_mmodule
Get the non-is_fictive
module on which self
is based on.
nitc :: MModule :: _foreign_callbacks
nitc :: MModule :: _generate_actor_submodule
Do we need to generate the actor submodule ?nitc :: MModule :: _header_dependencies
Modules with public foreign code blocks (C header)nitc :: MModule :: _in_importation
The view of the module in themodel.mmodule_importation_hierarchy
nitc :: MModule :: _intro_mclasses
All the classes introduced in the modulenitc :: MModule :: _intrude_mmodules
nitc :: MModule :: _is_generated
Isself
a module generated by a tool?
nitc :: MModule :: _java_file
Java source file extracted from user FFI code with generated structurenitc :: MModule :: _mclassdef_sorter
nitc :: MModule :: _mclassdefs
All the class definitions of the modulenitc :: MModule :: _mpropdef_sorter
nitc :: MModule :: _native_array_class
The primitive classNativeArray
nitc :: MModule :: _nitni_ccu
CCompilationUnit
used for nitni signatures and code specific to the compiler
nitc :: MModule :: _objc_file
nitc :: MModule :: _objc_imported_headers
Imported modules with public Objective-C code blocksnitc :: MModule :: _object_type
The primitive typeObject
, the root of the class hierarchy
nitc :: MModule :: _pkgconfigs
Additional libraries needed for the compilationnitc :: MModule :: _pointer_type
The typePointer
, super class to all extern classes
nitc :: MModule :: _present_languages
Foreign language used in this AModulenitc :: MModule :: _private_mmodules
nitc :: MModule :: _properties_cache
nitc :: MModule :: _public_mmodules
nitc :: MModule :: _serializable_type
Get the type of the classSerializable
nitc :: MModule :: add_mclassdef
Adds another class definition in the modue.nitc :: MModule :: array_class=
The primitive classArray
nitc :: MModule :: before_all
Methods tagged withbefore_all
at the module level (in Sys
)
nitc :: MModule :: bool_type=
The primitive typeBool
nitc :: MModule :: byte_type=
The primitive typeByte
nitc :: MModule :: c_namespace_for
C identifier version ofnamespace_for
.
nitc :: MModule :: c_string_type=
The primitive typeCString
nitc :: MModule :: char_type=
The primitive typeChar
nitc :: MModule :: check_callback_compilation
Returns true if callbacks has yet to be generated and register it as being generatednitc :: MModule :: collect_imported_mclasses
Collect all classes imported fromself
parents
nitc :: MModule :: collect_intro_attributes
Collect attributes introduced inself
nitc :: MModule :: collect_intro_inits
Collect all inits introduced inself
nitc :: MModule :: collect_intro_mclassdefs
Collect all class definitions introduced inself
nitc :: MModule :: collect_intro_mclasses
Collect all classes introduced inself
nitc :: MModule :: collect_intro_methods
Collect methods introduced inself
(without inits)
nitc :: MModule :: collect_intro_mproperties
Collect all properties introduced inself
nitc :: MModule :: collect_intro_vts
Collect virtual types introduced inself
nitc :: MModule :: collect_linker_libs
Give requided addinional system libraries (as given to LD_LIBS)nitc :: MModule :: collect_local_mclassdefs
Collect all class definitions introduced and refined inself
nitc :: MModule :: collect_local_mclasses
Collect all classes introduced and refined inself
nitc :: MModule :: collect_redef_mclassdefs
Collect all class definitions refined inself
nitc :: MModule :: collect_redef_mclasses
Collect all classes refined inself
nitc :: MModule :: collect_redef_mproperties
Collect properties redefined inself
nitc :: MModule :: compiled_callbacks
nitc :: MModule :: compiled_callbacks=
nitc :: MModule :: compiled_ffi_methods
Avoid the compile a ffi propdef more than oncenitc :: MModule :: compiled_ffi_methods=
Avoid the compile a ffi propdef more than oncenitc :: MModule :: defaultinit
nitc :: MModule :: ensure_java_files
Set up the templates of the Java implementation classnitc :: MModule :: ensure_linking_callback_methods
Compile C code to call JNI and link C callbacks implementations to Java extern methodsnitc :: MModule :: extra_java_files
Extra Java files to compile with the modulenitc :: MModule :: extra_java_files=
Extra Java files to compile with the modulenitc :: MModule :: ffi_callbacks
Callbacks used by this module, classified by languagenitc :: MModule :: ffi_callbacks=
Callbacks used by this module, classified by languagenitc :: MModule :: ffi_files=
All FFI files linked to this modulenitc :: MModule :: finalizable_type
The primitive typeFinalizable
nitc :: MModule :: finalize_ffi
Write FFI and nitni results to filenitc :: MModule :: finalize_ffi_wrapper
Complete the compilation of the FFI codenitc :: MModule :: first_real_mmodule
Get the non-is_fictive
module on which self
is based on.
nitc :: MModule :: first_real_mmodule=
Get the non-is_fictive
module on which self
is based on.
nitc :: MModule :: flatten_mclass_hierarchy
Full hierarchy of introduced and imported classes.nitc :: MModule :: float_type=
The primitive typeFloat
nitc :: MModule :: foreign_callbacks
nitc :: MModule :: foreign_callbacks=
nitc :: MModule :: full_name=
The canonical name of the module.nitc :: MModule :: generate_actor_submodule
Do we need to generate the actor submodule ?nitc :: MModule :: generate_actor_submodule=
Do we need to generate the actor submodule ?nitc :: MModule :: get_primitive_class
Force to get the primitive class namedname
or abort
nitc :: MModule :: has_mclass
Does the current module has a given classmclass
?
nitc :: MModule :: header_dependencies
Modules with public foreign code blocks (C header)nitc :: MModule :: header_dependencies=
Modules with public foreign code blocks (C header)nitc :: MModule :: impl_java_class_name
Name of the generated Java class where to store all implementation methods of this modulenitc :: MModule :: in_importation
The view of the module in themodel.mmodule_importation_hierarchy
nitc :: MModule :: in_importation=
The view of the module in themodel.mmodule_importation_hierarchy
nitc :: MModule :: insert_compiler_options
Tell the C compiler where to find jni.h and how to link with libjvmnitc :: MModule :: int16_type=
The primitive typeInt16
nitc :: MModule :: int32_type=
The primitive typeInt32
nitc :: MModule :: int8_type=
The primitive typeInt8
nitc :: MModule :: intro_mclasses
All the classes introduced in the modulenitc :: MModule :: intro_mclasses=
All the classes introduced in the modulenitc :: MModule :: intrude_mmodules
nitc :: MModule :: intrude_mmodules=
nitc :: MModule :: is_generated=
Isself
a module generated by a tool?
nitc :: MModule :: is_visible
Return true if a class or a property introduced inintro_mmodule
with a visibility of visibility
is visible in self.
nitc :: MModule :: java_file=
Java source file extracted from user FFI code with generated structurenitc :: MModule :: linearize_mclassdefs
Sort a given array of class definitions using the linearization order of the modulenitc :: MModule :: linearize_mclasses
Sort a given array of classes using the linearization order of the modulenitc :: MModule :: linearize_mpropdefs
Sort a given array of property definitions using the linearization order of the modulenitc :: MModule :: local_target_platform
nitc :: MModule :: make_module
nitc :: MModule :: makefile_path
nitc :: MModule :: mclassdef_sorter
nitc :: MModule :: mclassdef_sorter=
nitc :: MModule :: mclassdefs
All the class definitions of the modulenitc :: MModule :: mclassdefs=
All the class definitions of the modulenitc :: MModule :: mpropdef_sorter
nitc :: MModule :: mpropdef_sorter=
nitc :: MModule :: namespace_for
The namespace used for entities according to their visibilityv
.
nitc :: MModule :: native_array_class
The primitive classNativeArray
nitc :: MModule :: native_array_class=
The primitive classNativeArray
nitc :: MModule :: native_array_type
A primitive type ofNativeArray
CCompilationUnit
used for nitni signatures and code specific to the compiler
nitc :: MModule :: nitni_ccu=
CCompilationUnit
used for nitni signatures and code specific to the compiler
nitc :: MModule :: objc_file=
nitc :: MModule :: objc_imported_headers
Imported modules with public Objective-C code blocksnitc :: MModule :: objc_imported_headers=
Imported modules with public Objective-C code blocksnitc :: MModule :: object_type
The primitive typeObject
, the root of the class hierarchy
nitc :: MModule :: object_type=
The primitive typeObject
, the root of the class hierarchy
nitc :: MModule :: pkgconfigs
Additional libraries needed for the compilationnitc :: MModule :: pkgconfigs=
Additional libraries needed for the compilationnitc :: MModule :: pointer_type
The typePointer
, super class to all extern classes
nitc :: MModule :: pointer_type=
The typePointer
, super class to all extern classes
nitc :: MModule :: present_languages
Foreign language used in this AModulenitc :: MModule :: present_languages=
Foreign language used in this AModulenitc :: MModule :: private_mmodules
nitc :: MModule :: private_mmodules=
nitc :: MModule :: properties
AllMProperty
associated to all MClassDef
of mclass
nitc :: MModule :: properties_cache
nitc :: MModule :: properties_cache=
nitc :: MModule :: public_mmodules
nitc :: MModule :: public_mmodules=
nitc :: MModule :: serializable_type
Get the type of the classSerializable
nitc :: MModule :: serializable_type=
Get the type of the classSerializable
nitc :: MModule :: set_imported_mmodules
Register the imported modules (ie "import some_module") and packages importation graphnitc :: MModule :: set_visibility_for
Set the visibility of an imported modulenitc :: MModule :: string_type=
The primitive typeString
Sys
, the main type of the program, if any
nitc :: MModule :: target_platform
Recursively get the platform targeted by this module or imported modulesnitc :: MModule :: try_get_primitive_method
Try to get the primitive method namedname
on the type recv
nitc :: MModule :: uint16_type=
The primitive typeUInt16
nitc :: MModule :: uint32_type=
The primitive typeUInt32
nitc :: MModule :: unsafe_update_hierarchy_cache
Adds a class definition insideflatten_mclass_hierarchy_cache
without
nitc :: MModule :: visibility_for
Return the visibility level of an imported modulem
nitc :: model_collect $ MModule :: collect_ancestors
Collect all modules directly imported byself
nitc :: model_collect $ MModule :: collect_children
Collect all modules that directly importself
nitc :: model_collect $ MModule :: collect_descendants
Collect all module descendants ofself
(direct and transitive imports)
nitc :: light $ MModule :: collect_linker_libs
Give requided addinional system libraries (as given to LD_LIBS)nitc :: api_metrics $ MModule :: collect_metrics
nitc :: model_collect $ MModule :: collect_modifiers
Collect modifier keywords likeredef
, private
etc
nitc :: model_collect $ MModule :: collect_parents
Collect all modules directly imported byself
nitc :: light $ MModule :: finalize_ffi
Write FFI and nitni results to filenitc :: compiler_ffi $ MModule :: finalize_ffi
Write FFI and nitni results to filenitc :: ffi $ MModule :: finalize_ffi_wrapper
Complete the compilation of the FFI codenitc :: html_model $ MModule :: html_namespace
Returnsfull_name
decorated with HTML links
nitc :: json_model $ MModule :: json_namespace
Returnself.full_name
as an object that can be serialized to json.
nitc :: model_index $ MModule :: mentity_kind_rank
Compare MEntity class kindnitc $ MModule :: parent_concern
The concern that containsself
or null if self
is the root of the concern hierarchy
nitc :: commands_graph $ MModule :: to_dot_node
Returnself
as a DotNode
nitc :: uml_module $ MModule :: tpl_module
Builds a dot UML package diagram entity fromself
nitc :: model_visitor $ MModule :: visit_all
Visit all the classes and class definitions of the module.nitc :: vim_autocomplete $ MModule :: write_extra_doc
Extra auto documentation to append to thestream
nitc :: AnnotatedMEntity :: _annotations
Names of the annotations found onself
declaration
nitc :: MModule :: _compiled_callbacks
nitc :: MModule :: _compiled_ffi_methods
Avoid the compile a ffi propdef more than oncenitc :: MEntity :: _const_color
nitc :: MEntity :: _css_classes
CSS classes used to decorateself
nitc :: MEntity :: _deprecation
Is the entity deprecated?nitc :: MModule :: _extra_java_files
Extra Java files to compile with the modulenitc :: MModule :: _ffi_callbacks
Callbacks used by this module, classified by languagenitc :: MModule :: _ffi_files
All FFI files linked to this modulenitc :: MModule :: _first_real_mmodule
Get the non-is_fictive
module on which self
is based on.
nitc :: MModule :: _foreign_callbacks
nitc :: MModule :: _generate_actor_submodule
Do we need to generate the actor submodule ?nitc :: MModule :: _header_dependencies
Modules with public foreign code blocks (C header)nitc :: MEntity :: _html_full_name
The MEntityfull_name
escaped for HTML
nitc :: MModule :: _in_importation
The view of the module in themodel.mmodule_importation_hierarchy
nitc :: MModule :: _intro_mclasses
All the classes introduced in the modulenitc :: MModule :: _intrude_mmodules
nitc :: MEntity :: _is_broken
The indication that the entity did not pass some semantic verifications.nitc :: MModule :: _is_generated
Isself
a module generated by a tool?
nitc :: MModule :: _java_file
Java source file extracted from user FFI code with generated structurenitc :: MModule :: _mclassdef_sorter
nitc :: MModule :: _mclassdefs
All the class definitions of the modulenitc :: MModule :: _mpropdef_sorter
nitc :: MModule :: _native_array_class
The primitive classNativeArray
nitc :: MModule :: _nitni_ccu
CCompilationUnit
used for nitni signatures and code specific to the compiler
nitc :: MModule :: _objc_file
nitc :: MModule :: _objc_imported_headers
Imported modules with public Objective-C code blocksnitc :: MModule :: _object_type
The primitive typeObject
, the root of the class hierarchy
nitc :: MModule :: _pkgconfigs
Additional libraries needed for the compilationnitc :: MModule :: _pointer_type
The typePointer
, super class to all extern classes
nitc :: MModule :: _present_languages
Foreign language used in this AModulenitc :: MModule :: _private_mmodules
nitc :: MModule :: _properties_cache
nitc :: MModule :: _public_mmodules
nitc :: MModule :: _serializable_type
Get the type of the classSerializable
serialization :: 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 infoboxnitc :: MModule :: add_mclassdef
Adds another class definition in the modue.serialization :: 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
nitc :: MModule :: array_class=
The primitive classArray
nitc :: MModule :: before_all
Methods tagged withbefore_all
at the module level (in Sys
)
nitc :: MModule :: bool_type=
The primitive typeBool
nitc :: MModule :: byte_type=
The primitive typeByte
nitc :: MModule :: c_namespace_for
C identifier version ofnamespace_for
.
nitc :: MModule :: c_string_type=
The primitive typeCString
nitc :: MModule :: char_type=
The primitive typeChar
nitc :: MModule :: check_callback_compilation
Returns true if callbacks has yet to be generated and register it as being generatedcore :: 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 :: MModule :: collect_imported_mclasses
Collect all classes imported fromself
parents
nitc :: MModule :: collect_intro_attributes
Collect attributes introduced inself
nitc :: MModule :: collect_intro_inits
Collect all inits introduced inself
nitc :: MModule :: collect_intro_mclassdefs
Collect all class definitions introduced inself
nitc :: MModule :: collect_intro_mclasses
Collect all classes introduced inself
nitc :: MModule :: collect_intro_methods
Collect methods introduced inself
(without inits)
nitc :: MModule :: collect_intro_mproperties
Collect all properties introduced inself
nitc :: MModule :: collect_intro_vts
Collect virtual types introduced inself
nitc :: MEntity :: collect_linearization
Collectself
linearization anchored on mainmodule
nitc :: MModule :: collect_linker_libs
Give requided addinional system libraries (as given to LD_LIBS)nitc :: MModule :: collect_local_mclassdefs
Collect all class definitions introduced and refined inself
nitc :: MModule :: collect_local_mclasses
Collect all classes introduced and refined inself
nitc :: MEntity :: collect_metrics
nitc :: MEntity :: collect_modifiers
Collect modifier keywords likeredef
, private
etc
nitc :: MEntity :: collect_parents
Collectself
parents (direct ancestors)
nitc :: MModule :: collect_redef_mclassdefs
Collect all class definitions refined inself
nitc :: MModule :: collect_redef_mclasses
Collect all classes refined inself
nitc :: MModule :: collect_redef_mproperties
Collect properties redefined inself
nitc :: MModule :: compiled_callbacks
nitc :: MModule :: compiled_callbacks=
nitc :: MModule :: compiled_ffi_methods
Avoid the compile a ffi propdef more than oncenitc :: MModule :: compiled_ffi_methods=
Avoid the compile a ffi propdef more than oncenitc :: 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 :: MConcern :: defaultinit
nitc :: MModule :: defaultinit
nitc :: HInfoBoxable :: defaultinit
core :: Object :: defaultinit
nitc :: AnnotatedMEntity :: defaultinit
nitc :: MEntity :: defaultinit
nitc :: MEntity :: deprecation=
Is the entity deprecated?nitc :: MModule :: ensure_java_files
Set up the templates of the Java implementation classnitc :: MModule :: ensure_linking_callback_methods
Compile C code to call JNI and link C callbacks implementations to Java extern methodsnitc :: MModule :: extra_java_files
Extra Java files to compile with the modulenitc :: MModule :: extra_java_files=
Extra Java files to compile with the modulenitc :: MModule :: ffi_callbacks
Callbacks used by this module, classified by languagenitc :: MModule :: ffi_callbacks=
Callbacks used by this module, classified by languagenitc :: MModule :: ffi_files=
All FFI files linked to this modulenitc :: MEntity :: field_separator
nitc :: MModule :: finalizable_type
The primitive typeFinalizable
nitc :: MModule :: finalize_ffi
Write FFI and nitni results to filenitc :: MModule :: finalize_ffi_wrapper
Complete the compilation of the FFI codenitc :: MModule :: first_real_mmodule
Get the non-is_fictive
module on which self
is based on.
nitc :: MModule :: first_real_mmodule=
Get the non-is_fictive
module on which self
is based on.
nitc :: MModule :: flatten_mclass_hierarchy
Full hierarchy of introduced and imported classes.nitc :: MModule :: float_type=
The primitive typeFloat
nitc :: MModule :: foreign_callbacks
nitc :: MModule :: foreign_callbacks=
serialization :: Serializable :: from_deserializer
Create an instance of this class from thedeserializer
nitc :: MModule :: full_name=
The canonical name of the module.nitc :: MModule :: generate_actor_submodule
Do we need to generate the actor submodule ?nitc :: MModule :: generate_actor_submodule=
Do we need to generate the actor submodule ?nitc :: MModule :: get_primitive_class
Force to get the primitive class namedname
or abort
nitc :: AnnotatedMEntity :: has_annotation
Doesself
contains annotation
in its declaration?
nitc :: MModule :: has_mclass
Does the current module has a given classmclass
?
nitc :: MModule :: header_dependencies
Modules with public foreign code blocks (C header)nitc :: MModule :: header_dependencies=
Modules with public foreign code blocks (C header)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 :: MModule :: impl_java_class_name
Name of the generated Java class where to store all implementation methods of this modulenitc :: MModule :: in_importation
The view of the module in themodel.mmodule_importation_hierarchy
nitc :: MModule :: in_importation=
The view of the module in themodel.mmodule_importation_hierarchy
nitc :: HInfoBoxable :: infobox
An new infobox documenting the entitynitc :: MModule :: insert_compiler_options
Tell the C compiler where to find jni.h and how to link with libjvmnitc :: MModule :: int16_type=
The primitive typeInt16
nitc :: MModule :: int32_type=
The primitive typeInt32
nitc :: MModule :: int8_type=
The primitive typeInt8
nitc :: MModule :: intro_mclasses
All the classes introduced in the modulenitc :: MModule :: intro_mclasses=
All the classes introduced in the modulenitc :: MModule :: intrude_mmodules
nitc :: MModule :: intrude_mmodules=
nitc :: MEntity :: is_broken=
The indication that the entity did not pass some semantic verifications.nitc :: MEntity :: is_fictive=
Isself
created for internal purpose?
nitc :: MModule :: is_generated=
Isself
a module generated by a tool?
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 :: MModule :: is_visible
Return true if a class or a property introduced inintro_mmodule
with a visibility of visibility
is visible in self.
nitc :: MModule :: java_file=
Java source file extracted from user FFI code with generated structurenitc :: MEntity :: json_namespace
Returnself.full_name
as an object that can be serialized to json.
nitc :: MEntity :: line_separator
nitc :: MModule :: linearize_mclassdefs
Sort a given array of class definitions using the linearization order of the modulenitc :: MModule :: linearize_mclasses
Sort a given array of classes using the linearization order of the modulenitc :: MModule :: linearize_mpropdefs
Sort a given array of property definitions using the linearization order of the modulenitc :: MEntity :: linkto_text
Link to theself
with a specific text.
nitc :: MModule :: local_target_platform
nitc :: MModule :: make_module
nitc :: MModule :: makefile_path
nitc :: MModule :: mclassdef_sorter
nitc :: MModule :: mclassdef_sorter=
nitc :: MModule :: mclassdefs
All the class definitions of the modulenitc :: MModule :: mclassdefs=
All the class definitions of the modulenitc :: MEntity :: mdoc_or_fallback
The documentation associated to the entity or their main nested entity.nitc :: MModule :: mpropdef_sorter
nitc :: MModule :: mpropdef_sorter=
serialization :: Serializable :: msgpack_extra_array_items
Hook to request a larger than usual metadata arraynitc :: MModule :: namespace_for
The namespace used for entities according to their visibilityv
.
nitc :: MModule :: native_array_class
The primitive classNativeArray
nitc :: MModule :: native_array_class=
The primitive classNativeArray
nitc :: MModule :: native_array_type
A primitive type ofNativeArray
core :: Object :: native_class_name
The class name of the object in CString format.CCompilationUnit
used for nitni signatures and code specific to the compiler
nitc :: MModule :: nitni_ccu=
CCompilationUnit
used for nitni signatures and code specific to the compiler
nitc :: MModule :: objc_file=
nitc :: MModule :: objc_imported_headers
Imported modules with public Objective-C code blocksnitc :: MModule :: objc_imported_headers=
Imported modules with public Objective-C code blocksnitc :: MModule :: object_type
The primitive typeObject
, the root of the class hierarchy
nitc :: MModule :: object_type=
The primitive typeObject
, the root of the class hierarchy
core :: Object :: output_class_name
Display class name on stdout (debug only).nitc :: MConcern :: parent_concern
The concern that containsself
or null if self
is the root of the concern hierarchy
nitc :: MModule :: pkgconfigs
Additional libraries needed for the compilationnitc :: MModule :: pkgconfigs=
Additional libraries needed for the compilationnitc :: MModule :: pointer_type
The typePointer
, super class to all extern classes
nitc :: MModule :: pointer_type=
The typePointer
, super class to all extern classes
nitc :: MModule :: present_languages
Foreign language used in this AModulenitc :: MModule :: present_languages=
Foreign language used in this AModulenitc :: MModule :: private_mmodules
nitc :: MModule :: private_mmodules=
nitc :: MModule :: properties
AllMProperty
associated to all MClassDef
of mclass
nitc :: MModule :: properties_cache
nitc :: MModule :: properties_cache=
nitc :: MModule :: public_mmodules
nitc :: MModule :: public_mmodules=
mentity
nitc :: MEntity :: ratings_by_dimension
Get the ratings of adimension
nitc :: MModule :: serializable_type
Get the type of the classSerializable
nitc :: MModule :: serializable_type=
Get the type of the classSerializable
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 :: MModule :: set_imported_mmodules
Register the imported modules (ie "import some_module") and packages importation graphnitc :: MModule :: set_visibility_for
Set the visibility of an imported modulenitc :: MEntity :: source_url
Render a HTML link for the MEntity locationnitc :: MModule :: string_type=
The primitive typeString
Sys
, the main type of the program, if any
nitc :: MModule :: target_platform
Recursively get the platform targeted by this module or imported modulesserialization :: Serializable :: to_pretty_json
Serializeself
to plain pretty JSON
nitc :: MEntity :: tpl_module
Builds a dot UML package diagram entity fromself
nitc :: MModule :: try_get_primitive_method
Try to get the primitive method namedname
on the type recv
nitc :: MModule :: uint16_type=
The primitive typeUInt16
nitc :: MModule :: uint32_type=
The primitive typeUInt32
nitc :: MModule :: unsafe_update_hierarchy_cache
Adds a class definition insideflatten_mclass_hierarchy_cache
without
nitc :: MModule :: visibility_for
Return the visibility level of an imported modulem
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 Nit module is usually associated with a Nit source file.
class MModule
super MConcern
# The model considered
redef var model
# The group of module in the package if any
var mgroup: nullable MGroup
# The path of the module source, if any
#
# safe alias to `location.file.filepath`
fun filepath: nullable String do
var res = self.location.file
if res == null then return null
return res.filename
end
# The package of the module if any
# Safe alias for `mgroup.mpackage`
fun mpackage: nullable MPackage
do
var g = mgroup
if g == null then return null else return g.mpackage
end
# The short name of the module
redef var name
redef var location is writable
# Alias for `name`
redef fun to_s do return self.name
# The view of the module in the `model.mmodule_importation_hierarchy`
var in_importation: POSetElement[MModule] is noinit
# The canonical name of the module.
#
# It is usually the `name` prefixed by the package's name.
# Example: `"package::name"`
#
# Default modules use a doubled name to distinguish them from the package name.
# E.g.: `"core::core"`
#
# If the module is package-less, then the short-name is used alone.
redef var full_name is lazy do
var mgroup = self.mgroup
if mgroup == null then
return self.name
else
return "{mgroup.mpackage.name}::{self.name}"
end
end
# The namespace used for entities according to their visibility `v`.
#
# Public entities use only the package as a namespace.
# Private entities use the `full_name` (i.e. "package::module")
#
# This method is used by entities to implement their `full_name`.
fun namespace_for(v: MVisibility): String do
if v <= private_visibility then return full_name
var mgroup = self.mgroup
if mgroup == null then
return full_name
else
return mgroup.mpackage.full_name
end
end
# Return the name of the global C identifier associated to `self`.
# This name is used to prefix files and other C identifiers associated with `self`.
redef var c_name is lazy do
var g = mgroup
var res
if g != null and g.mpackage.name != name then
res = g.mpackage.name.to_cmangle + "__" + name.to_cmangle
else
res = name.to_cmangle
end
return res
end
# C identifier version of `namespace_for`.
# See `c_name`
#
# This method is used by entities to implement their `c_name`.
fun c_namespace_for(v: MVisibility): String do
if v <= private_visibility then return c_name
var mgroup = self.mgroup
if mgroup == null then
return c_name
else
return mgroup.mpackage.c_name
end
end
# Create a new empty module and register it to a model
init
do
model.mmodules_by_name.add_one(name, self)
model.mmodules.add(self)
var mgroup = self.mgroup
if mgroup != null then
mgroup.mmodules.add(self)
if mgroup.name == name then
assert mgroup.default_mmodule == null
mgroup.default_mmodule = self
end
end
self.in_importation = model.mmodule_importation_hierarchy.add_node(self)
end
# Register the imported modules (ie "import some_module") and packages importation graph
# In the same time it register the imported package
# The visibility must be set with `set_visibility_for`.
fun set_imported_mmodules(imported_mmodules: Array[MModule])
do
for m in imported_mmodules do
self.model.mmodule_importation_hierarchy.add_edge(self, m)
var actual_mpackage = self.mpackage
var imported_mpackage = m.mpackage
if actual_mpackage != null and imported_mpackage != null then
# Register the imported package
self.model.mpackage_importation_graph.add_arc(actual_mpackage, imported_mpackage)
end
end
end
private var intrude_mmodules = new HashSet[MModule]
private var public_mmodules = new HashSet[MModule]
private var private_mmodules = new HashSet[MModule]
# Return the visibility level of an imported module `m`
fun visibility_for(m: MModule): MVisibility
do
if m == self then return intrude_visibility
if self.intrude_mmodules.has(m) then return intrude_visibility
if self.public_mmodules.has(m) then return public_visibility
if self.private_mmodules.has(m) then return private_visibility
return none_visibility
end
# Set the visibility of an imported module
# REQUIRE: the visibility of the modules imported by `m` are already set for `m`
fun set_visibility_for(m: MModule, v: MVisibility)
do
if v == intrude_visibility then
self.intrude_mmodules.add(m)
self.intrude_mmodules.add_all(m.intrude_mmodules)
self.public_mmodules.add_all(m.public_mmodules)
self.private_mmodules.add_all(m.private_mmodules)
else if v == public_visibility then
self.public_mmodules.add(m)
self.public_mmodules.add_all(m.intrude_mmodules)
self.public_mmodules.add_all(m.public_mmodules)
else if v == private_visibility then
self.private_mmodules.add(m)
self.private_mmodules.add_all(m.intrude_mmodules)
self.private_mmodules.add_all(m.public_mmodules)
else
print "{self} visibility for {m} = {v}"
abort # invalid visibility
end
end
# Return true if a class or a property introduced in `intro_mmodule` with a visibility of `visibility` is visible in self.
fun is_visible(intro_mmodule: MModule, visibility: MVisibility): Bool
do
var v = visibility_for(intro_mmodule)
if v == intrude_visibility then
return visibility >= private_visibility
else if v == public_visibility then
return visibility > private_visibility
else if v == private_visibility then
return visibility > private_visibility
else if v == none_visibility then
return false
else
abort
end
end
# Is `self` a module generated by a tool?
#
# This flag has no effect on the semantic.
# It is only intended on software engineering software to discriminate computer-generated modules from human-written ones.
var is_generated: Bool = false is writable
# Get the non-`is_fictive` module on which `self` is based on.
#
# On non-fictive module, this returns `self`.
# On fictive modules, this is used to refer the module which `self` is based on.
#
# This attribute should be set when a fictive module is created. See `is_fictive`.
var first_real_mmodule: MModule = self is writable
redef fun parent_concern do return mgroup
end
src/model/mmodule.nit:73,1--273,3
redef class MModule
# All the classes introduced in the module
var intro_mclasses = new Array[MClass]
# All the class definitions of the module
# (introduction and refinement)
var mclassdefs = new Array[MClassDef]
private var mclassdef_sorter: MClassDefSorter is lazy do
return new MClassDefSorter(self)
end
private var mpropdef_sorter: MPropDefSorter is lazy do
return new MPropDefSorter(self)
end
# Does the current module has a given class `mclass`?
# Return true if the mmodule introduces, refines or imports a class.
# Visibility is not considered.
fun has_mclass(mclass: MClass): Bool
do
return self.in_importation <= mclass.intro_mmodule
end
# Full hierarchy of introduced and imported classes.
#
# Create a new hierarchy got by flattening the classes for the module
# and its imported modules.
# Visibility is not considered.
#
# Note: this function is expensive and is usually used for the main
# module of a program only. Do not use it to do your own subtype
# functions.
fun flatten_mclass_hierarchy: POSet[MClass]
do
var res = self.flatten_mclass_hierarchy_cache
if res != null then return res
self.flatten_mclass_hierarchy_cache = new POSet[MClass]
for m in self.in_importation.greaters do
for cd in m.mclassdefs do
unsafe_update_hierarchy_cache(cd)
end
end
return self.flatten_mclass_hierarchy_cache.as(not null)
end
# Adds another class definition in the modue.
# Updates the class hierarchy cache.
fun add_mclassdef(mclassdef: MClassDef)
do
self.mclassdefs.add(mclassdef)
if self.flatten_mclass_hierarchy_cache != null then
unsafe_update_hierarchy_cache(mclassdef)
end
end
# Adds a class definition inside `flatten_mclass_hierarchy_cache` without
# null check. The caller must have initialized the cache.
protected fun unsafe_update_hierarchy_cache(mclassdef: MClassDef)
do
var hierarchy = self.flatten_mclass_hierarchy_cache.as(not null)
# Update the cache
var c = mclassdef.mclass
hierarchy.add_node(c)
for s in mclassdef.supertypes do
hierarchy.add_edge(c, s.mclass)
end
end
# Sort a given array of classes using the linearization order of the module
# The most general is first, the most specific is last
fun linearize_mclasses(mclasses: Array[MClass])
do
self.flatten_mclass_hierarchy.sort(mclasses)
end
# Sort a given array of class definitions using the linearization order of the module
# the refinement link is stronger than the specialisation link
# The most general is first, the most specific is last
fun linearize_mclassdefs(mclassdefs: Array[MClassDef])
do
mclassdef_sorter.sort(mclassdefs)
end
# Sort a given array of property definitions using the linearization order of the module
# the refinement link is stronger than the specialisation link
# The most general is first, the most specific is last
fun linearize_mpropdefs(mpropdefs: Array[MPropDef])
do
mpropdef_sorter.sort(mpropdefs)
end
private var flatten_mclass_hierarchy_cache: nullable POSet[MClass] = null
# The primitive type `Object`, the root of the class hierarchy
var object_type: MClassType = self.get_primitive_class("Object").mclass_type is lazy
# The type `Pointer`, super class to all extern classes
var pointer_type: MClassType = self.get_primitive_class("Pointer").mclass_type is lazy
# The primitive type `Bool`
var bool_type: MClassType = self.get_primitive_class("Bool").mclass_type is lazy
# The primitive type `Int`
var int_type: MClassType = self.get_primitive_class("Int").mclass_type is lazy
# The primitive type `Byte`
var byte_type: MClassType = self.get_primitive_class("Byte").mclass_type is lazy
# The primitive type `Int8`
var int8_type: MClassType = self.get_primitive_class("Int8").mclass_type is lazy
# The primitive type `Int16`
var int16_type: MClassType = self.get_primitive_class("Int16").mclass_type is lazy
# The primitive type `UInt16`
var uint16_type: MClassType = self.get_primitive_class("UInt16").mclass_type is lazy
# The primitive type `Int32`
var int32_type: MClassType = self.get_primitive_class("Int32").mclass_type is lazy
# The primitive type `UInt32`
var uint32_type: MClassType = self.get_primitive_class("UInt32").mclass_type is lazy
# The primitive type `Char`
var char_type: MClassType = self.get_primitive_class("Char").mclass_type is lazy
# The primitive type `Float`
var float_type: MClassType = self.get_primitive_class("Float").mclass_type is lazy
# The primitive type `String`
var string_type: MClassType = self.get_primitive_class("String").mclass_type is lazy
# The primitive type `CString`
var c_string_type: MClassType = self.get_primitive_class("CString").mclass_type is lazy
# A primitive type of `Array`
fun array_type(elt_type: MType): MClassType do return array_class.get_mtype([elt_type])
# The primitive class `Array`
var array_class: MClass = self.get_primitive_class("Array") is lazy
# A primitive type of `NativeArray`
fun native_array_type(elt_type: MType): MClassType do return native_array_class.get_mtype([elt_type])
# The primitive class `NativeArray`
var native_array_class: MClass = self.get_primitive_class("NativeArray") is lazy
# The primitive type `Sys`, the main type of the program, if any
fun sys_type: nullable MClassType
do
var clas = self.model.get_mclasses_by_name("Sys")
if clas == null then return null
return get_primitive_class("Sys").mclass_type
end
# The primitive type `Finalizable`
# Used to tag classes that need to be finalized.
fun finalizable_type: nullable MClassType
do
var clas = self.model.get_mclasses_by_name("Finalizable")
if clas == null then return null
return get_primitive_class("Finalizable").mclass_type
end
# Force to get the primitive class named `name` or abort
fun get_primitive_class(name: String): MClass
do
var cla = self.model.get_mclasses_by_name(name)
# Filter classes by introducing module
if cla != null then cla = [for c in cla do if self.in_importation <= c.intro_mmodule then c]
if cla == null or cla.is_empty then
if name == "Bool" and self.model.get_mclasses_by_name("Object") != null then
# Bool is injected because it is needed by engine to code the result
# of the implicit casts.
var loc = model.no_location
var c = new MClass(self, name, loc, null, enum_kind, public_visibility)
var cladef = new MClassDef(self, c.mclass_type, loc)
cladef.set_supertypes([object_type])
cladef.add_in_hierarchy
return c
end
print_error("Fatal Error: no primitive class {name} in {self}")
exit(1)
abort
end
if cla.length != 1 then
var msg = "Fatal Error: more than one primitive class {name} in {self}:"
for c in cla do msg += " {c.full_name}"
print_error msg
#exit(1)
end
return cla.first
end
# Try to get the primitive method named `name` on the type `recv`
fun try_get_primitive_method(name: String, recv: MClass): nullable MMethod
do
var props = self.model.get_mproperties_by_name(name)
if props == null then return null
var res: nullable MMethod = null
var recvtype = recv.intro.bound_mtype
for mprop in props do
assert mprop isa MMethod
if not recvtype.has_mproperty(self, mprop) then continue
if res == null then
res = mprop
else if res != mprop then
print_error("Fatal Error: ambigous property name '{name}'; conflict between {mprop.full_name} and {res.full_name}")
abort
end
end
return res
end
end
src/model/model.nit:170,1--384,3
redef class MModule
# Force the parsing of the module using `modelbuilder`.
#
# If the module was already parsed, the existing ASI is returned.
# Else the source file is loaded, and parsed and some
#
# The importation is not done by this
#
# REQUIRE: `filepath != null`
# ENSURE: `modelbuilder.parsed_modules.has(self)`
fun parse(modelbuilder: ModelBuilder): nullable AModule
do
# Already known and loaded? then return it
var nmodule = modelbuilder.mmodule2nmodule.get_or_null(self)
if nmodule != null then return nmodule
var filepath = self.filepath
assert filepath != null
# Load it manually
nmodule = modelbuilder.load_module_ast(filepath)
if nmodule == null then return null # forward error
# build the mmodule
nmodule.mmodule = self
self.location = nmodule.location
modelbuilder.build_a_mmodule(mgroup, nmodule)
modelbuilder.parsed_modules.add self
return nmodule
end
# Parse and process importation of a given MModule.
#
# Basically chains `parse` and `build_module_importation`.
fun load(modelbuilder: ModelBuilder): nullable AModule
do
var nmodule = parse(modelbuilder)
if nmodule == null then return null
modelbuilder.build_module_importation(nmodule)
return nmodule
end
end
src/loader.nit:1131,1--1173,3
redef class MModule
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 = super
for parent in in_importation.direct_greaters do
node.out_edges.add(new NeoEdge(node, "IMPORTS", parent.to_node(nodes, model_name)))
end
for mclass in intro_mclasses do
node.out_edges.add(new NeoEdge(node, "INTRODUCES", mclass.to_node(nodes, model_name)))
end
for mclassdef in mclassdefs do
node.out_edges.add(new NeoEdge(node, "DEFINES", mclassdef.to_node(nodes, model_name)))
end
return node
end
end
src/neo.nit:716,1--731,3
redef class MModule
# All FFI files linked to this module
var ffi_files = new Array[ExternFile]
end
src/ffi/light_ffi_base.nit:81,1--84,3
redef class MModule
private var local_target_platform: nullable Platform = null
# Recursively get the platform targeted by this module or imported modules
fun target_platform: nullable Platform
do
var ltp = local_target_platform
if ltp != null then return ltp
for mmodule in in_importation.greaters do
ltp = mmodule.local_target_platform
if ltp != null then return ltp
end
return null
end
end
src/platform/platform.nit:87,1--103,3
redef class MModule
# Do we need to generate the actor submodule ?
var generate_actor_submodule = false
end
src/frontend/actors_generation_phase.nit:288,1--291,3
redef class MModule
super AnnotatedMEntity
redef var is_test is lazy do return has_annotation("test")
end
src/frontend/parse_annotations.nit:107,1--111,3
redef class MModule
# FIXME make nullable the key of `cflags`, `ldflags` and `cppflags` when
# supported by the bootstrap
# Custom options for the C compiler (CFLAGS)
var cflags = new MultiHashMap[String, String]
# Custom options for the C linker (LDFLAGS)
var ldflags = new MultiHashMap[String, String]
# Additional libraries needed for the compilation
# Will be used with pkg-config
var pkgconfigs = new Array[String]
end
src/ffi/light_c.nit:73,1--86,3
redef class MModule
# Callbacks used by this module, classified by language
var ffi_callbacks = new HashMap[FFILanguage, Set[NitniCallback]]
end
src/ffi/ffi_base.nit:27,1--30,3
redef class MModule
# Methods tagged with `before_all` at the module level (in `Sys`)
private fun before_all: Array[MMethodDef] do
var res = new Array[MMethodDef]
for mmodule in in_importation.greaters do
for mclassdef in mmodule.mclassdefs do
if mclassdef.name != "Sys" then continue
for mpropdef in mclassdef.mpropdefs do
if not mpropdef isa MMethodDef or not mpropdef.is_before_all then continue
res.add mpropdef
end
end
end
var lin = res.to_a
linearize_mpropdefs(lin)
return lin
end
# Methods tagged with `after_all` at the module level (in `Sys`)
private fun after_all: Array[MMethodDef] do
var res = new Array[MMethodDef]
for mmodule in in_importation.greaters do
for mclassdef in mmodule.mclassdefs do
if mclassdef.name != "Sys" then continue
for mpropdef in mclassdef.mpropdefs do
if not mpropdef isa MMethodDef or not mpropdef.is_after_all then continue
res.add mpropdef
end
end
end
var lin = res.to_a
linearize_mpropdefs(lin)
return lin.reversed
end
end
src/testing/testing_suite.nit:544,1--578,3
redef class MModule
# Does this module uses the FFI?
var uses_ffi: Bool = false
# C compilation unit for the FFI files
private var ffi_ccu: nullable CCompilationUnit = null
# Foreign language used in this AModule
private var present_languages = new HashSet[FFILanguage]
# Complete the compilation of the FFI code
fun finalize_ffi_wrapper(compdir: String, mainmodule: MModule)
do
var cflags = self.cflags[""].join(" ")
ffi_ccu.write_as_impl(self, compdir)
for filename in ffi_ccu.files do
var f = new ExternCFile(filename.basename, cflags)
f.pkgconfigs.add_all pkgconfigs
ffi_files.add(f)
end
end
# Avoid the compile a ffi propdef more than once
# See `AMethPropdef::compile_ffi_method`
# FIXME find a better way
private var compiled_ffi_methods = new HashSet[AMethPropdef]
end
src/ffi/light_ffi.nit:43,1--70,3
redef class MModule
# Modules with public foreign code blocks (C header)
var header_dependencies: nullable HashSet[MModule] = null
private fun compute_header_dependencies(v: HeaderDependancyPhase)
do
if header_dependencies != null then return
var header_dependencies = new HashSet[MModule]
# gather from importation
for m in in_importation.direct_greaters do
m.compute_header_dependencies v
# does the super module has inherited dependencies?
var hd = m.header_dependencies
assert hd != null
if not hd.is_empty then
header_dependencies.add_all hd
end
# does the super module itself has extern dependencies?
var amodule = v.toolcontext.modelbuilder.mmodule2node(m)
if amodule != null and amodule.has_public_c_header then header_dependencies.add(m)
end
self.header_dependencies = header_dependencies
end
end
src/ffi/header_dependency.nit:35,1--63,3
redef class MModule
private var objc_file: nullable ObjCCompilationUnit = null
private var has_public_objc_header = false
# Imported modules with public Objective-C code blocks
var objc_imported_headers: HashSet[MModule] is lazy do
var dep = new HashSet[MModule]
# gather from importation
for m in in_importation.direct_greaters do
# does the super module has inherited dependencies?
var import_dep = m.objc_imported_headers
if not import_dep.is_empty then
dep.add_all import_dep
end
# does the super module itself has a public header?
if m.has_public_objc_header then dep.add(m)
end
return dep
end
end
src/ffi/objc.nit:33,1--56,3
redef class MModule
# Get the type of the class `Serializable`
var serializable_type: MClassType is lazy do
return self.get_primitive_class("Serializable").mclass_type
end
end
src/nitserial.nit:52,1--57,3
redef class MModule
redef fun collect_modifiers do return super + ["module"]
# Collect all modules directly imported by `self`
redef fun collect_ancestors(mainmodule, filter) do
var res = new HashSet[MENTITY]
for mentity in in_importation.greaters do
if mentity == self then continue
if filter == null or filter.accept_mentity(mentity) then res.add mentity
end
return res
end
# Collect all modules directly imported by `self`
redef fun collect_parents(mainmodule, filter) do
var res = new HashSet[MENTITY]
for mentity in in_importation.direct_greaters do
if mentity == self then continue
if filter == null or filter.accept_mentity(mentity) then res.add mentity
end
return res
end
# Collect all modules that directly import `self`
redef fun collect_children(mainmodule, filter) do
var res = new HashSet[MENTITY]
for mentity in in_importation.direct_smallers do
if mentity == self then continue
if filter == null or filter.accept_mentity(mentity) then res.add mentity
end
return res
end
# Collect all module descendants of `self` (direct and transitive imports)
redef fun collect_descendants(mainmodule, filter) do
var res = new HashSet[MENTITY]
for mentity in in_importation.smallers do
if mentity == self then continue
if filter == null or filter.accept_mentity(mentity) then res.add mentity
end
return res
end
# Collect all class definitions introduced in `self`
fun collect_intro_mclassdefs(filter: nullable ModelFilter): Set[MClassDef] do
var res = new HashSet[MClassDef]
for mclassdef in mclassdefs do
if not mclassdef.is_intro then continue
if filter == null or filter.accept_mentity(mclassdef) then res.add mclassdef
end
return res
end
# Collect all class definitions refined in `self`
fun collect_redef_mclassdefs(filter: nullable ModelFilter): Set[MClassDef] do
var res = new HashSet[MClassDef]
for mclassdef in mclassdefs do
if mclassdef.is_intro then continue
if filter == null or filter.accept_mentity(mclassdef) then res.add mclassdef
end
return res
end
# Collect all class definitions introduced and refined in `self`
fun collect_local_mclassdefs(filter: nullable ModelFilter): Set[MClassDef] do
var res = new HashSet[MClassDef]
res.add_all collect_intro_mclassdefs(filter)
res.add_all collect_redef_mclassdefs(filter)
return res
end
# Collect all classes introduced in `self`
fun collect_intro_mclasses(filter: nullable ModelFilter): Set[MClass] do
var res = new HashSet[MClass]
for mclass in intro_mclasses do
if filter == null or filter.accept_mentity(mclass) then res.add mclass
end
return res
end
# Collect all classes refined in `self`
fun collect_redef_mclasses(filter: nullable ModelFilter): Set[MClass] do
var mclasses = new HashSet[MClass]
for mclassdef in mclassdefs do
if filter != null and not filter.accept_mentity(mclassdef.mclass) then continue
if not mclassdef.is_intro then mclasses.add(mclassdef.mclass)
end
return mclasses
end
# Collect all classes introduced and refined in `self`
fun collect_local_mclasses(filter: nullable ModelFilter): Set[MClass] do
var res = new HashSet[MClass]
res.add_all collect_intro_mclasses(filter)
res.add_all collect_redef_mclasses(filter)
return res
end
# Collect all classes imported from `self` parents
fun collect_imported_mclasses(mainmodule: MModule, filter: nullable ModelFilter): Set[MClass] do
var res = new HashSet[MClass]
for parent in collect_parents(mainmodule, filter) do
res.add_all parent.collect_intro_mclasses(filter)
res.add_all parent.collect_redef_mclasses(filter)
res.add_all parent.collect_imported_mclasses(mainmodule, filter)
end
return res
end
# Collect all properties introduced in `self`
fun collect_intro_mproperties(filter: nullable ModelFilter): Set[MProperty] do
var res = new HashSet[MProperty]
for mclass in collect_intro_mclasses(filter) do
res.add_all mclass.collect_intro_mproperties(filter)
end
return res
end
# Collect properties redefined in `self`
fun collect_redef_mproperties(filter: nullable ModelFilter): Set[MProperty] do
var res = new HashSet[MProperty]
for mclassdef in mclassdefs do
for mpropdef in mclassdef.collect_redef_mpropdefs(filter) do
res.add mpropdef.mproperty
end
end
return res
end
# Collect attributes introduced in `self`
fun collect_intro_attributes(filter: nullable ModelFilter): Set[MAttribute] do
var res = new HashSet[MAttribute]
for mproperty in collect_intro_mproperties(filter) do
if mproperty isa MAttribute then res.add(mproperty)
end
return res
end
# Collect all inits introduced in `self`
fun collect_intro_inits(filter: nullable ModelFilter): Set[MMethod] do
var res = new HashSet[MMethod]
for mproperty in collect_intro_mproperties(filter) do
if mproperty isa MMethod and mproperty.is_init then res.add(mproperty)
end
return res
end
# Collect methods introduced in `self` (without inits)
fun collect_intro_methods(filter: nullable ModelFilter): Set[MMethod] do
var res = new HashSet[MMethod]
for mproperty in collect_intro_mproperties(filter) do
if mproperty isa MMethod and not mproperty.is_init then res.add(mproperty)
end
return res
end
# Collect virtual types introduced in `self`
fun collect_intro_vts(filter: nullable ModelFilter): Set[MVirtualTypeProp] do
var res = new HashSet[MVirtualTypeProp]
for mproperty in collect_intro_mproperties(filter) do
if mproperty isa MVirtualTypeProp then res.add(mproperty)
end
return res
end
end
src/model/model_collect.nit:475,1--640,3
redef class MModule
# Visit all the classes and class definitions of the module.
#
# On class introduction, the `MClass` then the `MClassDef` are visited.
# On class refinement, only the `MClassDef` is visited (the `MClass` is visited in an imported module).
# On class importation, nothing is visited (the `MClass` and the `MClassDef` are visited in imported modules).
redef fun visit_all(v) do
for x in mclassdefs do
if x.is_intro then v.enter_visit(x.mclass)
v.enter_visit(x)
end
end
end
src/model/model_visitor.nit:128,1--140,3
redef class MModule
private var callbacks_used_from_java = new ForeignCallbackSet
# Java source file extracted from user FFI code with generated structure
var java_file: nullable JavaClassTemplate = null
# Set up the templates of the Java implementation class
private fun ensure_java_files
do
if java_file != null then return
# Java implementation code
java_file = new JavaClassTemplate(impl_java_class_name)
end
# Compile C code to call JNI and link C callbacks implementations to Java extern methods
private fun ensure_linking_callback_methods(ccu: CCompilationUnit)
do
var callbacks = callbacks_used_from_java.callbacks
if callbacks.is_empty then
ccu.body_decl.add "static int nit_ffi_with_java_registered_natives = 1;\n"
return
end
ccu.body_decl.add "static int nit_ffi_with_java_registered_natives = 0;\n"
var jni_methods = new Array[String]
for cb in callbacks do
jni_methods.add_all(cb.jni_methods_declaration(self))
end
for cb in callbacks_used_from_java.types do
jni_methods.add_all(cb.jni_methods_declaration(self))
end
var cf = new CFunction("void nit_ffi_with_java_register_natives(JNIEnv* env, jclass jclazz)")
cf.exprs.add """
nit_ffi_with_java_registered_natives = 1;
jint n_methods = {{{jni_methods.length}}};
JNINativeMethod methods[] = {
{{{jni_methods.join(",\n\t\t")}}}
};
jint res = (*env)->RegisterNatives(env, jclazz, methods, n_methods);
if (res != JNI_OK) {
PRINT_ERROR("RegisterNatives failed\\n");
(*env)->ExceptionDescribe(env);
exit(1);
}
"""
ccu.add_local_function cf
end
# Tell the C compiler where to find jni.h and how to link with libjvm
private fun insert_compiler_options
do
cflags.add_one("", "-I $(JAVA_HOME)/include/ -I $(JAVA_HOME)/include/linux/")
end
# Name of the generated Java class where to store all implementation methods of this module
# as well as generated callbacks.
private fun impl_java_class_name: String do return "Nit_{name}"
end
src/ffi/java.nit:254,1--315,3
redef class MModule
redef fun infobox(v)
do
var res = new HInfoBox(v, "module {name}")
res.href = v.hrefto(self)
if not v.show_infobox then return res
res.new_field("module").add(linkto(v))
add_doc_to_infobox(res)
if in_importation.greaters.length > 1 then
var c = res.new_dropdown("imports", "{in_importation.greaters.length-1} modules")
for x in in_importation.greaters do
if x == self then continue
c.open("li").add x.linkto(v)
end
end
return res
end
redef fun linkto(v) do return linkto_text(v, name)
end
src/htmlight.nit:475,1--494,3
redef class MModule
redef fun write_extra_doc(model, mainmodule, stream)
do
# Introduced classes
var class_intros = collect_intro_mclasses.to_a
if class_intros.not_empty then
alpha_comparator.sort class_intros
stream.write line_separator*2
stream.write "## Introduced classes"
for c in class_intros do
stream.write line_separator
stream.write "* {c.name}"
var doc = c.intro.mdoc
if doc != null then stream.write ": {doc.content.first}"
end
end
# Introduced properties
var prop_intros = new Array[MPropDef]
for c in mclassdefs do
prop_intros.add_all c.collect_intro_mpropdefs
end
if prop_intros.not_empty then
alpha_comparator.sort prop_intros
stream.write line_separator*2
stream.write "## Introduced properties"
stream.write line_separator
for p in prop_intros do
p.mproperty.write_synopsis(mainmodule, stream)
end
end
end
end
src/doc/vim_autocomplete.nit:333,1--368,3
redef class MModule
redef fun mentity_kind_rank do return 3
end
src/model/model_index.nit:654,1--656,3
redef class MModule
# Extra Java files to compile with the module
private var extra_java_files: nullable Array[ExtraJavaFile] = null
end
src/ffi/extra_java_files.nit:30,1--33,3
redef class MModule
redef fun tpl_module(model) do
var name = self.name.escape_to_dot
var t = new Template
t.add "subgraph cluster{name} \{\n"
t.add "label = \"{name}\"\n"
for i in mclassdefs do
if not model.filter.accept_mentity(i) then continue
t.add i.tpl_module(model)
end
t.add "\}\n"
return t
end
end
src/uml/uml_module.nit:48,1--61,3
redef class MModule
# All `MProperty` associated to all `MClassDef` of `mclass`
fun properties(mclass: MClass): Set[MProperty] do
if not self.properties_cache.has_key(mclass) then
var properties = new HashSet[MProperty]
var parents = new Array[MClass]
if self.flatten_mclass_hierarchy.has(mclass) then
parents.add_all(mclass.in_hierarchy(self).direct_greaters)
end
for parent in parents do
properties.add_all(self.properties(parent))
end
for mclassdef in mclass.mclassdefs do
if not self.in_importation <= mclassdef.mmodule then continue
for mprop in mclassdef.intro_mproperties do
properties.add(mprop)
end
end
self.properties_cache[mclass] = properties
end
return properties_cache[mclass]
end
private var properties_cache: Map[MClass, Set[MProperty]] = new HashMap[MClass, Set[MProperty]]
# Write FFI and nitni results to file
fun finalize_ffi(c: AbstractCompiler) do end
# Give requided addinional system libraries (as given to LD_LIBS)
# Note: can return null instead of an empty set
fun collect_linker_libs: nullable Array[String] do return null
end
src/compiler/abstract_compiler.nit:4629,1--4659,3
redef class MModule
private fun makefile_path: nullable String do
var file = location.file
if file == null then return null
var dir = file.filename.dirname
var makefile = (dir / "Makefile")
if not makefile.file_exists then return null
for line in makefile.to_path.read_lines do
if line.has_prefix("{name}:") then return makefile
end
return null
end
private fun man_path: nullable String do
var mpackage = self.mpackage
if mpackage == null then return null
var path = mpackage.man_path
if path == null then return null
return path / "{name}.man"
end
# Does `self` have a manpage?
private fun has_man: Bool do
var man_path = self.man_path
if man_path == null then return false
return man_path.file_exists
end
private fun make_module(toolcontext: ToolContext): Bool do
var mpackage = self.mpackage
if mpackage == null then return false
if not mpackage.is_expanded then return false
var pkg_path = mpackage.package_path
if pkg_path == null then return false
var pr = new ProcessReader("sh", "-c", "cd {pkg_path} && make -Bs bin/{name}")
var out = pr.read_all.trim
pr.close
pr.wait
if pr.status > 0 then
toolcontext.error(location, "unable to compile `{name}`")
print out
return false
end
return true
end
private fun stub_man(toolcontext: ToolContext): nullable String do
if not make_module(toolcontext) then return null
var mpackage = self.mpackage
if mpackage == null then return null
if not mpackage.is_expanded then return null
var pkg_path = mpackage.package_path
if pkg_path == null then return null
var pr = new ProcessReader("{pkg_path}/bin/{name}", "--stub-man")
var man = pr.read_all.trim
pr.close
pr.wait
if pr.status > 0 then
toolcontext.error(location, "unable to run `{pkg_path}/bin/{name} --stub-man`")
print man
return null
end
return man
end
private fun check_man(toolcontext: ToolContext) do
if not has_man then
toolcontext.error(location, "No manpage for bin {full_name}")
return
end
var man_path = self.man_path.as(not null)
var man = stub_man(toolcontext)
if man == null or man.is_empty then return
var old_man = new ManPage.from_file(self, man_path)
var new_man = new ManPage.from_string(self, man)
old_man.diff(toolcontext, new_man)
end
private fun gen_man(toolcontext: ToolContext) do
var man = stub_man(toolcontext)
if man == null or man.is_empty then return
var man_path = self.man_path
if man_path == null then return
man.write_to_file(man_path)
toolcontext.info("created manpage `{man_path}`", 0)
end
end
src/nitpackage.nit:436,1--529,3
redef class MModule
# `CCompilationUnit` used for nitni signatures and code specific to the compiler
var nitni_ccu: nullable CCompilationUnit = null
private fun nmodule(v: AbstractCompilerVisitor): nullable AModule
do
return v.compiler.modelbuilder.mmodule2node(self)
end
redef fun finalize_ffi(compiler)
do
if not uses_ffi then return
var v = compiler.new_visitor
var n = nmodule(v)
if n == null then return
n.ensure_compile_ffi_wrapper
finalize_ffi_wrapper(v.compiler.toolchain.compile_dir, v.compiler.mainmodule)
for file in ffi_files do v.compiler.extern_bodies.add(file)
ensure_compile_nitni_base(v)
nitni_ccu.header_c_types.add("#include \"{c_name}._ffi.h\"\n")
nitni_ccu.header_c_types.add("#include <stdint.h>\n")
nitni_ccu.header_c_types.add """
extern void nitni_global_ref_incr(void*);
extern void nitni_global_ref_decr(void*);
"""
var cflags = self.cflags[""].join(" ")
nitni_ccu.write_as_nitni(self, v.compiler.toolchain.compile_dir)
for file in nitni_ccu.files do
var f = new ExternCFile(file.basename, cflags)
f.pkgconfigs.add_all pkgconfigs
v.compiler.extern_bodies.add(f)
end
# reset FFI things so the next compilation job, if any, starts with a clean context
# FIXME clean and rationalize this
nitni_ccu = null
compiled_ffi_methods.clear
ffi_ccu = null
ffi_files.clear
end
private fun ensure_compile_nitni_base(v: AbstractCompilerVisitor)
do
if nitni_ccu != null then return
nitni_ccu = new CCompilationUnit
end
redef fun collect_linker_libs
do
if not self.ldflags.keys.has("") then return null
return self.ldflags[""]
end
end
src/compiler/compiler_ffi/light.nit:23,1--81,3
redef class MModule
# Complete the compilation of the FFI code
redef fun finalize_ffi_wrapper(compdir, mainmodule)
do
for language in ffi_callbacks.keys do
for callback in ffi_callbacks[language] do
language.compile_callback(callback, self, mainmodule, ffi_ccu.as(not null))
end
language.compile_to_files(self, compdir)
end
# include dependancies FFI
for mod in header_dependencies do
if mod.uses_ffi then ffi_ccu.header_custom.add("#include \"{mod.c_name}._ffi.h\"\n")
end
super
end
end
src/ffi/ffi.nit:57,1--76,3
redef class MModule
private var foreign_callbacks = new ForeignCallbackSet
redef fun finalize_ffi(compiler: AbstractCompiler)
do
if not uses_ffi then return
super
compiled_callbacks.clear
#Do not reset `foreign_callbacks` and `ffi_callbacks` because they are computed in previous phases
end
private var compiled_callbacks = new Array[NitniCallback]
# Returns true if callbacks has yet to be generated and register it as being generated
private fun check_callback_compilation(cb: NitniCallback): Bool
do
var compiled = compiled_callbacks.has(cb)
if not compiled then compiled_callbacks.add(cb)
return not compiled
end
end
src/compiler/compiler_ffi/compiler_ffi.nit:23,1--45,3
redef class MModule
redef fun html_icon do return new BSIcon("file", ["text-muted"])
redef fun html_namespace do
var mpackage = self.mpackage
var tpl = new Template
if mpackage != null then
tpl.add mpackage.html_namespace
tpl.add " :: "
end
tpl.add html_link
return tpl
end
end
src/doc/templates/html_model.nit:119,1--132,3
redef class MModule
redef fun json_namespace do
var ns = new JsonNamespace
if mgroup != null then
ns.add_all mgroup.as(not null).mpackage.json_namespace
ns.add "::"
end
ns.add to_json_ref
return ns
end
private fun ns_for(visibility: MVisibility): JsonNamespace do
if visibility <= private_visibility then return json_namespace
var mgroup = self.mgroup
if mgroup == null then return json_namespace
return mgroup.mpackage.json_namespace
end
end
src/doc/templates/json_model.nit:130,1--147,3
redef class MModule
redef fun collect_metrics(h) do
var mclasses_metrics = h.mclasses_metrics
mclasses_metrics.collect(new HashSet[MClass].from(intro_mclasses))
var mmodule_metrics = h.mmodules_metrics
mmodule_metrics.collect(new HashSet[MModule].from([self]))
var metrics = new JsonObject
metrics["mclasses"] = mclasses_metrics
metrics["mmodule"] = mmodule_metrics
return metrics
end
end
src/doc/api/api_metrics.nit:126,1--139,3