Information technology - Programming languages - Ada

Technologies de l'information — Langages de programmation — Ada

General Information

Status
Withdrawn
Publication Date
22-Feb-1995
Withdrawal Date
22-Feb-1995
Current Stage
9599 - Withdrawal of International Standard
Start Date
10-Dec-2012
Completion Date
30-Oct-2025
Ref Project

Relations

Effective Date
15-Apr-2008
Standard
ISO/IEC 8652:1995 - Information technology -- Programming languages -- Ada
English language
511 pages
sale 15% off
Preview
sale 15% off
Preview

Frequently Asked Questions

ISO/IEC 8652:1995 is a standard published by the International Organization for Standardization (ISO). Its full title is "Information technology - Programming languages - Ada". This standard covers: Information technology - Programming languages - Ada

Information technology - Programming languages - Ada

ISO/IEC 8652:1995 is classified under the following ICS (International Classification for Standards) categories: 35.060 - Languages used in information technology. The ICS classification helps identify the subject area and facilitates finding related standards.

ISO/IEC 8652:1995 has the following relationships with other standards: It is inter standard links to ISO/IEC 8652:1995/Amd 1:2007, ISO/IEC 8652:2012, ISO 8652:1987; is excused to ISO/IEC 8652:1995/Amd 1:2007. Understanding these relationships helps ensure you are using the most current and applicable version of the standard.

You can purchase ISO/IEC 8652:1995 directly from iTeh Standards. The document is available in PDF format and is delivered instantly after payment. Add the standard to your cart and complete the secure checkout process. iTeh Standards is an authorized distributor of ISO standards.

Standards Content (Sample)


INTERNATIONAL
ISO/IEC
STANDARD
Second edition
1995-02-15
Information technology - Programming
languages - Ada
- Langages de programmation - Ada
Technologies de I’information
ISOIIEC 8652:1995(E)
Contents
................................................................................................................. X
Forewotd
............................................................................................................. xi
Introduction
. . . . . .~~.~~~.~.~.~.~.~.~.~.~.~.~~ 1
1 l General
l.lScope .
l.l.lExtant .
...........................................................
1.1.2Structure
.......................
1.1.3 Conformity of an Implementation with the Standard
..............................
1.1.4 Method of Description and Syntax Notation
...............................................
1.1.5 Classification of Errors
......................................................
1.2 Normative References
1.3Definitions .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2. Lexical Elements
2.1 Character Set. .
................................... 10
2.2 Lexical Elements, Separators, and Delimiters
2.3Identifiers .
..........................................................
2.4 Numeric Literals
..................................................... 12
2.4.1 Decimal Literals
....................................................... 12
2.4.2 Based Literals
......................................................... 13
2.5 Character Literals
............................................................ 13
2.6 String Literals
2.7Commentr .
2.8Pragmar .
2.9ReservedWords .
. . . . .*.*.
3. Declarations and Types
3.1 Declaratlonr .
.......................................................
3.2TypesandSubtypes
.................................................... 21
3.2.1 Type Declarations
................................................. 23
3.2.2 Subtype Declaratlons
........................................... 24
3.2.3 Classificatlon of Operations
............................................... 24
3.3 Objects and Named Numbers
.................................................. 26
3.3.1 Object Declaratlons
.................................................
3.3.2 Number Declarations 28
3.4DerivedTypesandClasser .
....................................................
3.4.1 Dwlvation Classes
o ISO/lEC 1995
All nghts reserved. Unless otherwrse specified, no part of thrs pubkation may be reproduced
or utilized in any form or by any means, electronrc or mechanical, including photocopyrng and
microfilm, without permrssion In writing from the publisher.
ISO/IEC Copyright Office l Case Postale 56 l CH-l 211 Geneve 20 l Switzerland
Printed in Swrtzerland
lSO/IEC 8652:1995(E)
35Scalarlypas .
3.5.1 Enumeration Types .
3.5.2 Character Types .
3.5.3BooleanTypes .
3.5.4IntegerTypes .
3.5.5 Operatlons of Discrete Types . 41
3.5.6RsalTypes .
.................................................
3.5.7FloatingPointTypes 43
3.5.8 Operations of Floating Point Types .
3.5.9FixedPointTypes .
3.5.10 Operations of Fixed Point Types . 47
36ArrayTypes .
3.6.1 Index Constraints and Discrete Ranges . 50
3.6.2 Operations of Array Types .
3.6.3StringTypes . 52
3.7Discriminants. .
3.7.1 Discriminant Constraints
.............................................. 55
3.7.2 Operations of Discriminated Types . 56
3.8RecordTypes .
3.8.1 Varlant Parts and Discrete Choices . 59
3.9 Tagged Types and Type Extensions . 60
3.9.1TypeExtensions. . 62
3.9.2 Dispatching Operations of Tagged Types . 63
3.9.3 Abstmct Typer and Subprograms . 65
3.lOAccessTy~s . 67
3.%OJ Incomplete Type Declaratlons . 69
3.10.2 Opemtions of Access Types .
3,llDeciaratlveParts. . 73
3.11.1 Completlons of Declarations 74
..........................................
4. Names and Expressions . 75
................................................................... 75
4.1Names
4.1.1IndexedComponents. . 76
............................................................ 77
4.1.2Slices.
4.1.3SeiectedComponents . 78
4.1.4Attributes . 79
4.2Literals . 80
............................................................... 81
4.3AggreIlates
4.3.1 Record Aggregates . 82
4.3.2 Extension Aggregates . 83
4.3.3 Array Aggregates .
4.4Expressions . 87
4.5 Operntors and Expression Evaluation 08
........................................
4.5.1 Logical Operators and Short-circuit Control Forms . 89
4.5.2 Reiational Operators and Membership Tests . 90
4.5.3 Binary Adding Operators .
4.5.4 Unary Adding Operators . 94
................................................. 94
4.5.5MuitipiyingOpemtors
4.5.6 Highest Precedence Operators . ; . 96
4.6 Type Conversions 97
.........................................................
4.7 Qualified Expressions . 101
4.8Allocators. . 102
4.9 Static Expressions and Static Subtypes .
4.9,1 Staticallw Matchina Constraints and Subtwes . 105

