-
Notifications
You must be signed in to change notification settings - Fork 0
Classes structure
"Class" is "Class_Header" [ "Obsolete" ] [ "Inherit" ] [ "Insert" ] ( "Class_Creation" )* ( "Feature_Clause" )* [ "Invariant" ] "end" end "Class_Header" is [ "Indexing" ] [ "deferred" | [ "expanded" | "separate" ] "frozen" ] "class" "class name" [ "Type_Parameters" ] end "Indexing" is "indexing" ( "entity_name" ":" "entity name" | "Manifest Constant" )* end "Obsolete" is "obsolete" "string" end
Classes are the components used to build Eiffel software.
Classes serve two complementary purposes: they are the modular units of software decomposition; they also provide the basis for the type system of Eiffel.
Indexing parts have no effect on the execution semantics of the class. They serve to associate information with the class, for use in particular by tools for configuration management, documentation, cataloging, archival, and for retrieving classes based on their properties.
The "class name"
part gives the name of the class. It must be written in upper case.
The keyword class
may optionally be preceded by one of the keywords deferred
, expanded
, frozen
and separate
, corresponding to variants of the basic notion of class:
- A deferred class describes an incompletely implemented abstraction, which descendants will use as a basis for further refinement.
- Declaring a class as expanded indicates that entities declared of the corresponding type will denote objects rather than references to objects.
- Making a class frozen prohibits it from serving as “conforming parent” to other classes.
- Making a class separate marks its instances as having their own processor.
Validity rule: Class deferred or frozen rule — VCDF | A class cannot be at the same time deferred and frozen. |
Validity rule: Class Header rule — VCCH | If at least a (possibly inherited) feature of the class is deferred, then the class must be deferred. |
Specifying an Obsolete mark for a class or feature has no run-time effect.
When encountering such a mark, language processing tools may issue a report, citing the obsolescence message and advising software authors to replace the class or feature by a newer version.