![]() |
![]() HP OpenVMS Systems |
![]() |
DEC Ada
|
Previous | Contents | Index |
Both VADS and DEC Ada provide packages beyond the minimum required by the Ada language standard.
The following packages are available on VADS:
Package UNSIGNED_TYPES is supplied to illustrate the definition of and services for the unsigned types supplied. It is given with no warranty, expressed or implied, for the effectiveness or legality of the package. UNSIGNED_TYPES is used at the user's own risk.
The following packages are available on DEC Ada:
The following lists differences regarding packages as implemented on VADS:
VADS supports packages to interface to every facility in UNIX, sometimes with several different interfaces. DEC Ada has minimal interfaces to the command line and to signals.
VADS provides the packages MACHINE_TYPES and MACHINE_CODE. Also
provided are the V_* packages designed for customizing the run-time
system and the kernel run-time system.
C.10 Bindings
DEC Ada provides the following strongly typed bindings:
On DIGITAL UNIX, DEC Ada also provides support for the POSIX Ada Language Interface bindings as required by IEEE Standard 1003.5-1992 (IEEE Standard for Information Technology, POSIX Ada Language Interfaces.
These bindings are compatible with VADS.
C.10.1 Interfaces to C
Both VADS and DEC Ada recognize the importance of interfacing to C and provide Ada types and operations, as shown in Table C-9.
Type or Operation | VADS | DEC Ada |
---|---|---|
C types package | C_TO_A_TYPES | C_TYPES |
C strings | C_STRINGS | C_TYPES.NULL_TERMINATED |
Other types | SHORT | SHORT_INT |
Operations |
C_PRINTF
STRLEN STRNCPY |
VADS does not require that a generic declaration and the corresponding body be part of the same compilation, and they are not required to exist in the same VADS library.
The VADS compiler generates code for a generic instantiation that can be shared by other instantiations of the same generic which reduces the size of the generated code and increases compilation speed. There is an overhead associated with the use of shared code instantiations because the generic actual parameters must be accessed indirectly and, in the case of a generic package instantiation, declarations in the package are also accessed indirectly. Greater optimization is possible for unshared instantiations because exact actual parameters are known. It is the responsibility of the programmer to decide whether space or time is the most critical in a specific application.
The compiler and other large dynamic compiled programs occasionally give problems due to the shell's stack limit. Altering the stack size and recompiling or re-executing is sometime necessary. A process inherits its stack limit from the invoking process (usually the shell).
The C shell allows the default stack size to be reset usually up to the limit of the process size. Most Bourne shell implementations do not permit the stack size to be altered.
On VADS, the following restrictions are in effect:
Other differences between VADS and DEC Ada are as follows:
type T16 is new SHORT_INTEGER range -32768 .. 32767 |
In this declaration, DEC Ada interprets the numeric literals in the
range of the declaration as having constraints that are of type
SHORT_INTEGER. Therefore, it considers positive value 32768 to be of
type SHORT_INTEGER. The intention is to apply a hyphen (-) to it, but
instead the compiler generates a constraint error. VADS as allowed by
LRM 11.6(6), uses a larger type as the base type for the operation.
On DEC Ada, the user can use attributes (such as
SHORT_INTEGER'FIRST), create a nonderived type, or use an integer
conversion. For example:
type T16 is new SHORT_INTEGER range SHORT_INTEGER'FIRST .. SHORT_INTEGER'LAST |
The following lists differences in the definition of a main program on VADS and DEC Ada:
VADS provides the implementation-defined attributes shown and briefly described in Table C-10.
Attribute | Description |
---|---|
COMPILER_KEY | For a prefix N denoting the name of an entity, N'COMPILER_KEY yields the full path name of the compiler key, which indicates the compiler that was used to generate code for the unit containing the definition of N. |
COMPILER_VERSION | For a prefix N denoting the name of an entity, N'COMPILER_VERSION yields the version of the compiler that was used to generate code for the unit containing the definition of N. |
DOPE_ADDRESS | For an array object A, A'DOPE_ADDRESS yields the address of the dope vector that describes A. |
DOPE_SIZE | For an array object A, A'DOPE_SIZE yields the size in bits of the dope vector. |
ENTRY_NUMBER | For a prefix E denoting A TASK ENTRY OR GENERIC FORMAL SUBPROGRAM, E'ENTRY_NUMBER yields a UNIVERSAL_INTEGER value that uniquely identifies the entity denoted by E. |
HOMOGENEOUS |
For a prefix T denoting an access type,
T'HOMOGENEOUS yields a Boolean value. |
REF | The REF attribute denotes the effective address of the first of the storage units allocated to the object. Not supported for a package, task unit, or entry. |
TASK_ID | For a non-passive task object or value X, X'TASK_ID yields the unique task ID associated with the task. |
TYPE_KEY | For a prefix T denoting a type name, T'TYPE_KEY yields a string that uniquely identifies type T. |
DEC Ada provides the implementation-defined attributes shown and briefly described in Table C-11.
Attribute | Description |
---|---|
BIT | For a prefix P that denotes an object, P'BIT yields the bit offset within the storage unit (byte) containing the first bit for the object P. |
MACHINE_SIZE | For a prefix P that denotes any type or subtype, P'MACHINE_SIZE yields the number of machine bits to be allocated for variables of the type or subtype. |
NULL_PARAMETER | For a prefix P that denotes any type or subtype, P'NULL_PARAMETER yields an (imaginary) object of type or subtype P allocated at (machine) address zero. |
TYPE_CLASS |
For a prefix P that denotes a type or subtype,
P'TYPE_CLASS yields the value of the type class for the full type of P. |
To pass options to the linker, VADS provides the pragma LINK_WITH. DEC Ada provides the following ways to pass options to the linker:
DEC Ada supplies the following pragmas to control optimization:
VADS supplies the following pragmas to control optimization:
Optimization on both implementations can be controlled at the
command-line level.
C.13 User Interface
VADS and DEC Ada provide a comparable set of commands to build programs and manage the program library. Table C-12 lists the VADS and DEC Ada commands and points out any differences as appropriate.
VADS Command | DEC Ada Command |
---|---|
ada | ada |
a.app | N/A |
a.cleanlib | arm |
a.cp | acp |
a.das | setenv 1 adalisflags "+m" |
a.db | dbx 2 with the name of the main program |
a.du | du 2 |
a.error | setenv ADAERRFLAGS with the desired options. |
a.help | man 2 (with name of the appropriate command); also, the ada(1) reference page contains additional information on defining a context, getting started, and debugging. |
a.info | als |
a.ld | ald , amake |
a.list |
You can create a listing file in two ways:
|
a.ls | als |
a.make | amake |
a.map | odump 2 |
a.mklib | amklib |
a.mkvar | tar 2 |
a.mv | acp and arm |
a.path or the -l option | setenv adalib or the -a option; aprintlib |
a.pr | N/A |
a.pragma | N/A |
a.report | Send an internet mail message |
a.rmlib | armlib |
a.rm | arm |
a.run | Enter the name of the executable program at the system prompt. |
a.tags | N/A |
a.to_srec | N/A |
a.vadsrc | N/A |
a.view | Use a DIGITAL UNIX editor to create aliases in your .login file. |
a.which | als |
xlink | |
Pragma LINK_WITH or WITH n directives (may require use of pragmas INTERFACE and NOT_ELABORATED) | aimport |
N/A | axargs |
Use the a.which command to located the source file. | acat |
N/A | areport |
VADS implementations supply optional products ( a.cvt and a.prof ), which are not listed in Table C-12.
Table C-13 briefly describes some of the features of the user interface.
Feature | VADS | DEC Ada |
---|---|---|
Modifying a path | Use the a.path -i command. This command generates a menu. | Use any of the DIGITAL UNIX editors to modify the context file. |
Specifying paths | Use the a.path command. | Define the environment variable (ADALIB) or use the -a option with a DEC Ada command. |
Sublibraries | Not supplied. | Allow you to create a sublibrary structure. Use the amklib -p command. |
The VADS Ada I/O system is implemented using DIGITAL UNIX I/O. Both formatted and binary I/O are available. There are no restrictions on the types with which DIRECT_IO and SEQUENTIAL_IO can be instantiated except that the element size must be less than a maximum given by the variable SYSTEM.MAX_REC_SIZE. This variable can be set to any value prior to the generic instantiation. Therefore, you can use any element size.
DIRECT_IO can be instantiated with unconstrained types, but each element is padded out to the maximum possible for that type or to SYSTEM.MAX_REC_SIZE, whichever is smaller. No checking (other than normal static Ada type checking) is done to ensure that values from files are into correctly sized and typed objects.
VADS file and terminal input-output are identical in most respects and differ only in the frequency of buffer flushing. Output is buffered (buffer size is 1024 bytes). The buffer is always flushed after each write request if the destination is a terminal. The procedure FILE_SUPPORT.ALWAYS_FLUSH (file_ptr) causes flushing of the buffer associated with file_ptr after all subsequent output requests.
Instantiations of DIRECT_IO use the value MAX_REC_SIZE as the record size (expressed in STORAGE_UNITs) when the size of ELEMENT_TYPE exceeds that value. MAX_REC_SIZE is defined in package SYSTEM and can be changed before instantiating DIRECT_IO to provide an upper limit on the record size. The maximum record size supported is 1024*1024*STORAGE_UNIT bits.
Instantiations of SEQUENTIAL_IO use the value MAX_REC_SIZE as the record size (expressed in STORAGE_UNITs) when the size of ELEMENT_TYPE exceeds that value. MAX_REC_SIZE is defined in package SYSTEM and can be changed by a program before instantiating SEQUENTIAL_IO to provide an upper limit on the record size. SEQUENTIAL_IO imposes no limit on MAX_REC_SIZE.
On DIGITAL UNIX systems, DEC Ada predefined input-output packages and their operations are implemented using systems calls, which provide read sharing for the sequential and direct packages. DEC Ada provides no additional input-output packages specifically related to DIGITAL UNIX systems.
DEC Ada predefines the following input-output packages on DIGITAL UNIX:
The packages DIRECT_IO, SEQUENTIAL_IO, AND TEXT_IO are predefined by the Ada language. The remaining packages are predefined by the Ada implementation.
To make the use of the generic TEXT_IO operations more convenient, DEC Ada provides predefined library packages that instantiate the integer and floating-point operations for the predefined integer and floating-point types as shown in Table C-14.
Package Name | Instantiation |
---|---|
LONG_INTEGER_TEXT_IO | LONG_INTEGER_IO(INTEGER) |
INTEGER_TEXT_IO | INTEGER_IO(INTEGER) |
SHORT_INTEGER_TEXT_IO | INTEGER_IO(SHORT_INTEGER) |
SHORT_SHORT_INTEGER_TEXT_IO | INTEGER_IO(SHORT_SHORT_INTEGER) |
FLOAT_TEXT_IO | FLOAT_IO(FLOAT) |
LONG_FLOAT_TEXT_IO | FLOAT_IO(LONG_FLOAT) |
The DEC Ada predefined packages and their operations are implemented using DIGITAL UNIX files and input-output facilities. DEC Ada supports asynchronous input-output on DIGITAL UNIX. Familiarity with the following is recommended:
On DIGITAL UNIX, the value of the FORM parameter conforms to the description of the FORM parameter in IEEE Standard 1003.5-1992, IEEE Standard for Information Technology, POSIX Ada Language Interfaces.
VADS also provides shareable generic instantiations of TEXT_IO packages for common data types in standard/shared_io.a . This package improves disk usage by ensuring that only one instantiation of the I/O packages exists for each VADS installation.
Shared generics cause a slight execution-time penalty because all type
attributes must be referenced indirectly (as if an extra calling
argument were added). However, it reduces compilation time
substantially in most circumstances and it reduces program size.
C.15 Implementation Limits
The following table lists implementation limits for DEC Ada on DIGITAL UNIX systems.
Limit | Value |
---|---|
In a subprogram or entry declaration, maximum number of formal parameters that are of an unconstrained record type | 32 |
Maximum identifier length (number of characters) | 255 |
Maximum number of characters in a source line | 255 |
Maximum collection size (number of bytes) | 2 63--1 |
Maximum number of discriminants for a record type | 245 |
Maximum number of formal parameters in an entry or subprogram declaration | 246 |
Maximum number of dimensions in an array type | 255 |
Maximum number of library units and subunits in a compilation closure 1 | 4095 |
Maximum number of library units and subunits in an execution closure 2 | 16383 |
Maximum number of objects declared with the pragma COMMON_OBJECT or PSECT_OBJECT | 32757 |
Maximum number of enumeration literals in an enumeration type definition | 65535 |
Maximum number of lines in a source file | 65534 |
Maximum number of bits in any object | 2 31 --1 |
Maximum size of the static portion of a stack frame (approximate) | 2 30 |
Previous | Next | Contents | Index |