Table of Contents |
|
i | |
Foreword to this version of the Ada Reference Manual |
|
xi | |
Foreword |
|
xii | |
Introduction |
|
xiii | |
Section 1: General |
|
1 | |
|
|
1 | |
|
|
1 | |
|
|
2 | |
|
1.1.3 Conformity of an Implementation with the Standard |
|
|
4 | |
|
1.1.4 Method of Description and Syntax Notation |
|
|
5 | |
|
1.1.5 Classification of Errors |
|
|
7 | |
|
|
8 | |
|
|
8 | |
Section 2: Lexical Elements |
|
9 | |
|
|
9 | |
|
2.2 Lexical Elements, Separators, and Delimiters |
|
|
11 | |
|
|
12 | |
|
|
13 | |
|
|
13 | |
|
|
14 | |
|
|
14 | |
|
|
15 | |
|
|
15 | |
|
|
16 | |
|
|
18 | |
Section 3: Declarations and Types |
|
19 | |
|
|
19 | |
|
|
20 | |
|
|
22 | |
|
3.2.2 Subtype Declarations |
|
|
23 | |
|
3.2.3 Classification of Operations |
|
|
24 | |
|
3.3 Objects and Named Numbers |
|
|
25 | |
|
3.3.1 Object Declarations |
|
|
26 | |
|
3.3.2 Number Declarations |
|
|
28 | |
|
3.4 Derived Types and Classes |
|
|
29 | |
|
|
32 | |
|
|
34 | |
|
|
38 | |
|
|
39 | |
|
|
40 | |
|
|
40 | |
|
3.5.5 Operations of Discrete Types |
|
|
43 | |
|
|
44 | |
|
3.5.7 Floating Point Types |
|
|
45 | |
|
3.5.8 Operations of Floating Point Types |
|
|
47 | |
|
|
47 | |
|
3.5.10 Operations of Fixed Point Types |
|
|
49 | |
|
|
50 | |
|
3.6.1 Index Constraints and Discrete Ranges |
|
|
52 | |
|
3.6.2 Operations of Array Types |
|
|
54 | |
|
|
55 | |
|
|
55 | |
|
3.7.1 Discriminant Constraints |
|
|
58 | |
|
3.7.2 Operations of Discriminated Types |
|
|
59 | |
|
|
60 | |
|
3.8.1 Variant Parts and Discrete Choices |
|
|
62 | |
|
3.9 Tagged Types and Type Extensions |
|
|
64 | |
|
|
67 | |
|
3.9.2 Dispatching Operations of Tagged Types |
|
|
68 | |
|
3.9.3 Abstract Types and Subprograms |
|
|
71 | |
|
|
72 | |
|
|
75 | |
|
3.10.1 Incomplete Type Declarations |
|
|
77 | |
|
3.10.2 Operations of Access Types |
|
|
80 | |
|
|
84 | |
|
3.11.1 Completions of Declarations |
|
|
84 | |
Section 4: Names and Expressions |
|
87 | |
|
|
87 | |
|
|
88 | |
|
|
89 | |
|
4.1.3 Selected Components |
|
|
90 | |
|
|
92 | |
|
|
93 | |
|
|
94 | |
|
|
94 | |
|
4.3.2 Extension Aggregates |
|
|
97 | |
|
|
98 | |
|
|
101 | |
|
4.5 Operators and Expression Evaluation |
|
|
102 | |
|
4.5.1 Logical Operators and Short-circuit Control Forms |
|
|
103 | |
|
4.5.2 Relational Operators and Membership Tests |
|
|
104 | |
|
4.5.3 Binary Adding Operators |
|
|
107 | |
|
4.5.4 Unary Adding Operators |
|
|
108 | |
|
4.5.5 Multiplying Operators |
|
|
109 | |
|
4.5.6 Highest Precedence Operators |
|
|
111 | |
|
|
112 | |
|
4.7 Qualified Expressions |
|
|
116 | |
|
|
117 | |
|
4.9 Static Expressions and Static Subtypes |
|
|
119 | |
|
4.9.1 Statically Matching Constraints and Subtypes |
|
|
122 | |
Section 5: Statements |
|
123 | |
|
5.1 Simple and Compound Statements - Sequences of Statements |
|
|
123 | |
|
5.2 Assignment Statements |
|
|
124 | |
|
|
126 | |
|
|
127 | |
|
|
128 | |
|
|
130 | |
|
|
130 | |
|
|
131 | |
Section 6: Subprograms |
|
133 | |
|
6.1 Subprogram Declarations |
|
|
133 | |
|
6.2 Formal Parameter Modes |
|
|
135 | |
|
|
136 | |
|
|
137 | |
|
6.3.2 Inline Expansion of Subprograms |
|
|
139 | |
|
|
140 | |
|
6.4.1 Parameter Associations |
|
|
142 | |
|
|
143 | |
|
|
145 | |
|
6.6 Overloading of Operators |
|
|
146 | |
|
|
147 | |
Section 7: Packages |
|
149 | |
|
7.1 Package Specifications and Declarations |
|
|
149 | |
|
|
150 | |
|
7.3 Private Types and Private Extensions |
|
|
151 | |
|
|
154 | |
|
|
156 | |
|
|
157 | |
|
7.6 User-Defined Assignment and Finalization |
|
|
158 | |
|
7.6.1 Completion and Finalization |
|
|
161 | |
Section 8: Visibility Rules |
|
165 | |
|
|
165 | |
|
8.2 Scope of Declarations |
|
|
166 | |
|
|
167 | |
|
8.3.1 Overriding Indicators |
|
|
170 | |
|
|
171 | |
|
8.5 Renaming Declarations |
|
|
172 | |
|
8.5.1 Object Renaming Declarations |
|
|
172 | |
|
8.5.2 Exception Renaming Declarations |
|
|
173 | |
|
8.5.3 Package Renaming Declarations |
|
|
174 | |
|
8.5.4 Subprogram Renaming Declarations |
|
|
174 | |
|
8.5.5 Generic Renaming Declarations |
|
|
176 | |
|
8.6 The Context of Overload Resolution |
|
|
177 | |
Section 9: Tasks and Synchronization |
|
181 | |
|
9.1 Task Units and Task Objects |
|
|
181 | |
|
9.2 Task Execution - Task Activation |
|
|
184 | |
|
9.3 Task Dependence - Termination of Tasks |
|
|
185 | |
|
9.4 Protected Units and Protected Objects |
|
|
187 | |
|
9.5 Intertask Communication |
|
|
190 | |
|
9.5.1 Protected Subprograms and Protected Actions |
|
|
191 | |
|
9.5.2 Entries and Accept Statements |
|
|
192 | |
|
|
195 | |
|
|
198 | |
|
9.6 Delay Statements, Duration, and Time |
|
|
199 | |
|
9.6.1 Formatting, Time Zones, and other operations for Time |
|
|
202 | |
|
|
208 | |
|
|
209 | |
|
|
211 | |
|
9.7.3 Conditional Entry Calls |
|
|
212 | |
|
9.7.4 Asynchronous Transfer of Control |
|
|
213 | |
|
9.8 Abort of a Task - Abort of a Sequence of Statements |
|
|
214 | |
|
9.9 Task and Entry Attributes |
|
|
215 | |
|
|
216 | |
|
9.11 Example of Tasking and Synchronization |
|
|
217 | |
Section 10: Program Structure and Compilation Issues |
|
219 | |
|
10.1 Separate Compilation |
|
|
219 | |
|
10.1.1 Compilation Units - Library Units |
|
|
219 | |
|
10.1.2 Context Clauses - With Clauses |
|
|
222 | |
|
10.1.3 Subunits of Compilation Units |
|
|
224 | |
|
10.1.4 The Compilation Process |
|
|
226 | |
|
10.1.5 Pragmas and Program Units |
|
|
227 | |
|
10.1.6 Environment-Level Visibility Rules |
|
|
228 | |
|
|
229 | |
|
10.2.1 Elaboration Control |
|
|
231 | |
Section 11: Exceptions |
|
235 | |
|
11.1 Exception Declarations |
|
|
235 | |
|
|
235 | |
|
|
236 | |
|
|
237 | |
|
11.4.1 The Package Exceptions |
|
|
238 | |
|
11.4.2 Pragmas Assert and Assertion_Policy |
|
|
240 | |
|
11.4.3 Example of Exception Handling |
|
|
241 | |
|
|
242 | |
|
11.6 Exceptions and Optimization |
|
|
245 | |
Section 12: Generic Units |
|
247 | |
|
12.1 Generic Declarations |
|
|
247 | |
|
|
249 | |
|
12.3 Generic Instantiation |
|
|
250 | |
|
|
252 | |
|
|
254 | |
|
12.5.1 Formal Private and Derived Types |
|
|
255 | |
|
12.5.2 Formal Scalar Types |
|
|
257 | |
|
12.5.3 Formal Array Types |
|
|
258 | |
|
12.5.4 Formal Access Types |
|
|
259 | |
|
12.5.5 Formal Interface Types |
|
|
259 | |
|
|
260 | |
|
|
262 | |
|
12.8 Example of a Generic Package |
|
|
264 | |
Section 13: Representation Issues |
|
267 | |
|
13.1 Operational and Representation Items |
|
|
267 | |
|
|
270 | |
|
13.3 Operational and Representation Attributes |
|
|
271 | |
|
13.4 Enumeration Representation Clauses |
|
|
277 | |
|
|
278 | |
|
13.5.1 Record Representation Clauses |
|
|
278 | |
|
13.5.2 Storage Place Attributes |
|
|
280 | |
|
|
281 | |
|
13.6 Change of Representation |
|
|
282 | |
|
|
283 | |
|
13.7.1 The Package System.Storage_Elements |
|
|
285 | |
|
13.7.2 The Package System.Address_To_Access_Conversions |
|
|
286 | |
|
13.8 Machine Code Insertions |
|
|
286 | |
|
13.9 Unchecked Type Conversions |
|
|
287 | |
|
|
288 | |
|
13.9.2 The Valid Attribute |
|
|
289 | |
|
13.10 Unchecked Access Value Creation |
|
|
290 | |
|
|
290 | |
|
13.11.1 The Max_Size_In_Storage_Elements Attribute |
|
|
293 | |
|
13.11.2 Unchecked Storage Deallocation |
|
|
294 | |
|
13.11.3 Pragma Controlled |
|
|
295 | |
|
13.12 Pragma Restrictions |
|
|
295 | |
|
13.12.1 Language-Defined Restrictions |
|
|
296 | |
|
|
297 | |
|
13.13.1 The Package Streams |
|
|
297 | |
|
13.13.2 Stream-Oriented Attributes |
|
|
298 | |
|
|
303 | |
|
|
305 | |
Annex A (normative) Predefined Language Environment |
|
307 | |
|
|
309 | |
|
|
313 | |
|
|
313 | |
|
A.3.1 The Packages Characters, Wide_Characters, and Wide_Wide_Characters |
|
|
314 | |
|
A.3.2 The Package Characters.Handling |
|
|
314 | |
|
A.3.3 The Package Characters.Latin_1 |
|
|
317 | |
|
A.3.4 The Package Characters.Conversions |
|
|
322 | |
|
|
324 | |
|
A.4.1 The Package Strings |
|
|
324 | |
|
A.4.2 The Package Strings.Maps |
|
|
324 | |
|
A.4.3 Fixed-Length String Handling |
|
|
327 | |
|
A.4.4 Bounded-Length String Handling |
|
|
336 | |
|
A.4.5 Unbounded-Length String Handling |
|
|
343 | |
|
A.4.6 String-Handling Sets and Mappings |
|
|
348 | |
|
A.4.7 Wide_String Handling |
|
|
348 | |
|
A.4.8 Wide_Wide_String Handling |
|
|
351 | |
|
|
353 | |
|
A.5 The Numerics Packages |
|
|
354 | |
|
A.5.1 Elementary Functions |
|
|
355 | |
|
A.5.2 Random Number Generation |
|
|
358 | |
|
A.5.3 Attributes of Floating Point Types |
|
|
363 | |
|
A.5.4 Attributes of Fixed Point Types |
|
|
367 | |
|
|
367 | |
|
A.7 External Files and File Objects |
|
|
367 | |
|
A.8 Sequential and Direct Files |
|
|
369 | |
|
A.8.1 The Generic Package Sequential_IO |
|
|
369 | |
|
|
370 | |
|
A.8.3 Sequential Input-Output Operations |
|
|
372 | |
|
A.8.4 The Generic Package Direct_IO |
|
|
373 | |
|
A.8.5 Direct Input-Output Operations |
|
|
374 | |
|
A.9 The Generic Package Storage_IO |
|
|
375 | |
|
|
375 | |
|
A.10.1 The Package Text_IO |
|
|
377 | |
|
A.10.2 Text File Management |
|
|
382 | |
|
A.10.3 Default Input, Output, and Error Files |
|
|
383 | |
|
A.10.4 Specification of Line and Page Lengths |
|
|
384 | |
|
A.10.5 Operations on Columns, Lines, and Pages |
|
|
385 | |
|
A.10.6 Get and Put Procedures |
|
|
388 | |
|
A.10.7 Input-Output of Characters and Strings |
|
|
389 | |
|
A.10.8 Input-Output for Integer Types |
|
|
391 | |
|
A.10.9 Input-Output for Real Types |
|
|
393 | |
|
A.10.10 Input-Output for Enumeration Types |
|
|
396 | |
|
A.10.11 Input-Output for Bounded Strings |
|
|
397 | |
|
A.10.12 Input-Output for Unbounded Strings |
|
|
398 | |
|
A.11 Wide Text Input-Output and Wide Wide Text Input-Output |
|
|
399 | |
|
|
400 | |
|
A.12.1 The Package Streams.Stream_IO |
|
|
400 | |
|
A.12.2 The Package Text_IO.Text_Streams |
|
|
403 | |
|
A.12.3 The Package Wide_Text_IO.Text_Streams |
|
|
403 | |
|
A.12.4 The Package Wide_Wide_Text_IO.Text_Streams |
|
|
403 | |
|
A.13 Exceptions in Input-Output |
|
|
404 | |
|
|
405 | |
|
A.15 The Package Command_Line |
|
|
405 | |
|
A.16 The Package Directories |
|
|
407 | |
|
A.17 The Package Environment_Variables |
|
|
414 | |
|
|
417 | |
|
A.18.1 The Package Containers |
|
|
417 | |
|
A.18.2 The Package Containers.Vectors |
|
|
417 | |
|
A.18.3 The Package Containers.Doubly_Linked_Lists |
|
|
431 | |
|
|
440 | |
|
A.18.5 The Package Containers.Hashed_Maps |
|
|
445 | |
|
A.18.6 The Package Containers.Ordered_Maps |
|
|
448 | |
|
|
452 | |
|
A.18.8 The Package Containers.Hashed_Sets |
|
|
458 | |
|
A.18.9 The Package Containers.Ordered_Sets |
|
|
462 | |
|
A.18.10 The Package Containers.Indefinite_Vectors |
|
|
466 | |
|
A.18.11 The Package Containers.lndefinite_Doubly_Linked_Lists |
|
|
467 | |
|
A.18.12 The Package Containers.Indefinite_Hashed_Maps |
|
|
467 | |
|
A.18.13 The Package Containers.Indefinite_Ordered_Maps |
|
|
468 | |
|
A.18.14 The Package Containers.lndefinite_Hashed_Sets |
|
|
468 | |
|
A.18.15 The Package Containersindefinite_Ordered_Sets |
|
|
468 | |
|
|
469 | |
Annex B (normative) Interface to Other Languages |
|
471 | |
|
|
471 | |
|
B.2 The Package Interfaces |
|
|
474 | |
|
B.3 Interfacing with C and C++ |
|
|
475 | |
|
B.3.1 The Package Interfaces.C.Strings |
|
|
482 | |
|
B.3.2 The Generic Package Interfaces.C.Pointers |
|
|
485 | |
|
B.3.3 Pragma Unchecked_Union |
|
|
488 | |
|
B.4 Interfacing with COBOL |
|
|
490 | |
|
B.5 Interfacing with Fortran |
|
|
496 | |
Annex C (normative) Systems Programming |
|
499 | |
|
C.1 Access to Machine Operations |
|
|
499 | |
|
C.2 Required Representation Support |
|
|
500 | |
|
|
500 | |
|
C.3.1 Protected Procedure Handlers |
|
|
502 | |
|
C.3.2 The Package Interrupts |
|
|
504 | |
|
C.4 Preelaboration Requirements |
|
|
506 | |
|
|
507 | |
|
C.6 Shared Variable Control |
|
|
507 | |
|
|
509 | |
|
C.7.1 The Package Task_Identification |
|
|
509 | |
|
C.7.2 The Package Task_Attributes |
|
|
511 | |
|
C.7.3 The Package Task_Termination |
|
|
513 | |
Annex D (normative) Real-Time Systems |
|
515 | |
|
|
515 | |
|
|
517 | |
|
D.2.1 The Task Dispatching Model |
|
|
517 | |
|
D.2.2 Task Dispatching Pragmas |
|
|
519 | |
|
D.2.3 Preemptive Dispatching |
|
|
520 | |
|
D.2.4 Non-Preemptive Dispatching |
|
|
521 | |
|
D.2.5 Round Robin Dispatching |
|
|
522 | |
|
D.2.6 Earliest Deadline First Dispatching |
|
|
524 | |
|
D.3 Priority Ceiling Locking |
|
|
526 | |
|
D.4 Entry Queuing Policies |
|
|
528 | |
|
|
529 | |
|
D.5.1 Dynamic Priorities for Tasks |
|
|
529 | |
|
D.5.2 Dynamic Priorities for Protected Objects |
|
|
531 | |
|
|
532 | |
|
|
533 | |
|
|
535 | |
|
|
538 | |
|
D.10 Synchronous Task Control |
|
|
539 | |
|
D.11 Asynchronous Task Control |
|
|
540 | |
|
D.12 Other Optimizations and Determinism Rules |
|
|
541 | |
|
|
542 | |
|
D.13.1 The Ravenscar Profile |
|
|
543 | |
|
|
544 | |
|
D.14.1 Execution Time Timers |
|
|
546 | |
|
D.14.2 Group Execution Time Budgets |
|
|
548 | |
|
|
550 | |
Annex E (normative) Distributed Systems |
|
553 | |
|
|
553 | |
|
E.2 Categorization of Library Units |
|
|
554 | |
|
E.2.1 Shared Passive Library Units |
|
|
555 | |
|
E.2.2 Remote Types Library Units |
|
|
556 | |
|
E.2.3 Remote Call Interface Library Units |
|
|
557 | |
|
E.3 Consistency of a Distributed System |
|
|
558 | |
|
E.4 Remote Subprogram Calls |
|
|
559 | |
|
E.4.1 Pragma Asynchronous |
|
|
561 | |
|
E.4.2 Example of Use of a Remote Access-to-Class-Wide Type |
|
|
561 | |
|
E.5 Partition Communication Subsystem |
|
|
563 | |
Annex F (normative) Information Systems |
|
567 | |
|
F.1 Machine Radix Attribute Definition Clause |
|
|
567 | |
|
|
568 | |
|
F.3 Edited Output for Decimal Types |
|
|
569 | |
|
F.3.1 Picture String Formation |
|
|
570 | |
|
F.3.2 Edited Output Generation |
|
|
574 | |
|
F.3.3 The Package Text_IO.Editing |
|
|
578 | |
|
F.3.4 The Package Wide_Text_IO.Editing |
|
|
581 | |
|
F.3.5 The Package Wide_Wide_Text_IO.Editing |
|
|
581 | |
Annex G (normative) Numerics |
|
583 | |
|
|
583 | |
|
|
583 | |
|
G.1.2 Complex Elementary Functions |
|
|
588 | |
|
G.1.3 Complex Input-Output |
|
|
591 | |
|
G.1.4 The Package Wide_Text_IO.Complex_IO |
|
|
594 | |
|
G.1.5 The Package Wide_Wide_Text_IO.Complex_IO |
|
|
594 | |
|
G.2 Numeric Performance Requirements |
|
|
594 | |
|
G.2.1 Model of Floating Point Arithmetic |
|
|
595 | |
|
G.2.2 Model-Oriented Attributes of Floating Point Types |
|
|
596 | |
|
G.2.3 Model of Fixed Point Arithmetic |
|
|
597 | |
|
G.2.4 Accuracy Requirements for the Elementary Functions |
|
|
599 | |
|
G.2.5 Performance Requirements for Random Number Generation |
|
|
601 | |
|
G.2.6 Accuracy Requirements for Complex Arithmetic |
|
|
601 | |
|
G.3 Vector and Matrix Manipulation |
|
|
603 | |
|
G.3.1 Real Vectors and Matrices |
|
|
603 | |
|
G.3.2 Complex Vectors and Matrices |
|
|
608 | |
Annex H (normative) High Integrity Systems |
|
619 | |
|
H.1 Pragma Normalize_Scalars |
|
|
619 | |
|
H.2 Documentation of Implementation Decisions |
|
|
620 | |
|
H.3 Reviewable Object Code |
|
|
620 | |
|
|
620 | |
|
H.3.2 Pragma Inspection_Point |
|
|
621 | |
|
H.4 High Integrity Restrictions |
|
|
622 | |
|
H.5 Pragma Detect_Blocking |
|
|
624 | |
|
H.6 Pragma Partition_Elaboration_Policy |
|
|
625 | |
Annex J (normative) Obsolescent Features |
|
627 | |
|
J.1 Renamings of Ada 83 Library Units |
|
|
627 | |
|
J.2 Allowed Replacements of Characters |
|
|
627 | |
|
J.3 Reduced Accuracy Subtypes |
|
|
628 | |
|
J.4 The Constrained Attribute |
|
|
629 | |
|
|
629 | |
|
|
630 | |
|
|
630 | |
|
|
630 | |
|
|
632 | |
|
J.9 The Storage_Size Attribute |
|
|
632 | |
|
J.10 Specific Suppression of Checks |
|
|
632 | |
|
J.11 The Class Attribute of Untagged Incomplete Types |
|
|
633 | |
|
|
633 | |
|
J.13 Dependence Restriction Identifiers |
|
|
633 | |
|
J.14 Character and Wide Character Conversion Functions |
|
|
634 | |
Annex K (informative) Language-Defined Attributes |
|
635 | |
Annex L (informative) Language-Defined Pragmas |
|
651 | |
Annex M (informative) Summary of Documentation Requirements |
|
653 | |
|
M.1 Specific Documentation Requirements |
|
|
653 | |
|
M.2 Implementation-Defined Characteristics |
|
|
655 | |
|
M.3 Implementation Advice |
|
|
661 | |
Annex N (informative) Glossary |
|
669 | |
Annex P (informative) Syntax Summary |
|
675 | |
Annex Q (informative) Language-Defined Entities |
|
703 | |
|
Q.1 Language-Defined Packages |
|
|
703 | |
|
Q.2 Language-Defined Types and Subtypes |
|
|
705 | |
|
Q.3 Language-Defined Subprograms |
|
|
709 | |
|
Q.4 Language-Defined Exceptions |
|
|
717 | |
|
Q.5 Language-Defined Objects |
|
|
718 | |
Index |
|
723 | |