A signature of a method

Introduced properties

private var _mparameters: Array[MParameter]

nitc :: MSignature :: _mparameters

The each parameter (in order)
private var _return_mtype: nullable MType

nitc :: MSignature :: _return_mtype

The return type (null for a procedure)
private var _vararg_rank: Int

nitc :: MSignature :: _vararg_rank

The rank of the main ellipsis (...) for vararg (starting from 0).
private fun adapt_to_contract: MSignature

nitc :: MSignature :: adapt_to_contract

Adapt signature for an contract
private fun adapt_to_ensurecondition: MSignature

nitc :: MSignature :: adapt_to_ensurecondition

Adapt signature for a ensure contract
fun arity: Int

nitc :: MSignature :: arity

The number of parameters
fun c_equiv(other: MSignature): Bool

nitc :: MSignature :: c_equiv

Does the C-version of self the same than the C-version of other?
private fun clone: MSignature

nitc :: MSignature :: clone

The returned MSignature is the exact copy of self.
init defaultinit(mparameters: Array[MParameter], return_mtype: nullable MType)

nitc :: MSignature :: defaultinit

fun mparameter_by_name(name: String): nullable MParameter

nitc :: MSignature :: mparameter_by_name

Returns a parameter named name, if any.
fun mparameters: Array[MParameter]

nitc :: MSignature :: mparameters

The each parameter (in order)
protected fun mparameters=(mparameters: Array[MParameter])

nitc :: MSignature :: mparameters=

The each parameter (in order)
fun return_mtype: nullable MType

nitc :: MSignature :: return_mtype

The return type (null for a procedure)
protected fun return_mtype=(return_mtype: nullable MType)

nitc :: MSignature :: return_mtype=

The return type (null for a procedure)
fun vararg_rank: Int

nitc :: MSignature :: vararg_rank

The rank of the main ellipsis (...) for vararg (starting from 0).
protected fun vararg_rank=(vararg_rank: Int)

nitc :: MSignature :: vararg_rank=

The rank of the main ellipsis (...) for vararg (starting from 0).

Redefined properties

redef type SELF: MSignature

nitc $ MSignature :: SELF

Type of this instance, automatically specialized in every class
redef fun core_serialize_to(v: Serializer)

nitc :: json_model $ MSignature :: core_serialize_to

Actual serialization of self to serializer
redef fun create_ast_representation(astbuilder: nullable ASTBuilder): ASignature

nitc :: astbuilder $ MSignature :: create_ast_representation

Build a ANode from self
redef fun cs_signature(no_color: nullable Bool): String

nitc :: term_model $ MSignature :: cs_signature

Returns self signature formatted for console.
redef fun depth: Int

nitc $ MSignature :: depth

The depth of the type seen as a tree.
redef fun html_signature(short: nullable Bool): Template

nitc :: html_model $ MSignature :: html_signature

Returns the MEntity signature decorated with HTML
redef init init

nitc $ MSignature :: init

REQUIRE: 1 <= mparameters.count p -> p.is_vararg
redef fun length: Int

nitc $ MSignature :: length

The length of the type seen as a tree.
redef fun linkto(v: HtmlightVisitor): HTMLTag

nitc :: htmlight $ MSignature :: linkto

A HTML version of to_s with hyper-links.
redef fun resolve_for(mtype: MType, anchor: nullable MClassType, mmodule: MModule, cleanup_virtual: Bool): MSignature

nitc $ MSignature :: resolve_for

Replace formals generic types in self with resolved values in mtype
redef fun to_node(nodes: HashMap[MEntity, NeoNode], model_name: nullable String): NeoNode

nitc :: neo $ MSignature :: to_node

Build a NeoNode representing self.
redef fun to_s: String

nitc $ MSignature :: to_s

User readable representation of self.
redef fun tpl_class(model: UMLModel): Writable

nitc :: uml_class $ MSignature :: tpl_class

Generates a dot-compatible Writable UML Class diagram from self

All properties

fun !=(other: nullable Object): Bool

core :: Object :: !=

Have self and other different values?
fun ==(other: nullable Object): Bool

core :: Object :: ==

Have self and other the same value?
type CLASS: Class[SELF]

core :: Object :: CLASS

The type of the class of self.
type MENTITY: SELF

nitc :: MEntity :: MENTITY

FIXME used to bypass RTA limitation on type resolution
type SELF: Object

core :: Object :: SELF

Type of this instance, automatically specialized in every class
private var _as_nullable_cache: nullable MType

nitc :: MType :: _as_nullable_cache

private var _css_classes: Array[String]

nitc :: MEntity :: _css_classes

CSS classes used to decorate self
private var _deprecation: nullable MDeprecationInfo

nitc :: MEntity :: _deprecation

Is the entity deprecated?
private var _examples: Array[MExample]

