VAX Ada Language Reference Manual

*HyperReader

  CONTENTS

  Title Page

  Copyright Page

  Preface

  New and Changed Features

  1      Introduction

  1.1     Scope of the Standard
    1.1.1      Extent of the Standard
    1.1.2      Conformity of an Implementation With the Standard

  1.2     Structure of the Standard

  1.3     Design Goals and Sources

  1.4     Language Summary

  1.4a    VAX Ada

  1.5     Method of Description and Syntax Notation

  1.6     Classification of Errors

  2      Lexical Elements

  2.1     Character Set

  2.2     Lexical Elements, Separators, and Delimiters

  2.3     Identifiers

  2.4     Numeric Literals
    2.4.1      Decimal Literals
    2.4.2      Based Literals

  2.5     Character Literals

  2.6     String Literals

  2.7     Comments

  2.8     Pragmas

  2.9     Reserved Words

  2.10    Allowable Replacements of Characters

  3      Declarations and Types

  3.1     Declarations

  3.2     Objects and Named Numbers
    3.2.1      Object Declarations
    3.2.2      Number Declarations

  3.3     Types and Subtypes
    3.3.1      Type Declarations
    3.3.2      Subtype Declarations
    3.3.3      Classification of Operations

  3.4     Derived Types

  3.5     Scalar Types
    3.5.1      Enumeration Types
    3.5.2      Character Types
    3.5.3      Boolean Types
    3.5.4      Integer Types
    3.5.5      Operations of Discrete Types
    3.5.6      Real Types
    3.5.7      Floating Point Types
    3.5.7a     Pragma LONG_FLOAT
    3.5.8      Operations of Floating Point Types
    3.5.9      Fixed Point Types
    3.5.10     Operations of Fixed Point Types

  3.6     Array Types
    3.6.1      Index Constraints and Discrete Ranges
    3.6.2      Operations of Array Types
    3.6.3      The Type String

  3.7     Record Types
    3.7.1      Discriminants
    3.7.2      Discriminant Constraints
    3.7.3      Variant Parts
    3.7.4      Operations of Record Types

  3.8     Access Types
    3.8.1      Incomplete Type Declarations
    3.8.2      Operations of Access Types

  3.9     Declarative Parts

  4      Names and Expressions

  4.1     Names
    4.1.1      Indexed Components
    4.1.2      Slices
    4.1.3      Selected Components
    4.1.4      Attributes

  4.2     Literals

  4.3     Aggregates
    4.3.1      Record Aggregates
    4.3.2      Array Aggregates

  4.4     Expressions

  4.5     Operators and Expression Evaluation
    4.5.1      Logical Operators and Short-circuit Control Forms
    4.5.2      Relational Operators and Membership Tests
    4.5.3      Binary Adding Operators
    4.5.4      Unary Adding Operators
    4.5.5      Multiplying Operators
    4.5.6      Highest Precedence Operators
    4.5.7      Accuracy of Operations with Real Operands

  4.6     Type Conversions

  4.7     Qualified Expressions

  4.8     Allocators

  4.9     Static Expressions and Static Subtypes

  4.10    Universal Expressions

  5      Statements

  5.1     Simple and Compound Statements-Sequences of Statements

  5.2     Assignment Statement
    5.2.1      Array Assignments

  5.3     If Statements

  5.4     Case Statements

  5.5     Loop Statements

  5.6     Block Statements

  5.7     Exit Statements

  5.8     Return Statements

  5.9     Goto Statements

  6      Subprograms

  6.1     Subprogram Declarations

  6.2     Formal Parameter Modes

  6.3     Subprogram Bodies
    6.3.1      Conformance Rules
    6.3.2      Inline Expansion of Subprograms

  6.4     Subprogram Calls
    6.4.1      Parameter Associations
    6.4.2      Default Parameters

  6.5     Function Subprograms

  6.6     Parameter and Result Type Profile-Overloading of Subprograms

  6.7     Overloading of Operators

  7      Packages

  7.1     Package Structure

  7.2     Package Specifications and Declarations

  7.3     Package Bodies

  7.4     Private Type and Deferred Constant Declarations
    7.4.1      Private Types
    7.4.2      Operations of a Private Type
    7.4.3      Deferred Constants
    7.4.4      Limited Types

  7.5     Example of a Table Management Package

  7.6     Example of a Text Handling Package

  8      Visibility Rules

  8.1     Declarative Region

  8.2     Scope of Declarations

  8.3     Visibility

  8.4     Use Clauses

  8.5     Renaming Declarations

  8.6     The Package Standard

  8.7     The Context of Overload Resolution

  9      Tasks

  9.1     Task Specifications and Task Bodies

  9.2     Task Types and Task Objects

  9.3     Task Execution-Task Activation

  9.4     Task Dependence-Termination of Tasks

  9.5     Entries, Entry Calls, and Accept Statements

  9.6     Delay Statements, Duration, and Time

  9.7     Select Statements
    9.7.1      Selective Waits
    9.7.2      Conditional Entry Calls
    9.7.3      Timed Entry Calls

  9.8     Priorities

  9.8a    Time Slicing

  9.9     Task and Entry Attributes

  9.10    Abort Statements

  9.11    Shared Variables

  9.12    Example of Tasking

  9.12a  Task Entries and VMS Asynchronous System Traps

  10     Program Structure and Compilation Issues

  10.1    Compilation Units-Library Units
    10.1.1     Context Clauses-With Clauses
    10.1.2     Examples of Compilation Units

  10.2    Subunits of Compilation Units
    10.2.1     Examples of Subunits

  10.3    Order of Compilation

  10.4    The Program Library

  10.5    Elaboration of Library Units

  10.6    Program Optimization

  11     Exceptions

  11.1    Exception Declarations

  11.2    Exception Handlers

  11.3    Raise Statements

  11.4    Exception Handling
    11.4.1     Exceptions Raised During the Execution of Statements
    11.4.2     Exceptions Raised During the Elaboration of Declarations

  11.5    Exceptions Raised During Task Communication

  11.6    Exceptions and Optimization

  11.7    Suppressing Checks

  12     Generic Units

  12.1    Generic Declarations
    12.1.1     Generic Formal Objects
    12.1.2     Generic Formal Types
    12.1.3     Generic Formal Subprograms

  12.1a  Pragma INLINE_GENERIC

  12.1b  Pragma SHARE_GENERIC

  12.2    Generic Bodies

  12.3    Generic Instantiation
    12.3.1     Matching Rules for Formal Objects
    12.3.2     Matching Rules for Formal Private Types
    12.3.3     Matching Rules for Formal Scalar Types
    12.3.4     Matching Rules for Formal Array Types
    12.3.5     Matching Rules for Formal Access Types
    12.3.6     Matching Rules for Formal Subprograms

  12.4    Example of a Generic Package

  13     Representation Clauses and Implementation-Dependent Features

  13.1    Representation Clauses

  13.2    Length Clauses

  13.2a  Pragma TASK_STORAGE

  13.2b  Pragma MAIN_STORAGE

  13.3    Enumeration Representation Clauses

  13.4    Record Representation Clauses

  13.5    Address Clauses
    13.5.1     Interrupts

  13.6    Change of Representation

  13.7    The Package System
    13.7.1     System-Dependent Named Numbers
    13.7.2     Representation Attributes
    13.7.3     Representation Attributes of Real Types

  13.7a  VAX Ada Additions to the Package System
    13.7a.1    Properties of the Type ADDRESS
    13.7a.2    Enumeration Type for Identifying Type Classes
    13.7a.3    Floating Point Type Declarations
    13.7a.4    Asynchronous-System-Trap-Related Declarations
    13.7a.5    Non-Ada Exception
    13.7a.6    VAX Hardware-Oriented Types and Functions
    13.7a.7    Conventional Names for Unsigned Longwords
    13.7a.8    Global Symbol Values
    13.7a.9    VAX Processor and Device Register Operations
    13.7a.10  VAX Interlocked-Instruction Procedures

  13.8    Machine Code Insertions

  13.9    Interface to Other Languages

  13.9a  VAX Ada Import and Export Pragmas
    13.9a.1    Importing and Exporting Subprograms
      13.9a.1.1    Importing Subprograms
      13.9a.1.2    Controlling the Passing Mechanisms for Parameters and Function Results
      13.9a.1.3    Attribute for Optional Parameters in Imported VMS Routines
      13.9a.1.4    Exporting Subprograms
    13.9a.2    Importing and Exporting Objects
      13.9a.2.1    Importing Objects
      13.9a.2.2    Exporting Objects
      13.9a.2.3    Importing and Exporting Objects with the Pragma PSECT_OBJECT
    13.9a.3    Importing and Exporting Exceptions
      13.9a.3.1    Importing Exceptions
      13.9a.3.2    Exporting Exceptions

  13.10  Unchecked Programming
    13.10.1    Unchecked Storage Deallocation
    13.10.2    Unchecked Type Conversions

  14     Input-Output

  14.1    External Files and File Objects

  14.1a  Elements and Records

  14.1b  Specification of the FORM Parameter in VAX Ada

  14.2    Sequential and Direct Files
    14.2.1     File Management
    14.2.2     Sequential Input-Output
    14.2.3     Specification of the Package Sequential_IO
    14.2.4     Direct Input-Output
    14.2.5     Specification of the Package Direct_IO

  14.2a  Relative and Indexed Files
    14.2a.1    File Management
    14.2a.2    Relative Input-Output
    14.2a.3    Specification of the Package Relative_IO
    14.2a.4    Indexed Input-Output
    14.2a.5    Specification of the Package Indexed_IO

  14.2b  Mixed-Type Input-Output
    14.2b.1    File Management
    14.2b.2    Item Input-Output
    14.2b.3    Sequential Mixed Input-Output
    14.2b.4    Specification of the Package Sequential_Mixed_IO
    14.2b.5    Direct Mixed Input-Output
    14.2b.6    Specification of the Package Direct_Mixed_IO
    14.2b.7    Relative Mixed Input-Output
    14.2b.8    Specification of the Package Relative_Mixed_IO
    14.2b.9    Indexed Mixed Input-Output
    14.2b.10  Specification of the Package Indexed_Mixed_IO

  14.3    Text Input-Output
    14.3.1     File Management
    14.3.2     Default Input and Output Files
    14.3.3     Specification of Line and Page Lengths
    14.3.4     Operations on Columns, Lines, and Pages
    14.3.5     Get and Put Procedures
    14.3.6     Input-Output of Characters and Strings
    14.3.7     Input-Output for Integer Types
    14.3.8     Input-Output for Real Types
    14.3.9     Input-Output for Enumeration Types
    14.3.10    Specification of the Package Text_IO

  14.4    Exceptions in Input-Output

  14.5    Specification of the Package IO_Exceptions

  14.5a  Specification of the Package Aux_IO_Exceptions

  14.6    Low Level Input-Output

  14.7    Example of Input-Output

  14.7a  Example of Additional VAX Ada Input-Output

  A   Predefined Language Attributes

  B   Predefined Language Pragmas

  C   Predefined Language Environment

  D   Glossary

  E   Syntax Summary

  F   Implementation-Dependent Characteristics

  F.1     Implementation-Dependent Pragmas

  F.2     Implementation-Dependent Attributes

  F.3     Specification of the Package System

  F.4     Restrictions on Representation Clauses

  F.5     Restrictions on Unchecked Type Conversions

  F.6     Conventions for Implementation-Generated Names Denoting Implementation-Dependent Components in Record Representation C

  F.7     Interpretation of Expressions Appearing in Address Clauses

  F.8     Implementation-Dependent Characteristics of Input-Output Packages
    F.8.1      Additional VAX Ada Input-Output Packages
    F.8.2      Auxiliary Input-Output Exceptions
    F.8.3      Interpretation of the FORM Parameter
    F.8.4      Implementation-Dependent Input-Output Error Conditions

  F.9     Other Implementation Characteristics
    F.9.1      Definition of a Main Program
    F.9.2      Values of Integer Attributes
    F.9.3      Values of Floating Point Attributes
    F.9.4      Attributes of Type DURATION
    F.9.5      Implementation Limits

  G   Ada Language Interpretations