Information technology — Programming languages — Ada

This document specifies the form and meaning of programs written in Ada. Its purpose is to promote the portability of Ada programs to a variety of computing systems. This document specifies: — The form of a program written in Ada; — The effect of translating and executing such a program; — The manner in which program units can be combined to form Ada programs; — The language-defined library units that a conforming implementation is required to supply; — The permissible variations in conformance to the rules of this document, and the manner in which they are to be documented; — Those violations of the requirements of this document 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 requirements of this document that a conforming implementation is not required to detect. This document 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.

Technologies de l'information — Langages de programmation — Ada

[Not translated]

General Information

Status
Published
Publication Date
01-May-2023
Current Stage
6060 - International Standard published
Start Date
02-May-2023
Due Date
25-Feb-2023
Completion Date
02-May-2023

Relations

Buy Standard

Standard
ISO/IEC 8652:2023 - Information technology — Programming languages — Ada Released:2. 05. 2023
English language
1048 pages
sale 15% off
Preview
sale 15% off
Preview

Standards Content (Sample)

INTERNATIONAL ISO/IEC
STANDARD 8652
Fourth edition
2023-05
Information technology —
Programming languages — Ada
Technologies de l'information — Langages de programmation — Ada
Reference number
ISO/IEC 8652:2023(E)
© ISO/IEC 2023

---------------------- Page: 1 ----------------------
ISO/IEC 8652:2023(E)
COPYRIGHT PROTECTED DOCUMENT
© ISO/IEC 2023
All rights reserved. Unless otherwise specified, or required in the context of its implementation, no part of this publication may
be reproduced or utilized otherwise in any form or by any means, electronic or mechanical, including photocopying, or posting on
the internet or an intranet, without prior written permission. Permission can be requested from either ISO at the address below
or ISO’s member body in the country of the requester.
ISO copyright office
CP 401 • Ch. de Blandonnet 8
CH-1214 Vernier, Geneva
Phone: +41 22 749 01 11
Email: copyright@iso.org
Website: www.iso.org
Published in Switzerland
ii
  © ISO/IEC 2023 – All rights reserved

---------------------- Page: 2 ----------------------
ISO/IEC 8652:2023(E)
Contents

Foreword . xiii
Introduction . xv
1 Scope . 1
2 Normative references . 1
3 Terms and definitions . 2
3.1 Types, objects, and their properties . 2
3.2 Subprograms and their properties . 7
3.3 Other syntactic constructs . 7
3.4 Runtime actions . 10
3.5 Exceptional situations . 10
4 General . 11
4.1 Structure . 11
4.2 Conformity of an Implementation . 12
4.3 Method of Description and Syntax Notation . 14
4.4 Classification of Errors . 15
5 Lexical Elements . 16
5.1 Character Set . 16
5.2 Lexical Elements, Separators, and Delimiters . 18
5.3 Identifiers . 19
5.4 Numeric Literals . 20
5.4.1 Decimal Literals . 20
5.4.2 Based Literals . 21
5.5 Character Literals . 21
5.6 String Literals . 21
5.7 Comments . 22
5.8 Pragmas . 22
5.9 Reserved Words . 25
6 Declarations and Types . 25
6.1 Declarations . 25
6.2 Types and Subtypes . 27
6.2.1 Type Declarations. 28
6.2.2 Subtype Declarations . 29
6.2.3 Classification of Operations . 30
6.2.4 Subtype Predicates . 31
6.3 Objects and Named Numbers . 34
6.3.1 Object Declarations . 36
6.3.2 Number Declarations . 39
6.4 Derived Types and Classes . 39
6.4.1 Derivation Classes . 42
6.5 Scalar Types . 44
6.5.1 Enumeration Types . 47
6.5.2 Character Types . 48
6.5.3 Boolean Types . 49
6.5.4 Integer Types . 49
6.5.5 Operations of Discrete Types . 52
6.5.6 Real Types . 53
6.5.7 Floating Point Types . 54
© ISO/IEC 2023 – All rights reserved iii