nitc :: MEntity :: _examples

Examples found for self
private var _html_full_name: String

nitc :: MEntity :: _html_full_name

The MEntity full_name escaped for HTML
private var _html_id: String

nitc :: MEntity :: _html_id

The MEntity unique ID in the HTML output
private var _html_name: String

nitc :: MEntity :: _html_name

The MEntity name escaped for HTML
private var _html_url: String

nitc :: MEntity :: _html_url

The MEntity URL in the HTML output
private var _html_url: String

nitc :: MEntity :: _html_url

private var _is_broken: Bool

nitc :: MEntity :: _is_broken

The indication that the entity did not pass some semantic verifications.
private var _is_fictive: Bool

nitc :: MEntity :: _is_fictive

Is self created for internal purpose?
private var _is_java_primitive: Bool

nitc :: MType :: _is_java_primitive

Is the associated Java type a primitive one?
private var _is_tagged: Bool

nitc :: MType :: _is_tagged

Are values of self tagged?
private var _is_test: Bool

nitc :: MEntity :: _is_test

Is self created for unit testing purpose?
private var _mdoc: nullable MDoc

nitc :: MEntity :: _mdoc

The documentation associated to the entity
private var _mexample: nullable MExample

nitc :: MEntity :: _mexample

Return this entity as a MExample
private var _mparameters: Array[MParameter]

nitc :: MSignature :: _mparameters

The each parameter (in order)
private var _return_mtype: nullable MType

nitc :: MSignature :: _return_mtype

The return type (null for a procedure)
private var _tag_value: Int

nitc :: MType :: _tag_value

The tag value of the type
private var _vararg_rank: Int

nitc :: MSignature :: _vararg_rank

The rank of the main ellipsis (...) for vararg (starting from 0).
protected fun accept_json_serializer(v: JsonSerializer)

serialization :: Serializable :: accept_json_serializer

Refinable service to customize the serialization of this class to JSON
protected fun accept_msgpack_attribute_counter(v: AttributeCounter)

serialization :: Serializable :: accept_msgpack_attribute_counter

Hook to customize the behavior of the AttributeCounter
protected fun accept_msgpack_serializer(v: MsgPackSerializer)

serialization :: Serializable :: accept_msgpack_serializer

Hook to customize the serialization of this class to MessagePack
private fun adapt_to_contract: MSignature

nitc :: MSignature :: adapt_to_contract

Adapt signature for an contract
private fun adapt_to_ensurecondition: MSignature

nitc :: MSignature :: adapt_to_ensurecondition

Adapt signature for a ensure contract
private fun add_doc_to_infobox(res: HInfoBox)

nitc :: MEntity :: add_doc_to_infobox

Append an entry for the doc in the given infobox
protected fun add_to_bundle(bundle: NativeBundle, key: JavaString)

serialization :: Serializable :: add_to_bundle

Called by []= to dynamically choose the appropriate method according
fun anchor_to(mmodule: MModule, anchor: nullable MClassType): MType

nitc :: MType :: anchor_to

The base class type on which self is based
fun api_url: String

nitc :: MEntity :: api_url

URL to self within the JSON api.
fun arity: Int

nitc :: MSignature :: arity

The number of parameters
fun as_notnull: MType

nitc :: MType :: as_notnull

Returns the not null version of the type.
fun as_nullable: MType

nitc :: MType :: as_nullable

Return the nullable version of the type
private fun as_nullable_cache: nullable MType

nitc :: MType :: as_nullable_cache

private fun as_nullable_cache=(as_nullable_cache: nullable MType)

nitc :: MType :: as_nullable_cache=

fun c_equiv(other: MSignature): Bool

nitc :: MSignature :: c_equiv

Does the C-version of self the same than the C-version of other?
abstract fun c_name: String

nitc :: MEntity :: c_name

A fully-qualified C-like identifier of this model entity.
private fun call_arg_field: String

nitc :: MType :: call_arg_field

Field to store this type in the C structure nit_call_arg
abstract fun can_resolve_for(mtype: MType, anchor: nullable MClassType, mmodule: MModule): Bool

nitc :: MType :: can_resolve_for

Can the type be resolved?
protected fun class_factory(name: String): CLASS

core :: Object :: class_factory

Implementation used by get_class to create the specific class.
fun class_name: String

core :: Object :: class_name

The class name of the object.
private fun clone: MSignature

nitc :: MSignature :: clone

The returned MSignature is the exact copy of self.
fun cname: String

nitc :: MType :: cname

Representation of this type in pure C on the FFI extern side
fun cname_blind: String

nitc :: MType :: cname_blind

Representation of this type in C for the internal of the system
protected fun cname_normal_class: String

nitc :: MType :: cname_normal_class

