TYPES AND SUBTYPES DEFINED IN ISO 8652:1995 The types defined in the package standard are always available ( unless the user hides them by defining the same name ). Other types are listed under the package that must be " withed " to make the types available. The exact definition of some types is implementation defined. This means the user may want to do some experiments when using a new Ada compiler. type comment ____ _______ BOOLEAN objects of this type take values TRUE or FALSE CHARACTER objects of this type are exactly one character. e.g. 'A' DURATION this is a fixed point type used with the " delay " statement in tasking and in the package CALENDAR FLOAT objects of this type are represented by hardware floating point numbers INTEGER objects of this type are represented by hardware integers the number of bits can vary. In some 16 bits while in other compilers 32 or 64 bits. NATURAL integer in range 0..INTEGER'LAST POSITIVE integer in range 1..INTEGER'LAST STRING objects of this type must be constrained by (1..N) where N is a positive value. Watch out for null filling, not blank filled. "this is a string literal" strings are technically arrays of characters optional types, may or may not be present SHORT_SHORT_INTEGER -- in some compilers SHORT_INTEGER LONG_INTEGER -- in some compilers SHORT_FLOAT -- in some compilers, 32 bit LONG_FLOAT -- in most compilers, 64 bit LONG_LONG_FLOAT -- in some compilers, 128 bit from the package TEXT_IO type comment ____ _______ COUNT e.g. page length, line length FIELD e.g. width FILE_MODE enumeration literal IN_FILE or OUT_FILE FILE_TYPE e.g. type of file NUMBER_BASE e.g. 2, 10, 16 POSITIVE_COUNT e.g. spacing amount TYPE_SET enumeration literal LOWER_CASE or UPPER_CASE from the package SYSTEM type comment ____ _______ ADDRESS the type definition for address. not necessarily INTEGER NAME enumeration type for target names PRIORITY subtype of INTEGER for task priorities from the package CALENDAR type comment ____ _______ DAY_DURATION fixed point seconds in a day 0.0 .. 86_400.0 DAY_NUMBER days in month 1 .. 31 MONTH_NUMBER months in year 1 .. 12 TIME a private type ( usually a record ) holds date and time YEAR_NUMBER year 1901 .. 2099 from the package UNCHECKED_DEALLOCATION type comment ____ _______ OBJECT generic format parameter NAME is access OBJECT pointer to what is deallocated from the package UNCHECKED_CONVERSION type comment ____ _______ SOURCE generic formal parameter TARGET generic formal parameter note: source object is usually required to be the same length as the target object. This is implementation dependent. This can be used to put a integer into a floating point object or other similar atrocities. SOME EXCEPTIONS DEFINED IN ISO 8652:1995 The user may provide exception handlers for these exceptions but should not declare local exceptions by these names. If the user does not provide the exception handler, the Ada run time that " calls " the main procedure will handle the exception. Usually with some message. Only one or a few causes of each exception are listed. CONSTRAINT_ERROR e.g. subscript out of range PROGRAM_ERROR e.g. something illegal at run time STORAGE_ERROR e.g. out of memory for this program TASKING_ERROR e.g. calling a task that has terminated An exception handler is of the form: begin ... exception when NUMERIC_ERROR => ... some executable code end ; from the package TEXT_IO DATA_ERROR e.g. illegal data read by GET DEVICE_ERROR e.g. input or output can not be completed END_ERROR e.g. hit end of file LAYOUT_ERROR e.g. bad line or page format. Too much of something MODE_ERROR e.g. trying to write IN_FILE or read OUT_FILE NAME_ERROR e.g. illegal file name STATUS_ERROR e.g. trying to use unopened file USE_ERROR e.g. improper use of a file from package CALENDAR TIME_ERROR e.g. not a legal date and/or time SOME NAMED NUMBERS DEFINED IN ISO 8652:1995 Named numbers can be used any place a number of the corresponding type can be used. Named numbers are defined by the format " XXX : constant := ... ; " from the package SYSTEM FINE_DELTA -- smallest delta in fixed point range -1.0 .. 1.0 MAX_DIGITS -- largest number of digits in floating point constraint MAX_INT -- largest positive value of all integer types MAX_MANTISSA -- largest number of bits in fixed point model number MEMORY_SIZE -- number of storage units available somewhere MIN_INT -- most negative of all integer types STORAGE_UNIT -- number of bits in a storage unit SYSTEM_NAME -- the default target name TICK -- the basic clock period in seconds from the package TEXT_IO UNBOUNDED SOME PRAGMAS DEFINED IN ISO 8652:1995 ( see annexes for definitions) CONTROLLED ELABORATE INLINE INTERFACE LIST MEMORY_SIZE OPTIMIZE PACK PAGE e.g. pragma PAGE ; PRIORITY e.g. pragma PRIORITY(5) ; SHARED STORAGE_UNIT SUPPRESS LIBRARY UNITS DEFINED IN ISO 8652:1995 Ada 95 Library Packages Library Name and some renamed for compatibility with '83 Ada Ada.Asynchronous_Task_Control Ada.Calendar Calendar Ada.Characters Ada.Characters.Handling Ada.Characters.Latin_1 Ada.Command_Line Ada.Decimal Ada.Direct_IO Direct_IO Ada.Dynamic_Priorities Ada.Exceptions Ada.Finalization Ada.Interrupts Ada.Interrupts.Names Ada.IO_Exceptions IO_Exceptions Ada.Numerics Ada.Numerics.Complex_Elementary_Functions Ada.Numerics.Complex_Types Ada.Numerics.Discrete_Randon Ada.Numerics.Elementary_Functions Ada.Numerics.Float_Random Ada.Numerics.Generic_Complex_Elementary_Functions Ada.Numerics.Generic_Complex_Types Ada.Numerics.Generic_Elementary_Functions Ada.Numerics.Random_Numbers Ada.Real_Time Ada.Sequential_IO Sequential_IO Ada.Storage_IO Ada.Streams Ada.Streams.Stream_IO Ada.Strings Ada.Strings.Bounded Ada.Strings.Fixed Ada.Strings.Maps Ada.Strings.Maps.Constants Ada.Strings.Unbounded Ada.Strings.Wide_Bounded Ada.Strings.Wide_Fixed Ada.Strings.Wide_Maps Ada.Strings.Wide_Maps.Wide_Constants Ada.Strings.Wide_Unbounded Ada.Synchronous_Task_Control Ada.Tags Ada.Task_Attributes Ada.Task_Identification Ada.Text_IO Text_IO Integer_IO Modular_IO Float_IO Fixed_IO Decimal_IO Enumeration_IO Ada.Text_IO.Complex_IO Ada.Text_IO.Editing Ada.Text_IO.Text_Strings Ada.Unchecked_Conversion Unchecked_Conversion Ada.Unchecked_Deallocation Unchecked_Deallocation Ada.Wide_Text_IO Integer_IO Modular_IO Float_IO Fixed_IO Decimal_IO Enumeration_IO Ada.Wide_Text_IO.Complex_IO Ada.Wide_Text_IO.Editing Ada.Wide_Text_IO.Text_Strings Interfaces Interfaces.C Interfaces.C.Pointers Interfaces.C.Strings Interfaces.COBOL Interfaces.Fortran System System.Address_To_Access_Conversion System.Machine_Code Machine_code System.RPC System.Storage_Elements System.Storage_Pools Note: most packages contain procedures and functions as well as type and object definitions. It is possible that the following chart will help clarify the terminology related to Ada types. This is a chart showing classes of types. |-- private [limited] [aliased] | type ---| |-- composite --|-- record --|-- tagged ----|-- Users | | | | | |-- untagged --|-- Users | | | |-- array ---|-- constrained ----|-- Users | | | | | |-- unconstrained --|-- String | | |-- Users | | | |-- task | |-- tagged | |-- protected | | |-- scalar --|-- real --|-- floating --|-- Float | | | |-- Users | | | | | |-- fixed -----|-- Duration | | |-- Users binary | | |-- Users decimal | | | | | | |-- modular --|-- Users | |-- discrete --|-- integer --| | | | | | |-- signed --|-- Integer | | |-- Positive | | |-- Natural | | |-- Users | | | |- enumeration -|-- Character | |-- Boolean | |-- Users | |-- access --|-- access-to-object |-- access-to-subprogram The classes "real" and "integer" together form the class numeric types. There is a long list of attributes defined in ISO 8652:1995 in Annex K Types of executable statements |-- null |-- assignment |-- procedure call |-- sequential --|-- entry call | |-- code | |-- delay | |-- abort | |-- requeue | |-- simple ----| | | | | |-- exit | |-- control -----|-- goto | |-- raise | |-- return | statement --| | | |-- if | |-- case | |-- sequential --|-- loop | | |-- block |-- compound --| | |-- accept |-- parallel ----|-- entry |-- select