![]() |
![]() HP OpenVMS Systems |
![]() |
DEC Ada
|
Previous | Contents | Index |
The Ada language specifies that unrecognized pragmas are accepted but
ignored. Therefore, programs using a Apex-only pragma on a DIGITAL
implementation compile but do not necessarily run as expected.
D.8.1 Pragma-Related Restrictions
Restrictions on the Pragma INLINE
Apex applies the following restrictions to the pragma INLINE:
DEC Ada applies the following restrictions to the pragma INLINE:
Restrictions on the Pragma INTERFACE
Table D-7 describes the restrictions on the pragma INTERFACE on Apex and DEC Ada.
Restriction | Apex | DEC Ada |
---|---|---|
Languages accepted: | Ada, C, Pascal, ASM, Fortran, unchecked. | Ada, Bliss, C, Fortran. Default is C on DIGITAL UNIX. |
Parameter passing: | Language specifies default mechanism. | Language specifies default mechanisms but can be overridden with an EXPORT pragma. |
Ada: use Ada rules. | Ada: use internal Ada rules. | |
C: parameters must be mode 'in'; scalar, access or SYSTEM.ADDRESS types for parameters and results. | Bliss, C: parameters must be mode 'in'; cannot be record or task type. Result cannot be a string, an array, or a record. | |
Fortran: pass by reference and must be of type ADDRESS. Result must be a scalar. | Fortran: parameters cannot be a task. Result cannot be a string, an array, or a record. | |
Unchecked: similar to the language Ada. | Not available on DEC Ada for DIGITAL UNIX. |
A library of predefined units is provided as part of the Apex and DEC Ada implementations. The following predefined units are provided by both implementations:
In Apex, UNCHECKED_CONVERSION cannot be instantiated with a target type that is an unconstrained array type or an unconstrained record type with discriminants.
There are no restrictions on the types with which UNCHECKED_DEALLOCATION can be instantiated. No checks are performed on released objects.
In addition, Apex provides the package LOW_LEVEL_IO and the package MACHINE_CODE. Package MACHINE_CODE provides an assembly language interface for the target machine, including the necessary record types needed in the code statement, an enumeration type containing all the opcode mnemonics, a set of register definitions, and a set of addressing mode functions.
DEC Ada does not provide the package MACHINE_CODE. Instead, DEC Ada
recommends importing assembler code.
D.9.1 Implementation-Defined Packages
Both VADS and DEC Ada provide packages beyond the minimum required by the Ada language standard.
The following packages are available on Apex:
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. |
Rational recommends that instead of using the package UNSIGNED_TYPES, that users use the Ada95 “mod” syntax to define their own modulo types.
The following packages are available on DEC Ada:
The following list shows differences regarding packages as implemented on Apex:
Apex 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.
Apex 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.
D.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.
Rational provides an optional bindings package to X/Windows and Motif, called AXI.
Apex is shipped with the POSIX Ada Language Interfaces.
D.10.1 Interfaces to C
Both Apex and DEC Ada recognize the importance of interfacing to C and provide Ada types and operations, as shown in Table D-8.
Type or Operation | Apex | 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 |
Other features and restrictions are as follows:
Other differences between Apex and DEC Ada are as follows:
type T16 is new SHORT_INTEGER range -32768 .. 32767 |
type T16 is new SHORT_INTEGER range SHORT_INTEGER'FIRST .. SHORT_INTEGER'LAST |
The differences in the definition of a main program on Apex and DEC Ada are as follows:
When a main function or main procedure declared with the pragma
EXPORT_VALUED_PROCEDURE returns a discrete value whose size is less
than 64 bits (on Alpha systems), the value is zero- or sign-extended as
appropriate.
D.11 Implementation-Defined Attributes
Apex provides the implementation-defined attributes shown and briefly described in Table D-9.
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 D-10.
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, Apex provides the pragma LINK_WITH. DEC Ada provides the following ways to pass options to the linker:
DEC Ada supplies the following ways of controlling optimization:
Apex supplies the following pragmas to control optimization:
Optimization with Apex can be controlled through the use of library level switches, or through use of the above pragmas.
Optimization on DEC Ada can be controlled at the command-line level.
D.13 User Interface
Apex is a GUI based application that provides an entire development environment. There are command line equivalents for all GUI operations. Only a small subset of the available commands is listed here. This subset is made up of those commands that have a DEC Ada equivalent.
Apex and DEC Ada provide a comparable set of commands to build programs and manage the program library. Table Table D-11 lists the ADA and DEC Ada commands and points out any differences as appropriate.
Apex Command | DEC Ada Command |
---|---|
apex code | ada |
apex clean | arm |
apex copy | acp |
disassemble | setenv 1 ADALISFLAGS "+m" |
a_db | DECladebug 2 with the name of the main program |
apex_display 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. |
apex report | als |
apex link | ald , amake |
N/A |
You can create a listing file in two ways:
|
N/A | als |
Make is automatic when any compilation is run | amake |
Map file created automatically | odump 2 |
apex create_view | amklib |
apex move | acp and arm |
Always derived from context of compilation | setenv adalib or the -A option |
N/A | aprintlib |
apex delete | armlib |
apex delete | arm |
N/A | axargs |
Directly viewed through the interactive Ada editor | acat |
N/A | areport |
Apex implementations supply optional products (for static analysis, cross compilation and so forth), as shown in Table D-12:
Product | Purpose |
---|---|
Ada Analyzer | Static Analysis of user code. Locates coding violations and Potential maintenance problems. |
AXI | Bindings for X11 and MOTIF |
Testmate | Test management system, code coverage analysis |
SoDA | Automated document production |
Rational/Rose | Visual Modeling using UML. Supports code generation and reverse engineering. |
Table D-13 briefly describes some of the features of the user interface.
Feature | Apex | DEC Ada |
---|---|---|
Modifying a path | Use Apex IMPORTS commands | Use any of the DIGITAL UNIX editors to modify the context file. |
Specifying paths | Use Apex IMPORTS commands | 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. |
The Apex 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.
Apex 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 D-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.
Previous | Next | Contents | Index |