lSO/lEC 8652: 1995(E)
.....................................................
9.7.1Sel~tiveAccept
..................................................
9.7.2TimedEntryCalls.
9.7.3ConditionaiEntryCaiis .
9.7.4AsynchronousTransferofControl .
98AbotiofaTask-AbortofaSequenceofStatements. .
...................................................
9,gTaskandEntryAttributes
9.10 Shared Variables .
9.11 Exampie of Tasking and Synchronkation .
.................................................. 183
10. Program Structure and Compilation Issues
.....................................................
lO.lSeparateCompilation
......................................
10.1.1 Compilation Units - Library Units
1~
10.1.2 Context Clauses - With Clauses .
10.1.3 Subunits of Compilation Units .
10.1.4 The Compilation Process .
10.1.5 Pragmas and Program Units .
10.1.6 Environment-Level Visibility IRules .
10.2 Program Execution .
10.2.1 ElaborationControl .
11. Exceptions . 195
..................................................
ll.lExceptionDeclarations.
.....................................................
11.2ExceptionHandlers.
11.3 Raise Statements .
..................................................... 197
11.4ExceptionHandllng.
11.4.1 The Package Exceptions .
....................................... 199
11.4.2 Example of Exception Handling
11SSuppressingChecks. .
11.6 Exceptions and Optimization .
12. Generic Units .
12.1GenericDeclaratlons. .
..........................................................
12.2GenericBodies
12.3GenericInstantiation. .
..........................................................
12.4FormalObjects
12.5FormalTypes. .
..................................... 212
12.51 Formal Private and Derived Types
12.5.2 Formal ScalarTypes .
12.5.3FormalArrayTypes .
.............................................. 215
12.5.4FormalAccessTypes.
12.6 Formal Subprograms .
12.7FormalPackalles .
............................................. 217
12.8ExampleofaGenericPackage
.....................................................................................
13. Representation Issues
13.1 Representationltems .
13.2PragmaPack .
................................................. 222
13.3 Representation Attributes
............... . ........................ 227
13.4 Enumeration Representation Clauses
........................................................... 228
13.5RecordLayout
........................................ 228
13.5.1RecordRepresentationClauses
.............................................
13.5.2StoragePlaceAttributes 230
...................................................... 230
13.5.3BltOrdering.
.................................................
13.6ChangeofRepresentation 231
.................................................... 232
13.7ThePackageSystem.
.............................. 234
13.7.1ThePackageSystem.Storage~Elements.