---------------------- Page: 3 ----------------------
ISO/IEC 8652:2023(E)
6.5.8 Operations of Floating Point Types . 55
6.5.9 Fixed Point Types . 56
6.5.10 Operations of Fixed Point Types . 58
6.6 Array Types . 59
6.6.1 Index Constraints and Discrete Ranges . 61
6.6.2 Operations of Array Types . 62
6.6.3 String Types . 63
6.7 Discriminants . 63
6.7.1 Discriminant Constraints . 66
6.7.2 Operations of Discriminated Types . 67
6.8 Record Types . 67
6.8.1 Variant Parts and Discrete Choices . 70
6.9 Tagged Types and Type Extensions . 72
6.9.1 Type Extensions . 75
6.9.2 Dispatching Operations of Tagged Types . 76
6.9.3 Abstract Types and Subprograms . 79
6.9.4 Interface Types . 80
6.10 Access Types . 82
6.10.1 Incomplete Type Declarations . 85
6.10.2 Operations of Access Types . 87
6.11 Declarative Parts . 93
6.11.1 Completions of Declarations . 93
7 Names and Expressions . 94
7.1 Names . 94
7.1.1 Indexed Components . 95
7.1.2 Slices . 96
7.1.3 Selected Components . 97
7.1.4 Attributes . 99
7.1.5 User-Defined References . 100
7.1.6 User-Defined Indexing . 101
7.2 Literals . 103
7.2.1 User-Defined Literals . 104
7.3 Aggregates . 106
7.3.1 Record Aggregates . 106
7.3.2 Extension Aggregates . 108
7.3.3 Array Aggregates . 110
7.3.4 Delta Aggregates . 114
7.3.5 Container Aggregates . 115
7.4 Expressions . 121
7.5 Operators and Expression Evaluation . 123
7.5.1 Logical Operators and Short-circuit Control Forms . 124
7.5.2 Relational Operators and Membership Tests . 125
7.5.3 Binary Adding Operators . 128
7.5.4 Unary Adding Operators . 129
7.5.5 Multiplying Operators . 129
7.5.6 Highest Precedence Operators . 132
7.5.7 Conditional Expressions . 132
7.5.8 Quantified Expressions . 134
7.5.9 Declare Expressions . 135
7.5.10 Reduction Expressions . 136
7.6 Type Conversions. 139
7.7 Qualified Expressions . 144
7.8 Allocators . 144
7.9 Static Expressions and Static Subtypes . 146
7.9.1 Statically Matching Constraints and Subtypes . 150
iv © ISO/IEC 2023 – All rights reserved

---------------------- Page: 4 ----------------------
ISO/IEC 8652:2023(E)
7.10 Image Attributes . 151
8 Statements . 154
8.1 Simple and Compound Statements - Sequences of Statements . 155
8.2 Assignment Statements . 156
8.2.1 Target Name Symbols. 158
8.3 If Statements . 158
8.4 Case Statements . 159
8.5 Loop Statements . 160
8.5.1 User-Defined Iterator Types . 164
8.5.2 Generalized Loop Iteration . 166
8.5.3 Procedural Iterators . 169
8.6 Block Statements . 172
8.6.1 Parallel Block Statements . 172
8.7 Exit Statements . 174
8.8 Goto Statements . 175
9 Subprograms . 175
9.1 Subprogram Declarations . 176
9.1.1 Preconditions and Postconditions . 178
9.1.2 The Global and Global'Class Aspects. 183
9.2 Formal Parameter Modes . 186
9.3 Subprogram Bodies . 187
9.3.1 Conformance Rules . 188
9.3.2 Inline Expansion of Subprograms. 190
9.4 Subprogram Calls . 190
9.4.1 Parameter Associations . 192
9.5 Return Statements . 194
9.5.1 Nonreturning Subprograms. 197
9.6 Overloading of Operators . 198
9.7 Null Procedures . 199
9.8 Expression Functions . 199
10 Packages . 201
10.1 Package Specifications and Declarations . 201
10.2 Package Bodies . 202
10.3 Private Types and Private Extensions . 203
10.3.1 Private Operations . 205
10.3.2 Type Invariants . 208
10.3.3 Default Initial Conditions . 211
10.3.4 Stable Properties of a Type . 211
10.4 Deferred Constants . 213
10.5 Limited Types . 214
10.6 Assignment and Finalization . 216
10.6.1 Completion and Finalization . 219
11 Visibility Rules . 221
11.1 Declarative Region . 221
11.2 Scope of Declarations . 222
11.3 Visibility . 223
11.3.1 Overriding Indicators. 226
11.4 Use Clauses. 227
11.5 Renaming Declarations . 228
11.5.1 Object Renaming Declarations . 228
11.5.2 Exception Renaming Declarations . 230
11.5.3 Package Renaming Declarations . 230
11.5.4 Subprogram Renaming Declarations . 230
© ISO/IEC 2023 – All rights reserved v

