3.1 Declarations
There are several forms of declaration. A
basic_declaration
is a form of declaration defined as follows.
Syntax
Static Semantics
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).
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)).
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
direct_name
or
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.
Dynamic Semantics
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 International Standard for each construct that has
a run-time effect.
1
At compile time,
the declaration of an entity
declares the entity.
At
run time, the elaboration of the declaration
creates the entity.