We do not introduce these services in MEntity to avoid semantics confusion. At this stage, the annotation concept is only relevant to source code related mentities such as MModules, MClassDefs and MPropdefs.
nitc :: AnnotatedMEntity :: _annotations
Names of the annotations found onself
declaration
nitc :: AnnotatedMEntity :: annotations
Names of the annotations found onself
declaration
nitc :: AnnotatedMEntity :: annotations=
Names of the annotations found onself
declaration
nitc :: AnnotatedMEntity :: defaultinit
nitc :: AnnotatedMEntity :: has_annotation
Doesself
contains annotation
in its declaration?
nitc $ AnnotatedMEntity :: SELF
Type of this instance, automatically specialized in every classnitc :: AnnotatedMEntity :: _annotations
Names of the annotations found onself
declaration
nitc :: AnnotatedMEntity :: annotations
Names of the annotations found onself
declaration
nitc :: AnnotatedMEntity :: annotations=
Names of the annotations found onself
declaration
core :: Object :: class_factory
Implementation used byget_class
to create the specific class.
nitc :: AnnotatedMEntity :: defaultinit
core :: Object :: defaultinit
nitc :: AnnotatedMEntity :: has_annotation
Doesself
contains annotation
in its declaration?
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.
core :: Object :: native_class_name
The class name of the object in CString format.core :: Object :: output_class_name
Display class name on stdout (debug only).
# A MEntity that can hold annotations from it's source code
#
# We do not introduce these services in MEntity to avoid semantics confusion.
# At this stage, the annotation concept is only relevant to source code related
# mentities such as MModules, MClassDefs and MPropdefs.
abstract class AnnotatedMEntity
# Names of the annotations found on `self` declaration
var annotations: Set[String] = new HashSet[String]
# Does `self` contains `annotation` in its declaration?
fun has_annotation(annotation: String): Bool do return annotations.has(annotation)
end
src/frontend/parse_annotations.nit:93,1--105,3