Name of this type in C for normal classes (not extern and not primitive)
fun collect_ancestors(mainmodule: MModule, filter: nullable ModelFilter): Set[MENTITY]

nitc :: MEntity :: collect_ancestors

Collect self ancestors (direct and indirect)
abstract fun collect_children(mainmodule: MModule, filter: nullable ModelFilter): Set[MENTITY]

nitc :: MEntity :: collect_children

Collect self children (direct descendants)
fun collect_descendants(mainmodule: MModule, filter: nullable ModelFilter): Set[MENTITY]

nitc :: MEntity :: collect_descendants

Collect self descendants (direct and direct)
fun collect_linearization(mainmodule: MModule): nullable Array[MEntity]

nitc :: MEntity :: collect_linearization

Collect self linearization anchored on mainmodule
abstract fun collect_mclassdefs(mmodule: MModule): Set[MClassDef]

nitc :: MType :: collect_mclassdefs

Compute all the classdefs inherited/imported.
abstract fun collect_mclasses(mmodule: MModule): Set[MClass]

nitc :: MType :: collect_mclasses

Compute all the super-classes.
fun collect_modifiers: Array[String]

nitc :: MEntity :: collect_modifiers

Collect modifier keywords like redef, private etc
abstract fun collect_mtypes(mmodule: MModule): Set[MClassType]

nitc :: MType :: collect_mtypes

Compute all the declared super-types.
abstract fun collect_parents(mainmodule: MModule, filter: nullable ModelFilter): Set[MENTITY]

nitc :: MEntity :: collect_parents

Collect self parents (direct ancestors)
fun color: String

nitc :: MEntity :: color

fun compile_callback_to_java(mmodule: MModule, mainmodule: MModule, ccu: CCompilationUnit)

nitc :: NitniCallback :: compile_callback_to_java

Compile C and Java code to implement this callback
fun compile_callback_to_objc(mmodule: MModule, mainmodule: MModule)

nitc :: NitniCallback :: compile_callback_to_objc

Compile this callback to be callable from Objective-C
private fun complete_mdoc: nullable MDoc

nitc :: MEntity :: complete_mdoc

Doc to use in completion
private fun complete_name: String

nitc :: MEntity :: complete_name

Actual name used in completion
protected fun const_color=(const_color: String)

nitc :: MEntity :: const_color=

fun core_serialize_to(serializer: Serializer)

serialization :: Serializable :: core_serialize_to

Actual serialization of self to serializer
abstract fun create_ast_representation(astbuilder: nullable ASTBuilder): ANode

nitc :: MEntity :: create_ast_representation

Build a ANode from self
fun cs_comment(no_color: nullable Bool): nullable String

nitc :: MEntity :: cs_comment

Returns the comment of this MEntity formatted for console.
fun cs_declaration(no_color: nullable Bool): String

nitc :: MEntity :: cs_declaration

Returns the complete MEntity declaration (modifiers + name + signature).
fun cs_full_name(no_color: nullable Bool): String

nitc :: MEntity :: cs_full_name

Returns self.full_name formatted for console
fun cs_icon(no_color: nullable Bool): String

nitc :: MEntity :: cs_icon

Text icon to be displayed in front of the entity
fun cs_list_item(no_color: nullable Bool): String

nitc :: MEntity :: cs_list_item

Returns self as a list element that can be displayed in console.
fun cs_location(no_color: nullable Bool): String

nitc :: MEntity :: cs_location

Source code location of this MEntity formatted for console
fun cs_short_comment(no_color: nullable Bool): nullable String

nitc :: MEntity :: cs_short_comment

Returns the comment of this MEntity formatted for console.
fun cs_signature(no_color: nullable Bool): String

nitc :: MEntity :: cs_signature

Returns self signature formatted for console.
fun cs_source_code: String

nitc :: MEntity :: cs_source_code

Source code associated to this MEntity.
fun css_classes: Array[String]

nitc :: MEntity :: css_classes

CSS classes used to decorate self
protected fun css_classes=(css_classes: Array[String])

nitc :: MEntity :: css_classes=

CSS classes used to decorate self
fun ctype: String

nitc :: MType :: ctype

Return the C type associated to a given Nit static type
fun ctype_extern: String

nitc :: MType :: ctype_extern

C type outside of the compiler code and in boxes
fun ctypename: String

nitc :: MType :: ctypename

Short name of the ctype to use in unions
init defaultinit(mparameters: Array[MParameter], return_mtype: nullable MType)

nitc :: MSignature :: defaultinit

fun deprecation: nullable MDeprecationInfo

nitc :: MEntity :: deprecation

Is the entity deprecated?
fun deprecation=(deprecation: nullable MDeprecationInfo)

nitc :: MEntity :: deprecation=

Is the entity deprecated?
fun depth: Int

nitc :: MType :: depth

