J.15.14 Elaboration Control Pragmas
{
AI12-0409-1}
This subclause defines pragmas that specify aspects that help control
the elaboration order of
library_items.
Discussion: {
AI12-0417-1}
Pragmas that do not have associated aspects still appear in
10.2.1.
These pragmas are presented in the order that the aspects are defined
in
10.2.1.
Syntax
pragma Preelaborate[(
library_unit_name)];
pragma Pure[(
library_unit_name)];
pragma Elaborate_Body[(
library_unit_name)];
{
AI12-0417-1}
Pragmas
Preelaborate, Pure, and Elaborate_Body are library unit pragmas.
Ramification: Pragma
Preelaborable_Initialization is
not a library unit pragma.
Static Semantics
{
AI12-0417-1}
A
pragma Preelaborate
specifies that a library unit is preelaborated, namely that the Preelaborate
aspect (see
10.2.1) of the library unit
is True.
{
AI12-0417-1}
A
pragma Pure
specifies that a library unit is declared pure, namely that the Pure
aspect (see
10.2.1) of the library unit
is True.
{
AI12-0417-1}
A
pragma Elaborate_Body
specifies that [a library unit requires a completion, namely that] the
Elaborate_Body aspect (see
10.2.1) of the
library unit is True.
Legality Rules
{
AI12-0409-1}
A
pragma Preelaborable_Initialization
specifies that the Preelaborable_Initialization aspect (see
10.2.1)
for a composite type is True. This pragma shall appear in the visible
part of a package or generic package.
{
AI12-0409-1}
If the pragma appears in the first declaration list of a
package_specification,
then the
direct_name
shall denote the first subtype of a composite type, and the type shall
be declared immediately within the same package as the pragma. The composite
type shall be one for which the Preelaborable_Initialization aspect can
be directly specified as True. In addition to the places where Legality
Rules normally apply (see
12.3), these rules
also apply in the private part of an instance of a generic unit.
NOTE {
AI12-0409-1}
Pragmas Elaborate and Elaborate_All, which do not have associated aspects,
are found in
10.2.1.
Wording Changes from Ada 2012
Ada 2005 and 2012 Editions sponsored in part by Ada-Europe