You are previewing Programming in Ada 2012.
O'Reilly logo
Programming in Ada 2012

Book Description

Ada is the language of choice for the majority of programmers involved in writing safety-critical and high-integrity software. Previous editions of John Barnes' books established themselves as the definitive references for earlier versions of Ada. With the release of the latest ISO standard, Ada 2012, this new book will become recognised as the go-to resource for those wishing to learn the language or to program in it.

Table of Contents

  1. Cover Page
  2. Half Title Page
  3. Title Page
  4. Copyright Page
  5. Dedication
  6. Contents
  7. Foreword
  8. Preface
  9. Part 1 An Overview
    1. 1 Introduction
      1. 1.1 Standard development
      2. 1.2 Software engineering
      3. 1.3 Evolution and abstraction
      4. 1.4 Structure and objectives of this book
      5. 1.5 References
    2. 2 Simple Concepts
      1. 2.1 Key goals
      2. 2.2 Overall structure
      3. 2.3 The scalar type model
      4. 2.4 Arrays and records
      5. 2.5 Access types
      6. 2.6 Errors and exceptions
      7. 2.7 Terminology
    3. 3 Abstraction
      1. 3.1 Packages and private types
      2. 3.2 Objects and inheritance
      3. 3.3 Classes and polymorphism
      4. 3.4 Genericity
      5. 3.5 Object oriented terminology
      6. 3.6 Tasking
    4. 4 Programs and Libraries
      1. 4.1 The hierarchical library
      2. 4.2 Input–output
      3. 4.3 Numeric library
      4. 4.4 Running a program
    5. Program 1 Magic Moments
  10. Part 2 Algorithmic Aspects
    1. 5 Lexical Style
      1. 5.1 Syntax notation
      2. 5.2 Lexical elements
      3. 5.3 Identifiers
      4. 5.4 Numbers
      5. 5.5 Comments
      6. 5.6 Pragmas and aspects
    2. 6 Scalar Types
      1. 6.1 Object declarations and assignments
      2. 6.2 Blocks and scopes
      3. 6.3 Types
      4. 6.4 Subtypes
      5. 6.5 Simple numeric types
      6. 6.6 Enumeration types
      7. 6.7 The type Boolean
      8. 6.8 Categories of types
      9. 6.9 Expression summary
    3. 7 Control Structures
      1. 7.1 If statements
      2. 7.2 Case statements
      3. 7.3 Loop statements
      4. 7.4 Goto statements and labels
      5. 7.5 Statement classification
    4. 8 Arrays and Records
      1. 8.1 Arrays
      2. 8.2 Array types
      3. 8.3 Array aggregates
      4. 8.4 Characters and strings
      5. 8.5 Arrays of arrays and slices
      6. 8.6 One-dimensional array operations
      7. 8.7 Records
    5. 9 Expression structures
      1. 9.1 Membership tests
      2. 9.2 If expressions
      3. 9.3 Case expressions
      4. 9.4 Quantified expressions
    6. 10 Subprograms
      1. 10.1 Functions
      2. 10.2 Operators
      3. 10.3 Procedures
      4. 10.4 Aliasing
      5. 10.5 Named and default parameters
      6. 10.6 Overloading
      7. 10.7 Declarations, scopes and visibility
    7. 11 Access Types
      1. 11.1 Flexibility versus integrity
      2. 11.2 Access types and allocators
      3. 11.3 Null exclusion and constraints
      4. 11.4 Aliased objects
      5. 11.5 Accessibility
      6. 11.6 Access parameters
      7. 11.7 Anonymous access types
      8. 11.8 Access to subprograms
      9. 11.9 Storage pools
    8. Program 2 Sylvan Sorter
  11. Part 3 The Big Picture
    1. 12 Packages and Private Types
      1. 12.1 Packages
      2. 12.2 Private types
      3. 12.3 Primitive operations and derived types
      4. 12.4 Equality
      5. 12.5 Limited types
      6. 12.6 Resource management
    2. 13 Overall Structure
      1. 13.1 Library units
      2. 13.2 Subunits
      3. 13.3 Child library units
      4. 13.4 Private child units
      5. 13.5 Mutually dependent units
      6. 13.6 Scope, visibility and accessibility
      7. 13.7 Renaming
      8. 13.8 Programs, partitions and elaboration
    3. Program 3 Rational Reckoner
    4. 14 Object Oriented Programming
      1. 14.1 Type extension
      2. 14.2 Polymorphism
      3. 14.3 Abstract types and interfaces
      4. 14.4 Primitive operations and tags
      5. 14.5 Views and redispatching
      6. 14.6 Private types and extensions
      7. 14.7 Controlled types
      8. 14.8 Multiple inheritance
      9. 14.9 Multiple implementations
    5. 15 Exceptions
      1. 15.1 Handling exceptions
      2. 15.2 Declaring and raising exceptions
      3. 15.3 Checking and exceptions
      4. 15.4 Exception occurrences
      5. 15.5 Exception pragmas and aspects
      6. 15.6 Scope of exceptions
    6. 16 Contracts
      1. 16.1 Aspect specifictions
      2. 16.2 Preconditions and postconditions
      3. 16.3 Type invariants
      4. 16.4 Subtype predicates
      5. 16.5 Messages
    7. 17 Numeric Types
      1. 17.1 Signed integer types
      2. 17.2 Modular types
      3. 17.3 Real types
      4. 17.4 Floating point types
      5. 17.5 Fixed point types
      6. 17.6 Decimal types
    8. 18 Parameterized Types
      1. 18.1 Discriminated record types
      2. 18.2 Default discriminants
      3. 18.3 Variant parts
      4. 18.4 Discriminants and derived types
      5. 18.5 Access types and discriminants
      6. 18.6 Private types and discriminants
      7. 18.7 Access discriminants
    9. 19 Generics
      1. 19.1 Declarations and instantiations
      2. 19.2 Type parameters
      3. 19.3 Subprogram parameters
      4. 19.4 Package parameters
      5. 19.5 Generic library units
    10. 20 Tasking
      1. 20.1 Parallelism
      2. 20.2 The rendezvous
      3. 20.3 Timing and scheduling
      4. 20.4 Protected objects
      5. 20.5 Simple select statements
      6. 20.6 Timed and conditional calls
      7. 20.7 Concurrent types and activation
      8. 20.8 Termination, exceptions and ATC
      9. 20.9 Signalling and scheduling
      10. 20.10 Summary of structure
    11. 21 Object Oriented Techniques
      1. 21.1 Extension and composition
      2. 21.2 Using interfaces
      3. 21.3 Mixin inheritance
      4. 21.4 Linked structures
      5. 21.5 Iterators
      6. 21.6 Generalized iteration
      7. 21.7 Object factories
      8. 21.8 Controlling abstraction
    12. 22 Tasking Techniques
      1. 22.1 Dynamic tasks
      2. 22.2 Multiprocessors
      3. 22.3 Synchronized interfaces
      4. 22.4 Discriminants
      5. 22.5 Task termination
      6. 22.6 Clocks and timers
      7. 22.7 The Ravenscar profile
    13. Program 4 Super Sieve
  12. Part 4 Completing the Story
    1. 23 Predefined Library
      1. 23.1 The package Standard
      2. 23.2 The package Ada
      3. 23.3 Characters and strings
      4. 23.4 Numerics
      5. 23.5 Input and output
      6. 23.6 Text input–output
      7. 23.7 Streams
      8. 23.8 Environment commands
    2. Program 5 Wild Words
    3. 24 Container Library
      1. 24.1 Organization of library
      2. 24.2 Doubly linked lists
      3. 24.3 Vectors
      4. 24.4 Maps
      5. 24.5 Sets
      6. 24.6 Trees
      7. 24.7 Holder
      8. 24.8 Queues
      9. 24.9 Bounded containers
      10. 24.10 Indefinite containers
      11. 24.11 Sorting
      12. 24.12 Summary table
    4. 25 Interfacing
      1. 25.1 Representations
      2. 25.2 Unchecked programming
      3. 25.3 The package System
      4. 25.4 Storage pools and subpools
      5. 25.5 Other languages
    5. Program 6 Playing Pools
    6. 26 The Specialized Annexes
      1. 26.1 Systems Programming
      2. 26.2 Real-Time Systems
      3. 26.3 Distributed Systems
      4. 26.4 Information Systems
      5. 26.5 Numerics
      6. 26.6 High Integrity Systems
    7. 27 Finale
      1. 27.1 Names and expressions
      2. 27.2 Type equivalence
      3. 27.3 Overall program structure
      4. 27.4 Portability
      5. 27.5 Penultimate thoughts
      6. 27.6 SPARK
  13. Appendices
    1. A1 Reserved Words, etc.
      1. A1.1 Reserved words
      2. A1.2 Predefined attributes
      3. A1.3 Predefined aspects
      4. A1.4 Predefined pragmas
      5. A1.5 Predefined restrictions
    2. A2 Glossary
    3. A3 Syntax
      1. A3.1 Syntax rules
      2. A3.2 Syntax index
  14. Answers to Exercises
  15. Bibliography
  16. Index