The depth of the type seen as a tree.
fun examples: Array[MExample]

nitc :: MEntity :: examples

Examples found for self
protected fun examples=(examples: Array[MExample])

nitc :: MEntity :: examples=

Examples found for self
init from_deserializer(deserializer: Deserializer)

serialization :: Serializable :: from_deserializer

Create an instance of this class from the deserializer
abstract fun full_name: String

nitc :: MEntity :: full_name

A fully-qualified name of this model entity.
private fun gen_arg_convert(template: Template, arg_name: String)

nitc :: MType :: gen_arg_convert

Write code in template to parse the argument arg_name to this parameter type
fun get_class: CLASS

core :: Object :: get_class

The meta-object representing the dynamic type of self.
fun has_mproperty(mmodule: MModule, mproperty: MProperty): Bool

nitc :: MType :: has_mproperty

Is the property in self for a given module
fun hash: Int

core :: Object :: hash

The hash code of the object.
fun hierarchy_poset(mainmodule: MModule, filter: nullable ModelFilter): POSet[MENTITY]

nitc :: MEntity :: hierarchy_poset

Build a poset representing self in it's own hierarchy
private fun href(v: NitlightVisitor): nullable String

nitc :: MEntity :: href

fun html_declaration: Template

nitc :: MEntity :: html_declaration

Returns the complete MEntity declaration decorated with HTML
fun html_full_name: String

nitc :: MEntity :: html_full_name

The MEntity full_name escaped for HTML
protected fun html_full_name=(html_full_name: String)

nitc :: MEntity :: html_full_name=

The MEntity full_name escaped for HTML
fun html_icon: BSIcon

nitc :: MEntity :: html_icon

An icon representative of the mentity
fun html_id: String

nitc :: MEntity :: html_id

The MEntity unique ID in the HTML output
protected fun html_id=(html_id: String)

nitc :: MEntity :: html_id=

The MEntity unique ID in the HTML output
fun html_name: String

nitc :: MEntity :: html_name

The MEntity name escaped for HTML
protected fun html_name=(html_name: String)

nitc :: MEntity :: html_name=

The MEntity name escaped for HTML
abstract fun html_namespace: Template

nitc :: MEntity :: html_namespace

Returns full_name decorated with HTML links
fun html_signature(short: nullable Bool): Template

nitc :: MEntity :: html_signature

Returns the MEntity signature decorated with HTML
fun html_url: String

nitc :: MEntity :: html_url

The MEntity URL in the HTML output
protected fun html_url=(html_url: String)

nitc :: MEntity :: html_url=

The MEntity URL in the HTML output
abstract fun infobox(v: HtmlightVisitor): HInfoBox

nitc :: HInfoBoxable :: infobox

An new infobox documenting the entity
init init

core :: Object :: init

fun inspect: String

core :: Object :: inspect

Developer readable representation of self.
protected fun inspect_head: String

core :: Object :: inspect_head

Return "CLASSNAME:#OBJECTID".
fun is_broken: Bool

nitc :: MEntity :: is_broken

The indication that the entity did not pass some semantic verifications.
fun is_broken=(is_broken: Bool)

nitc :: MEntity :: is_broken=

The indication that the entity did not pass some semantic verifications.
fun is_c_primitive: Bool

nitc :: MType :: is_c_primitive

Is the associated C type a primitive one?
fun is_cprimitive: Bool

nitc :: MType :: is_cprimitive

Does this type have a primitive representation?
fun is_example: Bool

nitc :: MEntity :: is_example

Is self existing for an example purpose?
fun is_fictive: Bool

nitc :: MEntity :: is_fictive

Is self created for internal purpose?
fun is_fictive=(is_fictive: Bool)

nitc :: MEntity :: is_fictive=

Is self created for internal purpose?
fun is_java_primitive: Bool

nitc :: MType :: is_java_primitive

Is the associated Java type a primitive one?
protected fun is_java_primitive=(is_java_primitive: Bool)

nitc :: MType :: is_java_primitive=

Is the associated Java type a primitive one?
fun is_ok: Bool

nitc :: MType :: is_ok

Is the type a MErrorType or contains an MErrorType?
intern fun is_same_instance(other: nullable Object): Bool

core :: Object :: is_same_instance

Return true if self and other are the same instance (i.e. same identity).
fun is_same_serialized(other: nullable Object): Bool

core :: Object :: is_same_serialized

Is self the same as other in a serialization context?
intern fun is_same_type(other: Object): Bool

core :: Object :: is_same_type

Return true if self and other have the same dynamic type.
fun is_subtype(mmodule: MModule, anchor: nullable MClassType, sup: MType): Bool

nitc :: MType :: is_subtype

Return true if self is an subtype of sup.
fun is_subtype_invar(mmodule: MModule, anchor: nullable MClassType, sup: MType): Bool