lSO/lEC 8652:1995(E)
13.7.2 The Package System.Address-To-Access Conversions .
13.8MachineCodeinsertions. . ., . 235
.............................................. 236
13.9UncheckedTypeConversions
13.9.1DataValidity. . 237
................................................ 238
13.9.2TheValidAttribute.
13.10 Unchecked Access Vaiue Creation 238
.........................................
l3.11StorageManagement .
13.11 .l The Max Size-In-Stotage-Elements Attribute . 242
1~.11.2UncheckedStorageDeallocation . 242
13.1 fl .3 Pragma Conttoll . 243
13.12 Pragma Restrittions .
13.13Streams .
eams 244
13.13.1 The Package .
s . 245
13.13.2 Stream-Orient
.......................................................... 247
13.14F~~PingRuies
................................................................. 251
redefined Language Enwiron
.l The Package Standard .
......................................................... 255
A.2ThePackageAda
ng .
.........................................
:::::::.:::::::::::::::::::::::::::::: 258
§tring Handling . 262
A.4.l The Package Strings .
A,4.2 The Package Strings.Maps . 263
.......................................... 266
.4.3 Fixed-Length String Handling
ounded-Length String Handling .
nbounded-Length String Handling . 278
A.4.6 String-Handling Sets and Mappings .
A.4.7 Wide-String Handling .
A.5 The Numerics Packages .
A.5.1 Elementary Functionr .
A.5.2 Random Number 6eneration .
A.5.3 Attributes of Floating Point 8~~~~.~~~~~.~.~~.~.~.~~~~~.~.~.~.* . . 293
A”5.4 Attributes of Fixed Point Ty 297
.... ..:::::::::::::::::::::::::::::::::::::::: 297
A.6lnput-Output . . . .
.............................................. 298
A.7 Extemal Files and File Objects
.............................................. 299
A.8 Sequentiai and Direct Fiies
A.8;1 The Generic Package uentialJ0 .
A.8.2 File Management .
A.8.3 Sequential Input-Output Operations .
A.8.4 The Generic Package Direct-IO .
A,8.5 Direct Input-Output Operations .
A.9 The Generic Package StorageJO .
A.lOTextinput-Output .
A.10.1 ThePackageText-IO .
19.10.2 Text File Management 311
...............................................
A.10.3 Defauit Input, Output, and Enor Files .
A.10.4 Specification of Line and Page Lengths .
vi
SO/lEC 8652:1995(E)
................. . . . . . . . . . . . . . 314
A.10.5 Operations on Columns, Limes, and Page8
................................ .‘....‘...... 317
A.10.6GetandPutProcedures
................................ 318
A.lO.7 Input-Output of Characters and Strings
........................................ 320
A.10.8 Input-Output for Integer Types
.......................................... 322
A.10.9 Input-Output for Real Types
.................................. 325
A.10.10 Input-Output for Enumeration Types
...................................................
A.11 WideText Input-Output
...................................................... 326
A.12 Stream Input-Output
...................................... 326
A.12.1 The Package Streams.Stream-IO
A.12.2 The Package Text lO.Text Streams
.................................................................
A.12.3 The Package WideTextJÖ.Text-Streams
A.13ExceptionsinInput-Output .
............................................................. 330
A.14FileSharing
A.l5ThePackageCommand-Line .
...........................................................................
6. Interface to Other Languages
.......................................................
B.l interfacing Pragmas
8.2ThePackageInterfaces .
.........................................................
B.3 Interfacing with C
......................................
8.3.1 The Package Interfaces.C.Strings
.............................. 344
B.3.2 The Generic Package Interfaces.C.Pointers
....................................................
8.4 Interfacing with COBOL
....................................................
B.5 interdacing with Fortran
......................................................................................
C. Systems Programming
..............................................
C.l Access to Machine Operations
...........................................
C.2 Required Representation Support
.........................................................
C.3 Interrupt Support
......................................... 360
C.3.1 Protected Procedure Handiers
...............................................
C.3.2 The Package Interrupts
............................................... 364
C.4 Preelaboration Requirements
....................................................
C.5 Pragma Dlscard-Names
....................................................
6.6 Shared Variable Controi
............................................
C.7 Task identific&ion and Attributes
.......................................
C.7.1 The Package Task-ldentification
.......................................... 368
6.7.2 The Package Task-Attributes
............................................................................................
D. Real-Time Systems
D.lTaskPrioritias .
........................................................
0.2 Priority Scheduiing
..........................................
0.2.1 The Task Dispatching Model
..................................
0.2.2 The Standard Task Dispatching Policy
....................................................
0.3 Priority Ceiling LocMng
....................................................
D.4 Entry Queuing Policies.
........................................................
D.5 DynamicPriorities
.........................................................
0.6 Prwmptive Abort
.......................................................
0.7 Tasking Restrittions
..........................................................
0.8 Monotonic Time
...........................................................
D.9DeiayAccunrcy
................................................. 387
D.lOSynchronousTaskControl
................................................
0.11 Asynchronous Task Control
..................................
0.12 Other Optimizations and Determinism Rules
..........................................................................................
E. Distributed Systems
................................................................
E.l Partitions
..............................................
E.2 Categorization of Library Units
vii
lSO/lEC 8652:1995(E)
E.2.1 Shared Passive Library Units
.......................................... 394
E.2.2 Remote Types Library Units
...........................................
E.2.3 Remote Cali Interface Library Units
.....................................
E.3 Consistency of a Distributed System
.........................................
E.4 Remote Subprogram Calls
..................................................
E.4.1 Pragma Asynchronous 396
...............................................
E.4.2 Example of Use of a Remote Access-to=Class-Wide Type
................... 399
E.5 Partition Communication Subsystem
......................................... 461
F. Information Systems .“““““““.““““““““‘.“‘“““““““““““““““.““.“““““““““
F.l Machine Radix Attribute Definition Clause
.................................... 403
F.2ThePackageDecimal
...................................................... 404
F.3 Edited Output for Decimal Types
............................................. 405
F.3.1 Picture String Formatlon
.............................................. 466
F.3.2 Edlted Output Generation
............................................. 409
F.3.3 The Package Text-lO.Editing
..........................................
F.3.4 The Package Wlde-Text-lO.Editing
..................................... 417
............................................................................................................
G. Numerics
G.l Complex Arithmetic
....................................................... 419
G.l.l CompiexTypes
..................................................... 419
G.1.2 Complex Elementary Functions
........................................ 424
G.1.3ComplexInput-Gutput
................................................ 427
G.1.4The Package Wide_Text~lO.Complex~lO
................................
G.2NumericPerformanceRequirements .
G.2.1 Model of Floating Point Arithmetic
..................................... 430
G.2.2 Model-Oriented Attributes of Floating Point Types
........................
G.2.3 Model of Fixed Point Arithmetic
........................................
G.2.4 Accuracy Requirements for the Elementary Functionr
..................... 434
G.2.5 Performance Requlrements for Random Number Generation
............... 436
G.2.6 Accuracy Requirements for Complex Arithmetic
.......................... 436
H. Safety and Security .
H.1 Pragma Normalks-Scalars
................................................. 439
H.2 Documentation of Implementation Decisions
..................................
H.3 Reviewable Object Code
................................................... 440
H.3.1 Pragma Reviewable
.................................................. 440
H.3.2 Pragma inspection Point
H.4 Safety and Security Restr&tions
.......................................................................................... 442
J. Obsolescent Features .
J.l Renamings of Ada 83 Library Units
........................................... 445
3.2 Allowed Replacements of Characters
......................................... 445
J.3 Reduced Accuracy Subtypes
................................................ 446
3.4 The Constrained Attribute
.................................................. 446
J.SASCll .
J.6 Numeric Error
............................................................ 447
J.7AtCiausÖs
...............................................................
J.7.1 Interrupt Entries
.............................................. ; ......
J.8ModClauses .
J.gTheStorage-Slze Attribute
.................................................. 449
K. Language-Defined Attributes .
L. Language-Defined Pragmas .
ISOIIEC 8652: 1995(E)
‘*‘~‘@“*“.*~“~‘~~“‘*.*.,,.,‘~~~,~~~,“,“““‘
M. Implementation-Defined Characteristics
. . . . . . .~.‘.*~.*9~*~“~‘*‘*“***~“““**“*~*~“““‘*‘**‘~*“““.“.“.,‘,‘,““‘~“,~““~ 473
N. Glossary
. . . . . . . . . . . . . . . . . . .“‘.“.‘.“.‘.‘.“‘.‘.‘.“.“‘.“‘.““.*‘.‘.*.“~~““‘~‘~“““‘~ 477
P. Syntax Summqf
“,‘,*‘~“,,,~~,“~‘,““‘,.‘.~.‘.‘.““““**‘.‘~.‘~.“““““*“““*““““.“~.““.,.““.““‘.,.,‘,“,
Index
ix
iSO/lEC 8652:1995(E)
Foreword
ISO (the International Organkation for Standardkation) and IEC (the International Electrotechnical Com-
rnission) ferm the specialized system for worldwide standardization. National bedies that are members of
C participate in the development of International Standards through technical committees es-
tablished by the respective Organkation to deal with particular Felds of technical activity. ISO and IEC
technical committees collaborate in fields of mutual interest. Other international orgarkations,
govemmental and non-govemmental, in liaison with ISO and IEC, aIso take part in the werk.
In the field of information technology, ISO and IEC have established a joint technical committee,
ISO/IEiC JTC 1. Dr& International Smdards adopted by the joint technical committee are circulated to
national bodies for voting. Publication as an International Standard requires approval by at least 75 % sf
the national botlies casting a vote.
International Standard ISO/IEC $652 was prepared by Joint Technical Committee ISO/IEC JTC 1,
Information Technology.
This second edition cancels and replaces the fnst edition (ISO 8652: 1987), of which it constitutes a
technical revision.
hnexes A to J form an integral part of this International Standard. Annexes K ts P are for information
only ‘
Foreword
X
lSO/lEC 8652:1995(E)
Introduction
This is the Ada Reference Manual.
Other available Ada documents include:
l Rationale for the Ada Programming Language - 1995 edition, which gives an introduction
to the new features of Ada, and explains the rationale behind them. Programmers should
read this fxst.
l Changes to Ada - 1987 to 1995. This document lists in detail the changes made to the 1987
edition of the Standard.
l The Annotated Ada Reference Manual @ARM). The AARM contains all of the text in the
RM%, plus various annotations. It is intended primarily for Compiler writers, Validation test
writers, and others who wish to study the fine details. The annotations include detailed
rationale for individual rules and explanations of some of the more arcane interactions among
the rules.
Design Goals
Ada was originally designed with three overriding concems: program reliability and maintenance, pro-
gramming as a human activity, and efficiency. This revision to the language was designed to provide
greater flexibility and extensibility, additional control over storage management and synchronization, and
standardized packages oriented toward supporting important application areas, while at the sarne time
retaining the original emphasis on reliability, maintainability, and efficiency.
The need for languages that promote reliability and simplify maintenance is weII established. Hence
emphasis was placed on program readability over esse of writing. For example, the rules of the language
require that program variables be explicitly declared and that their type be specified. Since the type of a
variable is invariant, Compilers tan ensure that operations on variables are compatible with the properties
intended for objects of the type. Furthermore, error-prone notations have been avoided, and the Syntax of
the language avoids the use of encoded forms in favor of more English-like constructs. FinaIly, the
language offers support for separate compilation of program units in a way that facilitates program
development and maintenance, and which provides the Same degree of checking between units as within a
mit.
Concem for the human programmer was aIso stressed during the design. Above all, an attempt was made
to keep to a relatively smalI number of underlying concepts integrated in a consistent and systematic way
The design especialiy aims to provide
while continuing to avoid the pitfaIls of excessive involution.
language constructs that correspond intuitively to the normal expectations of users.
Like many other human activities, the development of programs is becoming ever more decentralized and
distributed. Consequently, the ability to assemble a program from independently produced Software
components continues to be a centraI idea in the design. The concepts of packages, of private types, and
of generic units are directly related to this idea, which has’ ramifications in many other aspects of the
language. An allied concem is the maintenance of programs to match changing requirements; type exten-
sion and the hierarchical library enable a program to be modified while minimizing disturbance to exist-
ing tested and trusted components.
No language tan avoid the Problem of efficiency. Languages that require over-elaborate Compilers, or
that lead to the inefficient use of storage or execution time, forte these inefflciencies on all machines and
on alI programs. Every construct of the language was examined in the light of present implementation
Introduction
xi
ISOIIEC 8652:1995(E)
&y proposed construct whose implementation was unclear or that required excessive
techniques.
machine resources was rejected.
Language Summary
An Ada program is composed of one or more program units.
Program units may be subprograms (which
defme executable algorithms), packages (which defme collections of entities), task units (which defme
concurrent computations), protected units (which define operations for the coordinated sharing of data
between tasks), or generic units (which define parameterized forms of packages and subprograms). Esch
program unit normally consists of two Parts: a specification, containing the information that must be
visible to other units, and a body, containing the implementation details, which need not be visible to
other units. Most program units tan be compiled separately.
This distinction of the specification and body, and the ability to compile units separately, allows a
program to be designed, written, and tested as a set of largely independent Software components.
An Ada program will normally make use of a library of program units of general Utility. The language
provides means whereby individual organizations tan construct their own libraries. All libraries are
structured in a hierarchical manner; this enables the logical decomposition of a Subsystem into individual
components. The text of a separately compiled program unit must name the library units it requires.
Program Units
There are two kinds of subprograms:
A subprogram is the basic -unit for expressing an algorithm.
procedures and functions. A procedure is the means of invoking a series of actions. For example, it may
read data, update variables, or produce some output. It may have parameters, to provide a controlled
means of passing information between the procedure and the point of call. A function is the means of
invoking the computation of a value. It is similar to a procedure, but in addition will retum a result.
A package is the basic unit for defming a collection of logically related entities. For example, a package
tan be used to define a set of type declarations and associated operations. Portions of a package tan be
hidden fiom the User, thus allowing access only to the logical properties expressed by the package
_ ,
specification.
Subprogram and package units may be compiled separately and arranged in hierarchies of parent and
Child units giving fine control over visibility of the logical properties and their detailed implementation.
A task unit is the basic unit for defining a task whose sequence of actions may be executed concurrently
with those of other tasks. Such taslcs may be implemented on multicomputers, multiprocessors, or with
interleaved execution on a Single processor. A task unit may defme either a Single executing task or a
task type permitting the creation of any number of similar tasks.
A protected unit is the basic unit for defining protected operations for the coordinated use. of data shared
between tasks. Simple mutual exclusion is provided automatically, and more elaborate sharing protocols
tan be defmed. A protected Operation tan either be a subprogram or an entry. A protected entry specifies
a Boolean expression (an entry barrier) that must be true before the body of the entry is executed. A
protected unit may defme a Single protected Object or a protected type permitting the creation of several
similar objects.
Declarations and Statements
Introduction
Xii
ISO/lEC 8652: 1995(E)
The body of a program unit generally contains two parts: a declarative part, which defmes the logical
entities to be used in the program unit, and a sequence of Statements, which defmes the execution of the
program unit.
The declarative part associates names with declared entities. For example, a name may denote a type, a
constant, a variable, or an exception. A declarative part also introduces the names and Parameters of
other nested subprograms, packages, task units, protected units, and generic units to be used in the
program unit.
The sequence of Statements describes a sequence of actions that arc to be performed. The Statements arc
executed in succession (unless a transfer of control Causes execution to continue from another place).
An assignment Statement changes the value of a variable. A procedure cal1 invokes execution of a
procedure after associating any actual Parameters provided at the call with the corresponding formal
Parameters.
Case Statements and if Statements allow the selection of an enclosed sequence of Statements based on the
value of an expression or on the value of a condition.
The loop Statement provides the basic iterative mechanism in the language. A loop Statement specifies
that a sequence of Statements is to be executed repeatedly as directed by an iteration scheme, or until an
exit Statement is encountered.
A block Statement comprises a sequence of Statements preceded by the declaration of local entities used
by the Statements.
Certain Statements are associated with concurrent execution. A delay Statement delays the execution of a
task for a specified duration or until a specified time. An entry cal1 Statement is written as a procedure
cal1 Statement; it requests an Operation on a task or on a protected Object, blocking the caller until the
Operation tan be performed. A called task may accept an entry call by executing a corresponding accept
Statement, which specifies the actions then to be performed as part of the rendezvous with the calling task.
An entry call on a protected Object is processed when the corresponding entry barrier evaluates to true,
whereupon the body of the entry is executed. The requeue Statement permits the Provision of a Service as
One form of the select Statement allows a selective
a number of related activities with preference control.
wait for one of several alternative rendezvous. Other forms of the select Statement allow conditional or
timed entry calls and the asynchronous transfer of control in response to some triggering event.
Execution of a program unit may encounter error situations in which normal program execution cannot
continue. For example, an arithmetic computation may exceed the maximum allowed value of a number,
or an attempt may be made to access an array component by using an incorrect index value. To deal with
such error situations, the Statements of a program unit tan be textually followed by exception handlers
that specify the actions to be taken when the error Situation arises. Exceptions tan be raised explicitly by
a raise Statement.
Data Types
Every Object in the language has a type, which characterizes a set of values and a set of applicable
operations. The main classes of types are elementar-y types (comprising enumeration, numeric, and ac-
cess types) and composite types (including array and record types).
Introduction
. . .
Xlll
ISO/lEC 8652:1995(E)
h enumeration type defmes an ordered set of distinct enumeration literals, for example a list of states or
The enumeration types Boolean, Character, and Wide-Character Xe
a alphabet of characters.
predefmed.
Numeric types provide a means of performing exact or approximate numerical computations. Exact
computations use integer types, which denote sets of consecutive integers. Approximate computations
use either fixed point types, with absolute bounds on the error, or floating Point types, with relative
bounds on the error. The numeric types Integer, Float, and Duration are predefmed.
Composite types allow definitions of structured objects with related components. The composite types in
An array is an Object with indexed components of the Same
the language include arrays and records.
type. A record is an Object with named components of possibly different types. Task and protected types
are also forms of composite types. The array types String and Wide-String are predefmed.
Record, task, and protected types may have special components called discriminants which parameter-&
the type. Variant record structures that depend on the values of d.iscriminants tan be defined within a
record type.
Access types allow the construction of linked data structures. A value sf an access type represents a
reference to an Object declared as aliased or to an Object created by the evaluation of an allocator. Several
variables of an access type may designate the same Object, and components of one Object may designate
Both the elements in such linked data structures and their relation to other
the Same or other objects.
elements tan be altered during program execution. Access types also permit references to subprograms to
be stored, passed as Parameters, and ultimately dereferenced as part of an indirect call.
Private types permit restricted views of a type. A private type tan be defmed in a package so that only
the logically necessary properties are made visible to the users of the type. The full structural details that
are extemally irrelevant are then only available within the package and any Child units.
From any type a new type may be defmed by derivation. A type, together with its derivatives (both direct
and indirect) form a derivation class. Class-wide operations may be defmed that accept as a Parameter an
Operand of any type in a derivation class. For record and private types, the derivatives may be extensions
of the parent type. Types that support these Object-oriented capabilities of class-wide operations and type
extension must be tagged, so that the specific type of an Operand within a derivation class tan be iden-
tified at run time. When an Operation of a tagged type is applied to an Operand whose specific type is not
known until run time, implicit dispatching is performed based on the tag of the Operand.
The concept of a tvpe is further refmed by the concept of a subtype, whereby a user tan constrain the set
of allowed values-of a type. Subtypes tan be used to defme subranges of scalar types, arrays with a
limited set of index values, and records and private types with particular discriminant values.
Other Facilities
Representation clauses tan be used to specify the mapping between types and features of an underlying
machine. For example, the user tan specify that o’bjects of a given type must be represented with a given
number of bits, or that the components of a record are to be represented using a given storage layout.
Other features allow the controlled use of low level, nonportable, or implementation-dependent aspects,
including the direct insertion of machine Code.
Intrtiuction
ISO/lEC 8652: 1995(E)
The predefmed environment of the language provides for input-output and other capabilities (such a,s
shg manipulation and random number generation) by means of Standard library packages. Input-output
is suppor-ted for values of userdefmed as weil as of predefmed types. Standard means of representing
values in display ferm are also provided. Other Standard library packages are defmed in annexes of the
Standard to support Systems with specialized requirements.
Finally, the language provides a powerful means of parameterization of program units, called generic
The generic Parameters tan be types and subprograms (as well as objects and packages)
program units.
and so allow general algorithms and data structures to be defined that are applicable to all types of a given
class.
Language Changes
This International Standard replaces the first edition of 1987. In this edition, the following major lan-
guage changes have been incorporated:
0 Support for Standard 8-bit and 16.bit Character Sets. See Section 2, 3.5.2, 3.6.3, A.l, A.3, and
A4 . .
l Object-oriented pro gramming with run-time polymorphism. See the discussions of classes,
derived types, tagged types, record extensions, and private extensions in clauses 3.4, 3.9, and
7.3. See also the new forms of generic formal Parameters that arc allowed by 12.5.1, ‘ ‘For-
mal Private and Derived Types” and 12.7, “Formal Packages”.
0 Access types have been extended to allow an access value to designate a subprogram or an
Object deckt-ed by an Object declaration (as opposed to just a heapallocated Object). See
3.10.
l Efficient data-oriented synchronization is provided via protected types. See Section 9.
l The library units of a library may be organized into a hierarchy of parent and Child units. See
Section 10.
l Additional support has been added for interfacing to other languages. See Annex B.
a T’he Spe&dized Needs Annexes have been added to provide specific support for certain
application areas:
l Annex C, “Systems Programming”
l Annex D, ‘ ‘Real-Time Systems”
0 Annex E, ’ ‘Distributed Systems”
l Annex F, “Information Systems”
l Annex G, “Numerics”
l Annex H; ’ ‘Safety and Security”
Introduction
xv
ISO/lEC 8652: 1995(E)
Instructions for Comment Submission
Informal comments on this International Standard may be sent via e-mail to ada-comment@sei.cmu.edu. If
appropriate, the Project Editor will initiate the defect correction procedure.
Comments should use the following format:
!topic Title s ummurizing comment
! reference RM95-SS. ss(pp)
!from Author Name yy-mm-dd
!keywords keywords related to topic
!discussion
text of discussion
where ss.ss is the section, clause or subclause number, pp is the Paragraph number where applicable, and
yy-mm-dd is the da
...

Questions, Comments and Discussion

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

Loading comments...