Ada Reference Manual - Ada Resource · PDF fileISO/IEC 8652:1995(E) with COR.1:2000 —...

582
Ada Reference Manual, ISO/IEC 8652:1995(E) with COR.1:2000 Ada Reference Manual ISO/IEC 8652:1995(E) with Technical Corrigendum 1 Language and Standard Libraries Copyright © 1992,1993,1994,1995 Intermetrics, Inc. Copyright © 2000 The MITRE Corporation, Inc.

Transcript of Ada Reference Manual - Ada Resource · PDF fileISO/IEC 8652:1995(E) with COR.1:2000 —...

  • Ada Reference Manual, ISO/IEC 8652:1995(E) with COR.1:2000

    Ada Reference Manual

    ISO/IEC 8652:1995(E)

    with Technical Corrigendum 1

    Language and Standard Libraries

    Copyright 1992,1993,1994,1995 Intermetrics, Inc.

    Copyright 2000 The MITRE Corporation, Inc.

  • Ada Reference Manual - Language and Standard Libraries

    Copyright 1992, 1993, 1994, 1995, Intermetrics, Inc.

    This copyright is assigned to the U.S. Government. All rights reserved.

    This document may be copied, in whole or in part, in any form or by any means, as is or with alterations,provided that (1) alterations are clearly marked as alterations and (2) this copyright notice is includedunmodified in any copy. Compiled copies of standard library units and examples need not contain thiscopyright notice so long as the notice is included in all copies of source code and documentation.

    Technical Corrigendum 1

    Copyright 2000, The MITRE Corporation. All Rights Reserved.

    This document may be copied, in whole or in part, in any form or by any means, as is, or with alterations,provided that (1) alterations are clearly marked as alterations and (2) this copyright notice is includedunmodified in any copy. Any other use or distribution of this document is prohibited without the priorexpress permission of MITRE.

    You use this document on the condition that you indemnify and hold harmless MITRE, its Board ofTrustees, officers, agents, and employees, from any and all liability or damages to yourself or yourhardware or software, or third parties, including attorneys' fees, court costs, and other related costs andexpenses, arising out of your use of this document irrespective of the cause of said liability.

    MITRE MAKES THIS DOCUMENT AVAILABLE ON AN "AS IS" BASIS AND MAKES NOWARRANTY, EXPRESS OR IMPLIED, AS TO THE ACCURACY, CAPABILITY, EFFICIENCYMERCHANTABILITY, OR FUNCTIONING OF THIS DOCUMENT. IN NO EVENT WILL MITREBE LIABLE FOR ANY GENERAL, CONSEQUENTIAL, INDIRECT, INCIDENTAL, EXEMPLARY,OR SPECIAL DAMAGES, EVEN IF MITRE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCHDAMAGES.

  • ISO/IEC 8652:1995(E) with COR.1:2000 Ada Reference Manual

    i 15 June 2001 Table of Contents

    Table of ContentsTable of Contents............................................................................................................ i

    Foreword to this version of the Ada Reference Manual ........................................... ix

    Foreword........................................................................................................................ xi

    Introduction .................................................................................................................. xii

    Section 1: General.......................................................................................................... 11.1 Scope.......................................................................................................................................... 1

    1.1.1 Extent .................................................................................................................................. 11.1.2 Structure ............................................................................................................................. 21.1.3 Conformity of an Implementation with the Standard....................................................... 41.1.4 Method of Description and Syntax Notation..................................................................... 51.1.5 Classification of Errors ...................................................................................................... 6

    1.2 Normative References............................................................................................................... 71.3 Definitions.................................................................................................................................. 8

    Section 2: Lexical Elements.......................................................................................... 92.1 Character Set ............................................................................................................................. 92.2 Lexical Elements, Separators, and Delimiters....................................................................... 102.3 Identifiers ................................................................................................................................. 112.4 Numeric Literals ...................................................................................................................... 12

    2.4.1 Decimal Literals................................................................................................................ 122.4.2 Based Literals................................................................................................................... 12

    2.5 Character Literals .................................................................................................................... 132.6 String Literals .......................................................................................................................... 132.7 Comments................................................................................................................................ 142.8 Pragmas ................................................................................................................................... 142.9 Reserved Words ...................................................................................................................... 17

    Section 3: Declarations and Types ............................................................................ 193.1 Declarations............................................................................................................................. 193.2 Types and Subtypes................................................................................................................ 20

    3.2.1 Type Declarations............................................................................................................. 213.2.2 Subtype Declarations....................................................................................................... 233.2.3 Classification of Operations............................................................................................ 24

    3.3 Objects and Named Numbers................................................................................................. 243.3.1 Object Declarations.......................................................................................................... 263.3.2 Number Declarations ....................................................................................................... 28

    3.4 Derived Types and Classes .................................................................................................... 293.4.1 Derivation Classes ........................................................................................................... 31

    3.5 Scalar Types ............................................................................................................................ 323.5.1 Enumeration Types .......................................................................................................... 363.5.2 Character Types ............................................................................................................... 373.5.3 Boolean Types.................................................................................................................. 383.5.4 Integer Types .................................................................................................................... 383.5.5 Operations of Discrete Types.......................................................................................... 413.5.6 Real Types ........................................................................................................................ 423.5.7 Floating Point Types ........................................................................................................ 433.5.8 Operations of Floating Point Types ................................................................................ 453.5.9 Fixed Point Types............................................................................................................. 45

  • ISO/IEC 8652:1995(E) with COR.1:2000 Ada Reference Manual

    Table of Contents 15 June 2001 ii

    3.5.10 Operations of Fixed Point Types ................................................................................... 473.6 Array Types .............................................................................................................................. 48

    3.6.1 Index Constraints and Discrete Ranges ......................................................................... 503.6.2 Operations of Array Types............................................................................................... 523.6.3 String Types...................................................................................................................... 53

    3.7 Discriminants ........................................................................................................................... 533.7.1 Discriminant Constraints ................................................................................................. 563.7.2 Operations of Discriminated Types................................................................................. 57

    3.8 Record Types ........................................................................................................................... 573.8.1 Variant Parts and Discrete Choices ...............................................