nitc :: MType :: is_subtype_invar

Return true if self is a invariant subtype of sup.
fun is_tagged: Bool

nitc :: MType :: is_tagged

Are values of self tagged?
protected fun is_tagged=(is_tagged: Bool)

nitc :: MType :: is_tagged=

Are values of self tagged?
fun is_test: Bool

nitc :: MEntity :: is_test

Is self created for unit testing purpose?
fun is_test=(is_test: Bool)

nitc :: MEntity :: is_test=

Is self created for unit testing purpose?
private fun java_is_nit_object: Bool

nitc :: MType :: java_is_nit_object

Is this type opaque in Java? As so it is represented by nit.app.NitObject.
fun java_type: String

nitc :: MType :: java_type

Return the Java type associated to a given Nit static type
private fun java_type: String

nitc :: MType :: java_type

Type name in Java
private fun jname: String

nitc :: MEntity :: jname

A Java compatible name for self
private fun jni_format: String

nitc :: MType :: jni_format

JNI short type name (for signatures)
fun jni_methods_declaration(from_module: MModule): Array[String]

nitc :: NitniCallback :: jni_methods_declaration

Returns the list of C functions to link with extern Java methods, as required
private fun jni_signature_alt: String

nitc :: MType :: jni_signature_alt

Type name appearing within JNI function names.
private fun jni_type: String

nitc :: MType :: jni_type

JNI type name (in C)
abstract fun json_namespace: JsonNamespace

nitc :: MEntity :: json_namespace

Return self.full_name as an object that can be serialized to json.
fun length: Int

nitc :: MType :: length

The length of the type seen as a tree.
fun linkto(v: HtmlightVisitor): HTMLTag

nitc :: MEntity :: linkto

A HTML version of to_s with hyper-links.
fun linkto_text(v: HtmlightVisitor, text: String): HTMLTag

nitc :: MEntity :: linkto_text

Link to the self with a specific text.
fun location: Location

nitc :: MEntity :: location

The origin of the definition.
fun lookup_bound(mmodule: MModule, resolved_receiver: MType): MType

nitc :: MType :: lookup_bound

Resolve formal type to its verbatim bound.
fun lookup_fixed(mmodule: MModule, resolved_receiver: MType): MType

nitc :: MType :: lookup_fixed

Resolve the formal type to its simplest equivalent form.
private fun make_node(nodes: HashMap[MEntity, NeoNode], model_name: nullable String): NeoNode

nitc :: MEntity :: make_node

Make a new NeoNode based on mentity.
abstract fun mangled_cname: String

nitc :: MType :: mangled_cname

Representation of this type in mangled C
fun mdoc: nullable MDoc

nitc :: MEntity :: mdoc

The documentation associated to the entity
fun mdoc=(mdoc: nullable MDoc)

nitc :: MEntity :: mdoc=

The documentation associated to the entity
fun mdoc_or_fallback: nullable MDoc

nitc :: MEntity :: mdoc_or_fallback

The documentation associated to the entity or their main nested entity.
private fun mentity_kind_rank: Int

nitc :: MEntity :: mentity_kind_rank

Compare MEntity class kind
fun mexample: nullable MExample

nitc :: MEntity :: mexample

Return this entity as a MExample
protected fun mexample=(mexample: nullable MExample)

nitc :: MEntity :: mexample=

Return this entity as a MExample
abstract fun model: Model

nitc :: MEntity :: model

A Model Entity has a direct link to its model
fun mparameter_by_name(name: String): nullable MParameter

nitc :: MSignature :: mparameter_by_name

Returns a parameter named name, if any.
fun mparameters: Array[MParameter]

nitc :: MSignature :: mparameters

The each parameter (in order)
protected fun mparameters=(mparameters: Array[MParameter])

nitc :: MSignature :: mparameters=

The each parameter (in order)
protected fun msgpack_extra_array_items: Int

serialization :: Serializable :: msgpack_extra_array_items

Hook to request a larger than usual metadata array
abstract fun name: String

nitc :: MEntity :: name

The short (unqualified) name of this model entity.
private intern fun native_class_name: CString

core :: Object :: native_class_name

The class name of the object in CString format.
fun need_anchor: Bool

nitc :: MType :: need_anchor

Does self contain a virtual type or a formal generic parameter type?
private fun needs_type_check: Bool

nitc :: MType :: needs_type_check

Does this parameter type needs to be checked before calling the method?
abstract fun nitdoc_breadcrumbs: Array[MEntity]

nitc :: MEntity :: nitdoc_breadcrumbs

MEntities composing the breadcrumbs of a nitdoc page
intern fun object_id: Int

core :: Object :: object_id

An internal hash code for the object based on its identity.
fun output

core :: Object :: output

