Annotated Ada Reference Manual (Ada 202y Draft 1)Legal Information
Contents   Index   References   Search   Previous   Next 

J.15.14 Elaboration Control Pragmas

1/5
{AI12-0409-1} This subclause defines pragmas that specify aspects that help control the elaboration order of library_items.
1.a/5
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

2/5
{AI12-0417-1} The following pragmas are defined with the given forms: 
3/5
  pragma Preelaborate[(library_unit_name)];
4/5
  pragma Preelaborable_Initialization(direct_name);
5/5
  pragma Pure[(library_unit_name)];
6/5
  pragma Elaborate_Body[(library_unit_name)];
7/5
{AI12-0417-1} Pragmas Preelaborate, Pure, and Elaborate_Body are library unit pragmas.
7.a/5
Ramification: Pragma Preelaborable_Initialization is not a library unit pragma. 

Static Semantics

8/5
{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.
9/5
{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.
10/5
{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

11/5
{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.
12/5
{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.
13/5
{AI12-0409-1} If the pragma appears in a generic_formal_part, then the direct_name shall denote a type declared in the same generic_formal_part as the pragma, and be one for which the Preelaborable_Initialization aspect can be directly specified as True. 
14/5
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

14.a/5
{AI12-0409-1} This subclause is new. These pragmas were moved here from 10.2.1.

Contents   Index   References   Search   Previous   Next 
Ada-Europe Ada 2005 and 2012 Editions sponsored in part by Ada-Europe