Consolidated Ada Reference Manual — 2005 Edition
305 8 November 2006 The Standard Libraries
The Standard Libraries
Consolidated Ada Reference Manual — 2005 Edition
1 8 November 2006
INTERNATIONAL STANDARD ISO/IEC 8652:2007(E), Ed. 3
Information technology — Programming
Languages — Ada
Section 1: General
Ada is a programming language designed to support the construction of long-lived, highly reliable
software systems. The language includes facilities to define packages of related types, objects, and
operations. The packages may be parameterized and the types may be extended to support the construction
of libraries of reusable, adaptable software components. The operations may be implemented as
subprograms using conventional sequential control structures, or as entries that include synchronization of
concurrent threads of control as part of their invocation. The language treats modularity in the physical
sense as well, with a facility to support separate compilation.
The language includes a complete facility for the support of real-time, concurrent programming. Errors
can be signaled as exceptions and handled explicitly. The language also covers systems programming; this
requires precise control over the representation of data and access to system-dependent properties. Finally,
a predefined environment of standard packages is provided, including facilities for, among others, input-
output, string manipulation, numeric elementary functions, and random number generation.
1.1 Scope
This International Standard specifies the form and meaning of programs written in Ada. Its purpose is to
promote the portability of Ada programs to a variety of data processing systems.
1.1.1 Extent
This International Standard specifies:
• The form of a program written in Ada;
• The effect of translating and executing such a program;
• The manner in which program units may be combined to form Ada programs;
• The language-defined library units that a conforming implementation is required to supply;
• The permissible variations within the standard, and the manner in which they are to be
documented;
1
2
1
1
2
3
4
5
6
Consolidated Ada Reference Manual — 2005 Edition
1.1.1 Extent 8 November 2006 2
• Those violations of the standard that a conforming implementation is required to detect, and the
effect of attempting to translate or execute a program containing such violations;
• Those violations of the standard that a conforming implementation is not required to detect.
This International Standard does not specify:
• The means whereby a program written in Ada is transformed into object code executable by a
processor;
• The means whereby translation or execution of programs is invoked and the executing units are
controlled;
• The size or speed of the object code, or the relative execution speed of different language
constructs;
• The form or contents of any listings produced by implementations; in particular, the form or
contents of error or warning messages;
• The effect of unspecified execution.
• The size of a program or program unit that will exceed the capacity of a particular conforming
implementation.
1.1.2 Structure
This International Standard contains thirteen sections, fourteen annexes, and an index.
The core of the Ada language consists of:
• Sections 1 through 13
• Annex A, “Predefined Language Environment”
• Annex B, “Interface to Other Languages”
• Annex J, “Obsolescent Features”
The following Specialized Needs Annexes define features that are needed by certain application areas:
• Annex C, “Systems Programming”
• Annex D, “Real-Time Systems”
• Annex E, “Distributed Systems”
• Annex F, “Information Systems”
• Annex G, “Numerics”
• Annex H, “High Integrity Systems”
The core language and the Specialized Needs Annexes are normative, except that the material in each of
the items listed below is informative:
• Text under a NOTES or Examples heading.
• Each clause or subclause whose title starts with the word “Example” or “Examples”.
All implementations shall conform to the core language. In addition, an implementation may conform
separately to one or more Specialized Needs Annexes.
7
8
9
10
11
12
13
14
15
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Consolidated Ada Reference Manual — 2005 Edition
3 8 November 2006 Structure 1.1.2
The following Annexes are informative:
• Annex K, “Language-Defined Attributes”
• Annex L, “Language-Defined Pragmas”
• M.2, “Implementation-Defined Characteristics”
• Annex N, “Glossary”
• Annex P, “Syntax Summary”
Each section is divided into clauses and subclauses that have a common structure. Each section, clause,
and subclause first introduces its subject. After the introductory text, text is labeled with the following
headings:
Syntax
Syntax rules (indented).
Name Resolution Rules
Compile-time rules that are used in name resolution, including overload resolution.
Legality Rules
Rules that are enforced at compile time. A construct is legal if it obeys all of the Legality Rules.
Static Semantics
A definition of the compile-time effect of each construct.
Post-Compilation Rules
Rules that are enforced before running a partition. A partition is legal if its compilation units are legal and
it obeys all of the Post-Compilation Rules.
Dynamic Semantics
A definition of the run-time effect of each construct.
Bounded (Run-Time) Errors
Situations that result in bounded (run-time) errors (see 1.1.5).
Erroneous Execution
Situations that result in erroneous execution (see 1.1.5).
Implementation Requirements
Additional requirements for conforming implementations.
Documentation Requirements
Documentation requirements for conforming implementations.
Metrics
Metrics that are specified for the time/space properties of the execution of certain language constructs.
Implementation Permissions
Additional permissions given to the implementer.
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
Consolidated Ada Reference Manual — 2005 Edition
1.1.2 Structure 8 November 2006 4
Implementation Advice
Optional advice given to the implementer. The word “should” is used to indicate that the advice is a
recommendation, not a requirement. It is implementation defined whether or not a given recommendation
is obeyed.
NOTES
1 Notes emphasize consequences of the rules described in the (sub)clause or elsewhere. This material is informative.
Examples
Examples illustrate the possible forms of the constructs described. This material is informative.
1.1.3 Conformity of an Implementation with the Standard
Implementation Requirements
A conforming implementation shall:
• Translate and correctly execute legal programs written in Ada, provided that they are not so
large as to exceed the capacity of the implementation;
• Identify all programs or program units that are so large as to exceed the capacity of the
implementation (or raise an appropriate exception at run time);
• Identify all programs or program units that contain errors whose detection is required by this
International Standard;
• Supply all language-defined library units required by this International Standard;
• Contain no variations except those explicitly permitted by this International Standard, or those
that are impossible or impractical to avoid given the implementation's execution environment;
• Specify all such variations in the manner prescribed by this International Standard.
The external effect of the execution of an Ada program is defined in terms of its interactions with its
external environment. The following are defined as external interactions:
• Any interaction with an external file (see A.7);
• The execution of certain
code_statements (see 13.8); which code_statements cause external
interactions is implementation defined.
• Any call on an imported subprogram (see Annex B), including any parameters passed to it;
• Any result returned or exception propagated from a main subprogram (see 10.2) or an exported
subprogram (see Annex B) to an external caller;
• Any read or update of an atomic or volatile object (see C.6);
• The values of imported and exported objects (see Annex B) at the time of any other interaction
with the external environment.
A conforming implementation of this International Standard shall produce for the execution of a given
Ada program a set of interactions with the external environment whose order and timing are consistent
with the definitions and requirements of this International Standard for the semantics of the given program.
An implementation that conforms to this Standard shall support each capability required by the core
language as specified. In addition, an implementation that conforms to this Standard may conform to one
or more Specialized Needs Annexes (or to none). Conformance to a Specialized Needs Annex means that
each capability required by the Annex is provided as specified.
37
38
39
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
评论1