Display self on stdout (debug only).
intern fun output_class_name

core :: Object :: output_class_name

Display class name on stdout (debug only).
fun ratings(config: NitwebConfig, user: nullable String): JsonObject

nitc :: MEntity :: ratings

Get the ratings of a mentity
fun ratings_by_dimension(config: NitwebConfig, dimension: String, user: nullable String): JsonObject

nitc :: MEntity :: ratings_by_dimension

Get the ratings of a dimension
private abstract fun related_mclasses(mmodule: MModule): Array[MClass]

nitc :: MType :: related_mclasses

List classes composing this type
abstract fun resolve_for(mtype: MType, anchor: nullable MClassType, mmodule: MModule, cleanup_virtual: Bool): MType

nitc :: MType :: resolve_for

Replace formals generic types in self with resolved values in mtype
fun return_mtype: nullable MType

nitc :: MSignature :: return_mtype

The return type (null for a procedure)
protected fun return_mtype=(return_mtype: nullable MType)

nitc :: MSignature :: return_mtype=

The return type (null for a procedure)
fun serialization_hash: Int

core :: Object :: serialization_hash

Hash value use for serialization
fun serialize_msgpack(plain: nullable Bool): Bytes

serialization :: Serializable :: serialize_msgpack

Serialize self to MessagePack bytes
fun serialize_to(serializer: Serializer)

serialization :: Serializable :: serialize_to

Serialize self to serializer
fun serialize_to_json(plain: nullable Bool, pretty: nullable Bool): String

serialization :: Serializable :: serialize_to_json

Serialize self to JSON
private fun serialize_to_or_delay(v: Serializer)

serialization :: Serializable :: serialize_to_or_delay

Accept references or force direct serialization (using serialize_to)
private fun source_url(url_pattern: nullable String): String

nitc :: MEntity :: source_url

Render a HTML link for the MEntity location
fun supertype_to(mmodule: MModule, anchor: nullable MClassType, super_mclass: MClass): MClassType

nitc :: MType :: supertype_to

Return the supertype when adapted to a class.
intern fun sys: Sys

core :: Object :: sys

Return the global sys object, the only instance of the Sys class.
fun tag_value: Int

nitc :: MType :: tag_value

The tag value of the type
protected fun tag_value=(tag_value: Int)

nitc :: MType :: tag_value=

The tag value of the type
fun to_dot_node: DotNode

nitc :: MEntity :: to_dot_node

Return self as a DotNode
fun to_json: String

serialization :: Serializable :: to_json

Serialize self to plain JSON
fun to_json_ref: MEntityRef

nitc :: MEntity :: to_json_ref

Return a new MEntityRef to self.
abstract fun to_jvalue(env: JniEnv): JValue

core :: Object :: to_jvalue

private fun to_node(nodes: HashMap[MEntity, NeoNode], model_name: nullable String): NeoNode

nitc :: MEntity :: to_node

Build a NeoNode representing self.
fun to_pretty_json: String

serialization :: Serializable :: to_pretty_json

Serialize self to plain pretty JSON
fun to_s: String

core :: Object :: to_s

User readable representation of self.
abstract fun tpl_class(model: UMLModel): Writable

nitc :: MEntity :: tpl_class

Generates a dot-compatible Writable UML Class diagram from self
abstract fun tpl_module(model: UMLModel): Writable

nitc :: MEntity :: tpl_module

Builds a dot UML package diagram entity from self
fun undecorate: MType

nitc :: MType :: undecorate

Remove the base type of a decorated (proxy) type.
fun vararg_rank: Int

nitc :: MSignature :: vararg_rank

The rank of the main ellipsis (...) for vararg (starting from 0).
protected fun vararg_rank=(vararg_rank: Int)

nitc :: MSignature :: vararg_rank=

The rank of the main ellipsis (...) for vararg (starting from 0).
fun visibility: MVisibility

nitc :: MEntity :: visibility

The visibility of the MEntity.
fun visit_all(v: ModelVisitor)

nitc :: MEntity :: visit_all

Call v.enter_visit on all nested entities.
fun web_url: String

nitc :: MEntity :: web_url

URL to self within the web interface.
private fun write_doc(model: Model, mainmodule: MModule, stream: Writer)

nitc :: MEntity :: write_doc

private fun write_extra_doc(model: Model, mainmodule: MModule, stream: Writer)

nitc :: MEntity :: write_extra_doc

Extra auto documentation to append to the stream
private fun write_location(mainmodule: MModule, stream: Writer)

nitc :: MEntity :: write_location

Location (file and line when available) of related declarations
package_diagram nitc::MSignature MSignature nitc::MType MType nitc::MSignature->nitc::MType nitc::MEntity MEntity nitc::MType->nitc::MEntity nitc::NitniCallback NitniCallback nitc::MType->nitc::NitniCallback ...nitc::MEntity ... ...nitc::MEntity->nitc::MEntity ...nitc::NitniCallback ... ...nitc::NitniCallback->nitc::NitniCallback