---------------------- Page: 5 ----------------------
ISO/IEC 8652:2023(E)
11.5.5 Generic Renaming Declarations . 232
11.6 The Context of Overload Resolution . 233
12 Tasks and Synchronization . 235
12.1 Task Units and Task Objects . 236
12.2 Task Execution - Task Activation . 238
12.3 Task Dependence - Termination of Tasks . 239
12.4 Protected Units and Protected Objects . 241
12.5 Intertask Communication . 244
12.5.1 Protected Subprograms and Protected Actions . 248
12.5.2 Entries and Accept Statements. 250
12.5.3 Entry Calls . 253
12.5.4 Requeue Statements . 255
12.6 Delay Statements, Duration, and Time . 257
12.6.1 Formatting, Time Zones, and other operations for Time . 260
12.7 Select Statements . 266
12.7.1 Selective Accept . 266
12.7.2 Timed Entry Calls . 268
12.7.3 Conditional Entry Calls . 269
12.7.4 Asynchronous Transfer of Control. 269
12.8 Abort of a Task - Abort of a Sequence of Statements . 270
12.9 Task and Entry Attributes . 272
12.10 Shared Variables . 272
12.10.1 Conflict Check Policies . 274
12.11 Example of Tasking and Synchronization . 276
13 Program Structure and Compilation Issues . 277
13.1 Separate Compilation . 277
13.1.1 Compilation Units - Library Units . 278
13.1.2 Context Clauses - With Clauses . 281
13.1.3 Subunits of Compilation Units . 283
13.1.4 The Compilation Process . 284
13.1.5 Pragmas and Program Units . 285
13.1.6 Environment-Level Visibility Rules . 286
13.2 Program Execution . 286
13.2.1 Elaboration Control . 288
14 Exceptions . 291
14.1 Exception Declarations . 292
14.2 Exception Handlers . 292
14.3 Raise Statements and Raise Expressions . 293
14.4 Exception Handling . 294
14.4.1 The Package Exceptions. 295
14.4.2 Pragmas Assert and Assertion_Policy . 297
14.4.3 Example of Exception Handling . 299
14.5 Suppressing Checks . 300
14.6 Exceptions and Optimization . 303
15 Generic Units . 304
15.1 Generic Declarations . 304
15.2 Generic Bodies . 306
15.3 Generic Instantiation . 307
15.4 Formal Objects . 309
15.5 Formal Types . 310
15.5.1 Formal Private and Derived Types . 312
15.5.2 Formal Scalar Types . 314
15.5.3 Formal Array Types . 314
vi © ISO/IEC 2023 – All rights reserved

---------------------- Page: 6 ----------------------
ISO/IEC 8652:2023(E)
15.5.4 Formal Access Types .
...

Questions, Comments and Discussion

Ask us and Technical Secretary will try to provide an answer. You can facilitate discussion about the standard in here.