This Reference Manual output has not been verified, and may contain omissions or errors. Report any problems on the tracking issue
The language defines several kinds of named entities that are declared by declarations. The entity's name is defined by the declaration, usually by a
defining_identifier, but sometimes by a
defining_operator_symbol. There are also entities that are not directly declared; some of these are elements of other entities, or are allocated dynamically. Such entities can be denoted using
selected_component, or dereference
names (see 4.1).
There are several forms of declaration. A
basic_declaration is a form of declaration defined as follows.
A declaration is a language construct that associates a name with (a view of) an entity. A declaration may appear explicitly in the program text (an explicit declaration), or may be supposed to occur at a given place in the text as a consequence of the semantics of another construct (an implicit declaration).
Each of the following is defined to be a declaration: any
defining_identifier of an
defining_identifier of a
defining_identifier of an
basic_declarationis expanded out) contains all syntactic categories that end in "_declaration" or "_specification", except for program unit _specifications. Moreover, it contains
subprogram_bodyis a declaration, whether or not it completes a previous declaration. This is a bit strange,
subprogram_bodyis not part of the syntax of
library_unit_declaration. A renaming-as-body is considered a declaration. An
accept_statementis not considered a declaration. Completions are sometimes declarations, and sometimes not.
All declarations contain a definition for a view of an entity. A view consists of an identification of the entity (the entity of the view), plus view-specific characteristics that affect the use of the entity through that view (such as mode of access to an object, formal parameter names and defaults for a subprogram, or visibility to components of a type). In most cases, a declaration also contains the definition for the entity itself (a
renaming_declaration is an example of a declaration that does not define a new entity, but instead defines a view of an existing entity (see 8.5)).
When it is clear from context, the term object is used in place of view of an object. Similarly, the terms type and subtype are used in place of view of a type and view of a subtype, respectively.
For each declaration, the language rules define a certain region of text called the scope of the declaration (see 8.2). Most declarations associate an
identifier with a declared entity. Within its scope, and only there, there are places where it is possible to use the
identifier to refer to the declaration, the view it defines, and the associated entity; these places are defined by the visibility rules (see 8.3). At such places the
identifier is said to be a name of the entity (the
selector_name); the name is said to denote the declaration, the view, and the associated entity (see 8.6). The declaration is said to declare the name, the view, and in most cases, the entity itself.
As an alternative to an
identifier, an enumeration literal can be declared with a
character_literal as its name (see 3.5.1), and a function can be declared with an
operator_symbol as its name (see 6.1).
The syntax rules use the terms
defining_operator_symbol for the defining occurrence of a name; these are collectively called defining names. The terms
selector_name are used for usage occurrences of
operator_symbols. These are collectively called usage names.
operator_symbolare used directly in contexts where the normal visibility rules do not apply (such as the
identifierthat appears after the end of a
task_body). Analogous conventions apply to the use of
designator, which is the collective term for
The process by which a construct achieves its run-time effect is called execution. This process is also called elaboration for declarations and evaluation for expressions. One of the terms execution, elaboration, or evaluation is defined by this Reference Manual for each construct that has a run-time effect.
subtype_indications are elaborated, and
ranges are evaluated.
statements, which are executable, but neither elaborable nor evaluable. We considered using the term "execution" only for nonelaborable, nonevaluable constructs, and defining the term "action" to mean what we have defined "execution" to mean. We rejected this idea because we thought three terms that mean the same thing was enough — four would be overkill. Thus, the term "action" is used only informally in the standard (except where it is defined as part of a larger term, such as "protected action").
entry_index_specification; and possibly
discrete_range. The last one is curious — RM83 uses the term “evaluation of a
discrete_range”, but never defines it. One might presume that the evaluation of a
discrete_rangeconsists of the evaluation of the
subtype_indication, depending on what it is. But
subtype_indications are not evaluated; they are elaborated.
declaration(if they include a trailing semicolon) or entity_
Wording Changes from Ada 83
defining_identifieris new. It is used for the defining occurrence of an
identifier. Usage occurrences use the
selector_namesyntactic categories. Each occurrence of an
operator_symbolin the Ada 83 syntax rules is handled as follows in Ada 95:
- It becomes a
defining_operator_symbol(or some syntactic category composed of these), to indicate a defining occurrence; 16.f/3
- It becomes a
direct_name, in usage occurrences where the usage is required (in Clause 8) to be directly visible; 16.g/3
- It becomes a
selector_name, in usage occurrences where the usage is required (in Clause 8) to be visible but not necessarily directly visible; 16.h
- It remains an
operator_symbol, in cases where the visibility rules do not apply (such as the
designatorthat appears after the end of a
defining_identifierafter the reserved word body, as opposed to
selector_name, not just at places where a
selector_namewas actually used. Thus, the places where a declaration is directly visible are a subset of the places where it is visible. See Clause 8 for details.)
_specifications that declare (views of) objects, such as
parameter_specifications. In Ada 83, these are referred to as a “form of declaration”, but it is not entirely clear that they are considered simply “declarations”.
compilation_units, but "elaboration" is defined elsewhere for various other constructs. To make matters worse, Ada 95 has a different set of elaborable constructs. Instead of correcting the list, it is more maintainable to refer to the term "elaborable," which is defined in a distributed manner.
declarative_partis doing the task creation.
Wording Changes from Ada 95
extended_return_statementto the list of declarations.