Ancestors

interface HInfoBoxable

nitc :: HInfoBoxable

Model entity or whatever that can produce an infobox
abstract class MEntity

nitc :: MEntity

A named and possibly documented entity in the model.
interface NitniCallback

nitc :: NitniCallback

Classification for all nitni callbacks
interface Object

core :: Object

The root of the class hierarchy.
interface Serializable

serialization :: Serializable

Instances of this class can be passed to Serializer::serialize

Parents

abstract class MType

nitc :: MType

A global static type

Class definitions

nitc $ MSignature
# A signature of a method
class MSignature
	super MType

	# The each parameter (in order)
	var mparameters: Array[MParameter]

	# Returns a parameter named `name`, if any.
	fun mparameter_by_name(name: String): nullable MParameter
	do
		for p in mparameters do
			if p.name == name then return p
		end
		return null
	end

	# The return type (null for a procedure)
	var return_mtype: nullable MType

	redef fun depth
	do
		var dmax = 0
		var t = self.return_mtype
		if t != null then dmax = t.depth
		for p in mparameters do
			var d = p.mtype.depth
			if d > dmax then dmax = d
		end
		return dmax + 1
	end

	redef fun length
	do
		var res = 1
		var t = self.return_mtype
		if t != null then res += t.length
		for p in mparameters do
			res += p.mtype.length
		end
		return res
	end

	# REQUIRE: 1 <= mparameters.count p -> p.is_vararg
	init
	do
		var vararg_rank = -1
		for i in [0..mparameters.length[ do
			var parameter = mparameters[i]
			if parameter.is_vararg then
				if vararg_rank >= 0 then
					# If there is more than one vararg,
					# consider that additional arguments cannot be mapped.
					vararg_rank = -1
					break
				end
				vararg_rank = i
			end
		end
		self.vararg_rank = vararg_rank
	end

	# The rank of the main ellipsis (`...`) for vararg (starting from 0).
	# value is -1 if there is no vararg.
	# Example: for "(a: Int, b: Bool..., c: Char)" #-> vararg_rank=1
	#
	# From a model POV, a signature can contain more than one vararg parameter,
	# the `vararg_rank` just indicates the one that will receive the additional arguments.
	# However, currently, if there is more that one vararg parameter, no one will be the main one,
	# and additional arguments will be refused.
	var vararg_rank: Int is noinit

	# The number of parameters
	fun arity: Int do return mparameters.length

	redef fun to_s
	do
		var b = new FlatBuffer
		if not mparameters.is_empty then
			b.append("(")
			var last_mtype = null
			for i in [0..mparameters.length[ do
				var mparameter = mparameters[i]

				# Group types that are common to contiguous parameters
				if mparameter.mtype != last_mtype and last_mtype != null then
					b.append(": ")
					b.append(last_mtype.to_s)
				end

				if i > 0 then b.append(", ")
				b.append(mparameter.name)

				if mparameter.is_vararg then
					b.append(": ")
					b.append(mparameter.mtype.to_s)
					b.append("...")
					last_mtype = null
				else
					last_mtype = mparameter.mtype
				end
			end

			if last_mtype != null then
				b.append(": ")
				b.append(last_mtype.to_s)
			end

			b.append(")")
		end
		var ret = self.return_mtype
		if ret != null then
			b.append(": ")
			b.append(ret.to_s)
		end
		return b.to_s
	end

	redef fun resolve_for(mtype: MType, anchor: nullable MClassType, mmodule: MModule, cleanup_virtual: Bool): MSignature
	do
		var params = new Array[MParameter]
		for p in self.mparameters do
			params.add(p.resolve_for(mtype, anchor, mmodule, cleanup_virtual))
		end
		var ret = self.return_mtype
		if ret != null then
			ret = ret.resolve_for(mtype, anchor, mmodule, cleanup_virtual)
		end
		var res = new MSignature(params, ret)
		return res
	end
end
src/model/model.nit:1964,1--2094,3

nitc :: neo $ MSignature
redef class MSignature
	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
		node.labels.add "MSignature"
		var names = new JsonArray
		var rank = 0
		for mparameter in mparameters do
			names.add mparameter.name
			var pnode = mparameter.to_node(nodes, model_name)
			pnode["rank"] = rank
			node.out_edges.add(new NeoEdge(node, "PARAMETER", pnode))
			rank += 1
		end
		if not names.is_empty then node["parameter_names"] = names
		var return_mtype = return_mtype
		if return_mtype != null then
			node.out_edges.add(new NeoEdge(node, "RETURNTYPE", return_mtype.to_node(nodes, model_name)))
		end
		return node
	end
end
src/neo.nit:934,1--955,3

nitc :: astbuilder $ MSignature
redef class MSignature
	redef fun create_ast_representation(astbuilder: nullable ASTBuilder): ASignature do
		var nparams = new Array[AParam]
		for mparam in mparameters do nparams.add(mparam.create_ast_representation(astbuilder))
		var return_type = null
		if self.return_mtype != null then return_type = self.return_mtype.create_ast_representation(astbuilder)
		return new ASignature.init_asignature(null, nparams, null, return_type)
	end
end
src/astbuilder.nit:1018,1--1026,3

nitc :: term_model $ MSignature
redef class MSignature
	redef fun cs_signature(no_color) do
		var tpl = new FlatBuffer
		if not mparameters.is_empty then
			tpl.append "("
			for i in [0..mparameters.length[ do
				tpl.append mparameters[i].cs_signature(no_color)
				if i < mparameters.length - 1 then tpl.append ", "
			end
			tpl.append ")"
		end
		var return_mtype = self.return_mtype
		if return_mtype != null then
			tpl.append ": "
			tpl.append return_mtype.cs_signature(no_color)
		end
		return tpl.write_to_string
	end
end
src/doc/templates/term_model.nit:252,1--270,3

nitc :: uml_class $ MSignature
redef class MSignature

	redef fun tpl_class(model) do
		var t = new Template
		t.add "("
		var params = new Array[MParameter]
		for i in mparameters do
			params.add i
		end
		if params.length > 0 then
			t.add params.first.name.escape_to_dot
			t.add ": "
			t.add params.first.mtype.tpl_class(model)
			for i in [1 .. params.length [ do
				t.add ", "
				t.add params[i].name.escape_to_dot
				t.add ": "
				t.add params[i].mtype.tpl_class(model)
			end
		end
		t.add ")"
		if return_mtype != null then
			t.add ": "
			t.add return_mtype.tpl_class(model)
		end
		return t
	end
end
src/uml/uml_class.nit:115,1--142,3

nitc :: contracts $ MSignature
redef class MSignature

	# Adapt signature for an contract
	#
	# The returned `MSignature` is the copy of `self` without return type.
	private fun adapt_to_contract: MSignature do return new MSignature(mparameters.to_a, null)

	# Adapt signature for a ensure contract
	#
	# The returned `MSignature` is the copy of `self` without return type.
	# The return type is replaced by a new parameter `result`
	private fun adapt_to_ensurecondition: MSignature
	do
		var rtype = return_mtype
		var msignature = adapt_to_contract
		if rtype != null then
			msignature.mparameters.add(new MParameter("result", rtype, false))
		end
		return msignature
	end

	# The returned `MSignature` is the exact copy of `self`.
	private fun clone: MSignature do return new MSignature(mparameters.to_a, return_mtype)
end
src/contracts.nit:767,1--790,3

nitc :: htmlight $ MSignature
redef class MSignature
	redef fun linkto(v)
	do
		var res = new HTMLTag("span")
		var first = true
		if not mparameters.is_empty then
			res.append "("
			for p in mparameters do
				if first then
					first = false
				else
					res.append ", "
				end
				res.append p.name
				res.append ": "
				res.add p.mtype.linkto(v)
			end
			res.append ")"
		end
		var ret = return_mtype
		if ret != null then
			res.append ": "
			res.add ret.linkto(v)
		end
		return res
	end
end
src/htmlight.nit:656,1--682,3

nitc :: html_model $ MSignature
redef class MSignature
	redef fun html_signature(short) do
		var tpl = new Template
		if not mparameters.is_empty then
			tpl.add "("
			for i in [0..mparameters.length[ do
				tpl.add mparameters[i].html_signature(short)
				if i < mparameters.length - 1 then tpl.add ", "
			end
			tpl.add ")"
		end
		if short == null or not short then
			var return_mtype = self.return_mtype
			if return_mtype != null then
				tpl.add ": "
				tpl.add return_mtype.html_signature(short)
			end
		end
		return tpl
	end
end
src/doc/templates/html_model.nit:319,1--339,3

nitc :: separate_compiler $ MSignature
redef class MSignature
	# Does the C-version of `self` the same than the C-version of `other`?
	fun c_equiv(other: MSignature): Bool
	do
		if self == other then return true
		if arity != other.arity then return false
		for i in [0..arity[ do
			if mparameters[i].mtype.ctype != other.mparameters[i].mtype.ctype then return false
		end
		if return_mtype != other.return_mtype then
			if return_mtype == null or other.return_mtype == null then return false
			if return_mtype.ctype != other.return_mtype.ctype then return false
		end
		return true
	end
end
src/compiler/separate_compiler.nit:2446,1--2461,3