1 ADA Invokes the Compaq Ada compiler to compile one or more Compaq Ada source files. NOTE The ADA command is a DCL command, not an ACS command. Format ADA file-spec[,...] 2 Parameters file-spec[,...] Specifies one or more Compaq Ada source files to be compiled. If you do not specify a file type, the compiler uses the default file type of .ADA. No wildcard characters are allowed in the file specifications. If you specify more than one input file, you must separate the file specifications with commas (,). You cannot use plus signs (+) to separate file specifications. 2 Description The DCL ADA command is one of four Compaq Ada compilation commands. The other three compilation commands are the ACS LOAD, COMPILE, and RECOMPILE commands. The ADA command can be used at any time to compile one or more source files (.ADA). Compaq Ada source files are compiled in the order in which they appear in the command line. If a source file contains more than one Compaq Ada compilation unit, the units are compiled in the order in which they appear in a source file. The Ada rules governing compilation order are summarized in Developing Ada Programs on OpenVMS Systems. The ADA command compiles units in the context of the current program library. Whenever a compilation unit is compiled without error, the current program library is updated with the object module and other products of compilation. See HELP ACS Libraries and HELP ACS Getting_Started for more information on Compaq Ada program libraries, sublibraries, and compilation. 2 Command_Qualifiers /LIBRARY /LIBRARY=directory-spec /LIBRARY=ADA$LIB (D) Specifies the program library that is to be the current program library for the duration for the compilation. The directory specified must be an existing Compaq Ada program library. No wildcard characters are allowed in the directory specification. By default, the current program library is the program library last specified in an ACS SET LIBRARY command. The logical name ADA$LIB is assigned to the program library specified in an ACS SET LIBRARY command. /LIBRARY=(lib-term[,..])/PATH Specifies the library search path that is to be the current path for the duration of the compilation. For more information on library search paths, enter HELP ACS Library_Search_Paths. You can specify lib-term as follows: o The directory specification of a Compaq Ada library. For example: [JONES.HOTEL.ADALIB]. o The default path of a Compaq Ada library. To specify the default path, you enter the name of a Compaq Ada library preceded by an at sign(@). For example: @[JONES.HOTEL.ADALIB]. o A file specification preceded by an at sign (@). For example: @[JONES.HOTEL]MYPATH.TXT. Note the that file, MYPATH.TXT, must contain one or more valid lib-terms. If you do not specify the full file specification, the default file name is PATH and the default file extension is .TXT. You must use commas to separate more than one lib-term in a library search path. If a term in the value of the /LIBRARY qualifier contains that at sign (@), you must use double quotes (") to surround the term. /PATH /PATH /NOPATH (D) Allows you to specify a library search path as the value of the /LIBRARY qualifier. If you do not specify the /PATH qualifier, the value of the /LIBRARY qualifier must be a directory specification of a DEC Ada library or sublibrary. For more information on library search paths, see the Developing Ada Programs on OpenVMS Systems. 2 Positional_Qualifiers /ANALYSIS_DATA /ANALYSIS_DATA[=file-spec] /NOANALYSIS_DATA (D) Controls whether a data analysis file containing source code cross-reference and static analysis information is created. The data analysis file is supported only for use with Digital layered products, such as the DEC Source Code Analyzer. One data analysis file is created for each source file that is compiled. The default directory for data analysis files is the current default directory. The default file name is the name of the source file being compiled. The default file type is .ANA. No wildcard characters are allowed in the file specification. By default, no data analysis file is created. /ARCHITECTURE Controls the use of new Alpha instructions. The syntax for this switch is as follows: /ARCHITECTURE = { GENERIC | HOST | EV4 | EV5 | EV56 } Setting the /ARCH switch causes a corresponding setting in the /TUNE switch. (See the Release Notes for more information.) /CHECK /CHECK /NOCHECK Controls whether all run-time checks are suppressed. The /NOCHECK qualifier is equivalent to having all possible SUPPRESS pragmas in the source code. Explicit use of the /CHECK qualifier overrides any occurrences of the pragmas SUPPRESS and SUPPRESS_ALL in the source code, without the need to edit the source code. By default, run-time checks are suppressed only in cases where a pragma SUPPRESS or SUPPRESS_ALL appears in the source code. See the DEC Ada Language Reference Manual for more information on the pragmas SUPPRESS and SUPPRESS_ALL. /COPY_SOURCE /COPY_SOURCE (D) /NOCOPY_SOURCE Controls whether a copied source file is created in the current program library when a compilation unit is compiled without error. The ACS RECOMPILE command requires that a copied source file exist in the current program library; the ACS COMPILE command uses the copied source file if it cannot find an external source file when it is recompiling an obsolete unit or completing an incomplete generic instantiation (see Developing Ada Programs on OpenVMS Systems). Copied source files may also be used by the OpenVMS Debugger (see the Developing Ada Programs on OpenVMS Systems for more information on debugging tasks; and the OpenVMS Debugger Manual for more information on the debugger). By default, a copied source file is created in the current program library when a unit is compiled without error. /DEBUG /DEBUG[=(option[,...])] (D) /NODEBUG Controls which compiler debugging options are provided. You can debug Compaq Ada programs with the OpenVMS Debugger (see the Developing Ada Programs on OpenVMS Systems for more information on debugging Ada tasks; and the OpenVMS Debugger Manual for more information on the OpenVMS debugger. You can request the following options: ALL Provides both SYMBOLS and TRACEBACK. NONE Provides neither SYMBOLS nor TRACEBACK. [NO]SYMBOLS Controls whether debugger symbol records are included in the object file. [NO]TRACEBACK Controls whether traceback information (a subset of the debugger symbol information) is included in the object file. By default, both debugger symbol records and traceback information are included in the object file (/DEBUG=ALL, or equivalently: /DEBUG). /DESIGN /DESIGN[=option] /NODESIGN (D) Allows you to process Ada source files as a detailed program design. For each unit that is design checked without error, the program library is updated with information about that unit. Design-checked units are considered to be obsolete in operations that require full compilation and must be recompiled. You can request the following options: [NO]COMMENTS Determines whether comments are processed for program design information. For the COMMENTS option to have effect, you must specify the /ANALYSIS_DATA qualifier. See Guide to Source Code Analyzer for VMS Systems for more information on using the Source Code Analyzer (SCA). If you specify NOCOMMENTS, comments are ignored. [NO]PLACEHOLDERS Determines whether design checking is performed. If you specify PLACEHOLDERS, compilation units are design checked-LSE placeholders are allowed and some of the Ada language rules are relaxed so that you can omit some implementation details. If you specify NOPLACEHOLDERS, full compilation is done-the compiler is invoked, LSE placeholders are not allowed, and Ada language rules are not relaxed. Note that when you specify this option with the /SYNTAX_ONLY qualifier, it determines only whether LSE placeholders are allowed. If you specify NOPLACEHOLDERS, then only valid Ada syntax is allowed. If you specify the /DESIGN qualifier without supplying any options, the effect is the same as the following default: /DESIGN=(COMMENTS,PLACEHOLDERS) If you specify only one of the options with the /DESIGN qualifier, the default value for the other option is used. For example, /DESIGN=NOCOMMENTS is equivalent to /DESIGN=(NOCOMMENTS,PLACEHOLDERS). In this case, both qualifiers specify that the unit is design-checked, but comment information is not collected. Similarly, /DESIGN=NOPLACEHOLDERS is equivalent to /DESIGN=(COMMENTS,NOPLACEHOLDERS). In this case, both qualifiers specify that comment information is collected, but the unit is not design-checked (that is, in the absence of the /SYNTAX_ONLY qualifier, units are fully compiled). /DIAGNOSTICS /DIAGNOSTICS[=file-spec] /NODIAGNOSTICS (D) Controls whether a diagnostics file containing compiler messages and diagnostic information is created. The diagnostics file is supported only for use with Digital layered products, such as the DEC Language-Sensitive Editor. One diagnostics file is created for each source file that is compiled. The default directory for diagnostics files is the current default directory. The default file name is the name of the source file being compiled. The default file type is .DIA. No wildcard characters are allowed in the file specification. By default, no diagnostics file is created. /ERROR_LIMIT /ERROR_LIMIT[=n] (D) /NOERROR_LIMIT Controls whether execution of the ADA command for a given compilation unit is terminated upon the occurrence of the nth E-level error within that unit. Error counts are not accumulated across a sequence of compilation units. If the /ERROR_LIMIT=n option is specified, each compilation unit may have up to n - 1 errors without terminating the compilation. When the error limit is reached within a compilation unit, compilation of that unit is terminated, but compilation of subsequent units continues. The /ERROR_LIMIT=0 option is equivalent to ERROR_LIMIT=1. By default, execution of the ADA command is terminated for a given compilation unit upon the occurrence of the 30th E-level error within that unit (equivalent to /ERROR_LIMIT=30). /EXPORT_INTERFACE /EXPORT_INTERFACE=ADA (D) /EXPORT_INTERFACE=FORTRAN /EXPORT_INTERFACE=DEFAULT This qualifier sets the passing mechanism chosen for string parameters for exported subprograms unless an export pragma specifically specifies the passing mechanism. The default is ADA, which uses dope vectors for the passing mechanism. FORTRAN or DEFAULT will use VAX descriptors for the passing mechanism. For more information, please see the Compaq Ada release notes. /LIST /LIST[=file-spec] /NOLIST (D) Controls whether a listing file is created. One listing file is created for each source file compiled. The default directory for listing files is the current default directory. The default file name is the name of the source file being compiled. The default file type is .LIS. No wildcard characters are allowed in the file specification. By default, the ADA command does not create a listing file. /LOAD /LOAD[= option] (D) /NOLOAD Controls whether the current program library is updated with the successfully processed units contained in the specified source files. Depending on other qualifiers specified (or not specified) with the ADA command, processing can involve full compilation, syntax checking only, and so on. The /NOLOAD qualifier causes the units in the specified source files to be processed, but prevents the current program library from being updated. For example, this effect allows you to obtain a machine code listing for a unit that has already been compiled into the program library without affecting the library. You can specify the following option: [NO]REPLACE Controls whether a unit added to the current program library replaces an existing unit with the same name. If you specify the NOREPLACE option, the unit will be added to the current program library only if no existing unit has the same name, except if the new unit is the missing body of an existing specification, or vice versa. By default, the current program library is updated with the successfully processed units, and a unit added to the current program library will replace an existing unit with the same name (/LOAD=REPLACE). /MACHINE_CODE /MACHINE_CODE /NOMACHINE_CODE (D) Controls whether generated machine code (approximating assembler notation) is included in the listing file. By default, generated machine code is not included in the listing file. /NOTE_SOURCE /NOTE_SOURCE (D) /NONOTE_SOURCE Controls whether the file specification of the source file is noted in the program library when a unit is compiled without error. The ACS COMPILE command uses this information to locate revised source files. By default, the file specification of the source file is noted in the program library when a unit is compiled without error. /OPTIMIZE /OPTIMIZE[=(option,...])] /NOOPTIMIZE Controls the level of optimization that is applied in producing the compiled code. You can specify one of the following primary options: TIME Provides full optimization with time as the primary optimization criterion. Overrides any occurrences of the pragma OPTIMIZE(SPACE) in the source code. SPACE Provides full optimization with space as the primary optimization criterion. Overrides any occurrences of the pragma OPTIMIZE(TIME) in the source code. DEVELOPMENT Suggested when active development of a program is in progress. Provides some optimization, but development considerations and ease of debugging take preference over optimization. This option overrides pragmas that establish a dependence on a subprogram or generic body (the pragmas INLINE and INLINE_GENERIC), and therefore reduces the need for recompilations when such bodies are modified. This option also disables generic code sharing. NONE Provides no optimization. Suppresses inline expansions of subprograms and generics, including those specified by the pragmas INLINE and INLINE_ GENERIC. Suppresses occurrences of the pragma SHARE_GENERIC and disables generic code sharing. The /NOOPTIMIZE qualifier is equivalent to /OPTIMIZE=NONE. By default, the ADA command applies full optimization with time as the primary optimization criterion (like /OPTIMIZE=TIME, but observing uses of the pragma OPTIMIZE). The /OPTIMIZE qualifier also has a set of secondary options that you can use separately or together with the primary options to override the default behavior for inline expansion (generic and subprogram) and generic code sharing. The INLINE secondary option can have the following values (see the DEC Ada Run-Time Reference Manual for OpenVMS Systems for more information about inline expansion): NONE Disables subprogram and generic inline expansion. This option overrides any occurrences of the pragmas INLINE or INLINE_GENERIC in the source code, without your having to edit the source file. It also disables implicit inline expansion of subprograms. (Implicit inline expansion means that the compiler assumes a pragma INLINE for certain subprograms as an optimization.) A call to a subprogram or an instance of a generic in another unit is not expanded inline, regardless of the /OPTIMIZE options in effect when that unit was compiled. NORMAL Provides normal subprogram and generic inline expansion. Subprograms to which an explicit pragma INLINE applies are expanded inline under certain conditions. In addition, some subprograms are implicitly expanded inline. The compiler assumes a pragma INLINE for calls to some small local subprograms (subprograms that are declared in the same unit as the unit in which the call occurs). Instances are compiled separately from the unit in which the instantiation occurred unless a pragma INLINE_GENERIC applies to the instance. If a pragma INLINE_GENERIC applies and the generic body has been compiled, the generic is expanded inline at the point of instantiation. SUBPROGRAMS Provides maximal subprogram inline expansion and normal generic inline expansion. In addition to the normal subprogram inline expansion that occurs when INLINE:NORMAL is specified, this option results in implicit inline expansion of some small subprograms declared in other units. The compiler assumes a pragma INLINE for any subprogram if it improves execution speed and reduces code size. This option may establish a dependence on the body of another unit, as would be the case if a pragma INLINE were specified explicitly in the source code. With this option, generic inline expansion occurs in the same manner as for INLINE:NORMAL. GENERICS Provides normal subprogram inline expansion and maximal generic inline expansion. With this option, subprogram inline expansion occurs in the same manner as for INLINE:NORMAL. The compiler assumes a pragma INLINE_GENERIC for every instantiation in the unit being compiled unless an explicit pragma SHARE_GENERIC applies. This option may establish a dependence on the body of another unit, as would be the case if a pragma INLINE_GENERIC were specified explicitly in the source code. MAXIMAL Provides maximal subprogram and generic inline expansion. Maximal subprogram inline expansion occurs as for INLINE:SUBPROGRAMS, and maximal generic inline expansion occurs as for INLINE:GENERICS. The SHARE secondary option can have the following values: NONE Disables generic sharing. This option overrides the effect of any occurrences of the pragma SHARE_ GENERIC in the source code, without your having to edit the source file. In addition, instances do not share code from previous instantiations. NORMAL Provides normal generic sharing. Normally, the compiler will not attempt to generate sharable code for an instance (code that can be shared by subsequent instantiations) unless an explicit pragma SHARE_GENERIC applies to that instance. However, an instance will attempt to share code that resulted from a previous instantiation to which the pragma SHARE_GENERIC applied. MAXIMAL Provides maximal generic sharing. The compiler assumes that a pragma SHARE_GENERIC applies to every instance in the unit being compiled unless an explicit pragma INLINE_GENERIC applies. Therefore, an instance will attempt to share code that resulted from a previous instantiation or to generate code that can be shared by subsequent instantiations. SHARE:MAXIMAL cannot be used in combination with INLINE:GENERICS or INLINE:MAXIMAL. By default, if you specify one of the /OPTIMIZE qualifier primary options on the left (for example, /OPTIMIZE=TIME), it has the same effect as specifying the secondary-option values to the right (in this case, /OPTIMIZE=(TIME,INLINE:NORMAL,SHARE:NORMAL)): TIME /OPTIMIZE=(TIME,INLINE:NORMAL,SHARE:NORMAL) SPACE /OPTIMIZE=(SPACE,INLINE:NORMAL,SHARE:NORMAL) DEVELOPMENT /OPTIMIZE=(DEVELOPMENT,INLINE:NONE,SHARE:NONE) NONE /OPTIMIZE=(NONE,INLINE:NONE,SHARE:NONE) See Developing Ada Programs on OpenVMS Systems for more information on the /OPTIMIZE qualifier and its options. /SHOW /SHOW[=option] (D) /NOSHOW Controls the listing file options included when a listing file is provided. You can specify one of the following options: ALL Provides all listing file options. [NO]PORTABILITYControls whether a program portability summary is included in the listing file (see Developing Ada Programs on OpenVMS Systems). NONE Provides none of the listing file options (same as /NOSHOW). By default, the ADA command provides a portability summary (/SHOW=PORTABILITY). /SMART_RECOMPILATION /SMART_RECOMPILATION (D) /NOSMART_RECOMPILATION Controls whether smart recompilation information is stored and used to minimize unnecessary recompilations. When the /SMART_RECOMPILATION qualifier is in effect, detailed information about dependences is stored in the program library for each unit compiled. This information describes the dependences of a unit at a finer level than the compilation unit level. If smart recompilation is not in effect, detailed information about dependences is not stored in the program library. (See Developing Ada Programs on OpenVMS Systems for more information.) /SYNTAX_ONLY /SYNTAX_ONLY /NOSYNTAX_ONLY (D) Controls whether the source file is to be checked only for correct syntax. If you specify the /SYNTAX_ONLY qualifier, other compiler checks are not performed (for example, semantic analysis, type checking, and so on). In the presence of the /LOAD=REPLACE qualifier (the default), the /SYNTAX_ONLY qualifier updates the current program library with syntax-checked-only units. The units are considered to be obsolete and must be subsequently recompiled. In the presence of the /NOLOAD qualifier, the /SYNTAX_ONLY qualifier checks the syntax of the specified units but does not update the library. By default, the compiler performs all compiler checks. /TUNE Selects processor-specific instruction tuning for implementations of the Alpha architecture. Tuning for a specific implementation can provide improvements in runtime performance. The syntax for this switch is as follows: /TUNE = { GENERIC | HOST | EV4 | EV5 | EV56 } For more information, see the Release Notes. /WARNINGS /WARNINGS[=(option[,...])] /NOWARNINGS Controls which categories of informational (I-level) and warning (W-level) messages are displayed and where those messages are displayed. You can specify any combination of the following message options: WARNINGS: (destination[,...]) NOWARNINGS WEAK_WARNINGS: (destination[,...]) NOWEAK_WARNINGS SUPPLEMENTAL: (destination[,...]) NOSUPPLEMENTAL COMPILATION_NOTES: (destination[,...]) NOCOMPILATION_NOTES STATUS: (destination[,...]) NOSTATUS The possible values of destination are ALL, NONE, or any combination of TERMINAL (terminal device), LISTING (listing file), and DIAGNOSTICS (diagnostics file). The message categories are summarized as follows (See the Developing Ada Programs on OpenVMS Systems for more information): WARNINGS W-level: Indicates a definite problem in a legal program-for example, an unknown pragma. WEAK_WARNINGS I-level: Indicates a potential problem in a legal program-for example, a possible CONSTRAINT_ERROR at run time. These are the only kind of I-level messages that are counted in the summary statistics at the end of a compilation. SUPPLEMENTAL I-level: Additional information associated with previous E-level or W-level diagnostics. COMPILATION_ I-level: Information about how the compiler NOTES translated a program, such as record layout, parameter-passing mechanisms, or decisions made for the pragmas INLINE, INTERFACE, or the import-subprogram pragmas. STATUS I-level: End-of-compilation statistics and other messages. The defaults are as follows: /WARNINGS=(WARN:ALL,WEAK:ALL,SUPP:ALL,COMP:NONE,STAT:LIST) If you specify only some of the message categories with the /WARNINGS qualifier, the default values for other categories are used. 2 Examples 1.$ ADA RESERVATIONS,RESERVATIONS__CANCEL Compiles the compilation units contained in the two files RESERVATIONS.ADA and RESERVATIONS__CANCEL.ADA, in the order given. 2.$ ADA/LIST/SHOW=ALL SCREEN_IO_,SCREEN_IO Compiles the compilation units contained in the two files SCREEN_IO_.ADA and SCREEN_IO.ADA, in the order given. The /LIST qualifier creates the listing files SCREEN_IO_.LIS and SCREEN_IO.LIS in the current default directory. The /SHOW=ALL qualifier causes all listing file options to be provided in the listing files. 3.$ ADA/OPT=INLINE:MAX/WARNINGS=COMPILATION_NOTES SCREEN_IO_, SCREEN_IO Compiles the compilation units contained in the files SCREEN_ IO_.ADA and SCREEN_IO.ADA, in the order given. The /OPTIMIZE qualifier specifies maximal subprogram and generic inline expansion. The /WARNINGS=COMPILATION_NOTES qualifier gives information about how the compiler translated the program, including the decisions made for inline expansions. 4.$ ADA/NOLOAD/LIST/MACHINE_CODE HOTEL Compiles the compilation units contained in the file HOTEL.ADA and generates a machine code listing, but does not update the current program library. 5.$ ADA/WARNINGS=COMPILATION_NOTES/LIST STACKS, SUM Compiles the compilation units contained in the files STACKS.ADA and SUM.ADA, giving information about record layout, parameter-passing mechanisms, inline expansions, and so on. 6.$ ADA/LIBRARY=([JONES.ADALIB],"@[SMITH.ADALIB]")/PATH HOTEL Compiles the compilation units contained in the file HOTEL.ADA using units in [JONES.ADALIB] and in the default path of the [SMITH.ADALIB]. Suppose the default path of [SMITH.ADALIB] identifies the following libraries: [SMITH.ADALIB] [PROJECT.ADALIB] In this case, the library search path used during the compilation is as follows: [JONES.ADALIB] [SMITH.ADALIB] [PROJECT.ADALIB] 2 Getting_Started You compile and link Compaq Ada programs in the context of an Ada program library, which is managed by the Compaq Ada program library manager (ACS). To start using Compaq Ada, enter the following ACS commands to create, initialize, and define your current program library. This series of commands assumes that your program library is a subdirectory of your current OpenVMS working directory. $ ACS CREATE LIBRARY [.ADALIB] $ ACS SET LIBRARY [.ADALIB] Then, compile, link, and execute your program using the following commands (assuming that the name of your program is MYPROG, and that it depends on the package MYPACK): $ ADA/LIST MYPACK_.ADA, MYPACK.ADA, MYPROG.ADA $ ACS LINK MYPROG $ RUN MYPROG You can also use the following equivalent set of commands: $ ACS LOAD MY* $ ACS COMPILE/LIST MYPROG $ ACS LINK MYPROG $ RUN MYPROG Note that when you successfully compile an Ada program, the program library manager stores the object files associated with the program in your current program library, not in your current default directory. Once you compile an Ada compilation unit into a program library, the program library manager recognizes the unit by its unit name, not by its source file name. To prevent confusion and promote efficient compilation, use one source file for each compilation unit, and follow these conventions for naming Compaq Ada source files: o The name of the source file for a library specification should be the name of the unit, followed by a trailing underscore (_). For example, MYPACK_.ADA is the name of the source file containing the specification of the package MYPACK. o The name of the source file for a library body or main subprogram should be the name of the unit. For example, MYPACK.ADA is the name of the source file containing the body of package MYPACK. MYPROG.ADA is the name of the source file containing the main subprogram MYPROG. o The name of the source file for a library generic instantiation should be the name of the instantiation. For example, MYGEN_.ADA and MYGEN.ADA are names of source files containing a library generic package specification and its body. MYINST.ADA is the name of a source file containing a library generic instantiation of the generic package MYGEN. o The name of the source file for a subunit should be the name of the ancestor unit, followed by two underscore characters, followed by the name of the subunit. For example, MYPACK__MYSUBUNIT.ADA is the name of the source file containing a subunit of package MYPACK. 2 Editing_Source_Files A number of text editors are available for editing Ada source files. One of the most suitable is the optional DEC Language- Sensitive Editor (LSE). LSE is a multilanguage, advanced text editor that is designed specifically for software development. In addition to text-editing features, LSE provides the following software development features: o Formatted language constructs, or templates, for most DEC programming languages, including Compaq Ada. These templates include the keywords and punctuation used in source programs, and use placeholders to indicate locations in the source code where additional program text must be provided. o Extensive online HELP for language constructs, as well as for LSE commands and key definitions. o The ability to compile, review, and correct compilation errors from within the editor. o Integration with the DEC Source Code Analyzer (SCA) and DEC /Code Management System (CMS). SCA and CMS commands can be entered from within the editor to make program analysis and source file management more efficient. For more information on LSE and its features, see the Guide to DEC Language-Sensitive Editor and DEC Source Code Analyzer. 2 Language_Topics 3 Compilation_Units A compilation unit is a unit that can be compiled as an independent part of the program. A compilation unit can be any of the following: o Subprogram declaration o Subprogram body o Package declaration o Package body o Generic declaration (subprogram or package) o Generic instantiation o Subunit (subprogram, package body, or task body) You can precede a compilation unit with a context clause, which names other compilation units upon which the unit depends by means of one or more 'with' clauses. Example: procedure MAIN; with SYSTEM, TEXT_IO; use SYSTEM, TEXT_IO; package LIST_MANAGER is ... begin ... end LIST_MANAGER; 4 Generic_Declaration A generic declaration defines a generic unit, which can be either a subprogram or a package. It consists of a generic formal part followed by a normal subprogram or package specification. The generic formal part can declare zero or more generic formal parameters. A generic formal parameter can be an object, a type, or a subprogram. Examples: -- Generic package generic -- Two formal subprograms: with function "*" (LEFT, RIGHT: INTEGER) return INTEGER is <>; with function "/" (LEFT, RIGHT: INTEGER) return INTEGER is <>; package SET_MANAGER is ... end SET_MANAGER; package body SET_MANAGER is ... end SET_MANAGER; -- Generic procedure generic type T is range <>; -- Generic formal type TIME: INTEGER := 0; -- Generic formal object with a default -- expression procedure CLOCK_COUNTER; -- Generic function generic type OPERAND is private; -- Generic formal type with function "+"(X,Y: OPERAND) return OPERAND is <>; -- Generic -- formal sub- -- program function ADD(A,B: OPERAND) return OPERAND; 4 Generic_Body The body of a generic subprogram or generic package has the same syntax as a nongeneric body. See HELP Ada Language_Topics Compilation_Units Package_Body or Subprogram_Body. 4 Generic_Instantiation A generic instantiation creates a particular instance of a generic subprogram or package. The instantiation creates a new copy of the subprogram or package based on the generic template and the parameters passed to it. You must provide an explicit generic actual parameter for each generic formal parameter, unless the parameter declaration also specifies a default. The association between actual and generic formal parameters can be either positional or named. An instance can be used as if it were an ordinary program unit. Examples: with TEXT_IO; package INTEGER_IO is new TEXT_IO.INTEGER_IO(NUM => INTEGER); procedure FREE_ELEMENT is new UNCHECKED_DEALLOCATION(LIST_ELEMENT, LIST_ELEMENT_PTR); 4 Library_Units A library unit is any compilation unit that is essential for compilation. Subprogram, package, and generic specifications are library units, as are generic instantiations and subprogram bodies that do not have corresponding specifications. A secondary unit is a compilation unit that is not essential for program compilation, but is essential for program linking and running. Subprogram, package, and generic bodies are secondary units, as are subunits. 4 Package_Declaration A package declaration specifies a group of logically related entities such as types, objects of those types, and subprograms with parameters of those types. A package declaration has a visible part, which declares the entities that are to be called from outside the package. It can also have a private part, which can contain implementation details that are needed to specify visible entities such as types, but that are not needed by users of the package. Example: with TEXT_IO; use TEXT_IO; package KEY_MANAGER is type KEY is private; ... procedure GET_KEY(K: out KEY); ... private type KEY is new NATURAL; ... end KEY_MANAGER; 4 Package_Body A package body implements subprograms, tasks, and so on that have been declared in the package specification. Example: package body KEY_MANAGER is LAST_KEY: KEY := 0; procedure GET_KEY(K: out KEY) is begin LAST_KEY := LAST_KEY + 1; K := LAST_KEY; end GET_KEY; ... 4 Subprogram A subprogram is either a procedure or a function, and can be given in two parts: a subprogram declaration and a subprogram body. Both declarations and bodies are compilation units. 5 Subprogram_Declaration A subprogram declaration declares either a procedure or a function without specifying its body. The declaration includes an identifier that names the subprogram and any formal parameters (the formal part). If the subprogram is a function, the identifier (or designator) can be an operator symbol. A function declaration also specifies the type of the value to be returned. Subprogram parameters can have one of three modes: 'in', 'in out', or 'out'. If you do not specify a mode, the default is 'in'. Function parameters must have a mode of 'in'. Examples: procedure BODY_NOT_HERE_YET (A: in INTEGER; B: in out FLOAT); function BODIES_DECLARED_LATER (X: in FLOAT) return FLOAT; 5 Subprogram_Body A subprogram body defines the full specification and the body for a procedure or function. Examples: procedure SWAP (N1, N2: in out INTEGER) is TEMP: INTEGER; begin TEMP := N1; N1 := N2; N2 := TEMP; end SWAP; function "+"(X,Y: ITEM) return ITEM is ... end "+"; 4 Subunit A subunit is the implementation of a subprogram, package, or task body that has been previously declared as a body stub. You use subunits when you want to separately compile the bodies of subprograms, packages, or tasks that are declared within another compilation unit. Example: procedure TOP is type REAL is digits 10; R,S: REAL := 1.0; package FACILITY is procedure G(X,Y: REAL); ... end FACILITY; package body FACILITY is separate; -- Body stub procedure TRANSFORM(U: in out REAL) is separate; -- Body stub begin TRANSFORM(R); ... FACILITY.G(R,S); end TOP; ----------------------------------------------------------------- separate (TOP) -- TOP is FACILITY's parent unit package body FACILITY is -- Subunit ... end FACILITY; ----------------------------------------------------------------- separate (TOP) procedure TRANSFORM(U: in out REAL) is -- Subunit begin ... end TRANSFORM; 3 Data_Types A data type (or type) is characterized by a set of values and a set of operations applicable to those values. Ada has several classes of types: o Scalar types are integer types, real types, and types defined by the enumeration of their values; values of these types have no components. Scalar types may involve a range, which specifies a subset of values of the type. You specify the range with a range constraint (for example, 1 .. 10 would constrain the range of a set of integers). o Array and record types are composite; a value of one of these types consists of component values. o An access type is one whose values provide access to objects. o Private types are those for which the set of possible values is well defined, but the definition is not directly available to the users of such types. o Task types declare entities that execute in parallel. 4 Access_Types Access types are pointers to other types. For example, the following declarations declare the access type POINTER_TO_COLOR: type COLOR is (RED, GREEN, YELLOW); type POINTER_TO_COLOR is access COLOR; You can assign an object of the type POINTER_TO_COLOR to point to a new object of the type COLOR with the 'new' allocation expression (an allocator) as follows: COLOR_POINTER := new COLOR; The assignment can also include an initialization, as follows: COLOR_POINTER := new COLOR'(YELLOW); When you need to declare an access type with a component that is itself of an access type, you can use an incomplete type declaration. For example: type LIST_ELEMENT; -- Incomplete type declaration type LIST_ELEMENT_PTR is access LIST_ELEMENT; type LIST_ELEMENT is record VALUE: INTEGER; NEXT: LIST_ELEMENT_PTR; end record; 4 Array_Types An array type is a composite type consisting of components that have the same subtype. The name for a component of an array uses one or more index values belonging to the specified discrete types. The value of an array object is a composite value consisting of the values of its components. An array object is characterized by the number of indices, the type and position of each index, the lower and upper bounds for each index, and the type and possible constraint of the components. The order of the indices is significant. An unconstrained array definition defines an array type whose bounds are not specified in the definition. The index subtype for a given index position is, by definition, the subtype denoted by the type mark of the corresponding index subtype definition. The compound delimiter <> (called a box) of an index subtype definition stands for an undefined range (different objects of the type need not have the same bounds). You must supply the bounds later in object declarations or when you pass parameters of unconstrained array types. A constrained array definition defines both an array type and a subtype of that type. The array type is an implicitly declared anonymous type; this type is defined by an (implicit) unconstrained array definition, in which the component subtype indication is that of the constrained array definition, and in which the type mark of each index subtype definition denotes the subtype defined by the corresponding discrete range. The array subtype is the subtype obtained by imposing the index constraint on the array type. Examples of type declarations with unconstrained array definitions: type VECTOR is array (INTEGER range <>) of REAL; type BIT_VECTOR is array (INTEGER range <>) of BOOLEAN; type ROMAN is array (POSITIVE range <>) of ROMAN_DIGIT; Examples of type declarations with constrained array definitions: type TABLE is array (1 .. 10) of INTEGER; type SCHEDULE is array (DAY) of BOOLEAN; type LINE is array (1 .. MAX_LINE_SIZE) of CHARACTER; Examples of object declarations with constrained array definitions: GRID : array (1 .. 80, 1 .. 100) of BOOLEAN; MIX : array (COLOR range RED .. GREEN) of BOOLEAN; PAGE : array (1 .. 50) of LINE; -- an array of arrays 4 Boolean_Types A boolean type is either the predefined enumeration type BOOLEAN or a type that is derived, directly or indirectly, from the type BOOLEAN. This predefined type contains the two enumeration literals FALSE and TRUE, which must be ordered with the relation FALSE < TRUE. 4 Character_Types A character type is an enumeration type whose enumeration literals include at least one character literal. Ada has a predefined type CHARACTER (defined in the package STANDARD) whose values are the 128 characters of the ASCII character set. 4 Derived_Types A derived type defines a new (base) type and subtype whose characteristics are the same as those of a parent type and subtype. A derived type declaration has the following form: type T is new TYPE_OR_SUBTYPE_INDICATION; The subtype indication that occurs after the reserved word 'new' defines the parent subtype. The parent type is the base type of the parent subtype. Examples: type LOCAL_COORDINATE is new COORDINATE; -- two different types type MIDWEEK is new DAY range TUE .. THU; type COUNTER is new POSITIVE; -- same range as POSITIVE 4 Enumerated_Types An enumeration type defines a set of values denoted by enumeration literals. It has the following form: type T is (lit { , lit } ); An enumeration literal can be either an identifier or a character literal. The enumeration literals must be distinct. Each enumeration literal declares a different enumeration value. The predefined order relations between enumeration values follow the order of corresponding position numbers. The position number of the value of the first listed enumeration literal is zero; the position number for each other enumeration literal is one more than for its predecessor in the list. If the same identifier or character literal is specified in more than one enumeration type definition, the corresponding literals are said to be overloaded. Examples: type DAY is (MON, TUE, WED, THU, FRI, SAT, SUN); type SUIT is (CLUBS, DIAMONDS, HEARTS, SPADES); type COLOR is (WHITE, RED, YELLOW, GREEN, BLUE, BROWN, BLACK); type LIGHT is (RED, AMBER, GREEN); -- RED and GREEN are overloaded type HEXA is ('A', 'B', 'C', 'D', 'E', 'F'); type MIXED is ('A', 'B', '*', B, NONE, '?', '%'); 4 Integer_Types An integer type defines a set of integer values that include at least those of the specified range. It has the following form: type T is range L .. U; If a range constraint is used as an integer type definition, each bound of the range must be defined by a static expression of some integer type, but the two bounds need not have the same integer type. Negative bounds are allowed. Compaq Ada provides the following predefined integer types with the following sets of values: SHORT_SHORT_SHORT_INTEGER -(2** 7) .. (2** 7) - 1 SHORT_SHORT_INTEGER -(2** 7) .. (2** 7) - 1 SHORT_INTEGER -(2**15) .. (2**15) - 1 INTEGER -(2**31) .. (2**31) - 1 LONG_INTEGER -(2**31) .. (2**31) - 1 4 Limited_Types A limited type is a private type that has no implicit operations. In other words, you must declare all of the operations associated with a limited type. Because assignment is not an implicit operation for limited types, you cannot use limited types in all situations. For example, you can use them only in a restricted manner for formal 'out' parameters. The initialization of objects of limited types is also restricted, and generic formal parameters of mode 'in' cannot be of a limited type. Example: package KEY_MANAGER is type KEY_TABLE is limited private; ... private type KEY_TABLE is record ... end record; package body KEY_MANAGER is procedure READ_TABLE (T: in KEY_TABLE) is begin ... end READ_TABLE; ... end KEY_MANAGER; 4 Private_Types A private type is a type whose structure is not visible to the user of the type. Private types also have a restricted set of implicit operations: private types have only assignment, equality, and inequality; limited private types have no implicit operations. Therefore, you can use private types to define and control the characteristics of new data types. You can declare private types only in packages. A private type and its applicable operations are defined in the visible part of a package, or in a generic formal part (if the package is generic). The structure of the type and its set of values are defined in the private part of the package. Example: package KEY_MANAGER is type KEY is private; NULL_KEY: constant KEY; ... private type KEY is new STRING(1 .. 5); ... end KEY_MANAGER; 4 Record_Types A record type is a composite type consisting of named components. The value of a record object is a composite value consisting of the values of its components. Unlike the components of an array, the components of a record need not be of the same type. Each component declaration declares a component of the record type. Besides components declared by component declarations, the components of a record type include any components declared by discriminant specifications of the record type declaration. You can use record discriminants to determine the value of record components; in particular, you can use them to control variant records. Discriminants must be of a discrete type. You can have a discriminant part only in a record type declaration, in a private or incomplete type declaration that involves a record type declaration, or in the generic parameter declaration for a formal private type. When you declare a record with discriminants that do not have default values, any object declarations must include a discriminant constraint as part of the type name associated with the object declaration. The identifiers of all components of a record type must be distinct. If a component declaration includes the assignment compound delimiter followed by an expression, the expression is the default expression of the record component; the default expression must be of the type of the component. If a record type does not have a variant part, the same components are present in all values of the type. See HELP Ada Language_Topics Data_Types Record_Types Variant_Part for more information on variant records. Examples: -- Record without discriminants type DATE is record DAY : INTEGER range 1 .. 31; MONTH : MONTH_NAME; YEAR : INTEGER range 0 .. 4000; end record; -- Record with one discriminant subtype VSTRING_RANGE is INTEGER range 0 .. 1024; type VSTRING (LEN : VSTRING_RANGE := 0) is record TEXT : STRING(1 .. LEN); end record; -- Object declaration with discriminant constraint VSTRING_OBJECT: VSTRING(LEN => 10); 5 Variant_Part A record type with a variant part specifies alternative lists of components. Each variant defines the components for the corresponding value or values of a discriminant. Each variant starts with a list of choices, which must be of the same type as the discriminant of the variant part. The simple expressions and discrete ranges given as choices in a variant part must be static. A choice defined by a discrete range stands for all values in the corresponding range (none if a null range). The choice 'others' is allowed only for the last variant and as its only choice; it stands for all values (possibly none) not given in the choices of previous variants. A record value contains the values of the components of a given variant if and only if the discriminant value is equal to one of the values specified by the choices of the variant. This rule applies, in turn, to any further variant that is itself included in the component list of the given variant. If the component list of a variant is specified by the reserved word 'null', the variant has no components. Example: type DEVICE is (PRINTER, DISK, DRUM); type STATE is (OPEN, CLOSED); type PERIPHERAL (UNIT : DEVICE := DISK) is record STATUS : STATE; case UNIT is when PRINTER => LINE_COUNT : INTEGER range 1 .. PAGE_SIZE; when others => CYLINDER : CYLINDER_INDEX; TRACK : TRACK_NUMBER; end case; end record; 4 Real_Types Real types provide approximations to the real numbers, with relative bounds on errors for floating-point types, and with absolute bounds on errors for fixed-point types. A set of numbers called model numbers is associated with each real type. Error bounds on the predefined operations are given in terms of the model numbers. Real literals are the literals of an anonymous predefined real type called universal_real. Other real types have no literals. However, for each real type, there exists an implicit conversion that converts a universal_real value into a value of the real type. 5 Fixed_Point_Types For fixed-point types, the error bound is specified as an absolute value, called the delta of the fixed-point type. The delta is specified by the value of the static simple expression of the fixed accuracy definition. This value must belong to some real type and must be positive (nonzero). If the fixed-point constraint is used as a real type definition, then it must include a range constraint; each bound of the specified range must be defined by a static expression of some real type, but the two bounds need not have the same real type. If the fixed-point constraint is used in a subtype indication, the range constraint is optional. Examples: type VOLT is delta 0.125 range 0.0 .. 255.0; subtype ROUGH_VOLTAGE is VOLT delta 1.0; -- same range as VOLT -- A pure fraction which requires all the available space -- in a word on a two's complement machine can be declared -- as the type FRACTION: DEL : constant := 1.0/2**(WORD_LENGTH - 1); type FRACTION is delta DEL range -1.0 .. 1.0 - DEL; 5 Floating_Point_Types For floating-point types, the error bound is specified as a relative precision by giving the required minimum number of significant decimal digits. The minimum number of significant decimal digits is specified by the value of the static simple expression of the floating accuracy definition. This value must belong to some integer type and must be positive (nonzero). If the floating-point constraint is used as a real type definition and includes a range constraint, then each bound of the range must be defined by a static expression of some real type, but the two bounds need not have the same real type. In addition to the type FLOAT, Compaq Ada provides the following floating-point types: In the package STANDARD: FLOAT LONG_FLOAT LONG_LONG_FLOAT (VAX only) In the package SYSTEM: F_FLOAT D_FLOAT G_FLOAT H_FLOAT (VAX only) IEEE_SINGLE_FLOAT (Alpha only) IEEE_DOUBLE_FLOAT (Alpha only) Each Compaq Ada floating-point type is represented by one of the following internal floating-point data representations. The representation depends on the value of the pragma FLOAT_ REPRESENTATION and, when the value of the pragma FLOAT_ REPRESENTATION is VAX_FLOAT, on the value of the pragma LONG_ FLOAT. o F_floating, which has a size of 32 bits and provides over 6 digits of precision o D_floating, which has a size of 64 bits and provides over 9 digits of precision o G_floating, which has a size of 64 bits and provides over 15 digits of precision o H_floating (on VAX systems only), which has a size of 128 bits and provides over 33 digits of precision o IEEE single float (on Alpha systems only), which has a size of 32 bits and provides over 6 digits of precision o IEEE double float (on Alpha systems only), which has a size of 64 bits and provides over 15 digits of precision A floating-point type declaration has the following form: type T is digits D [range L .. R]; (The optional range constraint is indicated by the square brackets.) Examples: type COEFFICIENT is digits 10 range -1.0 .. 1.0; type REAL is digits 8; type MASS is digits 7 range 0.0 .. 1.0E35; 4 String_Type The predefined type STRING defines one-dimensional arrays of the predefined CHARACTER. The characters in a string are indexed by values of the predefined subtype POSITIVE. (STRING, CHARACTER, and POSITIVE are predefined in the the package STANDARD.) Examples: ONE_STRING: STRING(1 .. 11) := "A few words"; TWO_STRINGS: constant STRING := ONE_STRING & ONE_STRING; BLANKS: STRING(1 .. 5) := (1 .. 5 => ' '); 4 Task_Types A task type is a language-defined limited type that allows you to declare a set of tasks. Tasks are entities whose executions occur in parallel. Because it is a limited type, a task type has no implicit operations (no assignment, equality, or inequality operations, for example). You cannot have a formal 'out' parameter that is of a task type. Example: task type T is entry E; end T; task body T is begin accept E; ... end T; 3 Declaration_Section A declaration section can declare any of a number of items. Basic declarative items are the first declarations in a declaration section. A basic declarative item is a basic declaration, a representation clause, or a use clause. A basic declaration is one of the following: an object declaration number declaration type declaration subtype declaration subprogram declaration package declaration task declaration generic declaration exception declaration generic instantiation renaming declaration deferred constant declaration Discriminant specifications, component declarations, entry declarations, parameter specifications, generic parameter declarations, and enumeration literal specifications always occur as part of basic declarations. Later declarative items follow basic declarative items in a declaration section. Bodies (subprogram, package, and task) and body stubs always occur as later declarative items. Subprogram, package, and task declarations, generic declarations and instantiations, and use clauses can also be later declarative items. 4 Body_Stub A body stub declares that a subprogram, package, or task body is to be written and compiled separately as a subunit. Example: package STACKS is ... procedure CREATE (X: in out STACK); procedure PUSH (X: in out STACK; ELEMENT: out ELEMENT_TYPE; OK: out BOOLEAN); task CONTROL; ... end STACKS; package body STACKS is ... procedure CREATE (X: in out STACK) is separate; -- body stub procedure PUSH (X: in out STACK; ELEMENT: out ELEMENT_TYPE; OK: out BOOLEAN) is separate; -- body stub task body CONTROL is separate; -- body stub ... end STACKS; 4 Deferred_Constant_Declaration A deferred constant declaration establishes a constant of a private type or subtype in a package. For example, consider the following declaration, made in the visible part of a package: type KEY is private; NULL_KEY: constant KEY; No initial value is given for NULL_KEY when it is declared as a deferred constant in the visible part. In the private part of the same package, the following full declaration of the deferred constant may appear: private type KEY is new STRING(1 .. 5); NULL_KEY: constant KEY := "XXXXX"; 4 Exception_Declaration An exception denotes an error or other exceptional situation that might arise during program execution. To raise an exception is to abandon normal program execution so as to draw attention to the fact that the corresponding situation has arisen. Executing some actions in response to the raising of an exception is called handling the exception. An exception can be raised by a raise statement, or it can be raised by another statement or operation that propagates the exception. When an exception is raised, control can be transferred to a user-provided exception handler at the end of a block statement or at the end of the body of a subprogram, package, or task unit. When control is transferred to an exception handler, it does not return to the point where the exception was raised. An exception declaration declares a name for an exception. You can use the name of an exception only in raise statements, exception handlers, and renaming declarations. The handler, or exception part, for an exception occurs either in a block statement or in the body of subprogram, package, task unit, or generic unit. Within the handler, you specify the response to one or more exceptions with exception choices. You can use the exception choice 'others' to represent all exceptions not already named by exception choices in the handler; the exception choice 'others' is only allowed as the last choice in a handler. Examples of user-defined exception declarations: SINGULAR : exception; ERROR : exception; OVERFLOW, UNDERFLOW : exception; Predefined exceptions declared in the package STANDARD: CONSTRAINT_ERROR NUMERIC_ERROR PROGRAM_ERROR STORAGE_ERROR TASKING_ERROR Example of an exception handler: begin -- Sequence of statements for a block exception when SINGULAR | CONSTRAINT_ERROR => PUT (" MATRIX IS SINGULAR "); when others -- Perform some cleanup operations ... raise; end; 4 Generic_Declaration A generic declaration defines a generic unit, which serves as a template for either a subprogram or a package. It consists of a generic formal part, which can include generic parameter declarations, followed by a normal subprogram or package specification. You code a body for a generic declaration just as you would code any subprogram or package body. Examples: generic with function "*" (LEFT, RIGHT: INTEGER) return INTEGER is <>; with function "/" (LEFT, RIGHT: INTEGER) return INTEGER is <>; package SET_MANAGER is ... end SET_MANAGER; generic type T is range <>; procedure CLOCK_COUNTER; 4 Generic_Body The body of a generic subprogram or generic package has the same syntax as a nongeneric body. See HELP Ada Language_Topics Declaration_Section Subprogram_Body or Package_Body. 4 Generic_Instantiation A generic instantiation creates a particular instance of a generic subprogram or package. The instantiation creates a new copy of the subprogram or package based on the generic template and the parameters passed to it. You must provide an explicit generic actual parameter for each generic formal parameter, unless the parameter declaration also specifies a default. The association between actual and generic formal parameters can be either positional or named. An instance can be used as if it were an ordinary program unit. Examples: with TEXT_IO; package INTEGER_IO is new TEXT_IO.INTEGER_IO(NUM => INTEGER); procedure FREE_ELEMENT is new UNCHECKED_DEALLOCATION(LIST_ELEMENT, LIST_ELEMENT_PTR); 4 Number_Declaration Number declarations establish numeric values for constant identifiers. Examples: PI : constant := 3.14159_26536; TWO_PI : constant := 2.0*PI; MAX : constant := 500; POWER_16 : constant := 2**16; ONE, UN, EINS: constant := 1; 4 Object_Declaration An object declaration names an object and associates that name with a type given either by a subtype indication or by a constrained array definition. If the object declaration includes the assignment compound delimiter followed by an expression, the expression specifies an initial value for the declared object; the type of the expression must be that of the object. The declared object is a constant if the reserved word 'constant' appears in the object declaration; the declaration must then include an explicit initialization. The value of a constant cannot be modified after initialization. Subprogram and entry formal parameters of mode 'in', as well as generic formal parameters of mode 'in', are also constants; a loop parameter is a constant within the corresponding loop; a subcomponent or slice of a constant is a constant. An object that is not a constant is called a variable (in particular, the object declared by an object declaration that does not include the reserved word 'constant' is a variable). The only ways to change the value of a variable are either directly by an assignment, or indirectly when the variable is updated by a procedure or entry call statement (this action can be performed either on the variable itself, on a subcomponent of the variable, or on another variable that has the given variable as subcomponent). The initialization of an object (the declared object or one of its subcomponents) checks that the initial value belongs to the subtype of the object; for an array object declared by an object declaration, an implicit subtype conversion is first applied as for an assignment statement, except when the object is a constant whose subtype is an unconstrained array type. The exception CONSTRAINT_ERROR is raised if this check fails. Examples of variable declarations: COUNT, SUM : INTEGER; SIZE : INTEGER range 0 .. 10_000 := 0; VOLUME : FLOAT; TREE_NAME : STRING(1..5) := "Maple"; SORTED : BOOLEAN := FALSE; ONE_COLOR : COLOR := RED; COLOR_TABLE : array (1 .. N) of COLOR; OPTION : BIT_VECTOR(1 .. 10) := (others => TRUE); Examples of constant declarations: LIMIT : constant INTEGER := 10_000; LOW_LIMIT : constant INTEGER := LIMIT/10; TOLERANCE : constant REAL := DISPERSION(1.15); 4 Package_Declaration A package declaration specifies a group of logically related entities such as types, objects of those types, and subprograms with parameters of those types. A package declaration has as visible part, which declares the entities that are to be called from outside the package. It can also have a private part, which can contain implementation details that are needed to specify the visible entities such as types, but that are not needed by users of the package. Example: with TEXT_IO; use TEXT_IO; package KEY_MANAGER is type KEY is private; ... procedure GET_KEY(K: out KEY); ... private type KEY is new NATURAL; ... end KEY_MANAGER; 4 Package_Body A package body implements subprograms, tasks, and so on that have been declared in the package specification. Example: package body KEY_MANAGER is LAST_KEY: KEY := 0; procedure GET_KEY(K: out KEY) is begin LAST_KEY := LAST_KEY + 1; K := LAST_KEY; end GET_KEY; ... 4 Renaming_Declaration A renaming declaration declares an alternative name for an entity. Both the original and the new name can be used to refer to the renamed entity. Renaming is useful in resolving naming conflicts and in creating convenient abbreviations for long names. A renaming declaration has one of the following forms: identifier : type_mark renames object_name; identifier : exception renames exception_name; package_identifier renames package_name; subprogram_specification renames subprogram_or_entry_name; The elaboration of a renaming declaration evaluates the name that follows the reserved word 'renames' and thereby determines the entity denoted by this name (the renamed entity). At any point where a renaming declaration is visible, the identifier, or operator symbol of this declaration denotes the renamed entity. The first form of renaming declaration is used for the renaming of objects. The renamed entity must be an object of the base type of the type mark. The properties of the renamed object are not affected by the renaming declaration. The second form of renaming declaration is used for the renaming of exceptions; the third form, for the renaming of packages. The last form of renaming declaration is used for the renaming of subprograms and entries. The renamed subprogram or entry and the subprogram specification given in the renaming declaration must have the same parameter and result type profile. The renaming declaration is legal only if exactly one visible subprogram or entry satisfies the preceding requirements and can be denoted by the given subprogram or entry name. In addition, parameter modes must be identical for formal parameters that are at the same parameter position. Examples: declare L : PERSON renames LEFTMOST_PERSON; begin L.AGE := L.AGE + 1; end; FULL : exception renames TABLE_MANAGER.TABLE_FULL; package TM renames TABLE_MANAGER; function REAL_PLUS (LEFT, RIGHT : REAL) return REAL renames "+"; function INT_PLUS (LEFT, RIGHT : INTEGER) return INTEGER renames "+"; 5 Subprogram_Renaming The subtypes of the parameters and result (if any) of a renamed subprogram or entry are not affected by renaming. These subtypes are those given in the original subprogram declaration, generic instantiation, or entry declaration (not those of the renaming declaration); even for calls that use the new name. On the other hand, a renaming declaration can introduce parameter names and default expressions that differ from those of the renamed subprogram; named associations of calls with the new subprogram name must use the new parameter name; calls with the old subprogram name must use the old parameter names. A procedure can be renamed only as a procedure. A function or operator can be renamed as either a function or operator; for renaming as an operator, the subprogram specification given in the renaming declaration is subject to the rules for operator declarations. Enumeration literals can be renamed as functions; similarly, attributes defined as functions (such as SUCC and PRED) can be renamed as functions. An entry can be renamed only as a procedure; the new name is allowed to appear only in contexts that allow a procedure name. An entry of a family can be renamed, but an entry family cannot be renamed as a whole. Examples of simple renaming declarations: type COLOR is (RED, WHITE, BLUE); function ROUGE return COLOR renames RED; function ROT return COLOR renames RED; function ROSSO return COLOR renames ROUGE; function NEXT (X : COLOR) return COLOR renames COLOR'SUCC; Example of a renaming declaration with new parameter names: function DOT_PRODUCT(L, R : VECTOR) return REAL is ...; function "*" (X, Y : VECTOR) return REAL renames DOT_PRODUCT; Example of a renaming declaration with a new default expression: function MIN_CELL(L : LINK) return CELL is ...; function MINIMUM (L : LINK := HEAD) return CELL renames MIN_CELL; 4 Representation_Clause Representation clauses specify how the types of the language are to be mapped onto the underlying machine. You can use them to give a more efficient representation or to interface with features that are outside the domain of the language (for example, peripheral hardware). A type representation clause applies either to a type or to a first named subtype (that is, to a subtype declared by a type declaration, the base type being therefore anonymous). Such a representation clause applies to all objects that have this type or this first named subtype. A representation clause and the declaration of the entity to which the clause applies must both occur immediately within the same declarative part, package specification, or task specification; the declaration must occur before the clause. In the absence of a representation clause for a given declaration, a default representation of this declaration is determined by the implementation. Such a default determination occurs no later than the end of the immediately enclosing declarative part, package specification, or task specification. For a declaration given in a declarative part, this default determination occurs before any enclosed body. Whereas a representation clause is used to impose certain characteristics of the mapping of an entity onto the underlying machine, pragmas can be used to provide an implementation with criteria for its selection of such a mapping. The pragma PACK specifies that storage minimization should be the main criterion when selecting the representation of a record or array type. Its form is as follows: pragma PACK(type_simple_name); Packing means that gaps between the storage areas allocated to consecutive components should be minimized. In Compaq Ada, each noncomposite component (scalar, access, and so on) is aligned by default on an appropriate boundary, according to the following conventions: o On OpenVMS VAX systems, all noncomposite components are aligned on byte boundaries. o On OpenVMS Alpha and ULTRIX systems, all noncomposite components are aligned on natural boundaries (for example, 1-byte components are aligned on byte boundaries, 2-byte components on 2-byte boundaries, 4-byte components on 4-byte boundaries, and so on). Each composite component is aligned so that it satisfies the maximum alignment required for its subcomponents and (in the case of record components) any representation clauses or representation pragmas that might apply. In Compaq Ada on all systems, the effect of the pragma PACK on a record or array is to cause those components that are packable to be allocated in the next available bit (if the component is packable) or byte (otherwise) without regard to natural boundaries. Whether any particular component is packable depends on the rules for its type; see the DEC Ada Run-Time Reference Manual for OpenVMS Systems and DEC Ada Run-Time Reference Manual for ULTRIX Systems for more information. 5 Enumeration_Clause Enumeration representation clauses specify what actual numeric values are to be associated with each member of an enumerated type. In the absence of an enumeration clause, the underlying representation is chosen by the compiler. Example: type COLOR is (RED, GREEN, BLUE); -- for example the compiler may choose to represent -- RED as 0, GREEN as 1, and BLUE as 2. for COLOR use (RED => 4, GREEN => 9, BLUE => 11); -- now compiler is directed to represent -- RED as 4, GREEN as 9, and BLUE as 11. 5 Length_Clause A length clause specifies an amount of storage associated with a type. It has the following form: for attribute use simple_expression; The attribute may have one of the following forms: T'SIZE or T'STORAGE_SIZE or T'SMALL The expression must be of some numeric type and is evaluated during the elaboration of the length clause (unless it is a static expression). The prefix of the attribute (T) must denote either a type or a first named subtype. The effect of the length clause depends on the attribute designator. Examples: -- Assumed declarations: type MEDIUM is range 0 .. 65000; type SHORT is delta 0.01 range -100.0 .. 100.0; type DEGREE is delta 0.1 range -360.0 .. 360.0; BYTE : constant := 8; PAGE : constant := 2000; -- Length clauses: for COLOR'SIZE use 1*BYTE; for MEDIUM'SIZE use 2*BYTE; for SHORT'SIZE use 15; for CAR_NAME'STORAGE_SIZE use -- approximately 2000 cars 2000*((CAR'SIZE/SYSTEM.STORAGE_UNIT) + 1); for KEYBOARD_DRIVER'STORAGE_SIZE use 1*PAGE; for DEGREE'SMALL use 360.0/2**(SYSTEM.STORAGE_UNIT - 1); 6 Size_Specification To specify a size in a length clause, you can use the SIZE attribute as follows: for T'SIZE use expression; The expression must be a static expression of some integer type. The value of the expression specifies an upper bound for the number of bits to be allocated to objects of the type or first named subtype T. The size specification must allow for enough storage space to accommodate every allowable value of these objects. The size specification is only allowed if the constraints on T and on its subcomponents (if any) are static. In the case of an unconstrained array type, the index subtypes must also be static. In Compaq Ada, for a discrete type, the given size must not exceed 32 (bits). The given size becomes the default allocation for all objects and components (in arrays and records) of that type. For the various types, the given size affects the internal representation as follows: o For integer types, high order bits are sign-extended. o For enumeration types, the high order bits may be either zero- or sign-extended depending upon the base representation that is selected. o For fixed-point types, the given size affects the range (but not the precision) of the underlying model numbers of the type. For all other types, the given size must equal the size that would apply in the absence of a size specification. 6 Collection_Size_Specification To specify the total amount of storage to be reserved for a collection of objects associated with an access type, you can use the STORAGE_SIZE attribute as follows: for T'STORAGE_SIZE use expression; The prefix T must denote an access type. The expression must be of some integer type (but need not be static); its value specifies the number of storage units to be reserved for the collection. In other words, the value of the expression must specify the storage space needed to contain all objects designated by values of the access type and by values of other types derived from the access type, directly or indirectly. This form of length clause is not allowed for a type derived from an access type. In Compaq Ada, the specification of a collection size is interpreted as follows. If the value of the expression is greater than zero, the specified size (representing the number of bytes in the collection) is rounded up to an appropriate boundary, and is then used as the initial size for the collection; the collection is not extended should that initial allocation be exhausted. The exception CONSTRAINT_ERROR is raised if the value, rounded up, exceeds the value of SYSTEM.MAX_INT. If the value is equal to zero or less than zero, no storage is allocated for the collection, and the collection is not extended. The default behavior (in the absence of a length clause) is for no storage to be initially allocated for the collection; storage is then allocated as needed, until all virtual memory is depleted. 6 Task_Size_Specification To specify the amount of storage to be allocated for a task activation, you can use the STORAGE_SIZE attribute, as follows: for T'STORAGE_SIZE use expression; The prefix T must denote a task type. The expression must be of some integer type (but need not be static); its value specifies the number of storage units to be reserved for an activation (not the code) of a task of the type. In Compaq Ada, the specification of storage for a task activation is interpreted as follows. If the value of the expression is greater than zero, the specified storage (in bytes) is rounded up to an appropriate boundary, and then is used as the amount of storage to be allocated for an activation of a task of the given type. If the value is equal to zero, a default allocation is used (this is the default behavior in the absence of a length clause). In both cases, the task activation storage is fixed and is not extended if the initial allocation is exhausted. If the value is less than zero, the exception CONSTRAINT_ERROR is raised. The storage allocation for a task may also be affected by the pragmas TASK_STORAGE and MAIN_STORAGE. 6 Fixed_Point_Specification To specify the value of small in a length clause for a fixed- point type, you can use the SMALL attribute as follows: for T'SMALL use expression; The prefix T must denote the first named subtype of a fixed-point type. The expression must be a static expression of some real type; its value must not be greater than the delta of the first named subtype. The effect of the length clause is to use this value of 'small' for the representation of values of the fixed- point base type. (The length clause thereby also affects the amount of storage for objects that have this type.) In Compaq Ada, the value of 'small' in a fixed-point representation clause can be any value in the range 2.0**-62 .. 2.0**31. Example: type MY_FIXED is delta 0.1 range 0.0 .. 1.0; for MY_FIXED'SMALL use 0.03125; 5 Record_Representation_Clause A record representation clause specifies the storage representation of records; that is, the order, position, and size of record components (including discriminants, if any). A record representation clause can include an alignment clause and zero or more component clauses. An alignment clause forces the record type to be allocated at a particular storage location. It has the following form: at mod static_simple_expression A component clause specifies the storage location of a record component relative to the start of the record. It has the following form: component_name at static_simple_expression range static_range Example: WORD : constant := 4; -- storage unit is byte, 4 bytes per word type STATE is (A, M, W, P); type MODE is (FIX, DEC, EXP, SIGNIF); type BYTE_MASK is array (0 .. 7) of BOOLEAN; type STATE_MASK is array (STATE) of BOOLEAN; type MODE_MASK is array (MODE) of BOOLEAN; pragma PACK(BYTE_MASK); -- In Compaq Ada these must be packed pragma PACK(STATE_MASK); -- for the alignment to work pragma PACK(MODE_MASK); type PROGRAM_STATUS_WORD is record SYSTEM_MASK : BYTE_MASK; PROTECTION_KEY : INTEGER range 0 .. 3; MACHINE_STATE : STATE_MASK; INTERRUPT_CAUSE : INTERRUPTION_CODE; ILC : INTEGER range 0 .. 3; CC : INTEGER range 0 .. 3; PROGRAM_MASK : MODE_MASK; INST_ADDRESS : ADDRESS; end record; for PROGRAM_STATUS_WORD use -- alignment clause and series -- of component clauses record at mod 8; SYSTEM_MASK at 0*WORD range 0 .. 7; PROTECTION_KEY at 0*WORD range 10 .. 11; -- bits 8, 9 unused MACHINE_STATE at 0*WORD range 12 .. 15; INTERRUPT_CAUSE at 0*WORD range 16 .. 31; ILC at 1*WORD range 0 .. 1; -- second word CC at 1*WORD range 2 .. 3; PROGRAM_MASK at 1*WORD range 4 .. 7; INST_ADDRESS at 1*WORD range 8 .. 31; end record; for PROGRAM_STATUS_WORD'SIZE use 8*SYSTEM.STORAGE_UNIT; 5 Address_Clause An address clause specifies the starting address in storage for an entity. An address clause in Compaq Ada may apply to an object (constant or variable) or an imported subprogram. Example: for CONTROL use at 16#0020#; The rules for specifying an address clause for an imported subprogram are as follows: o The subprogram must be specified with a pragma INTERFACE. It may also be specified with an import pragma (a pragma IMPORT_FUNCTION, IMPORT_PROCEDURE, IMPORT_VALUED_PROCEDURE, or INTERFACE_NAME). o If you specify the subprogram with an import pragma, you must also specify a null string ("") for the external designator (see Section 13.9a of the DEC Ada Language Reference Manual for import pragma syntax). o You must specify the address clause after the pragma INTERFACE (see Section 13.5 of the DEC Ada Language Reference Manual for address clause rules). If you also specify an import pragma, the order of the address clause and the import pragma is not significant. 4 Subprogram_Declaration A subprogram declaration declares a subprogram, which may be either a procedure or a function. The subprogram declaration may also include the body for the subprogram, or that body may be deferred until a later part of the program. The declaration includes an indentifier that names the subprogram and any formal parameters (the formal part). If the subprogram is a function, the identifier (or designator) can be an operator symbol. A function declaration also specifies the type of the value to be returned. Subprogram parameters can have one of three modes: 'in', 'in out', or 'out'. If you do not specify a mode, the default is 'in'. Function parameters must have a mode of 'in'. Examples: -- Examples of subprogram declarations with deferred body procedure SWAP (A, B: in out INTEGER); function FACTORIAL (A: in INTEGER) return INTEGER; -- Example of subprogram declaration with body procedure SWAP (A, B: in out INTEGER) is TEMP: INTEGER; begin TEMP := A; A := B; B := TEMP; end SWAP; -- Examples of subprogram declarations that -- are generic instantiations -- procedure SWAP_INTEGERS is new SWAP(PARAM_TYPE => INTEGER); function INVERT_CHAR is new INVERT_BITWISE(PARAMETER_TYPE => CHARACTER); 4 Subprogram_Body A subprogram body defines the full specification and the body for a procedure or function. Example: procedure SWAP (N1, N2: in out INTEGER) is TEMP: INTEGER; begin TEMP := N1; N1 := N2; N2 := TEMP; end SWAP; 4 Subtype_Declaration A subtype declaration declares a subset (possibly all) of the set of values of a given type or subtype. A subtype declaration includes an identifier, which names the subtype, and a subtype indication (or type mark), which names the type or subtype from which the subtype is formed. Examples: subtype OVERFLOW_TYPE is INTEGER range -1 .. 1; subtype STORED_IN_A_BYTE is SHORT_SHORT_INTEGER range 11 .. 25; subtype STR_8 is STRING(1 .. 8); subtype A_NEW_NAME_FOR_FLOAT is FLOAT; -- like a renaming 4 Task_Declaration A task declaration declares a single task or a task type, and specifies its entries, if any. You can declare a family of task entries by including a discrete range in the entry declaration. You then specify the name of an entry of a family as an indexed component. Examples: task NULL_TASK; -- not very useful, but legal task SCHEDULER is entry ADD_TO_QUEUE (JOB: in JOB_DESCRIPTOR); entry GET_FROM_QUEUE (JOB: in out JOB_DESCRIPTOR); end SCHEDULER; task type VALVE_CONTROLLER is entry CHECK; entry OPEN; entry CLOSE; entry SET_WATCH (WATCH_POINT: in VALVE_READING_TYPE); end VALVE_CONTROLLER; -- An array of tasks: VALVE: array (1 .. MAX_VALVES) of VALVE_CONTROLLER; -- A task with a family of entries: type ITEM is INTEGER; type LEVEL is (LOW, MEDIUM, HIGH); task CONTROLLER is entry REQUEST(LEVEL) (D: ITEM); end CONTROLLER; 4 Task_Body A task body defines the execution defined by a task specification. Example: task GRANTOR is entry GRAB_ACCESS; entry RELEASE_ACCESS; end GRANTOR; task body GRANTOR is begin loop select accept GRAB_ACCESS; accept RELEASE_ACCESS; or terminate; end select; end loop end GRANTOR; 4 Type_Declaration A type declaration declares a type, or possibly an anonymous type and a subtype of that type. Note that Ada uses the term "type mark" to denote either a type or a subtype. See HELP Ada Language_Topics Declaration_Section Subtype_Declaration for more information on subtypes. Ada allows three kinds of type declarations: full type declarations, incomplete type declarations, and private type declarations. A full type declaration involves an identifier, which names the type, and a type definition. See HELP Ada Language_Topics Data_ Types for information on the type definitions available in Ada. Incomplete type declarations can occur when you define access types. See HELP Ada Language_Topics Data_Types Access_Types for more information on incomplete type declarations. Private type declarations allow you to define types whose structure is not visible to the user of the type. See HELP Ada Language_Topics Data_Types Private_Types for more information on private type declarations. Examples of full type declarations: -- Enumerated type: type CITIZEN_TYPE is (US, CANADA, NATO, EASTERN_BLOCK, UNKNOWN); -- Integer: type COLUMN is range 1 .. 72; -- One-dimensional array: type TABLE is array (1 .. 10) of INTEGER; -- Three-dimensional array: type MATRIX is array (1 .. 10, 2 .. 14, -4 .. 7) of FLOAT; -- Record type with variant part: type PERSON_REC (CITIZENSHIP: CITIZEN_TYPE) is record NAME: NAME_TYPE; ADDRESS: ADDRESS_REC; case CITIZENSHIP is when US | CANADA => SS_NUMBER: SS_NUMBER_TYPE; when NATO => COUNTRY: NATO_COUNTRY_TYPE; CITIZEN_SINCE: DATE_TYPE; BORN_IN: COUNTRY_TYPE; when others => COUNTRY: COUNTRY_TYPE; ATTENTION: CUSTOMS_OFFICER_NUMBER_TYPE; end case; end record; 4 Use_Clause A 'use' clause makes the declarations of the visible part of a package become directly visible. Examples: -- For direct visibility to the entities of TEXT_IO throughout -- WINDOW_MANAGER with TEXT_IO; use TEXT_IO; package WINDOW_MANAGER is ...; -- For direct visibility to TEXT_IO just within a local block declare use TEXT_IO; A, B, C: INTEGER; begin ... end; 3 Names A name is a series of characters that can denote any of the following: o An declared entity (either implicitly or explicitly declared) o An object designated by an access value o A subcomponent or slice of an object o A single task entry, entry family, or entry in a family of entries o An attribute A name can be any of the following: o A simple name - an identifier. The Ada syntax rules use the term "identifier" for the first occurrence of an identifier in some form of declaration; they use the term "simple name" for any occurrence of an identifier that already denotes a declared entity (for example a renamed entity). Some entities whose names are identifiers: labels, objects, packages (generic or nongeneric), subprograms (generic or nongeneric), types, and tasks. See HELP Ada Language_Topics Lexical_ Elements Identifiers for more information on identifiers. o A character literal - an explicit character, such as 'A' or 'x'. Enumeration literals can have names that are character literals. o An operator symbol - a string literal that spells any of the predefined operator symbols, such as "+", "**". Functions can have names that are operator symbols. o An indexed component - component of an array or an entry in a family of entries. o A slice - a one-dimensional array formed by a sequence of consecutive components of a one-dimensional array. o A selected component - a record component, entry, entry family or an object designated by an access value. o An attribute - a basic operation that can be applied to an entity given by a prefix. An attribute can be a basic operation that delivers a value; it can also be a function, a type, or a range. The name of the attribute is also called the attribute designator. The Ada standard and Compaq Ada define a number of attributes; see Annex A of the DEC Ada Language Reference Manual for a complete list. Examples: -- Some simple names: COLOR -- enumeration type name <> -- label name TEXT_IO -- package name CONTROLLER -- task name -- Character literals: 'A' 'x' -- Operator symbols: "and" "or" "xor" "=" "/=" "<" "<=" ">" ">=" "+" "-" "&" "*" "/" "mod" "rem" "**" "abs" "not" -- Indexed components: MY_ARRAY(10) -- Component of a one-dimensional array REQUEST(MEDIUM) -- An entry in a family of entries -- Slices: MY_ARRAY(1 .. 5) -- A slice of 5 components MY_ARRAY(1 .. 0) -- A null slice -- Selected components: PERSON_REC.NAME -- A record component SCHEDULER.ADD_TO_QUEUE -- An entry of the task SCHEDULER NEXT_ELEMENT.all -- The object designated by the access -- variable NEXT_ELEMENT -- Attributes MY_ARRAY'FIRST MY_ARRAY'LAST MY_ARRAY'RANGE REQUEST(MEDIUM)'ADDRESS 3 Aggregates An aggregate is a basic operation that combines array or record component values into one composite value. Each component value associates an expression with an array or record component. Component associations may be named or positional. The choice 'others' is allowed as the last association in an aggregate; it specifies a value for all of the remaining components. Examples of array aggregates: -- Initialize an array variable: TEXT_LINE: LINE => (others => ' '); -- First named association, then positional: TABLE1 := TABLE'(1 | 3 | 5 => 5, others => 0); TABLE2 := TABLE'(1,2,3,4,5,6,7,8,9,10); Examples of record aggregates: -- Initialize a record variable using named association: TODAY: DATE := (DAY => 14, MONTH => September, YEAR => 1992); -- Assign a record value using positional association: OBJECT := ('A', 5, "Summer is a..."); -- Assign a record value using named association: THIS_ELEMENT.NEXT := new LIST_ELEMENT'(CLASS => ELEMENT, NEXT => null, ELEMENT_VALUE => I); 3 Expressions An expression is a formula that defines the computation of a value. Ada defines some particular kinds of expressions: o A simple expression involves arithmetic operations, 'abs', or 'not'. o A static expression is one that can be evaluated at compile time; a nonstatic expression is one that cannot be evaluated at compile time. o A qualified expression is one that explicitly states the type and possibly the subtype of an operand that is the given expression or aggregate. o A universal expression is one that delivers a result of either type 'universal_integer' or 'universal_real'. Note that if a universal expression is static, then the evaluation of the expression must be exact. o A boolean expression or condition is one that delivers a boolean result (TRUE or FALSE). Some expressions: -4.0 + A (COLD and SUNNY) or WARM COUNT not in SMALL_INT A**(B**C) ""AA"" < "B" and "A" < "A " 'A' & 'A' Some simple expressions: -4.0 B**2 - 4.0*A*C not DESTROYED Some static expressions: (5 * 8) mod 11 8 * BITS_PER_ROW * NUMBER_OF_ROWS -- Both BITS_PER_ROW -- and NUMBER_OF_ROWS must -- be constants 'A' Some nonstatic expressions: CURRENT_COUNTER * 4 -- CURRENT_COUNTER is a variable "Hello " & THIS_PERSON.NAME -- THIS_PERSON is a record variable "Hello" & " " & "Again" Some qualified expressions: type MASK is (FIX, DEC, EXP, SIGNIF); type CODE is (FIX, CLS, DEC, TNZ, SUB); PRINT (MASK'DEC)); -- need to qualify which DEC is required for J in CODE'(FIX) .. CODE'(DEC) loop -- need to qualify either -- FIX or DEC Some universal expressions: abs(-10)*3 -- universal integer expression TWO_PI : constant := 2.0*3.14159_26536 -- universal real expression LONG : constant := FLOAT'DIGITS*2; -- universal real expression Some boolean expressions: A = B ITEM in SET P < Q or R > S 3 Lexical_Elements Lexical elements comprise the text of an Ada program. 4 Character_Set The only characters allowed in the text of a program are the graphic characters and format effectors. Each graphic character corresponds to a unique code of the ISO 7-bit coded character set (ISO Standard 646), and is represented (visually) by a graphical symbol. The basic character set is sufficient for writing any program. The characters included in each of the categories of basic graphic characters are defined as follows: (a) uppercase letters A B C ... Z (b) digits 0 1 2 3 4 5 6 7 8 9 (c) special characters " # & ' ( ) * + , - . / : ; < = > _ | (d) the space character Format effectors are the ISO (and ASCII) characters called horizontal tabulation, vertical tabulation, carriage return, line feed, and form feed. The characters included in each of the remaining categories of graphic characters are defined as follows: (e) lowercase letters a b c ... z (f) other special characters ! $ % ? @ [ \ ] ^ ` { } ~ The following names are used when referring to special characters and other special characters: symbol name symbol name " quotation > greater than # sharp _ underline & ampersand | vertical bar ' apostrophe ! exclamation mark ( left parenthesis $ dollar ) right parenthesis % percent * star, multiply ? question mark + plus @ commercial at , comma [ left square bracket - hyphen, minus \ back-slash / slash, divide ^ circumflex : colon ` grave accent ; semicolon { left brace < less than } right brace = equal ~ tilde 4 Comments Ada comments start with two adjacent hyphens and extend up to the end of the line. You can have a comment on any line of a program. Examples: -- A full comment line.... Z := X + Y -- assign the sum of X and Y to Z -- A comment can be broken across -- two lines. --------------- 4 Identifiers Identifiers are used as names and reserved words. They can be formed from any combination of letters, digits, and underscores, but must begin with a letter. The first 255 characters denote a unique identfier. Examples: A BITS_PER_ROW Current_Counter COLOR1 4 Literals A literal is an explicit value. Ada allows numeric, character, enumeration, and string literals. Numeric literals can be either real or integer, and can be expressed in either decimal or based notation. Ada also accepts the literal 'null' as the value of an access type. Examples: -- Numeric literals: 10 4 5E8 165_000 -- integer literals in decimal -- notation 10.0 4.0 5.0E+8 3.14159 -- real literals in decimal -- notation 2#1111_1111# 16#FF# -- integer literals (255) in based -- notation 16#F.FF#E+2 2#1.1111_1111#E11 -- real literals in based notation -- Character literals: 'X' '+' ''' ' ' -- Enumeration literals: TRUE FALSE RED -- String literals: "Today is Tuesday." "" "A catenated" & "string literal" 4 Reserved_Words The identifiers listed below are called reserved words and have special significance in the language. abort abs accept access all and array at begin body case constant declare delay delta digits do else elsif end entry exception exit for function generic goto if in is limited loop mod new not null of or others out package pragma private procedure raise range record rem renames return reverse select separate subtype task terminate then type use when while with xor You cannot use reserved words to declare identifiers. 4 Special_Symbols Ada provides for the following special symbols: Single-character special symbols: & ' ( ) * + , - . / : ; < = > | Multicharacter special symbols (compound symbols): => .. ** := /= >= <= << >> <> The following names are used when referring to compound symbols: Symbol Name => arrow .. double dot ** double star, exponentiate := assignment (pronounced: "becomes") /= inequality (pronounced: "not equal") >= greater than or equal <= less than or equal << left label bracket >> right label bracket <> box 3 Statements A statement describes an executable action which the program is to perform. Multiple statements nested between a 'begin' and an 'end' reserved word are treated as a single statement. Statements can be labeled; labels have the following form: <> 4 Abort_Statement An abort statement terminates the execution of a task. Examples: abort SCHEDULER; -- aborts task SCHEDULER 4 Accept_Statement An accept statement specifies the actions to be performed at a call of a named task entry. The entry can be an entry of a family of entries. An accept statement can only occur in the task body corresponding to the task declaration in which the entry or family of entries was declared. A task body can have more than one accept statement for the same entry. The formal part of the accept statement must conform to the formal part given in the entry declaration. Examples: task READ_WRITE is entry READ (V : out ITEM); entry WRITE (Y: in ITEM); end READ_WRITE; task body READ_WRITE is begin ... accept READ (V: out ITEM) do V := LOCAL_ITEM; end READ; accept WRITE (Y: in ITEM) do LOCAL_ITEM := Y; end WRITE; ... end READ_WRITE; 4 Assignment_Statement An assignment statement replaces the current value of a variable with a new value specified by an expression. The named variable (on the left side of the statement) and the expression (on the right side of the statement) must be of the same type; this type must not be a limited type. For the execution of an assignment statement, the variable name and the expression are first evaluated. The evaluation is done in some order that is not defined by the language. A check is then made that the value of the expression belongs to the subtype of the variable, except in the case of a variable that is an array (the assignment then involves a subtype conversion). Finally, the value of the expression becomes the new value of the variable. The exception CONSTRAINT_ERROR is raised if the previously mentioned subtype check fails; in such cases, the current value of the variable is left unchanged. If the variable is a subcomponent that depends on discriminants of an unconstrained record variable, then the execution of the assignment is erroneous if the value of any of these discriminants is changed by that execution. Examples: VALUE := MAX_VALUE - 1; SHADE := BLUE; NEXT_FRAME(F)(M, N) := 2.5; U := DOT_PRODUCT(V, W); WRITER := (STATUS => OPEN, UNIT => PRINTER, LINE_COUNT => 60); 4 Block_Statement A block statement encloses a sequence of statements optionally preceded by a declarative part and optionally followed by exception handlers. If a block statement has a block simple name (identifier), that simple name must be given both at the beginning and at the end. The execution of a block statement consists of the elaboration of its declarative part (if any) followed by the execution of the sequence of statements. If the block statement has exception handlers, they handle corresponding exceptions that are raised during the execution of the sequence of statements. Example: SWAP: declare TEMP : INTEGER; begin TEMP := V; V := U; U := TEMP; end SWAP; 4 Case_Statement A case statement selects for execution one of a number of alternative sequences of statements; the chosen alternative is defined by the value of an expression. The expression must be of a nongeneric discrete type. Each choice in a case statement alternative must be of the same type as the expression; the list of choices specifies for which values of the expression the alternative is chosen. If the expression is the name of an object whose subtype is static, then each value of that subtype must be represented once and only once in the set of choices of the case statement, and no other value is allowed. This rule is likewise applied if the expression is a qualified expression or type conversion whose type mark denotes a static subtype. Otherwise, for other forms of expression, each value of the (base) type of the expression must be represented once and only once in the set of choices, and no other value is allowed. The simple expressions and discrete ranges given as choices in a case statement must be static. A choice defined by a discrete range stands for all values in the corresponding range (none if a null range). The choice 'others' is allowed only for the last alternative and as its only choice; it stands for all values (possibly none) not given in the choices of previous alternatives. A component simple name is not allowed as a choice of a case statement alternative. The execution of a case statement consists of the evaluation of the expression followed by the execution of the chosen sequence of statements. Examples: case SENSOR is when ELEVATION => RECORD_ELEVATION(SENSOR_VALUE); when AZIMUTH => RECORD_AZIMUTH (SENSOR_VALUE); when DISTANCE => RECORD_DISTANCE (SENSOR_VALUE); when others => null; end case; case TODAY is when MON => COMPUTE_INITIAL_BALANCE; when FRI => COMPUTE_CLOSING_BALANCE; when TUE .. THU => GENERATE_REPORT(TODAY); when SAT .. SUN => null; end case; case BIN_NUMBER(COUNT) is when 1 => UPDATE_BIN(1); when 2 => UPDATE_BIN(2); when 3 | 4 => EMPTY_BIN(1); EMPTY_BIN(2); when others => raise ERROR; end case; 4 Delay_Statement A delay statement causes execution to pause for a specified amount of time. The time is specified in the type DURATION, which is defined in package STANDARD. Example: delay 4.0; -- delays 4.0 seconds 4 Entry_Call_Statement An entry call is like a procedure call. It calls an entry with its associated parameters. The entry name is given first, followed by a parenthesized list of parameter values. Examples: GRANTOR.GRAB_ACCESS; -- Call of an entry with no -- parameters SCHEDULER.ADD_TO_QUEUE(NEXT_JOB); -- Call of an entry with one -- parameter VALVE(2).SET_WATCH(OPEN); -- Call of an entry from an -- array of entries; one -- parameter CONTROLLER.REQUEST(MEDIUM)(ITEM_3); -- Call of an entry from an -- entry family; one parameter 4 Exit_Statement An exit statement is used to complete the execution of an enclosing loop; the completion is conditional if the exit statement includes a boolean expression (condition). Example: for N in 1 .. MAX_NUM_ITEMS loop GET_NEW_ITEM(NEW_ITEM); MERGE_ITEM(NEW_ITEM, STORAGE_FILE); exit when NEW_ITEM = TERMINAL_ITEM; end loop; 4 If_Statement An if statement selects for execution one or none of the enclosed sequences of statements, depending on the truth value of one or more corresponding conditions. An expression specifying a condition must be a boolean expression. For the execution of an if statement, the condition specified after 'if', and any conditions specified after 'elsif', are evaluated in succession (treating a final 'else' as 'elsif TRUE then'), until one evaluates to TRUE or all conditions are evaluated and yield FALSE. If one condition evaluates to TRUE, then the corresponding sequence of statements is executed; otherwise none of the sequences of statements is executed. Examples: if MONTH = DECEMBER and DAY = 31 then MONTH := JANUARY; DAY := 1; YEAR := YEAR + 1; end if; if LINE_TOO_SHORT then raise LAYOUT_ERROR; elsif LINE_FULL then NEW_LINE; PUT(ITEM); else PUT(ITEM); end if; if MY_CAR.OWNER.VEHICLE /= MY_CAR then REPORT("Incorrect data"); end if; 4 Loop_Statement A loop statement includes a sequence of statements that is to be executed repeatedly, zero or more times. If a loop has no iteration scheme, then it is executed over and over again indefinitely, until an exit statement is executed. A loop can also be completed by a return statement or by the raising of an exception. If a loop statement has a loop simple name (identifier), the simple name must be given both at the beginning and at the end of the loop. Example of a loop without an iteration scheme: loop REEVALUATE(A); exit when A > THRESHOLD; end loop; Example of a loop with a 'for' iteration scheme and a simple name: FOR_LOOP: for I in LIMIT'RANGE loop if X < Y then PUT(Y); end if; end loop FOR_LOOP; 5 For_Loop A for loop has an iteration scheme defining the lower and upper bounds of an iteration variable. For the execution of a loop statement with a for iteration scheme, the loop parameter specification is first elaborated. This elaboration creates the loop parameter and evaluates the discrete range. If the discrete range is a null range, the execution of the loop statement is complete. Otherwise, the sequence of statements is executed once for each value of the discrete range (subject to the loop not being left as a consequence of the execution of an exit statement or as a consequence of some other transfer of control). Prior to each such iteration, the corresponding value of the discrete range is assigned to the loop parameter. These values are assigned in increasing order unless the reserved word 'reverse' is present, in which case the values are assigned in decreasing order. Example: for J in BUFFER'RANGE loop -- legal even with a null range if BUFFER(J) /= SPACE then PUT(BUFFER(J)); end if; end loop; 5 Exit_From_Loop An exit statement may be placed within any loop, regardless of its iteration scheme or absence thereof. An exit statement has the following form: exit [loop_name] [when boolean_condition]; A loop name, if given, must denote the loop identifier of an enclosing loop. If a loop name is not given, the innermost containing loop (there must be one) is implied by default. Examples of exiting a loop: loop STATUS := CHECK_VALVE(VALVE(1)); if STATUS = ALERT then exit; end if; end loop; Or, equivalently: loop STATUS := CHECK_VALVE(VALVE(1)); exit when STATUS = ALERT; end loop; 5 While_Loop For a loop statement with a while iteration scheme, the condition is evaluated before each execution of the sequence of statements; if the value of the condition is TRUE, the sequence of statements is executed; if FALSE, the execution of the loop statement is complete. Examples: while BID(N).PRICE < CUT_OFF.PRICE loop RECORD_BID(BID(N).PRICE); N := N + 1; end loop; while not END_OF_FILE(DATA_FILE) loop PROCESS_NEXT_RECORD(DATA_FILE); end loop; 4 Goto_Statement A goto statement specifies an explicit transfer of control to a target statement named by a label. The innermost sequence of statements that encloses the target statement must also enclose the goto statement (note that the goto statement can be a statement of an inner sequence). Furthermore, if a goto statement is enclosed by an accept statement or the body of a program unit, then the target statement must not be outside this enclosing construct; conversely, it follows from the previous rule that if the target statement is enclosed by such a construct, then the goto statement cannot be outside. Example: if A(I) < ELEMENT then if LEFT(I) /= 0 then goto COMPARE; end if; -- some statements <> TRY_COMPARE(...); -- target of above goto ... end if; 4 Null_Statement A null statement has the following form: null; The null statement does nothing. It is used most often as a placeholder in some other statement, as in the following example: if A < B then null; else DO_SOMETHING; end if; 4 Subprogram_Call_Statement A suprogram call calls a procedure or a function with its associated parameters. The procedure or function name is given first followed by a parenthesized list of parameter values. The paremeter values are called actual parameters, and are associated with the formal parmeters declared in the subprogram declaration. The association between formal and actual parameters may be positional or named; named association often improves readability. Examples from the package TEXT_IO: PUT("Hello"); -- Procedure call OPEN (FILE => STORAGE_FILE, -- Procedure call using MODE => OUT_FILE, -- named association NAME => "DISK$:STORAGE.DAT", FORM => ""); if not END_OF_LINE then -- Function call ... end if; CURRENT_LINE_NUMBER := LINE(FILE => MY_FILE); -- Function call -- using named -- association 4 Raise_Statement For the execution of a raise statement with an exception name, the named exception is raised. A raise statement without an exception name is allowed only within an exception handler (but not within the sequence of statements of a subprogram, package, task unit, or generic unit, enclosed by the handler); it raises again the exception that caused transfer to the innermost enclosing handler. Examples: raise SINGULAR; raise NUMERIC_ERROR; -- explicitly raising -- a predefined exception raise; -- only within an exception handler 4 Return_Statement A return statement completes the execution of the innermost enclosing function, procedure, or accept statement. A return statement is allowed only within the body of a subprogram or generic subprogram, or within an accept statement, and applies to the innermost (enclosing) construct. A return statement is not allowed within the body of a task unit, package, or generic package enclosed by this construct (on the other hand, it is allowed within a compound statement enclosed by this construct and, in particular, in a block statement). A return statement for an accept statement or for the body of a procedure or generic procedure must not include an expression. A return statement for the body of a function or generic function must include an expression. The value of the expression defines the result returned by the function. The type of this expression must be the base type of the type mark given after the reserved word return in the specification of the function or generic function (this type mark defines the result subtype). For the execution of a return statement, the expression (if any) is first evaluated and a check is made that the value belongs to the result subtype. The execution of the return statement is thereby completed if the check succeeds; so also is the execution of the subprogram or of the accept statement. The exception CONSTRAINT_ERROR is raised at the place of the return statement if the check fails. Examples: return; -- in a procedure -- or accept statement return KEY_VALUE(LAST_INDEX); -- in a function 4 Select_Statement There are three forms of select statement: o The selective wait allows a combination of waiting for, and selecting from, one or more alternatives: an accept alternative (accept statement), a delay alternative (delay statement), or a terminate alternative. The selection can depend on conditions associated with each alternative of the selective wait. The selective wait must contain at least one accept alternative. o The conditional entry call issues an entry call that is then canceled if a rendezvous is not immediately possible. o The timed entry call issues an entry call that is canceled if a rendezvous is not started within a given period of time. Example of a selective wait form of a select statement: select accept DRIVER_AWAKE_SIGNAL; or delay 30.0*SECONDS; STOP_THE_TRAIN; or terminate; end select; Example of a conditional entry call form of a select statement: loop select R.SEIZE; return; else null; -- busy waiting end select; end loop; Example of a timed entry call form of a select statement: select CONTROLLER.REQUEST(MEDIUM)(SOME_ITEM); or delay 45.0; -- controller too busy, try something else end select 3 File_Management All of the input-output packages provide file management operations. 4 CREATE procedure CREATE(FILE : in out FILE_TYPE; MODE : in FILE_MODE := default_mode; NAME : in STRING := ""; FORM : in STRING := ""); Establishes a new external file, with the given name and form, and associates this external file with the given file. The given file is left open. The current mode of the given file is set to the given access mode. The default access mode is the mode OUT_FILE for sequential and text input-output; it is the mode INOUT_FILE for direct input-output. For direct access, the size of the created file is implementation-dependent. A null string for NAME specifies an external file that is not accessible after the completion of the main program (a temporary file). A null string for FORM specifies the use of the default options of the implementation for the external file. On OpenVMS systems, a name can be specified in FORM. However, NAME overrides any name given in FORM. If NAME is null, any name given in FORM is ignored, and a temporary file is created that is not accessible after the file is closed. On ULTRIX systems, a file descriptor can be specified in FORM. If the external file referred to by the file descriptor is already open, then the Ada file is opened, and the file pointer is set to the beginning of the file. For direct access, the size of a file that has just been created is zero. The exception STATUS_ERROR is raised if the given file is already open. The exception NAME_ERROR is raised if the string given as NAME does not allow the identification of an external file. The exception USE_ERROR is raised if, for the specified mode, the environment does not support creation of an external file with the given name (in the absence of NAME_ERROR) and form. In Compaq Ada, the exception USE_ERROR is raised if the mode is IN_FILE. The exception USE_ERROR is also raised if any file attributes specified in FORM are not supported by the package. 4 OPEN procedure OPEN(FILE : in out FILE_TYPE; MODE : in FILE_MODE; NAME : in STRING := ""; FORM : in STRING := ""); Associates the given file with an existing external file having the given name and form, and sets the current mode of the given file to the given mode. The given file is left open. The exception STATUS_ERROR is raised if the given file is already open. The exception NAME_ERROR is raised if the string given as NAME does not allow the identification of an external file; in particular, this exception is raised if no external file with the given name exists. The exception USE_ERROR is raised if, for the specified mode, the environment does not support opening for an external file with the given name (in the absence of NAME_ERROR) and form. 4 CLOSE procedure CLOSE(FILE : in out FILE_TYPE); Severs the association between the given file and its associated external file. The given file is left closed. The exception STATUS_ERROR is raised if the given file is not open. 4 DELETE procedure DELETE(FILE : in out FILE_TYPE); Deletes the external file associated with the given file. The given file is closed, and the external file ceases to exist. The exception STATUS_ERROR is raised if the given file is not open. The exception USE_ERROR is raised if deletion of the external file is not supported by the environment. In DEC Ada on ULTRIX systems, the exception USE_ERROR is raised if an attempt is made to delete an Ada file that was opened by specifying the file descriptor in the FORM parameter of an OPEN procedure. 4 RESET procedure RESET(FILE : in out FILE_TYPE; MODE : in FILE_MODE); procedure RESET(FILE : in out FILE_TYPE); Resets the given file so that reading from or writing to its elements can be restarted from the beginning of the file; in particular, for direct access this means that the current index is set to one. If a MODE parameter is supplied, the current mode of the given file is set to the given mode. The exception STATUS_ERROR is raised if the file is not open. The exception USE_ERROR is raised if the environment does not support resetting for the external file and, also, if the environment does not support resetting to the specified mode for the external file. 4 MODE function MODE(FILE : in FILE_TYPE) return FILE_MODE; Returns the current mode of the given file. The exception STATUS_ERROR is raised if the file is not open. 4 NAME function NAME(FILE : in FILE_TYPE) return STRING; Returns a string which uniquely identifies the external file currently associated with the given file (and may, therefore, be used in an OPEN operation). If an environment allows alternative specifications of the name (for example, abbreviations), the string returned by the function should correspond to a full specification of the name. The exception STATUS_ERROR is raised if the given file is not open. In DEC Ada on ULTRIX systems, the exception USE_ERROR is raised if an attempt is made to obtain the name of an Ada file that was opened by specifying the file descriptor in the FORM parameter of an OPEN or CREATE procedure. 4 FORM function FORM(FILE : in FILE_TYPE) return STRING; Returns the form string for the external file currently associated with the given file. If an environment allows alternative specifications of the form (for example, abbreviations using default options), the string returned by the function should correspond to a full specification (that is, it should indicate explicitly all options selected, including default options). In Compaq Ada on OpenVMS systems, a full FDL string is returned. The exception STATUS_ERROR is raised if the given file is not open. 4 IS_OPEN function IS_OPEN(FILE : in FILE_TYPE) return BOOLEAN; Returns TRUE if the file is open (that is, if it is associated with an external file), otherwise returns FALSE. 3 Item_Input_Output The mixed-type input-output packages all provide item input- output operations for moving values in and out of a file buffer. 4 ITEM_TYPE generic type ITEM_TYPE is private; procedure GET_ITEM(FILE : in FILE_TYPE; ITEM : out ITEM_TYPE); Operates on a file buffer for a file of mode IN_FILE or INOUT_ FILE. Gets an item from the file buffer at the current position, and returns its value in the parameter ITEM. Then, the current position in the file buffer is updated to the position of the next item. The exception MODE_ERROR is raised if the current mode of the given file is OUT_FILE. The exception LAYOUT_ERROR is raised if no more items can be read from the file buffer. 4 GET_ARRAY generic type ITEM_TYPE is private; type INDEX is (<>); type ITEM_ARRAY is array (INDEX range <>) of ITEM_TYPE; procedure GET_ARRAY(FILE : in FILE_TYPE; ITEMS : out ITEM_ARRAY; LAST : out INDEX); Operates on a file buffer for a file of mode IN_FILE or INOUT_ FILE. Gets the remaining items in the file buffer, and returns their values in the parameter ITEMS. Then, sets LAST to the index of the last element of ITEMS that is updated. Reading stops when the array ITEMS is full or when no more items can be read from the file buffer. The current position in the file buffer is updated to the position after the last position read. If no items are read, returns in LAST an index value that is one less than ITEMS'FIRST. The exception MODE_ERROR is raised if the current mode of the given file is OUT_FILE. 4 PUT_ITEM generic type ITEM_TYPE is private; procedure PUT_ITEM(FILE : in FILE_TYPE; ITEM : in ITEM_TYPE); Operates on a file buffer for a file of mode OUT_FILE or INOUT_ FILE. The value of the parameter ITEM is written into the file buffer at the current position, and the current position is updated to the position of the next item in the file buffer. The exception MODE_ERROR is raised if the current mode of the given file is IN_FILE. The exception LAYOUT_ERROR is raised if the current position exceeds the file buffer size. The file buffer size is limited by the maximum size of a record in the external file. 4 END_OF_BUFFER function END_OF_BUFFER(FILE : in FILE_TYPE) return BOOLEAN; Operates on a file buffer for a file of mode IN_FILE or INOUT_ FILE. Returns TRUE if there are no more items to be read from the file buffer. Returns FALSE otherwise. The exception MODE_ERROR is raised if the current mode of the given file is OUT_FILE. 4 SET_POSITION procedure SET_POSITION(FILE : in FILE_TYPE; TO : in POSITIVE_COUNT); Operates on a file buffer for a file of any mode. Sets the current position of the file buffer to the position specified by the value of TO. 4 POSITION function POSITION(FILE : in FILE_TYPE) return POSITIVE_COUNT; Operates on a file buffer for a file of any mode. Returns the current position in the file buffer. 4 MAX_ELEMENT_SIZE function MAX_ELEMENT_SIZE(FILE : in FILE_TYPE) return COUNT; Operates on a file of any mode. Returns the maximum record (element) size (in bytes) specified for the external file. The maximum record size, in turn, defines the limits for the size of the file buffer. A value of zero indicates that there is no maximum record size associated with the file; the buffer size is limited only by the maximum size of a OpenVMS RMS record. A maximum record size may be specified for a file (when it is created) with a FORM parameter value that includes the string "RECORD; SIZE max_record_size". 4 ELEMENT_SIZE function ELEMENT_SIZE(FILE : in FILE_TYPE) return COUNT; Operates on a file buffer for a file of mode IN_FILE or INOUT_ FILE. Returns the size (in bytes) of the record (element) last read into the file buffer. If no records have ever been read into the file buffer, a value of zero is returned. The ELEMENT_SIZE function can be used in combination with the POSITION function to determine the number of bytes remaining in the file buffer (of the last element read): ELEMENT_SIZE (F) - POSITION (F) + 1, for any file F. The exception MODE_ERROR is raised if the mode is not IN_FILE or INOUT_FILE. 3 TEXT_IO TEXT_IO is an Ada package that provides input-output operations for text files, including interactive input-output to and from a terminal. All of the file management input-output operations are also provided by this package (see HELP Ada Language_Topics File_ Management). 4 SET_INPUT procedure SET_INPUT(FILE : in FILE_TYPE); Operates on a file of mode IN_FILE. Sets the current default input file to FILE. The exception STATUS_ERROR is raised if the given file is not open. The exception MODE_ERROR is raised if the mode of the given file is not IN_FILE. 4 SET_OUTPUT procedure SET_OUTPUT(FILE : in FILE_TYPE); Operates on a file of mode OUT_FILE. Sets the current default output file to FILE. The exception STATUS_ERROR is raised if the given file is not open. The exception MODE_ERROR is raised if the mode of the given file is not OUT_FILE. 4 STANDARD_INPUT function STANDARD_INPUT return FILE_TYPE; Returns the standard input file. Note: The standard input file cannot be opened, closed, reset, or deleted, because the parameter FILE of the corresponding procedures has the mode 'in out'. 4 STANDARD_OUTPUT function STANDARD_OUTPUT return FILE_TYPE; Returns the standard output file. Note: The standard output file cannot be opened, closed, reset, or deleted, because the parameter FILE of the corresponding procedures has the mode 'in out'. 4 CURRENT_INPUT function CURRENT_INPUT return FILE_TYPE; Returns the current default input file. 4 CURRENT_OUTPUT function CURRENT_OUTPUT return FILE_TYPE; Returns the current default output file. 4 SET_LINE_LENGTH procedure SET_LINE_LENGTH(FILE : in FILE_TYPE; TO : in COUNT); procedure SET_LINE_LENGTH(TO : in COUNT); Sets the maximum line length of the specified output file to the number of characters specified by TO. The value zero for TO specifies an unbounded line length. The exception USE_ERROR is raised if the specified line length is inappropriate for the associated external file. 4 SET_PAGE_LENGTH procedure SET_PAGE_LENGTH(FILE : in FILE_TYPE; TO : in COUNT); procedure SET_PAGE_LENGTH(TO : in COUNT); Sets the maximum page length of the specified output file to the number of lines specified by TO. The value zero for TO specifies an unbounded page length. The exception USE_ERROR is raised if the specified page length is inappropriate for the associated external file. 4 LINE_LENGTH function LINE_LENGTH(FILE : in FILE_TYPE) return COUNT; function LINE_LENGTH return COUNT; Returns the maximum line length currently set for the specified output file, or zero if the line length is unbounded. 4 PAGE_LENGTH function PAGE_LENGTH(FILE : in FILE_TYPE) return COUNT; function PAGE_LENGTH return COUNT; Returns the maximum page length currently set for the specified output file, or zero if the page length is unbounded. 4 NEW_LINE procedure NEW_LINE(FILE : in FILE_TYPE; SPACING : in POSITIVE_COUNT := 1); procedure NEW_LINE(SPACING : in POSITIVE_COUNT := 1); Operates on a file of mode OUT_FILE. For a SPACING of one: Outputs a line terminator and sets the current column number to one. Then increments the current line number by one, except in the case that the current line number is already greater than or equal to the maximum page length, for a bounded page length; in that case a page terminator is output, the current page number is incremented by one, and the current line number is set to one. For a SPACING greater than one, the above actions are performed SPACING times. The exception MODE_ERROR is raised if the mode is not OUT_FILE. 4 SKIP_LINE procedure SKIP_LINE(FILE : in FILE_TYPE; SPACING : in POSITIVE_COUNT := 1); procedure SKIP_LINE(SPACING : in POSITIVE_COUNT := 1); Operates on a file of mode IN_FILE. For a SPACING of one: Reads and discards all characters until a line terminator has been read, and then sets the current column number to one. If the line terminator is not immediately followed by a page terminator, the current line number is incremented by one. Otherwise, if the line terminator is immediately followed by a page terminator, then the page terminator is skipped, the current page number is incremented by one, and the current line number is set to one. For a SPACING greater than one, the above actions are performed SPACING times. The exception MODE_ERROR is raised if the mode is not IN_FILE. The exception END_ERROR is raised if an attempt is made to read a file terminator. 4 END_OF_LINE function END_OF_LINE(FILE : in FILE_TYPE) return BOOLEAN; function END_OF_LINE return BOOLEAN; Operates on a file of mode IN_FILE. Returns TRUE if a line terminator or a file terminator is next; otherwise returns FALSE. The exception MODE_ERROR is raised if the mode is not IN_FILE. 4 NEW_PAGE procedure NEW_PAGE(FILE : in FILE_TYPE); procedure NEW_PAGE; Operates on a file of mode OUT_FILE. Outputs a line terminator if the current line is not terminated, or if the current page is empty (that is, if the current column and line numbers are both equal to one). Then outputs a page terminator, which terminates the current page. Adds one to the current page number and sets the current column and line numbers to one. The exception MODE_ERROR is raised if the mode is not OUT_FILE. 4 SKIP_PAGE procedure SKIP_PAGE(FILE : in FILE_TYPE); procedure SKIP_PAGE; Operates on a file of mode IN_FILE. Reads and discards all characters and line terminators until a page terminator has been read. Then adds one to the current page number, and sets the current column and line numbers to one. The exception MODE_ERROR is raised if the mode is not IN_FILE. The exception END_ERROR is raised if an attempt is made to read a file terminator. 4 END_OF_PAGE function END_OF_PAGE(FILE : in FILE_TYPE) return BOOLEAN; function END_OF_PAGE return BOOLEAN; Operates on a file of mode IN_FILE. Returns TRUE if the combination of a line terminator and a page terminator is next, or if a file terminator is next; otherwise returns FALSE. The exception MODE_ERROR is raised if the mode is not IN_FILE. 4 END_OF_FILE function END_OF_FILE(FILE : in FILE_TYPE) return BOOLEAN; function END_OF_FILE; Operates on a file of mode IN_FILE. Returns TRUE if a file terminator is next, or if the combination of a line, a page, and a file terminator is next; otherwise returns FALSE. The exception MODE_ERROR is raised if the mode is not IN_FILE. 4 SET_COL procedure SET_COL(FILE : in FILE_TYPE; TO : in POSITIVE_COUNT); procedure SET_COL(TO : in POSITIVE_COUNT); If the file mode is OUT_FILE: If the value specified by TO is greater than the current column number, outputs spaces, adding one to the current column number after each space, until the current column number equals the specified value. If the value specified by TO is equal to the current column number, there is no effect. If the value specified by TO is less than the current column number, has the effect of calling NEW_LINE (with a spacing of one), then outputs (TO - 1) spaces, and sets the current column number to the specified value. The exception LAYOUT_ERROR is raised if the value specified by TO exceeds LINE_LENGTH when the line length is bounded (that is, when it does not have the conventional value zero). If the file mode is IN_FILE: Reads (and discards) individual characters, line terminators, and page terminators, until the next character to be read has a column number that equals the value specified by TO; there is no effect if the current column number already equals this value. Each transfer of a character or terminator maintains the current column, line, and page numbers in the same way as a GET procedure. (Short lines will be skipped until a line is reached that has a character at the specified column position.) The exception END_ERROR is raised if an attempt is made to read a file terminator. 4 SET_LINE procedure SET_LINE(FILE : in FILE_TYPE; TO : in POSITIVE_COUNT); procedure SET_LINE(TO : in POSITIVE_COUNT); If the file mode is OUT_FILE: If the value specified by TO is greater than the current line number, has the effect of repeatedly calling NEW_LINE (with a spacing of one), until the current line number equals the specified value. If the value specified by TO is equal to the current line number, there is no effect. If the value specified by TO is less than the current line number, has the effect of calling NEW_PAGE followed by a call of NEW_LINE with a spacing equal to (TO - 1). The exception LAYOUT_ERROR is raised if the value specified by TO exceeds PAGE_LENGTH when the page length is bounded (that is, when it does not have the conventional value zero). If the mode is IN_FILE: Has the effect of repeatedly calling SKIP_LINE (with a spacing of one), until the current line number equals the value specified by TO; there is no effect if the current line number already equals this value. (Short pages will be skipped until a page is reached that has a line at the specified line position.) The exception END_ERROR is raised if an attempt is made to read a file terminator. 4 COL function COL(FILE : in FILE_TYPE) return POSITIVE_COUNT; function COL return POSITIVE_COUNT; Returns the current column number. The exception LAYOUT_ERROR is raised if this number exceeds COUNT'LAST. 4 LINE function LINE(FILE : in FILE_TYPE) return POSITIVE_COUNT; function LINE return POSITIVE_COUNT; Returns the current line number. The exception LAYOUT_ERROR is raised if this number exceeds COUNT'LAST. 4 PAGE function PAGE(FILE : in FILE_TYPE) return POSITIVE_COUNT; function PAGE return POSITIVE_COUNT; Returns the current page number. The exception LAYOUT_ERROR is raised if this number exceeds COUNT'LAST. 4 Character_and_String_IO 5 GET procedure GET(FILE : in FILE_TYPE; ITEM : out CHARACTER); procedure GET(ITEM : out CHARACTER); procedure GET(FILE : in FILE_TYPE; ITEM: out STRING); procedure GET(ITEM: out STRING); If ITEM is of the type CHARACTER: After skipping any line terminators and any page terminators, reads the next character from the specified input file and returns the value of this character in the out parameter ITEM. The exception END_ERROR is raised if an attempt is made to skip a file terminator. If ITEM is of the type STRING: Determines the length of the given string and attempts that number of GET operations for successive characters of the string (in particular, no operation is performed if the string is null). 5 PUT procedure PUT(FILE : in FILE_TYPE; ITEM : in CHARACTER); procedure PUT(ITEM : in CHARACTER); procedure PUT(FILE : in FILE_TYPE; ITEM : in STRING); procedure PUT(ITEM : in STRING); If ITEM is of the type CHARACTER: If the line length of the specified output file is bounded (that is, does not have the conventional value zero), and the current column number exceeds it, has the effect of calling NEW_LINE with a spacing of one. Then, or otherwise, outputs the given character to the file. If ITEM is of the type STRING: Determines the length of the given string and attempts that number of PUT operations for successive characters of the string (in particular, no operation is performed if the string is null). 5 GET_LINE procedure GET_LINE(FILE : in FILE_TYPE; ITEM : out STRING; LAST : out NATURAL); procedure GET_LINE(ITEM : out STRING; LAST : out NATURAL); Replaces successive characters of the specified string by successive characters read from the specified input file. Reading stops if the end of the line is met, in which case the procedure SKIP_LINE is then called (in effect) with a spacing of one; reading also stops if the end of the string is met. Characters not replaced are left undefined. If characters are read, returns in LAST the index value such that ITEM(LAST) is the last character replaced (the index of the first character replaced is ITEM'FIRST). If no characters are read, returns in LAST an index value that is one less than ITEM'FIRST. The exception END_ERROR is raised if an attempt is made to skip a file terminator. 5 PUT_LINE procedure PUT_LINE(FILE : in FILE_TYPE; ITEM : in STRING); procedure PUT_LINE(ITEM : in STRING); Calls the procedure PUT for the given string, and then the procedure NEW_LINE with a spacing of one. 4 INTEGER_IO INTEGER_IO is a generic package defined within the package TEXT_ IO. You use it to input and output integers to and from a text file, or interactively with a terminal. You instantiate it with one generic parameter, NUM, which defines the integer type upon which the procedures and functions will operate. For example, if you defined the following type type MY_INT is new INTEGER range 0 .. INTEGER'LAST; you would need two instantiations of INTEGER_IO if numbers of both types MY_INT and INTEGER were to be used for input-output. For example: package MY_INT_IO is new TEXT_IO.INTEGER_IO(NUM => MY_INT); package INT_IO is new TEXT_IO.INTEGER_IO(NUM => INTEGER); 5 GET procedure GET(FILE : in FILE_TYPE; ITEM : out NUM; WIDTH : in FIELD := 0); procedure GET(ITEM : out NUM; WIDTH : in FIELD := 0); If the value of the parameter WIDTH is zero, skips any leading blanks, line terminators, or page terminators, then reads a plus or a minus sign if present, then reads according to the syntax of an integer literal (which may be a based literal). If a nonzero value of WIDTH is supplied, then exactly WIDTH characters are input, or the characters (possibly none) up to a line terminator, whichever comes first; any skipped leading blanks are included in the count. Returns, in the parameter ITEM, the value of type NUM that corresponds to the sequence input. The exception DATA_ERROR is raised if the sequence input does not have the required syntax or if the value obtained is not of the subtype NUM. procedure GET(FROM : in STRING; ITEM : out NUM; LAST : out POSITIVE); Reads an integer value from the beginning of the given string, following the same rules as the GET procedure that reads an integer value from a file, but treating the end of the string as a file terminator. Returns, in the parameter ITEM, the value of type NUM that corresponds to the sequence input. Returns in LAST the index value such that FROM(LAST) is the last character read. 5 PUT procedure PUT(FILE : in FILE_TYPE; ITEM : in NUM; WIDTH : in FIELD := DEFAULT_WIDTH; BASE : in NUMBER_BASE := DEFAULT_BASE); procedure PUT(ITEM : in NUM; WIDTH : in FIELD := DEFAULT_WIDTH; BASE : in NUMBER_BASE := DEFAULT_BASE); Outputs the value of the parameter ITEM as an integer literal, with no underlines, no exponent, and no leading zeros (but a single zero for the value zero), and a preceding minus sign for a negative value. If the resulting sequence of characters to be output has fewer than WIDTH characters, then leading spaces are first output to make up the difference. Uses the syntax for a decimal literal if the parameter BASE has the value ten (either explicitly or through DEFAULT_BASE); otherwise, uses the syntax for a based literal, with any letters in uppercase. procedure PUT(TO : out STRING; ITEM : in NUM; BASE : in NUMBER_BASE := DEFAULT_BASE); Outputs the value of the parameter ITEM to the given string, following the same rule as for output to a file, using the length of the given string as the value for WIDTH. 4 Real_IO FLOAT_IO and FIXED_IO are generic packages defined within the package TEXT_IO. You use them to input and output real numbers to and from a text file, or interactively with a terminal. You instantiate them with one generic parameter, NUM, which defines the real type, floating or fixed respectively, upon which the procedures and functions will operate. For example, if you defined the following types type VOLT is delta 0.125 range 0.0 .. 255.0; type MASS is digits 7 range 0.0 .. 1.0E35; you would need to instantiate both FLOAT_IO and FIXED_IO if numbers of both types were to be used for input-output. For example: package VOLT_IO is new TEXT_IO.FIXED_IO(NUM => VOLT); package MASS_IO is new TEXT_IO.FLOAT_IO(NUM => MASS); 5 GET procedure GET(FILE : in FILE_TYPE; ITEM : out NUM; WIDTH : in FIELD := 0); procedure GET(ITEM : out NUM; WIDTH : in FIELD := 0); If the value of the parameter WIDTH is zero, skips any leading blanks, line terminators, or page terminators, then reads a plus or a minus sign if present, then reads according to the syntax of a real literal (which may be a based literal). If a nonzero value of WIDTH is supplied, then exactly WIDTH characters are input, or the characters (possibly none) up to a line terminator, whichever comes first; any skipped leading blanks are included in the count. Returns, in the parameter ITEM, the value of type NUM that corresponds to the sequence input. The exception DATA_ERROR is raised if the sequence input does not have the required syntax or if the value obtained is not of the subtype NUM. procedure GET(FROM : in STRING; ITEM : out NUM; LAST : out POSITIVE); Reads a real value from the beginning of the given string, following the same rule as the GET procedure that reads a real value from a file, but treating the end of the string as a file terminator. Returns, in the parameter ITEM, the value of the type NUM that corresponds to the sequence input. Returns in LAST the index value such that FROM(LAST) is the last character read. The exception DATA_ERROR is raised if the sequence input does not have the required syntax, or if the value obtained is not of the subtype NUM. 5 PUT procedure PUT(FILE : in FILE_TYPE; ITEM : in NUM; FORE : in FIELD := DEFAULT_FORE; AFT : in FIELD := DEFAULT_AFT; EXP : in FIELD := DEFAULT_EXP); procedure PUT(ITEM : in NUM; FORE : in FIELD := DEFAULT_FORE; AFT : in FIELD := DEFAULT_AFT; EXP : in FIELD := DEFAULT_EXP); Outputs the value of the parameter ITEM as a decimal literal with the format defined by FORE, AFT, and EXP. If the value is negative, a minus sign is included in the integer part. If EXP has the value zero, then the integer part to be output has as many digits as are needed to represent the integer part of the value of ITEM, overriding FORE if necessary, or consists of the digit zero if the value of ITEM has no integer part. If EXP has a value greater than zero, then the integer part to be output has a single digit, which is nonzero except for the value 0.0 of ITEM. In both cases, however, if the integer part to be output has fewer than FORE characters, including any minus sign, then leading spaces are first output to make up the difference. The number of digits of the fractional part is given by AFT, or is one if AFT equals zero. The value is rounded; a value of exactly one half in the last place may be rounded either up or down. If EXP has the value zero, there is no exponent part. If EXP has a value greater than zero, then the exponent part to be output has as many digits as are needed to represent the exponent part of the value of ITEM (for which a single digit integer part is used), and includes an initial sign (plus or minus). If the exponent part to be output has fewer than EXP characters, including the sign, then leading zeros precede the digits, to make up the difference. For the value 0.0 of ITEM, the exponent has the value zero. procedure PUT(TO : out STRING; ITEM : in NUM; AFT : in FIELD := DEFAULT_AFT; EXP : in FIELD := DEFAULT_EXP); Outputs the value of the parameter ITEM to the given string, following the same rule as for output to a file, using a value for FORE such that the sequence of characters output exactly fills the string, including any leading spaces. 4 ENUMERATION_IO ENUMERATION_IO is a generic package defined within the package TEXT_IO. You use it to input and output enumerated types to and from a text file, or interactively with a terminal. You instantiate it with one generic parameter, ENUM, which defines the enumerated type upon which the procedures and functions will operate. For example, if you defined the following type type COLOR is (RED, YELLOW, GREEN, BLUE, VIOLET); you would need to instantiate ENUMERATION_IO if values of the type COLOR were to be used for input-output. For example: package COLOR_IO is new TEXT_IO.ENUMERATION_IO(ENUM => COLOR); 5 GET procedure GET(FILE : in FILE_TYPE; ITEM : out ENUM); procedure GET(ITEM : out ENUM); After skipping any leading blanks, line terminators, or page terminators, reads an identifier according to the syntax of this lexical element (lower- and uppercase being considered equivalent), or a character literal according to the syntax of this lexical element (including the apostrophes). Returns, in the parameter ITEM, the value of type ENUM that corresponds to the sequence input. The exception DATA_ERROR is raised if the sequence input does not have the required syntax, or if the identifier or character literal does not correspond to a value of the subtype ENUM. procedure GET(FROM : in STRING; ITEM : out ENUM; LAST : out POSITIVE): Reads an enumeration value from the beginning of the given string, following the same rule as the GET procedure that reads an enumeration value from a file, but treating the end of the string as a file terminator. Returns, in the parameter ITEM, the value of the type ENUM that corresponds to the sequence input. Returns in LAST the index value such that FROM(LAST) is the last character read. The exception DATA_ERROR is raised if the sequence input does not have the required syntax, or if the identifier or character literal does not correspond to a value of the subtype ENUM. 5 PUT procedure PUT(FILE : in FILE_TYPE; ITEM : in ENUM; WIDTH : in FIELD := DEFAULT_WIDTH; SET : in TYPE_SET := DEFAULT_SETTING); procedure PUT(ITEM : in ENUM; WIDTH : in FIELD := DEFAULT_WIDTH; SET : in TYPE_SET := DEFAULT_SETTING); Outputs the value of the parameter ITEM as an enumeration literal (either an identifier or a character literal). The optional parameter SET indicates whether lower- or uppercase is used for identifiers; it has no effect for character literals. If the sequence of characters produced has fewer than WIDTH characters, then trailing spaces are finally output to make up the difference. procedure PUT(TO : out STRING; ITEM : in ENUM; SET : in TYPE_SET := DEFAULT_SETTING); Outputs the value of the parameter ITEM to the given string, following the same rule as for output to a file, using the length of the given string as the value for WIDTH. 3 SEQUENTIAL_IO SEQUENTIAL_IO is a generic Ada package that provides input-output operations for access to and from sequential files. All of the file management input-output operations are also provided by this package (see HELP Ada Language_Topics File_ Management). 4 READ procedure READ(FILE : in FILE_TYPE; ITEM : out ELEMENT_TYPE); Operates on a file of mode IN_FILE. Reads an element from the given file, and returns the value of this element in the ITEM parameter. The exception MODE_ERROR is raised if the mode is not IN_FILE. The exception END_ERROR is raised if no more elements can be read from the given file. In Compaq Ada, this procedure does not perform the check that raises the exception DATA_ERROR. 4 WRITE procedure WRITE(FILE : in FILE_TYPE; ITEM : in ELEMENT_TYPE); Operates on a file of mode OUT_FILE. Writes the value of ITEM to the given file. The exception MODE_ERROR is raised if the mode is not OUT_FILE. The exception USE_ERROR is raised if the capacity of the external file is exceeded. 4 END_OF_FILE function END_OF_FILE(FILE : in FILE_TYPE) return BOOLEAN; Operates on a file of mode IN_FILE. Returns TRUE if no more elements can be read from the given file; otherwise returns FALSE. The exception MODE_ERROR is raised if the mode is not IN_FILE. 3 DIRECT_IO DIRECT_IO is a generic Ada package that provides input-output operations for access to and from direct files. All of the file management input-output operations are also provided by this package (see HELP Ada Language_Topics File_ Management). 4 READ procedure READ(FILE : in FILE_TYPE; ITEM : out ELEMENT_TYPE; FROM : in POSITIVE_COUNT); procedure READ (FILE : in FILE_TYPE; ITEM : out ELEMENT_TYPE); Operates on a file of mode IN_FILE or INOUT_FILE. In the case of the first form, sets the current index of the given file to the index value given by the parameter FROM. Then (for both forms) returns, in the parameter ITEM, the value of the element whose position in the given file is specified by the current index of the file; finally, increases the current index by one. The exception MODE_ERROR is raised if the mode of the given file is OUT_FILE. The exception END_ERROR is raised if the index to be used exceeds the size of the external file. In Compaq Ada, this procedure does not perform the check that raises the exception DATA_ERROR. 4 WRITE procedure WRITE(FILE : in FILE_TYPE; ITEM : in ELEMENT_TYPE; TO : in POSITIVE_COUNT); procedure WRITE(FILE : in FILE_TYPE; ITEM : in ELEMENT_TYPE); Operates on a file of mode INOUT_FILE or OUT_FILE. In the case of the first form, sets the index of the given file to the index value given by the parameter TO. Then (for both forms) gives the value of the parameter ITEM to the element whose position in the given file is specified by the current index of the file; finally, increases the current index by one. The exception MODE_ERROR is raised if the mode of the given file is IN_FILE. The exception USE_ERROR is raised if the capacity of the external file is exceeded. 4 SET_INDEX procedure SET_INDEX(FILE : in FILE_TYPE; TO : in POSITIVE_COUNT); Operates on a file of any mode. Sets the current index of the given file to the given index value (which may exceed the current size of the file). 4 INDEX function INDEX(FILE : in FILE_TYPE) return POSITIVE_COUNT; Operates on a file of any mode. Returns the current index of the given file. 4 SIZE function SIZE(FILE : in FILE_TYPE) return COUNT; Operates on a file of any mode. Returns the current size of the external file that is associated with the given file. In Compaq Ada, returns the number of elements (OpenVMS RMS records) in the file. This value is obtained from the external file when an existing file is opened. The value is updated whenever the index of a WRITE operation to the file exceeds the current size. Therefore, the size of the file is always equal to the highest index number that has been written to the file. 4 END_OF_FILE function END_OF_FILE(FILE : in FILE_TYPE) return BOOLEAN; Operates on a file of mode IN_FILE or INOUT_FILE. Returns TRUE if the current index exceeds the size of the external file; otherwise returns FALSE. The exception MODE_ERROR is raised if the mode of the given file is OUT_FILE. 3 RELATIVE_IO RELATIVE_IO is a generic Compaq Ada package that provides input- output operations for access to and from relative files. All of the file management input-output operations are also provided by this package (see HELP Ada Language_Topics File_ Management). 4 READ procedure READ(FILE : in FILE_TYPE; ITEM : out ELEMENT_TYPE; FROM : in POSITIVE_COUNT); procedure READ(FILE : in FILE_TYPE; ITEM : out ELEMENT_TYPE); Operates on a file of mode IN_FILE or INOUT_FILE. In the case of the first form, sets the current index of the given file to the index value given by the parameter FROM. Then (for both forms) returns, in the parameter ITEM, the value of the element whose position is specified by the current index of the given file. The element read becomes the current element, and the current index is increased by one. The exception MODE_ERROR is raised if the current mode is OUT_ FILE. The exception LOCK_ERROR is raised if the element to be read is locked; this error is possible only if the external file is being shared. The exception EXISTENCE_ERROR is raised if the element does not exist (that is, the given cell is empty or the current index is beyond the end of the file). 4 READ_EXISTING procedure READ_EXISTING(FILE : in FILE_TYPE; ITEM : out ELEMENT_TYPE; FROM : in POSITIVE_COUNT); procedure READ_EXISTING(FILE : in FILE_TYPE; ITEM : out ELEMENT_TYPE); Operates on a file of mode IN_FILE or INOUT_FILE. In the case of the first form, sets the current index of the given file to the index value given by the parameter FROM. Then (for both forms) starts at the current index and scans forward, skipping empty cells, and sets the current index to the first nonempty cell. Then returns, in the parameter ITEM, the value of the element whose position is specified by the current index of the given file. The element read becomes the current element, and the current index is increased by one. The exception MODE_ERROR is raised if the mode of the given file is OUT_FILE. The exception LOCK_ERROR is raised if the element found is locked; this error is possible only if the external file is being shared. The exception EXISTENCE_ERROR is raised if the current index is beyond the end of the file, or if the end of the file is reached before an existing element (a nonempty cell) is found. 4 WRITE procedure WRITE(FILE : in FILE_TYPE; ITEM : in ELEMENT_TYPE; TO : in POSITIVE_COUNT); procedure WRITE(FILE : in FILE_TYPE; ITEM : in) ELEMENT_TYPE); Operates on a file of mode INOUT_FILE or OUT_FILE. In the case of the first form, sets the current index of the given file to the index value given by the parameter TO. Then (for both forms) writes the value of the parameter ITEM to the cell whose position in the given file is specified by the current index of the file; finally, increases the current index by one. The exception MODE_ERROR is raised if the mode of the given file is IN_FILE. The exception USE_ERROR is raised if the element position in the file has already been written. 4 UPDATE procedure UPDATE(FILE : in FILE_TYPE; ITEM : in ELEMENT_TYPE); Operates on a file of mode INOUT_FILE. Updates the current element of the given file with the value of the parameter ITEM. The exception MODE_ERROR is raised if the current mode is not INOUT_FILE. The exception USE_ERROR is raised if the current element is undefined at the start of this operation. 4 UNLOCK procedure UNLOCK(FILE : in FILE_TYPE); Operates on a file of any mode. After this operation, the current element is undefined. 4 DELETE_ELEMENT procedure DELETE_ELEMENT(FILE : in FILE_TYPE); Operates on a file of mode INOUT_FILE. Deletes the current element in the file. The exception MODE_ERROR is raised if the current mode is not INOUT_FILE. The exception USE_ERROR is raised if the current element is undefined at the start of this operation. 4 SET_INDEX procedure SET_INDEX(FILE : in FILE_TYPE; TO : in POSITIVE_COUNT); Operates on a file of any mode. Sets the current index of the given file to the index value given by the parameter TO. 4 INDEX function INDEX(FILE : in FILE_TYPE) return POSITIVE_COUNT; Operates on a file of any mode. Returns the current index of the given file. 4 END_OF_FILE function END_OF_FILE(FILE : in FILE_TYPE) return BOOLEAN; Operates on a file of mode IN_FILE or INOUT_FILE. Returns TRUE if no cell, starting at the current index, contains an element; otherwise returns FALSE. The exception MODE_ERROR is raised if the current mode is OUT_ FILE. 3 INDEXED_IO INDEXED_IO is a generic Compaq Ada package that provides input- output operations for access to and from indexed files. All of the file management input-output operations are also provided by this package (see HELP Ada Language_Topics File_ Management). The package INDEXED_IO provides a generic READ_BY_KEY procedure, which defines input for the given element type. This procedure must be instantiated with an actual type parameter for the generic parameter KEY_TYPE; it may be instantiated with or without a value for the generic parameter DEFAULT_KEY_NUMBER. The range of values for DEFAULT_KEY_NUMBER is 0 to 254; a value of 0 (the default) designates the primary key. If the RELATION parameter to the READ_BY_KEY procedure is specified, it must have a value of EQUAL_NEXT, EQUAL, or NEXT (the default is EQUAL). 4 READ procedure READ (FILE : in FILE_TYPE; ITEM : out ELEMENT_TYPE); generic type KEY_TYPE is private; DEFAULT_KEY_NUMBER : INTEGER := 0; procedure READ_BY_KEY(FILE : in FILE_TYPE; ITEM : out ELEMENT_TYPE; KEY : in KEY_TYPE; KEY_NUMBER : in INTEGER := DEFAULT_KEY_NUMBER; RELATION : in RELATION_TYPE := EQUAL); Operates on a file of mode IN_FILE or INOUT_FILE. In the case of the first form, returns, in the parameter ITEM, the value of the next element, according to the most recent key and relation information. In the case of the second form, returns, in the parameter ITEM, the value of the element specified by the given key information; KEY gives the key value; KEY_NUMBER designates a primary (0) or alternate key (1 to 254); and RELATION determines the kind of match to be made for the key value. For both forms, the element read becomes the current element. In the case of the first form, the next sequential element becomes the next element, according to the most recent key and relation information. In the case of the second form, the next sequential element becomes the next element. If neither the key nor the relation information changes from one READ_BY_KEY operation to the next, the same element will continue to be read. The exception MODE_ERROR is raised if the current mode is OUT_ FILE. The exception END_ERROR is raised if an attempt is made to read past the end of the file by the first form. The exception LOCK_ERROR is raised if the element to be read is locked; this error is possible only if the external file is being shared. The exception EXISTENCE_ERROR is raised if the element does not exist. The exception KEY_ERROR is raised if the size of the given key is not a multiple of eight bits. 4 WRITE procedure WRITE(FILE : in FILE_TYPE; ITEM : in ELEMENT_TYPE); Operates on a file of mode INOUT_FILE or OUT_FILE. Gives the value of the parameter ITEM to the element whose position in the given file is specified by the key information contained within the value of ITEM. The exception MODE_ERROR is raised if the current mode is IN_ FILE. The exception USE_ERROR is raised if the element position in the file has already been written. The exception KEY_ERROR is raised if a key has been duplicated and if duplicates are not allowed by the external file. 4 UPDATE procedure UPDATE(FILE : in FILE_TYPE; ITEM : in ELEMENT_TYPE); Operates on a file of mode INOUT_FILE. Updates the current element of the given file with the value of the parameter ITEM. The exception MODE_ERROR is raised if the current mode is not INOUT_FILE. The exception USE_ERROR is raised if the current element is undefined at the start of this operation or if some key specification in ITEM violates the external file attributes defined for that key. The exception KEY_ERROR is raised if a key has been changed or duplicated and if changes or duplicates are not allowed by the external file. 4 UNLOCK procedure UNLOCK(FILE : in FILE_TYPE); Operates on a file of any mode. After this operation, the current element is undefined. 4 DELETE_ELEMENT procedure DELETE_ELEMENT(FILE : in FILE_TYPE); Operates on a file of mode INOUT_FILE. Deletes the current element of the file. The exception MODE_ERROR is raised if the current mode is not INOUT_FILE. The exception USE_ERROR is raised if the current element is undefined at the start of this operation. 4 END_OF_FILE function END_OF_FILE(FILE : in FILE_TYPE) return BOOLEAN; Operates on a file of mode IN_FILE or INOUT_FILE. Returns TRUE if there are no more elements (according to the most recent key and relation information) starting at the next element in the file; otherwise returns FALSE. The exception MODE_ERROR is raised if the current mode is OUT_ FILE. 3 SEQUENTIAL_MIXED_IO SEQUENTIAL_MIXED_IO is a Compaq Ada package that provides input- output operations for access to and from direct files whose elements contain values of different types. All of the file management and item input-output operations are also provided by this package (see HELP Ada Language_Topics File_ Management and HELP Ada Language_Topics Item_Input_Output). 4 READ procedure READ(FILE : in FILE_TYPE); Operates on a file of mode IN_FILE. Reads the next sequential element from the given file into the file buffer. The exception MODE_ERROR is raised if the mode is not IN_FILE. The exception END_ERROR is raised if an attempt is made to read past the end of the file. 4 WRITE procedure WRITE(FILE : in FILE_TYPE); Operates on a file of mode OUT_FILE. Writes the file buffer to the given file as a new element. If the external file record format is fixed and the current position in the file buffer does not indicate the end of the buffer, the rest of the buffer is filled with zero bits before being written to the file. The exception MODE_ERROR is raised if the mode is not OUT_FILE. 4 END_OF_FILE function END_OF_FILE(FILE : in FILE_TYPE) return BOOLEAN; Operates on a file of mode IN_FILE. Returns TRUE if no more elements can be read from the given file; otherwise returns FALSE. The exception MODE_ERROR is raised if the mode is not IN_FILE. 3 DIRECT_MIXED_IO DIRECT_MIXED_IO is a Compaq Ada package that provides input-output operations for access to and from direct files whose elements contain values of different types. All of the file management and item input-output operations are also provided by this package (see HELP Ada Language_Topics File_ Management and HELP Ada Language_Topics Item_Input_Output). 4 READ procedure READ (FILE : in FILE_TYPE; FROM : in POSITIVE_COUNT); procedure READ (FILE : in FILE_TYPE); Operates on a file of mode IN_FILE or INOUT_FILE. In the case of the first form, sets the current index of the given file to the index value given by the parameter FROM. Then (for both forms) returns, in the file buffer, the value of the element whose position is specified by the current index of the file; finally, increases the current index by one. The exception MODE_ERROR is raised if the mode of the given file is OUT_FILE. The exception END_ERROR is raised if the index to be used exceeds the size of the external file. 4 WRITE procedure WRITE (FILE : in FILE_TYPE; TO : in POSITIVE_COUNT); procedure WRITE (FILE : in FILE_TYPE); Operates on a file of mode INOUT_FILE or OUT_FILE. In the case of the first form, sets the index of the given file to the index value given by the parameter TO. Then (for both forms) writes the file buffer to the element whose position in the given file is specified by the current index of the file; finally, increases the current index by one. If the current position in the file buffer does not indicate the end of the buffer, the rest of the file buffer is filled with zero bits before being written to the file. The exception MODE_ERROR is raised if the mode of the given file is IN_FILE. 4 SET_INDEX procedure SET_INDEX(FILE : in FILE_TYPE; TO : in POSITIVE_COUNT); Operates on a file of any mode. Sets the current index of the given file to the index value given by the parameter TO. The value may exceed the size of the file. 4 INDEX function INDEX(FILE : in FILE_TYPE) return POSITIVE_COUNT; Operates on a file of any mode. Returns the current index of the given file. 4 SIZE function SIZE(FILE : in FILE_TYPE) return COUNT; Operates on a file of any mode. Returns the number of elements (OpenVMS RMS records) in the file. 4 END_OF_FILE function END_OF_FILE(FILE : in FILE_TYPE) return BOOLEAN; Operates on a file of mode IN_FILE or INOUT_FILE. Returns TRUE if the current index exceeds the size of the external file; otherwise returns FALSE. The exception MODE_ERROR is raised if the current mode is OUT_ FILE. 3 RELATIVE_MIXED_IO RELATIVE_MIXED_IO is a Compaq Ada package that provides input-output operations for access to and from direct files whose elements contain values of different types. All of the file management and item input-output operations are also provided by this package (see HELP Ada Language_Topics File_ Management and HELP Ada Language_Topics Item_Input_Output). 4 READ procedure READ (FILE : in FILE_TYPE; FROM : in POSITIVE_COUNT); procedure READ (FILE : in FILE_TYPE); Operates on a file of mode IN_FILE or INOUT_FILE. In the case of the first form, sets the current index of the given file to the index value given by the parameter FROM. Then (for both forms) returns, in the file buffer, the value of the element whose position is specified by the current index of the given file. The element read becomes the current element, and the current index is increased by one. The exception MODE_ERROR is raised if the current mode is OUT_ FILE. The exception LOCK_ERROR is raised if the element to be read is locked; this error is possible only if the external file is being shared. The exception EXISTENCE_ERROR is raised if the element does not exist (that is, the given cell is empty or the current index is beyond the end of the file). 4 READ_EXISTING procedure READ_EXISTING (FILE : in FILE_TYPE; FROM : in POSITIVE_COUNT); procedure READ_EXISTING (FILE : in FILE_TYPE); Operates on a file of mode IN_FILE or INOUT_FILE. In the case of the first form, sets the current index of the given file to the index value given by the parameter FROM. Then (for both forms) starts at the current index and scans forward, skipping empty cells, and sets the current index to the first nonempty cell. Then returns, in the file buffer, the value of the element whose position is specified by the current index of the given file. The element read becomes the current element, and the current index is increased by one. The exception MODE_ERROR is raised if the mode of the given file is OUT_FILE. The exception LOCK_ERROR is raised if the element to be read is locked; this error is possible only if the external file is being shared. The exception EXISTENCE_ERROR is raised if the current index is beyond the end of the file, or if the end of the file is reached before an existing element (nonempty cell) is found. 4 WRITE procedure WRITE (FILE : in FILE_TYPE; TO : in POSITIVE_COUNT); procedure WRITE (FILE : in FILE_TYPE); Operates on a file of mode INOUT_FILE or OUT_FILE. In the case of the first form, sets the current index of the given file to the index value given by the parameter TO. Then (for both forms) writes the contents of the file buffer to the cell whose position in the given file is specified by the current index of the file; finally, increases the current index by one. If the format of the associated external file is fixed and the current position in the file buffer does not indicate the end of the buffer, the rest of the file buffer is filled with zero bits before being written to the file. The exception MODE_ERROR is raised if the mode of the given file is IN_FILE. The exception USE_ERROR is raised if the element position in the file has already been written. 4 UPDATE procedure UPDATE(FILE : in FILE_TYPE); Operates on a file of mode INOUT_FILE. Updates the current element with the contents of the file buffer. The exception MODE_ERROR is raised if the current mode is not INOUT_FILE. The USE_ERROR is raised if the current element is undefined at the start of this operation. 4 UNLOCK procedure UNLOCK (FILE : in FILE_TYPE); Operates on a file of any mode. After this operation, the current element is undefined. 4 DELETE_ELEMENT procedure DELETE_ELEMENT(FILE : in FILE_TYPE); Operates on a file of mode INOUT_FILE. Deletes the current element in the file. The exception MODE_ERROR is raised if the current mode is not INOUT_FILE. The exception USE_ERROR is raised if the current element is undefined at the start of this operation. 4 SET_INDEX procedure SET_INDEX(FILE : in FILE_TYPE; TO : in POSITIVE_COUNT); Operates on a file of any mode. Sets the current index of the given file to the index value specified by the parameter TO. 4 INDEX function INDEX(FILE : in FILE_TYPE) return POSITIVE_COUNT; Operates on a file of any mode. Returns the current index of the given file. 4 END_OF_FILE function END_OF_FILE(FILE : in FILE_TYPE) return BOOLEAN; Operates on a file of mode IN_FILE or INOUT_FILE. Returns TRUE if no cell, starting at the current index, contains an element; otherwise returns FALSE. The exception MODE_ERROR is raised if the current mode is OUT_ FILE. 3 INDEXED_MIXED_IO INDEXED_MIXED_IO is a Compaq Ada package that provides input-output operations for access to and from indexed files whose elements contain values of different types. All of the file management and item input-output operations are also provided by this package (see HELP Ada Language_Topics File_ Management and HELP Ada Language_Topics Item_Input_Output) This package provides a generic READ_BY_KEY procedure, which defines input for the given element type. This procedure must be instantiated with an actual type parameter for the generic parameter KEY_TYPE; it may be instantiated with or without a value for the generic parameter DEFAULT_KEY_NUMBER. The range of values for DEFAULT_KEY_NUMBER is 0 to 254; a value of 0 (the default) designates the primary key. If the RELATION parameter to the READ_BY_KEY procedure is specified, it must have a value of EQUAL_NEXT, EQUAL, or NEXT (the default is EQUAL). 4 READ procedure READ(FILE : in FILE_TYPE); generic type KEY_TYPE is private; DEFAULT_KEY_NUMBER : INTEGER := 0; procedure READ_BY_KEY(FILE : in FILE_TYPE; KEY : in KEY_TYPE; KEY_NUMBER : in INTEGER := DEFAULT_KEY_NUMBER; RELATION : in RELATION_TYPE := EQUAL); Operates on a file of mode IN_FILE or INOUT_FILE. In the case of the first form, returns in the file buffer the value of the next element, according to the last specified key and relation information. In the case of the second form, returns in the file buffer the value of the element specified by the given key information; KEY gives the key value; KEY_NUMBER designates a primary (0) or alternate key (1 to 254); and RELATION determines the kind of match to be made for the key value. For both forms, the element read becomes the current element. In the case of the first form, the next sequential element becomes the next element, according to the most recent key and relation information. In the case of the second form, the next sequential element that matches the key and relation information specified becomes the next element. If neither the key nor the relation information changes from one READ_BY_KEY operation to the next, the same element will continue to be read. The exception MODE_ERROR is raised if the current mode is OUT_ FILE. The exception END_ERROR is raised if an attempt is made to read past the end of the file by the first form. The exception LOCK_ERROR is raised if the element to be read is locked; this error is possible only if the external file is being shared. The exception EXISTENCE_ERROR is raised if the element does not exist. The exception KEY_ERROR is raised if the size of the given key is not a multiple of eight bits. 4 WRITE procedure WRITE(FILE : in FILE_TYPE); Operates on a file of mode INOUT_FILE or OUT_FILE. Gives the value of the file buffer to the element whose position in the given file is specified by the key information contained within the file buffer. If the format of the associated external file is fixed and the current position in the file buffer does not indicate the end of the buffer, the rest of the file buffer is filled with zero bits before being written to the file. The exception MODE_ERROR is raised if the current mode is IN_ FILE. The exception USE_ERROR is raised if the element position in the file has already been written. The exception KEY_ERROR is raised if a key has been duplicated and if duplicates are not allowed by the external file. 4 UPDATE procedure UPDATE(FILE : in FILE_TYPE); Operates on a file of mode INOUT_FILE. Updates the current element of the given file with the contents of the file buffer. If the format of the associated external file record is fixed and the current position in the file buffer does not indicate the end of the buffer, the rest of the file buffer is filled with zero bits before being written to the file. The exception MODE_ERROR is raised if the current mode is not INOUT_FILE. The exception USE_ERROR is raised if the current element is undefined at the start of this operation or if some key specification in the file buffer violates the external file attributes defined for that key. The exception KEY_ERROR is raised if a key has been changed or duplicated and if changes or duplicates are not allowed by the external file. 4 UNLOCK procedure UNLOCK(FILE : in FILE_TYPE); Operates on a file of any mode. After this operation, the current element is undefined. 4 DELETE_ELEMENT procedure DELETE_ELEMENT(FILE : in FILE_TYPE); Operates on a file of mode INOUT_FILE. Deletes the current element of the file. The exception MODE_ERROR is raised if the current mode is not INOUT_FILE. The exception USE_ERROR is raised if the current element is undefined at the start of this operation. 4 END_OF_FILE function END_OF_FILE(FILE : in FILE_TYPE) return BOOLEAN; Operates on a file of mode IN_FILE or INOUT_FILE. Returns TRUE if there are no more elements (according to the most recent key and relation information) starting at the next element in the file; otherwise returns FALSE. The exception MODE_ERROR is raised if the current mode is OUT_ FILE. 3 Pragmas Pragmas convey information to the compiler. You can use them to tune the behavior of the compiler so that it best meets your programming needs. 4 AST_ENTRY On OpenVMS systems only. Takes the simple name of a single entry as the single argument; at most one AST_ENTRY pragma is allowed for any given entry. This pragma must be used in combination with the AST_ENTRY attribute, and is only allowed after the entry declaration and in the same task type specification or single task as the entry to which it applies. This pragma specifies that the given entry may be used to handle a OpenVMS asynchronous system trap (AST) resulting from a OpenVMS system service call. The pragma does not affect normal use of the entry (see the DEC Ada Language Reference Manual, section 9.12a). 4 COMMON_OBJECT Takes an internal name denoting an object, and optionally takes an external designator (the name of a linker storage area) and a size as arguments. This pragma is only allowed at the place of a declarative item, and must apply to a variable declared by an earlier declarative item of the same declarative part or package specification. The variable must have a size that is known at compile time, and it must not require implicit initialization. This pragma is not allowed for objects declared with a renaming declaration. This pragma enables the shared use of objects that are stored in overlaid storage areas (see the DEC Ada Language Reference Manual, section 13.9a.2.3). 4 COMPONENT_ALIGNMENT Takes an alignment choice and optionally the simple name of an array or record type as arguments. When no simple name is specified, the pragma must occur within a declarative part or package specification, and the effect of the pragma extends to types declared from the place of the pragma to the end of the innermost declarative part or package specification in which the pragma was declared. When a simple name is specified, the pragma and the type declaration must both occur immediately within the same declarative part, package specification, or task specification; the declaration must occur before the pragma. The position of the pragma and the restrictions on the named type are governed by the same rules as those for a representation clause. This pragma specifies the kind of alignment used for the components of the array or record types to which it applies (see the DEC Ada Language Reference Manual, section 13.1a). 4 CONTROLLED Takes the simple name of an access type as the single argument. This pragma is only allowed immediately within the declarative part or package specification that contains the declaration of the access type; the declaration must occur before the pragma. This pragma is not allowed for a derived type. This pragma specifies that automatic storage reclamation must not be performed for objects designated by values of the access type, except upon leaving the innermost block statement, subprogram body, or task body that encloses the access type declaration, or after leaving the main program (see the DEC Ada Language Reference Manual, section 4.8). 4 ELABORATE Takes one or more simple names denoting library units as arguments. This pragma is only allowed immediately after the context clause of a compilation unit (before the subsequent library unit or secondary unit). Each argument must be the simple name of a library unit mentioned by the context clause. This pragma specifies that the corresponding library unit body must be elaborated before the given compilation unit. If the given compilation unit is a subunit, the library unit body must be elaborated before the body of the ancestor library unit of the subunit (see the DEC Ada Language Reference Manual, section 10.5). 4 EXPORT_EXCEPTION On VMS systems only. Takes an internal name denoting an exception, and optionally takes an external designator (the name of a linker global symbol), a form (ADA or VMS), and a code (a static integer expression that is interpreted as a condition code) as arguments. A code value must be specified when the form is VMS (the default if the form is not specified). This pragma is only allowed at the place of a declarative item, and must apply to an exception declared by an earlier declarative item of the same declarative part or package specification; it is not allowed for an exception declared with a renaming declaration or for an exception declared in a generic unit. This pragma permits an Ada exception to be handled by programs written in another programming language (see the DEC Ada Language Reference Manual, section 13.9a.3.2). 4 EXPORT_FUNCTION Takes an internal name denoting a function, and optionally takes an external designator (the name of a linker global symbol), parameter types, result type, parameter mechanisms, and result mechanism as arguments. This pragma is only allowed at the place of a declarative item, and must apply to a function declared by an earlier declarative item of the same declarative part or package specification. In the case of a function declared as a compilation unit, the pragma is only allowed after the function declaration and before any subsequent compilation unit. This pragma is not allowed for a function declared with a renaming declaration, and it is not allowed for a generic function (it may be given for a generic instantiation). This pragma permits an Ada function to be called from a program written in another programming language (see the DEC Ada Language Reference Manual, section 13.9a.1.3). 4 EXPORT_OBJECT Takes an internal name denoting an object, and optionally takes an external designator (the name of a linker global symbol) and size option (a linker absolute global symbol that will be defined in the object module-useful on OpenVMS systems only) as arguments. This pragma is only allowed at the place of a declarative item, and must apply to a constant or a variable declared by an earlier declarative item of the same declarative part or package specification; the declaration must occur at the outermost level of a library package specification or body. The object to be exported must have a size that is known at compile time. This pragma is not allowed for objects declared with a renaming declaration, and is not allowed in a generic unit. This pragma permits an Ada object to be referred to by a routine written in another programming language (see the DEC Ada Language Reference Manual, section 13.9a.2.2). 4 EXPORT_PROCEDURE Takes an internal name denoting a procedure, and optionally takes an external designator (the name of a linker global symbol), parameter types, and parameter mechanisms as arguments. This pragma is only allowed at the place of a declarative item, and must apply to a procedure declared by an earlier declarative item of the same declarative part or package specification. In the case of a procedure declared as a compilation unit, the pragma is only allowed after the procedure declaration and before any subsequent compilation unit. This pragma is not allowed for a procedure declared with a renaming declaration, and is not allowed for a generic procedure (it may be given for a generic instantiation). This pragma permits an Ada routine to be called from a program written in another programming language (see the DEC Ada Language Reference Manual, section 13.9a.1.3). 4 EXPORT_VALUED_PROCEDURE Takes an internal name denoting a procedure, and optionally takes an external designator (the name of a linker global symbol), parameter types, and parameter mechanisms as arguments. This pragma is only allowed at the place of a declarative item, and must apply to a procedure declared by an earlier declarative item of the same declarative part or package specification. In the case of a procedure declared as a compilation unit, the pragma is only allowed after the procedure declaration and before any subsequent compilation unit. The first (or only) parameter of the procedure must be of mode . This pragma is not allowed for a procedure declared with a renaming declaration and is not allowed for a generic procedure (it may be given for a generic instantiation). This pragma permits an Ada procedure to behave as a function that both returns a value and causes side effects on its parameters when it is called from a routine written in another programming language (see the DEC Ada Language Reference Manual, section 13.9a.1.3). 4 FLOAT_REPRESENTATION On OpenVMS systems only. On OpenVMS VAX systems, takes VAX_FLOAT as the single argument. On OpenVMS Alpha systems, takes either VAX_FLOAT or IEEE_FLOAT as the single argument; the default is VAX_FLOAT. This pragma is only allowed at the start of a compilation, before the first compilation unit (if any) of the compilation. It specifies the choice of representation to be used for the predefined floating point types in the packages SYSTEM and STANDARD. (see the Compaq Ada Version release notes). 4 IDENT Takes a string literal of 31 or fewer characters as the single argument. The pragma IDENT has the following form: pragma IDENT (string_literal); This pragma is allowed only in the outermost declarative part or declarative items of a compilation unit. The given string is used to identify the object module associated with the compilation unit in which the pragma IDENT occurs. 4 IMPORT_EXCEPTION On VMS systems only. Takes an internal name denoting an exception, and optionally takes an external designator (the name of a linker global symbol), a form (ADA or VMS), and a code (a static integer expression that is interpreted as a condition code) as arguments. A code value is allowed only when the form is VMS (the default if the form is not specified). This pragma is only allowed at the place of a declarative item, and must apply to an exception declared by an earlier declarative item of the same declarative part or package specification; it is not allowed for an exception declared with a renaming declaration. This pragma permits a non- Ada exception (most notably, a OpenVMS condition) to be handled by an Ada program (see the DEC Ada Language Reference Manual, section 13.9a.3.1). 4 IMPORT_FUNCTION Takes an internal name denoting a function, and optionally takes an external designator (the name of a linker global symbol), parameter types, result type, parameter mechanisms, and result mechanism as arguments. On OpenVMS systems, a first optional parameter is also available as an argument. The pragma INTERFACE must be used with this pragma (see the DEC Ada Language Reference Manual, section 13.9). This pragma is only allowed at the place of a declarative item, and must apply to a function declared by an earlier declarative item of the same declarative part or package specification. In the case of a function declared as a compilation unit, the pragma is only allowed after the function declaration and before any subsequent compilation unit. This pragma is allowed for a function declared with a renaming declaration; it is not allowed for a generic function or a generic function instantiation. This pragma permits a non-Ada routine to be used as an Ada function (see the DEC Ada Language Reference Manual, section 13.9a.1.1). 4 IMPORT_OBJECT Takes an internal name denoting an object, and optionally takes an external designator (the name of a linker global symbol) and size (a linker absolute global symbol that will be defined in the object module-useful on OpenVMS systems only) as arguments. This pragma is only allowed at the place of a declarative item, and must apply to a variable declared by an earlier declarative item of the same declarative part or package specification. The variable must have a size that is known at compile time, and it cannot have an initial value. This pragma is not allowed for objects declared with a renaming declaration. This pragma permits storage declared in a non-Ada routine to be referred to by an Ada program (see the DEC Ada Language Reference Manual, section 13.9a.2.1). 4 IMPORT_PROCEDURE Takes an internal name denoting a procedure, and optionally takes an external designator (the name of a linker global symbol), parameter types, and parameter mechanisms as arguments. On OpenVMS systems, a first optional parameter is also available as an argument. The pragma INTERFACE must be used with this pragma (see the DEC Ada Language Reference Manual, section 13.9). This pragma is only allowed at the place of a declarative item, and must apply to a procedure declared by an earlier declarative item of the same declarative part or package specification. In the case of a procedure declared as a compilation unit, the pragma is only allowed after the procedure declaration and before any subsequent compilation unit. This pragma is allowed for a procedure declared with a renaming declaration; it is not allowed for a generic procedure or a generic procedure instantiation. This pragma permits a non-Ada routine to be used as an Ada procedure (see the DEC Ada Language Reference Manual, section 13.9a.1.1). 4 IMPORT_VALUED_PROCEDURE Takes an internal name denoting a procedure, and optionally takes an external designator (the name of a linker global symbol), parameter types, and parameter mechanisms as arguments. On OpenVMS systems, a first optional parameter is also available as an argument. The pragma INTERFACE must be used with this pragma (see the DEC Ada Language Reference Manual, section 13.9). This pragma is only allowed at the place of a declarative item, and must apply to a procedure declared by an earlier declarative item of the same declarative part or package specification. In the case of a procedure declared as a compilation unit, the pragma is only allowed after the procedure declaration and before any subsequent compilation unit. The first (or only) parameter of the procedure must be of mode . This pragma is allowed for a procedure declared with a renaming declaration; it is not allowed for a generic procedure. This pragma permits a non-Ada routine that returns a value and causes side effects on its parameters to be used as an Ada procedure (see the DEC Ada Language Reference Manual, section 13.9a.1.1). 4 INLINE Takes one or more names as arguments; each name is either the name of a subprogram or the name of a generic subprogram. This pragma is only allowed at the place of a declarative item in a declarative part or package specification, or after a library unit in a compilation, but before any subsequent compilation unit. This pragma specifies that the subprogram bodies should be expanded inline at each call whenever possible; in the case of a generic subprogram, the pragma applies to calls of its instantiations (see the DEC Ada Language Reference Manual, section 6.3.2). 4 INLINE_GENERIC Takes one or more names as arguments; each name is either the name of a generic declaration or the name of an instance of a generic declaration. This pragma is only allowed at the place of a declarative item in a declarative part or package specification, or after a library unit in a compilation, but before any subsequent compilation unit. Each argument must be the simple name of a generic subprogram or package, or a (nongeneric) subprogram or package that is an instance of a generic subprogram or package declared by an earlier declarative item of the same declarative part or package specification. This pragma specifies that inline expansion of the generic body is desired for each instantiation of the named generic declarations or of the particular named instances; the pragma does not apply to calls of instances of generic subprograms (see the DEC Ada Language Reference Manual, section 12.1a). 4 INTERFACE Takes a language name and a subprogram name as arguments. This pragma is allowed at the place of a declarative item, and must apply in this case to a subprogram declared by an earlier declarative item of the same declarative part or package specification. This pragma is also allowed for a library unit; in this case the pragma must appear after the subprogram declaration, and before any subsequent compilation unit. This pragma specifies the other language (and thereby the calling conventions) and informs the compiler that an object module will be supplied for the corresponding subprogram (see the DEC Ada Language Reference Manual, section 13.9). In Compaq Ada, the pragma INTERFACE is required in combination with the pragmas IMPORT_FUNCTION, IMPORT_PROCEDURE, and IMPORT_VALUED_ PROCEDURE when any of those pragmas are used (see the DEC Ada Language Reference Manual, section 13.9a.1). 4 INTERFACE_NAME Takes an internal name and an external name as arguments. The internal name may be an Ada simple name that denotes a subprogram or an object. If the declared entity is a function, the internal name may be a string literal that denotes an operator symbol. The external name may be any string literal; the literal is used as a linker global symbol that is associated with the external subprogram or object. This pragma is only allowed at the place of a declarative item, and must apply to an entity declared by an earlier declarative item of the same declarative part or package specification. This pragma can apply to more than one subprogram with the same internal name. In this case, the external name is used for all of the overloaded subprograms. If this pragma applies to a subprogram, then the pragma INTERFACE must also apply (see the DEC Ada Language Reference Manual, section 13.9); a pragma IMPORT_PROCEDURE, IMPORT_FUNCTION, or IMPORT_VALUED_ PROCEDURE cannot be used for the same subprogram named in the pragma INTERFACE_NAME; if a subprogram has been declared as a compilation unit, the pragma is only allowed after the subprogram declaration and before any subsequent compilation unit. This pragma can be used for subprograms declared with a renaming declaration. This pragma cannot be used for a generic subprogram or a generic subprogram instantiation. If the pragma applies to an object, then the size of the object must be known at compile time; a pragma IMPORT_OBJECT, EXPORT_OBJECT, PSECT_OBJECT, or COMMON_OBJECT cannot be used for the same object; an address clause and this pragma cannot both apply to an object; the object must not be declared with a renaming declaration; the object cannot be a constant or require implicit initialization. This pragma associates an external symbol with the internal Ada name for a subprogram or object (see the Compaq Ada Version release notes). 4 LIST Takes one of the identifiers ON or OFF as the single argument. This pragma is allowed anywhere a pragma is allowed. It specifies that listing of the compilation is to be continued or suspended until a LIST pragma with the opposite argument is given within the same compilation. The pragma itself is always listed if the compiler is producing a listing. 4 LONG_FLOAT On OpenVMS systems only. Also, the value of the pragma FLOAT_ REPRESENTATION must be VAX_FLOAT. Takes either D_FLOAT or G_FLOAT as the single argument. The default is G_FLOAT. This pragma is only allowed at the start of a compilation, before the first compilation unit (if any) of the compilation. It specifies the choice of representation to be used for the predefined type LONG_FLOAT in the package STANDARD, and for floating point type declarations with specified in the range 7 .. 15 (see the DEC Ada Language Reference Manual, section 3.5.7a). 4 MAIN_STORAGE On OpenVMS VAX systems only. Takes one or two nonnegative static simple expressions of some integer type as arguments. This pragma is only allowed in the outermost declarative part of a library subprogram; at most one such pragma is allowed in a library subprogram. It has an effect only when the subprogram to which it applies is used as a main program. This pragma causes a fixed-size stack to be created for a main task (the task associated with a main program), and determines the number of storage units (bytes) to be allocated for the stack working storage area or guard pages or both. The value specified for either or both the working storage area and guard pages is rounded up to an integral number of pages. A value of zero for the working storage area results in the use of a default size; a value of zero for the guard pages results in no guard storage. A negative value for either working storage or guard pages causes the pragma to be ignored (see the DEC Ada Language Reference Manual, section 13.2b). 4 MEMORY_SIZE Takes a numeric literal as the single argument. This pragma is only allowed at the start of a compilation, before the first compilation unit (if any) of the compilation. The effect of this pragma is to use the value of the specified numeric literal for the definition of the named number MEMORY_SIZE (see the DEC Ada Language Reference Manual, section 13.7). 4 OPTIMIZE Takes one of the identifiers TIME or SPACE as the single argument. This pragma is only allowed within a declarative part and it applies to the block or body enclosing the declarative part. It specifies whether time or space is the primary optimization criterion. In Compaq Ada, this pragma is only allowed immediately within a declarative part of a body declaration. 4 PACK Takes the simple name of a record or array type as the single argument. The allowed positions for this pragma, and the restrictions on the named type, are governed by the same rules as for a representation clause. The pragma specifies that storage minimization should be the main criterion when selecting the representation of the given type (see the DEC Ada Language Reference Manual, section 13.1). 4 PAGE This pragma has no argument, and is allowed anywhere a pragma is allowed. It specifies that the program text which follows the pragma should start on a new page (if the compiler is currently producing a listing). 4 PRIORITY Takes a static expression of the predefined integer subtype PRIORITY as the single argument. This pragma is only allowed within the specification of a task unit or immediately within the outermost declarative part of a main program. It specifies the priority of the task (or tasks of the task type) or the priority of the main program (see the DEC Ada Language Reference Manual, section 9.8). 4 PSECT_OBJECT On OpenVMS systems only. Has the same syntax and the same effect as the pragma COMMON_ OBJECT (see the DEC Ada Language Reference Manual, section 13.9a.2.3). 4 SHARED Takes the simple name of a variable as the single argument. This pragma is allowed only for a variable declared by an object declaration and whose type is a scalar or access type; the variable declaration and the pragma must both occur (in this order) immediately within the same declarative part or package specification. This pragma specifies that every read or update of the variable is a synchronization point for that variable. An implementation must restrict the objects for which this pragma is allowed to objects for which each of direct reading and direct updating is implemented as an indivisible operation (see the DEC Ada Language Reference Manual, section 9.11). 4 SHARE_GENERIC On OpenVMS systems only. Takes one or more names as arguments; each name is either the name of a generic declaration or the name of an instance of a generic declaration. This pragma is only allowed at the place of a declarative item in a declarative part or package specification, or after a library unit in a compilation, but before any subsequent compilation unit. Each argument either must be the simple name of a generic subprogram or package, or it must be a (nongeneric) subprogram or package that is an instance of a generic subprogram or package. If the argument is an instance of a generic subprogram or package, then it must be declared by an earlier declarative item of the same declarative part or package specification. This pragma specifies that generic code sharing is desired for each instantiation of the named generic declarations or of the particular named instances (see the DEC Ada Language Reference Manual, section 12.1b). 4 STORAGE_UNIT Takes a numeric literal as the single argument. This pragma is only allowed at the start of a compilation, before the first compilation unit (if any) of the compilation. The effect of this pragma is to use the value of the specified numeric literal for the definition of the named number STORAGE_UNIT (see the DEC Ada Language Reference Manual, section 13.7). In Compaq Ada, the only argument allowed for this pragma is 8 (bits). 4 SUPPRESS Takes as arguments the identifier of a check and optionally also the name of either an object, a type or subtype, a subprogram, a task unit, or a generic unit. This pragma is only allowed either immediately within a declarative part or immediately within a package specification. In the latter case, the only allowed form is with a name that denotes an entity (or several overloaded subprograms) declared immediately within the package specification. The permission to omit the given check extends from the place of the pragma to the end of the declarative region associated with the innermost enclosing block statement or program unit. For a pragma given in a package specification, the permission extends to the end of the scope of the named entity. If the pragma includes a name, the permission to omit the given check is further restricted: it is given only for operations on the named object or on all objects of the base type of a named type or subtype; for calls of a named subprogram; for activations of tasks of the named task type; or for instantiations of the given generic unit (see the DEC Ada Language Reference Manual, section 11.7). 4 SUPPRESS_ALL This pragma has no argument and is only allowed following a compilation unit. This pragma specifies that all run-time checks in the unit are suppressed (see the DEC Ada Language Reference Manual, section 11.7). 4 SYSTEM_NAME Takes an enumeration literal as the single argument. This pragma is only allowed at the start of a compilation, before the first compilation unit (if any) of the compilation. The effect of this pragma is to use the enumeration literal with the specified identifier for the definition of the constant SYSTEM_NAME. This pragma is only allowed if the specified identifier corresponds to one of the literals of the type NAME declared in the package SYSTEM (see the DEC Ada Language Reference Manual, section 13.7). 4 TASK_STORAGE Takes the simple name of a task type and a static expression of some integer type as arguments. This pragma is allowed anywhere that a task storage specification is allowed; that is, the declaration of the task type to which the pragma applies and the pragma must both occur (in this order) immediately within the same declarative part, package specification, or task specification. The effect of this pragma is to use the value of the expression as the number of storage units (bytes) to be allocated as guard storage. The value is rounded up to an appropriate boundary. A negative value causes the pragma to be ignored. A zero value has system-specific results: on OpenVMS VAX systems, a value of zero results in no guard storage; on OpenVMS Alpha and ULTRIX systems, a value of zero results in a minimal guard area (see the DEC Ada Language Reference Manual, section 13.2a). 4 TIME_SLICE On OpenVMS systems only. Takes a static expression of the predefined fixed point type DURATION (in the package STANDARD) as the single argument. This pragma is only allowed in the outermost declarative part of a library subprogram, and at most one such pragma is allowed in a library subprogram. It has an effect only when the subprogram to which it applies is used as a main program. This pragma causes the task scheduler to turn time slicing on or off and, on some systems, to limit the amount of continuous execution time given to a task (see the DEC Ada Language Reference Manual, section 9.8a; see also the appropriate run-time reference manual for implementation differences across systems). 4 TITLE Takes a title or a subtitle string, or both, as arguments. The pragma TITLE has the following form: pragma TITLE (titling-option [,titling-option]); titling-option := [TITLE =>] string_literal | [SUBTITLE =>] string_literal This pragma is allowed anywhere a pragma is allowed; the given strings supersede the default title and/or subtitle portions of a compilation listing. 4 VOLATILE Takes the simple name of a variable as the single argument. This pragma is only allowed for a variable declared by an object declaration. The variable declaration and the pragma must both occur (in this order) immediately within the same declarative part or package specification. The pragma must appear before any occurrence of the name of the variable other than in an address clause or in one of the Compaq Ada pragmas IMPORT_OBJECT, EXPORT_ OBJECT, COMMON_OBJECT, or PSECT_OBJECT. The variable cannot be declared by a renaming declaration. The pragma VOLATILE specifies that the variable may be modified asynchronously. This pragma instructs the compiler to obtain the value of a variable from memory each time it is used (see the DEC Ada Language Reference Manual, section 9.11). 2 Release_Notes You can obtain the Compaq Ada release notes by typing or printing the following file: SYS$HELP:ADAvvp.RELEASE_NOTES In the filename, "vv" and "p" are the major and minor version numbers of the product. For example, Version 3.0 would be "030". To get a list of all available Compaq Ada release notes, enter the following command: $ DIRECTORY SYS$HELP:ADA*.RELEASE_NOTES* Postscript format is in .RELEASE_NOTES_PS files. 2 Error_Messages Compaq Ada error messages come from three sources: the compiler, the program library manager (ACS), and the Compaq Ada run-time library. For the most part, the Compaq Ada error messages are self-explanatory. Those messages that need more explanation are documented here. For a description of the format for error messages, see Developing Ada Programs on OpenVMS Systems. 3 Run_Time_Messages 4 ALICOLILL Requested alignment for a collection is illegal Fatal: The Compaq Ada run-time library was asked to allocate a collection on a storage boundary that is not supported by the dynamic memory allocation routines (LIB$GET_VM). The most likely cause of this error is an erroneous value specified on an alignment clause. User Action: Check the value specified for the alignment clause. See also PROGRAM_ERROR. 4 ALREADY_OPEN File is already open Fatal: See also STATUS_ERROR. 4 AMBKEYFORM Ambiguous keyword in FORM parameter Informational: A keyword in the FORM parameter of a CREATE or OPEN operation has not been specified with enough characters to distinguish it from another keyword acceptable in this context. Note that VAXELN Ada accepts FORM parameter values that are different from OpenVMS RMS File Definition Language (FDL) statements. User Action: Replace the keyword, specifying enough characters to make it unique. 4 ASTDELTER An AST was delivered, but the task is terminated Fatal: In Compaq Ada, asynchronous system traps (ASTs) are handled by using the AST_ENTRY pragma and attribute to transform the delivery of an AST into a special kind of entry call. In this case, the task entry to which the AST was delivered belongs to a terminated task. Note that this situation cannot be detected in all cases. In particular, it cannot be detected if the immediate master upon which the task depends has also terminated. This error raises an exception declared by the Compaq Ada run-time library. Because there is no reasonable exception handler for this case, the exception is allowed to propagate so that it can produce a traceback, or so that you can diagnose the error if you are executing the program under the control of the debugger. User Action: Determine why a task that was to receive an AST entry call was terminated when the AST was delivered. See also PROGRAM_ERROR. 4 ASTNOTCAL The task named in an AST_ENTRY attribute is not callable Fatal: The AST_ENTRY attribute was invoked for an entry in a task that is completed and therefore cannot receive the AST. User Action: Keep the task from becoming completed or do not use the AST_ENTRY attribute on an entry of a completed task. See also PROGRAM_ERROR. 4 ASTPKTQUO The AST packet pool has been exhausted Fatal: The pool of space from which the Compaq Ada run-time library allocates AST packets for the AST_ENTRY attribute has been exhausted. The ASTs being delivered are not accepted quickly enough by the task entries that have been designated to handle them. User Action: Make tasks receiving AST entry calls accept the entries more rapidly, perhaps by raising the priority of such tasks. You can also increase the pool of space from which AST packets are allocated by calling the Compaq Ada run-time library routine SYSTEM_RUNTIME_TUNING.EXPAND_AST_PACKET_POOL. See also PROGRAM_ERROR. 4 ATTUNWREN An attempt was made to unwind a rendezvous in progress Fatal: The condition handler that was established by the DEC Ada run-time library to monitor exceptions propagating from a rendezvous between tasks has been called with the SS$_UNWIND condition, but the rendezvous is still in progress. The Compaq Ada run-time library cannot signal this error because signaling during an unwind is forbidden by the OpenVMS operating system. The program is forced to exit after displaying this error message. User Action: The most likely cause of this error is an error in a call to the OpenVMS SYS$UNWIND system service during the rendezvous. Check any non-Ada code called by the accepting task to determine if one of its handlers is requesting too deep an unwind. See also PROGRAM_ERROR. 4 ATTUNWTAS Attempting to unwind the first stack frame of a task Fatal: The first frame of a task is created by the Compaq Ada run- time library and is not normally unwound (that is, it is never removed from the stack using the OpenVMS SYS$UNWIND system service). This error condition is raised if the SYS$UNWIND system service is called to unwind this frame. The Compaq Ada run-time library cannot signal this error because signaling during an unwind is forbidden by the OpenVMS operating system. The program is forced to exit after displaying the error message. User Action: The most likely cause of this error is an error in a call to the OpenVMS SYS$UNWIND system service. Check any non-Ada code called by the task to determine if one of its handlers is requesting too deep an unwind. See also PROGRAM_ERROR. 4 CONSTRAINT_ERRO CONSTRAINT_ERROR Fatal: This predefined exception is raised upon an attempt to violate a range constraint, an index constraint, or a discriminant constraint; upon an attempt to use a record component that does not exist for the current discriminant values; or upon an attempt to use a selected component, an indexed component, a slice, or an attribute of an object designated by an access value, if the object does not exist because the access value is null. In response to Ada interpretation AI-00387, Compaq Ada also raises this exception for integer overflow, floating-point overflow, and integer and floating-point division by zero. This exception is not raised by floating-point underflow (floating-point underflow is not defined as an exception in Compaq Ada); underflow can be handled as an imported condition. 4 DATA_ERROR DATA_ERROR Fatal: This predefined exception is raised by a TEXT_IO GET procedure if the input character sequence fails to satisfy the required syntax, or if the value input does not belong to the range of the required type or subtype. This exception may also be raised in any input operation (using any of the input-output packages) that would result in overflowing the item being written to. 4 DEVICE_ERROR DEVICE_ERROR Fatal: This predefined exception is never raised by Compaq Ada. See also USE_ERROR. 4 DURNOTRAN Computed duration is not in the range of the type DURATION Fatal: See also TIME_ERROR. 4 END_ERROR END_ERROR Fatal: This predefined exception is raised by an attempt to skip (read past) the end of a file. 4 ERRONEOUS Program is erroneous Fatal: An inconsistency was detected at run time that indicates that the program is erroneous. Appended messages give more information about the error. User Action: Follow the recommendations given by the appended messages. 4 EXCCOP Exception was copied at a raise or accept statement Fatal: This is the first in a series of exception messages that are issued when an exception (signal argument list) has been copied. Exception copying occurs at a raise statement without an exception name, or when an exception is propagating out of a rendezvous into the calling task. Compaq Ada ignores this first message when matching the exception to a choice in an exception handler. The purpose of this message is to prevent non-Ada condition handlers from mishandling the copied exception. 4 EXCCOPLOS Exception was copied at a raise or accept statement, but some details were lost Fatal: This is the first message in a series of exception messages that are issued when an exception (signal argument list) has been copied and some detailed information has been lost. Exception copying occurs at a raise statement without an exception name, or when an exception is propagating out of a rendezvous into the calling task. The lost information in the exception messages was replaced by zeros (that is, some FAO arguments were zeroed) to avoid copying a pointer into a stack that no longer exists. Compaq Ada ignores this first message when matching the exception to a choice in an exception handler. The purpose of this message is to prevent non-Ada condition handlers from mishandling the copied exception. 4 EXCDUREXC An exception occurred in the Compaq Ada run-time library while handling an exception Fatal: An exception was propagated out of the first frame of a task or the main program while the task or main program was already in the process of terminating because of a prior exception. Because there is no reasonable exception handler for this case, the exception is allowed to propagate so that it can produce a traceback, or so that you can diagnose the error if you are executing the program under the control of the debugger. User Action: The most likely cause of this error is that the stack has overflowed and the overflow was not detected. Use the debugger to determine what caused the original exception that caused the task or main program to become terminated. Eliminating this exception is likely to also eliminate the exception during exception handling. Also, try enabling Ada checks to detect the error sooner. See also PROGRAM_ERROR. 4 EXCEPTION Exception ident Fatal: An exception that was declared in an exception declaration located somewhere in the Ada program was raised. 4 EXISTENCE_ERROR The element does not exist Fatal: This predefined exception is raised when the element to be read cannot be found in a relative or indexed file during the execution of a READ or READ_EXISTING procedure. 4 FAC_MODE_MISMAT The file access does not allow the new mode Informational: The file access attributes specified for the file do not match the mode desired for the file in a CREATE, OPEN, or RESET operation. See also USE_ERROR. 4 FAIMODTIM Unable to modify time-slice setting Fatal: An error occurred when the Compaq Ada run-time library was calling a system service to set up time slicing. The most likely cause is that the system AST quota has been exceeded. Appended messages give more information on the error. User Action: Observe the appended message to determine why the system service failed. See also PROGRAM_ERROR. 4 FAISETTIM Unable to request another time-slice AST Fatal: The error occurred when the Compaq Ada run-time library called the OpenVMS SYS$SETIMR system service to schedule the next time-slice AST. An appended message gives the reason for the error. See also PROGRAM_ERROR. User Action: Examine the appended message to determine why the OpenVMS SYS$SETIMR system service failed. If it failed because of an exceeded quota (SS$_EXQUOTA), then the most likely cause of this error is that the value of your process's AST queue limit (ASTLM) parameter was exceeded. Determine if your program has generated many ASTs while AST delivery has been disabled by a call to the OpenVMS SYS$SETAST system service. If there are no such program errors, then ask your system manager to increase the value of your ASTLM parameter (a UAF parameter). Then try your program again. See the description of SYS$SETIMR in the OpenVMS System Services Reference Manual for additional situations that can cause a status of SS$_EXQUOTA to be returned. 4 FATINTERR Fatal internal error in the Compaq Ada run-time library Fatal: User Action: Submit a Software Performance Report (SPR) to Digital, including a machine-readable copy of your program, data, and a sample execution showing the problem. 4 INSSPAALL Insufficient space to allocate from a collection Fatal: An explicit (or implicit) allocator cannot allocate from a collection. See also STORAGE_ERROR. 4 INSSPACOL Insufficient space to create a collection Fatal: See also STORAGE_ERROR. 4 INSSPATAS Insufficient space to create a task Fatal: See also STORAGE_ERROR. 4 INTDATCOR Internal data in the Compaq Ada run-time library is corrupted Fatal: The data corruption may have been caused by a Compaq Ada error or by your program. User Action: If you cannot determine the source of the error, please submit a Software Performance Report (SPR) to Digital, including a machine-readable copy of your program, data, and a sample execution showing the problem. See also PROGRAM_ERROR. 4 INVVALFORM Invalid attribute value in FORM parameter Informational: The FORM parameter of a CREATE or OPEN operation contains an attribute value that is not legal for the attribute's keyword. Note that VAXELN Ada accepts FORM parameter values that are different from OpenVMS RMS File Definition Language (FDL) statements. User Action: Either the keyword or its attribute's value is incorrect. Replace the invalid attribute value with a legal value, or replace the attribute's keyword with one for which the attribute's value is legal. 4 KEYSIZERR Size of the key is not a multiple of 8 bits Fatal: A read operation from an indexed file has specified a key that is not a multiple of 8 bits. See also KEY_ERROR. 4 KEY_ERROR Key is inappropriate for the file Fatal: This predefined exception is raised in an indexed file if the key has been changed or duplicated and changes or duplicates are not permitted. This exception is also raised if a read operation from an indexed file has specified a key that is not a multiple of 8 bits. 4 KEY_MISMATCH The file key does not match the key value specified in the FORM parameter Informational: The OPEN operation has detected that the key specification asserted in the FORM string does not match the key specification of the file being opened. See also USE_ERROR. 4 LAYOUT_ERROR LAYOUT_ERROR Fatal: This predefined exception is raised by the TEXT_IO COL, LINE, or PAGE operations if the value returned exceeds COUNT'LAST; on output by an attempt to set column or line numbers in excess of specified maximum line or page lengths, respectively (excluding the unbounded cases); by an attempt to write too many characters to a string with a PUT procedure; and in item operations of the mixed input-output packages when a GET_ITEM or PUT_ITEM operation results in reading or writing beyond the file buffer. 4 LINEXCMRS Line will exceed external file's maximum record size Informational: The TEXT_IO operation will overflow the maximum record size of the external file. See also USE_ERROR. 4 LOCK_ERROR The element is locked Fatal: This predefined exception is raised by a READ or READ_ EXISTING procedure if the result is a locked record error in a relative or indexed file. 4 MAXLINEXC Maximum line length exceeded Informational: The line length specified by the TEXT_IO.SET_LINE_ LENGTH procedure exceeds the maximum record size of the file. See also USE_ERROR. 4 MISKEYFORM Missing or unrecognized keyword in FORM parameter Informational: The FORM parameter of a CREATE or OPEN procedure contains an illegal keyword value. Note that VAXELN Ada accepts FORM parameter values that are different from OpenVMS RMS File Definition Language (FDL) statements. User Action: Supply the missing keyword or correct the illegal keyword. 4 MODE_ERROR MODE_ERROR Fatal: This predefined exception is raised by an attempt to read from, or test for the end of, a file whose current mode is OUT_ FILE, and also by an attempt to write to a file whose current mode is IN_FILE. In the case of TEXT_IO operations, the exception MODE_ERROR is also raised by specifying a file whose current mode is OUT_FILE in a call of SET_INPUT, SKIP_LINE, END_OF_LINE, SKIP_ PAGE, or END_OF_PAGE; and by specifying a file whose current mode is IN_FILE in a call of SET_OUTPUT, SET_LINE_LENGTH, SET_PAGE_ LENGTH, LINE_LENGTH, PAGE_LENGTH, NEW_LINE, or NEW_PAGE. 4 MRN_MISMATCH The file maximum record number does not match the maximum record number specified in the FORM parameter Informational: The OPEN operation has detected that the maximum record number asserted in the FORM parameter does not match the maximum record number of the file being opened. See also USE_ ERROR. 4 MRS_MISMATCH The file maximum record size does not match the maximum record size specified in the FORM parameter Informational: The OPEN operation has detected that the maximum record size asserted in the FORM parameter does not match the maximum record size of the file being opened. See also USE_ERROR. 4 NAME_ERROR NAME_ERROR Fatal: This predefined exception is raised by a call of a CREATE or OPEN procedure if the string given for the parameter NAME does not identify an external file. For example, this exception is raised if the string is improper, or, alternatively, if either none or more than one external file corresponds to the string. 4 NON_ADA_ERROR NON_ADA_ERROR Fatal: This exception is declared in the package SYSTEM. When used as a choice in an Ada exception part, NON_ADA_ERROR matches itself or any VMS (that is, non-Ada) exception that is not treated as being equivalent to an Ada predefined exception. It allows the treatment of non-Ada conditions as a special subclass of Ada exceptions. 4 NOTASTLEV Name cannot be called at AST level Fatal: User Action: Modify your program so that the specified operation is no longer called from an AST service routine. See also PROGRAM_ERROR. 4 NOT_OPEN File is not open Fatal: See also STATUS_ERROR. 4 NUMERIC_ERROR NUMERIC_ERROR Fatal: In response to Ada interpretation AI-00387, Compaq Ada raises NUMERIC_ERROR only when it is explicitly raised with a raise statement. Wherever the Ada language standard requires that NUMERIC_ERROR be raised, CONSTRAINT_ERROR is raised instead. 4 ORG_MISMATCH The file organization does not match the organization specified in the FORM parameter Informational: The OPEN operation has detected that the OpenVMS RMS organization asserted in the FORM parameter does not match the organization of the file being opened. See also USE_ERROR. 4 PACNUMILL Illegal number of AST packets was requested Fatal: The number of AST packets requested by the SYSTEM_RUNTIME_ TUNING.EXPAND_AST_PACKET_POOL procedure is either less than zero or, when added to the number of existing AST packets, exceeds the number of AST packets allowed by the Compaq Ada run-time library. User Action: Modify your program to pass a correct value to the SYSTEM_RUNTIME_TUNING.EXPAND_AST_PACKET_POOL procedure. If you need more than the current limit of AST packets then make tasks receiving AST entry calls accept them more rapidly, perhaps by raising the priority of such tasks. See also PROGRAM_ERROR. 4 PROGRAM_ERROR PROGRAM_ERROR Fatal: This predefined exception is raised upon an attempt to call a subprogram, to activate a task, or to elaborate a generic instantiation, if the body of the corresponding unit has not yet been elaborated. This exception is also raised if the end of a function is reached; or during the execution of a selective wait that has no else part, if this execution determines that all alternatives are closed. Finally, this exception may be raised upon an attempt to execute an action that is erroneous. Additional messages are sometimes appended to this exception to further identify the reason why it was raised. 4 RAT_MISMATCH The file record attribute does not match the record attribute specified in the FORM parameter Informational: The OPEN operation has detected that the record attribute asserted in the FORM parameter does not match the record attribute of the file being opened. See also USE_ERROR. 4 RECNOTPOS Program is erroneous, error recovery by exception handling is not possible Fatal: An error that cannot be corrected by an Ada exception handler has been detected at run time. Either there is no appropriate handler or the error condition would remain after the exception was handled. The program is presumed to be erroneous. Typically, the cause of such an error is that the program has become corrupted because it suppresses Ada checking, it misuses the AST_ENTRY attribute, or because it improperly uses imported non-Ada subprograms (such as system services). Appended messages give more information about the error. User Action: Determine from the appended messages what the program did to cause the Compaq Ada run-time library to fail. Also, try enabling checking in the Ada program, and carefully investigate the use of imported subprograms and the AST_ENTRY attribute. See also PROGRAM_ERROR. 4 RFM_MISMATCH The file record format does not match the record format specified in the FORM parameter Informational: The OPEN operation has detected that the record format asserted in the FORM parameter does not match the record format of the file being opened. See also USE_ERROR. 4 SELALTCLS All select alternatives are closed and there is no else part Fatal: See also PROGRAM_ERROR. 4 SIGVECIMP Signal vector is improperly formatted-one or more FAO arguments are missing Fatal: While copying an exception, the Compaq Ada run-time library has detected that the signal arguments are improperly formatted. Most likely an FAO argument count is incorrect. If you cannot determine the source of the error, submit a Software Performance Report (SPR) to Digital, including a machine-readable copy of your program, data, and a sample execution showing the problem. 4 SIZCOLCRE Attempting to get the size of a collection before its creation Fatal: This error can occur when you use the 'STORAGE_SIZE attribute to obtain the size of a collection for an access type whose designated type is an incomplete type, and the corresponding full type declaration is not in the same compilation unit. User Action: Try obtaining the collection size after the full type declaration has been elaborated. See also PROGRAM_ERROR. 4 STAOVF Attempted stack overflow was detected Fatal: See also STORAGE_ERROR. 4 STATUS_ERROR STATUS_ERROR Fatal: This predefined exception is raised by an attempt to operate upon a file that is not open, and by an attempt to open a file that is already open. 4 STORAGE_ERROR STORAGE_ERROR Fatal: This predefined exception is raised in any of the following situations: when the dynamic storage allocated to a task is exceeded; during the evaluation of an allocator, if the space available for the collection of allocated objects is exhausted; or during the elaboration of a declarative item, or the execution of a subprogram call, if storage is not sufficient. Appended messages give more information about the error. User Action: Typically, two situations raise this exception: the program has no more free virtual pages for any allocations, or an attempt was made to exceed the amount of storage specified in a length clause (in other words, the value specified for T'STORAGE_ SIZE was exceeded). In the first situation, see if the program has an error that causes a large number of allocators to be evaluated; for example, an infinite loop containing allocator evaluations. If the program has no error, ask your system manager to consider increasing the value of the SYSGEN VIRTUALPAGECNT parameter (maximum number of virtual pages parameter) on your system. In the second situation, consider changing the value of a task or access type length clause STORAGE_SIZE attribute designator. Use the appended message to further determine the reason for the exception. 4 STOSIZILL Requested value of STORAGE_SIZE for a collection is illegal Fatal: Typically, this error can occur if the program specifies an illegal value for a length clause STORAGE_SIZE attribute designator, and compiler checks have been suppressed so that the illegal value is not detected at compile time. User Action: Check the STORAGE_SIZE value for the appropriate access type. Try recompiling the program (or compilation unit) with checking enabled. See also PROGRAM_ERROR. 4 SUBNOTELA The body of the called subprogram has not yet been elaborated Fatal: See also PROGRAM_ERROR. 4 SYNERRFORM Syntax error in FORM parameter Informational: The FORM parameter of a CREATE or OPEN procedure cannot be parsed because it contains a syntax error. Note that VAXELN Ada accepts FORM parameter values that are different from OpenVMS RMS File Definition Language (FDL) statements. User Action: Correct the syntax error in the FORM parameter. 4 TASCOMACT A task completed during its activation Fatal: See also TASKING_ERROR. 4 TASKING_ERROR TASKING_ERROR Fatal: This predefined exception is raised when exceptions arise during intertask communication. Appended messages give more information about the error. 4 TASNOTCAL The task named on an entry call is not callable Fatal: See also TASKING_ERROR. 4 TASNOTELA A task's body was not elaborated before its activation Fatal: See also TASKING_ERROR. 4 TASSTOSMA Requested STORAGE_SIZE for a task is illegal Fatal: User Action: Typically, this error can occur if the program specifies an illegal value for a length clause STORAGE_SIZE attribute designator, and compiler checks have been suppressed so that the illegal value is not detected at compile time. Check the STORAGE_SIZE value for the appropriate task type. Try recompiling the program (or compilation unit) with checking enabled. See also PROGRAM_ERROR. 4 TASTERAST A task is terminating with an AST pending Fatal: A task that should have waited for an AST to be delivered is terminating. This situation is erroneous because the task's stack must not be deallocated (as it would be at task termination) while a system service is possibly accessing the stack. User Action: Determine why the task that was to wait for an AST is terminating. Use the debugger to determine if the task is being terminated because of an exception. See also PROGRAM_ERROR. 4 TIMERFAIL Insufficient quota for call to SYS$SETIMR at delay statement Fatal: A status of SS$_EXQUOTA was returned by the OpenVMS SYS$SETIMR system service when it was called by the Compaq Ada run- time library as part of its implementation of a delay statement. User Action: The most likely cause of this error is that the value of your process's AST queue limit (ASTLM) parameter was exceeded. Determine if your program has generated many ASTs while AST delivery has been disabled by a call to the OpenVMS SYS$SETAST system service. If there are no such program errors, then ask your system manager to increase the value of your ASTLM parameter (a UAF parameter). Then try your program again. See the description of SYS$SETIMR in the OpenVMS System Services Reference Manual for additional situations that can cause a status of SS$_EXQUOTA to be returned. See also PROGRAM_ERROR. 4 TIME_ERROR TIME_ERROR Fatal: This predefined exception can be raised by the TIME_OF, "+", and "-" operations in the predefined package CALENDAR. 4 TIMPARNOT TIME_OF parameters do not form a proper date Fatal: See also TIME_ERROR. 4 TOOMANENT Task type has too many entries Fatal: The total number of entries (including members in entry families) for some task type exceeds the value of the constant MAX_INT declared in the package SYSTEM. User Action: Reduce the total number of entries, including entry family members. Perhaps move some of the entries to a different task type. See also PROGRAM_ERROR. 4 UNLCKNOTOWN A task tried to unlock the global lock without first locking it Fatal: A task routine in package SYNCHRONIZE_NONREENTRANT_ACCESS tried to unlock the global lock without having first locked it. User Action: Check the source code for the task to determine why it is trying to unlock the global lock when it does not have it locked. See also PROGRAM_ERROR. 4 UNSUPPORTED The input-output package does not support the intended operation Informational: For example, some input-output packages support only certain RMS file organizations. See also USE_ERROR. 4 USE_ERROR USE_ERROR Fatal: This predefined exception is raised when an attempted operation is not possible for reasons that depend on characteristics of the external file. For example, this exception can be raised by a CREATE procedure, if the given mode is OUT_ FILE, but the form parameter specifies an input only device. 4 YEANOTRAN Computed year is not in the range of subtype YEAR_NUMBER Fatal: The subtype YEAR_NUMBER is declared in the package CALENDAR. See also CONSTRAINT_ERROR, PROGRAM_ERROR, and TIME_ ERROR. 4 ZONECORR The "zone" used to implement the collection for the object being allocated or deallocated has been corrupted Fatal: The Compaq Ada run-time library implements collections using the OpenVMS Run-Time Library LIB$ memory allocation operations. In particular, Ada collections are implemented as zones. This error code is returned when LIB$GET_VM or LIB$FREE_VM fails because the zone from which the object is being allocated or deallocated has been corrupted. User Action: Make sure that your program is not corrupting the zone. For example, be sure that your program is not calling an instantiation of the generic procedure UNCHECKED_DEALLOCATION to deallocate an object that has already been deallocated. One way this can happen is when two access variables designate the same object, and an instantiation of UNCHECKED_DEALLOCATION is called twice, once for each access variable. Also, if your program is written in more than one language, make sure your program is not allocating an object in one language and deallocating it in another. In addition, ensure that your program has not disabled array indexing checks; writing at random memory addresses can also cause the heap to become corrupted. See also PROGRAM_ERROR. 3 Other_Messages 4 CHOICE_OVERLAP* Choice value_or_range overlaps another choice for value_or_range source_location Error: The given value or range overlaps with the value or range of another choice of the same case statement, variant part, or aggregate. There are multiple variations of this message depending on whether each of the overlapping choices is a single value or range of values, and whether the overlap is a single value or a range of values. If the overlap occurs within the choices of a single alternative (separated by vertical bars (|)), then the source location is given as "in this same sequence." Otherwise, appropriate variants of the message occur twice: as an informational message on the first of the overlapping pair of choices, and as an error message on the second of the pair of choices. 4 CL_COMPLETE Instantiations within the following units need to be completed (use ACS COMPILE or ACS RECOMPILE): Informational: Incomplete generic instantiations must be completed before you can link a program that contains such instantiations. An incomplete generic instantiation can occur if the body or subunits or the body for the corresponding generic unit are not available when the instantiation of the generic is compiled or if the generic body is compiled or recompiled after the unit containing the instantiation is compiled. 4 CL_ERROPELIB1 Error opening program library directory_specification Error: Either the library index file (ADALIB.ALB) or the library version control file (ADA$LIB.DAT) or both are not accessible or the VMS directory containing the program library is not specified correctly or not accessible 4 CL_SECCONFAI Multiple connections to the compilation library file_ specification failed Error: The Compaq Ada program library manager may open the program library more than once for any operation. This message is most likely given when accessing a program library over DECnet. Usually, the cause of the problem is that the node containing the library is not accepting any more links. 4 CL_SECOPNFAI Multiple opens of the compilation library file_specification failed Error: The Compaq Ada program library manager may open the program library more than once for any operation. This message is most likely given when accessing a program library over DECnet. Usually, the cause of the problem is that the node containing the library is not accepting any more links. 4 CL_SYSLIBMIS Program library directory_specification specifies a target that is not supported (SYSTEM.SYSTEM_NAME set to name) by the current compiler version (version-number) Error: Either use the compiler or program library manager that supports the specified target or redefine the value of the system characteristic SYSTEM_NAME to specify a supported target. You can redefine SYSTEM.SYSTEM_NAME by compiling the pragma SYSTEM_NAME or by entering the ACS SET PRAGMA/SYSTEM_NAME command 4 SUPP* Possible_meaning Informational - supplemental: Following detection of an error in overload resolution for a choice, expression, name, or subtype indication, a series of supplementary messages report the possible meanings that were considered for each component, presented in left-to-right order. There are multiple variations of this message, depending on the nature of the component (identifier, parentheses, attribute, and so on), on the number of possible meanings (none, one, or multiple), and on the kind of each meaning (valued entity, nonvalued entity, call of user function or predefined operator, and so on). A possible meaning that was determined to be inconsistent with its use in context is noted as "(discarded)" at the end of its description. 2 Ada_Interpretation_Summaries Under the rules of the American National Standards Institute (ANSI), the Ada Joint Program Office (AJPO) of the United States Department of Defense, as the sponsor of the United States Ada language standard, is responsible for the ongoing maintenance and interpretation of that standard. Under the rules of the International Standards Organization (ISO), ISO-IEC/JTC1/SC22/WG9 (WG9) is responsible for the development and ongoing maintenance and interpretation of the international Ada language standard, coordination with related standards, and so on. Under WG9, an Ada Rapporteur Group (ARG) has been formed to make recommendations on maintenance and interpretation of the standard to WG9. Both the ANSI (AJPO) and ISO (WG9/ARG) groups coordinate their efforts, and, in particular, seek to retain Ada's strength as an internationally single standard and to avoid any divergence in the interpretation of the ISO and ANSI Ada language standards. A number of language interpretations (called Ada commentaries) have been made (or recommended) between publication of the standards and the publication of the current version of the DEC Ada Language Reference Manual. These commentaries have been coordinated between, and are endorsed by, both the ANSI and ISO groups. The summary part of each commentary is presented here for convenience. For information on how to obtain the full text of the commentaries, contact the AJPO (see the Postscript at the end of the DEC Ada Language Reference Manual for the mailing address), the WG9, or the Ada Information Clearinghouse (AdaIC). The Ada Information Clearinghouse is operated by the IIT Research Institute for the AJPO. Its post office mailing addresses and phone numbers are as follows: AdaIC 3D139 (1211 Fern St., C-107) The Pentagon Washington, DC 20301-3081 (703) 685-1477 AdaIC 4600 Forbes Blvd. Lanham, MD 20706 (301) 459-3711 3 AI_00001 AI-00001/10: Renaming and static expressions If the name declared by a renaming declaration denotes a constant explicitly declared by a constant declaration having the form specified in 4.9(6), then the name can be used as a primary in a static expression. 3 AI_00002 AI-00002/07: Deriving homographs for an enumeration literal and a function It is possible to derive both an enumeration literal and a user- defined function that is a homograph of the literal. In such cases, the enumeration literal is hidden by the user-defined function. 3 AI_00006 AI-00006/05: The subtype of a loop parameter The subtype of a loop parameter is determined by the discrete range in the loop parameter specification. Therefore, the loop parameter has a static subtype if the discrete range is static. 3 AI_00007 AI-00007/19: Discriminant compatibility for incomplete, private, and access types When a subtype indication with a discriminant constraint is elaborated, 3.3.2(6-8) requires that the compatibility check defined in 3.7.2(5) be performed. The check has two parts: first, check that the value of each discriminant belongs to the corresponding discriminant subtype, and second, if a discriminant is used in a subcomponent constraint, check the constraint for compatibility with the subcomponent's type. If a discriminant constraint is applied to a private type or to an incomplete type before its complete declaration, the second part of the check cannot be performed when the subtype indication is elaborated because no subcomponent declarations exist. The recommended interpretation of 3.7.2(5) in this case is that the check for subcomponents be deferred and be performed no later than the end of the declaration that allows the deferred check to be completely performed, except when an incomplete type is declared in the private part of a package and its full declaration is given in the package body; in this case, a discriminant constraint is not allowed for the type prior to the end of the package specification. If a discriminant constraint is given for an access type, the constraint applies to the designated type. The second part of the compatibility check is optional in this case (even if the designated type is completely declared, e.g., even if the constraint occurs in an object declaration or allocator). When the initial values of discriminants are given by the evaluation of default expressions, the corresponding constraint is checked for compatibility. 3 AI_00008 AI-00008/05: Negative exponents in based notation The exponent of a based literal must not have a minus sign if the based literal is an integer literal. 3 AI_00014 AI-00014/10: Evaluating default discriminant expressions Default discriminant expressions are not evaluated when an explicit initialization expression is provided in an object declaration or a component declaration. 3 AI_00015 AI-00015/12: When the prefix of 'ADDRESS contains a function name The name of an attribute designator can be taken into account when deciding whether the prefix of an attribute is a name or a function call, but the attribute designator cannot be considered when resolving identifiers that are used in the prefix. In particular, the fact that the prefix of 'ADDRESS (as well as the prefix of 'SIZE, 'CONSTRAINED, and 'STORAGE_SIZE) can be an object but not a function call does not affect the resolution of a name that occurs in the prefix. 3 AI_00016 AI-00016/10: Using a renamed package prefix inside a package An expanded name is legal if the prefix denotes a package and the selector is a simple name declared within the visible part of the package, regardless of whether the prefix is a name declared by a renaming declaration. 3 AI_00018 AI-00018/06: Checking aggregate index and subcomponent values The check that the value of an index in an array aggregate belongs to an index subtype can be made before or after all choices have been evaluated. Similarly, the check that a subcomponent value belongs to the subcomponent's subtype can be performed before or after all subcomponent expressions have been evaluated. 3 AI_00019 AI-00019/07: Checking for too many components in positional aggregates CONSTRAINT_ERROR is raised if the bounds of a positional aggregate do not belong to the corresponding index subtype. 3 AI_00020 AI-00020/07: Real literals with fixed point multiplication and division A real literal is not allowed as an operand of a fixed point multiplication or division. The possibility of adopting a more liberal rule in a future version of the language will be studied. 3 AI_00023 AI-00023/06: Static numeric subtypes Declarations containing integer and real type definitions declare static subtypes, e.g., given type T is range 1..10; T is a static subtype. 3 AI_00024 AI-00024/09: Type conversions as out parameters for non-scalar types If an out parameter has the form of a type conversion and the type mark denotes an array type, the type conversion is performed before the call (see 4.6(11, 13) for the semantics of such a conversion). If the type mark denotes an access type, the value of the variable is converted before the call to the base type of the formal parameter; the designated object need not satisfy a constraint imposed by the formal parameter. 3 AI_00025 AI-00025/08: Checking out parameter constraints for private types When a subprogram parameter has a private type, the constraint checks that are performed before or after the call are those appropriate for the type declared in the private type's full declaration. 3 AI_00026 AI-00026/07: Effect of full type decl on CONSTRAINED attribute After the full declaration of a private type P, P'CONSTRAINED is not allowed unless P's full declaration derives from a private type. 3 AI_00027 AI-00027/07: Visibility of type mark in explicit conversion or qualified expression The type mark that occurs in an explicit conversion or in a qualified expression must denote a visible declaration. 3 AI_00030 AI-00030/07: All guards need not be evaluated first In the execution of a selective wait statement, the evaluation of conditions, delay expressions, and entry indices is performed in some order that is not defined by the language, except that a delay expression or an entry index cannot be evaluated until after the condition for the corresponding alternative is evaluated and found to be true. 3 AI_00031 AI-00031/06: Out-of-range argument to pragma PRIORITY If the argument to pragma PRIORITY does not lie in the range of the subtype PRIORITY, the pragma has no effect. 3 AI_00032 AI-00032/09: Preemptive scheduling is required If an implementation supports more than one priority level, or interrupts, then it must also support a preemptive scheduling policy. 3 AI_00034 AI-00034/06: Value of COUNT in an accept statement In an accept statement for a member of an entry family, the member being called (and consequently, the task calling the member) is not known until the entry index has been evaluated. This means that if the entry index contains a COUNT attribute, its value is not affected by what member of the family is eventually determined to be called. 3 AI_00035 AI-00035/06: Body stubs are not allowed in package specifications Body stubs are not allowed in package specifications. 3 AI_00037 AI-00037/12: Instantiating when discriminants have defaults An actual subtype in a generic instantiation can be an unconstrained type with discriminants that have defaults even if an occurrence of the formal type (as an unconstrained subtype indication) is at a place where either a constraint or default discriminants would be required for a type with discriminants. 3 AI_00038 AI-00038/06: Declarations associated with default names The normal visibility rules apply to identifiers used in default subprogram names, i.e., these identifiers are associated with declarations visible at the point of the generic declaration, not those visible at each place of instantiation. 3 AI_00039 AI-00039/12: Forcing occurrences and premature uses of a type Each operand of a relational operator (and similarly, the operand of a type conversion or membership test) is considered to be implicitly qualified with the name of the corresponding operand type; such implicit occurrences are considered to be occurrences of the type name with respect to the rules given in 13.1(6), 13.1(7), and 7.4.1(4). This means that such occurrences can be illegal if the implicit type name is an incompletely declared private type (7.4.1(4)), or they can make the subsequent occurrence of a representation clause illegal (13.1(6, 7)). 3 AI_00040 AI-00040/07: Multiple specification of T'SIZE, T'STORAGE_SIZE, T'SMALL For a given type, the 'SIZE, 'STORAGE_SIZE, and 'SMALL attributes can each be specified at most once by an explicit representation clause. 3 AI_00045 AI-00045/05: Subtype SYSTEM.PRIORITY The subtype SYSTEM.PRIORITY can be non-static. The subtype can have a null range. 3 AI_00046 AI-00046/06: Lifetime of a temporary file and its name 1) An implementation is allowed to delete a temporary file immediately after closing it. 2) The NAME function is allowed to raise USE_ERROR if its argument is associated with an external file that has no name, in particular, a temporary file. 3 AI_00047 AI-00047/08: Effect of RESET on line and page length Calling RESET resets the line and page lengths to UNBOUNDED. 3 AI_00048 AI-00048/12: Default files can be closed, deleted, and re-opened The CLOSE operation can be applied to a file object that is also serving as the default input or default output file. The effect is to close the default file. A subsequent OPEN operation can have the effect of opening the default file as well. Similarly, a DELETE operation can be applied to a file object that is serving as the default file. The exception MODE_ERROR is raised by OPEN if the specified mode is OUT_FILE and the file object being opened is serving as the default input file. Similarly, MODE_ERROR is raised if the specified mode is IN_FILE and the file object being opened is serving as the default output file. 3 AI_00050 AI-00050/11: When does GET_LINE call SKIP_LINE? GET_LINE reads characters until either the end of the string is met or until END_OF_LINE is true. If the end of the string has been met, SKIP_LINE is not called even if END_OF_LINE is true. In particular, no characters are read if the string is null. 3 AI_00051 AI-00051/07: Reading "integer literals" Integer GET reads according to the syntax of an optionally signed numeric literal that does not contain a point. It raises DATA_ ERROR if the characters read do not form a legal integer literal. For example, if integer GET attempts to read 0.3, 0E-3, or 20#0#, reading stops before the decimal point for 0.3, after the 3 for 0E-3, and after the second # for 20#0#; DATA_ERROR is raised for 0E-3 since legal integer literals are not allowed to have exponents containing minus signs. DATA_ERROR is also raised for 20#0#, since 20 is not an allowed base value. 3 AI_00099 AI-00099/12: 'SMALL can be specified for a derived fixed point type A representation clause specifying small for a derived fixed point type is allowed if the resulting model numbers are (representable) values of the parent type and the value specified for small is not greater than the delta of the derived type. 3 AI_00103 AI-00103/06: Accuracy of a relation between two static universal real operands The relational and membership operations for static universal real operands must be evaluated exactly. 3 AI_00113 AI-00113/12: A subunit's with clause can name its ancestor library unit A with clause for a subunit can name the subunit's ancestor library name. 3 AI_00120 AI-00120/05: Overload resolution for assignment statements The type of the right-hand side of an assignment statement can be used to determine an overload resolution of the left-hand side. 3 AI_00128 AI-00128/04: No membership tests or short-circuit operations in static expressions Membership tests and short-circuit control forms are not allowed in static expressions because neither of these are operators. 3 AI_00132 AI-00132/05: Static constraints and component clauses A record component clause is only allowed for a record component having a constraint if the constraint is static and, if the component has subcomponents that are constrained, each subcomponent constraint is static. 3 AI_00137 AI-00137/05: Exponentiation with floating point operand Since the model interval for X*X*X*X is sometimes smaller than the interval for (X*X)*(X*X), an implementation cannot compute X**4 as sqr(sqr(X)), where sqr(Y) computes Y*Y. In general, exponentation to the Nth power must be implemented using N-1 multiplications to ensure the required accuracy is obtained. 3 AI_00138 AI-00138/10: Representation clauses for derived types If an aspect of a parent type's representation has been specified by an implicit or explicit representation clause and no explicit representation clause is given for the same aspect of the derived type, the representation of the derived and parent types are the same with respect to this aspect. An explicit length clause for STORAGE_SIZE of a task type, for SIZE (of any type), or for SMALL of a fixed point type, an explicit enumeration representation clause, an explicit record representation clause, or an explicit address clause for a task type can be given for a derived type (prior to a forcing occurrence for the type) even if a representation clause has also been given (explicitly or implicitly) for the same aspect of the parent type's representation. (But only a length clause is allowed for a derived type if the parent type has derivable subprograms.) An expression in an implicit representation clause is not evaluated when the implicit clause is elaborated. 3 AI_00139 AI-00139/04: The declaration of "additional operations" for access types A consequence of the rule in 7.4.2(7, 8) is that an object A1 can be declared such that the name A1(1) is illegal when A1.all(1) would be legal. Similar examples exist for slices, for the attributes 'FIRST, 'LAST, 'LENGTH, and 'RANGE, and for selection of a record component (e.g., R1.C1 can be illegal when R1.all.C1 is legal). 3 AI_00143 AI-00143/04: Model numbers for delta 1.0 range -7.0 .. 8.0 Given type F is delta 1.0 range -7.0 .. 8.0; The model numbers for F do not include the value 8.0 and F'MANTISSA must be 3. 3 AI_00144 AI-00144/10: A fixed point type declaration cannot raise an exception A fixed point type declaration cannot raise an exception. Declarations such as: type F is delta 2.0**(-15) range -1.0 .. 1.0; are legal even if F'SIZE is equal to 16 so 1.0 is not a representable value. 3 AI_00145 AI-00145/04: Dynamic computation of 'MANTISSA for fixed point subtypes If F is a non-static fixed point subtype, F'MANTISSA must, in general, be computed at run-time. 3 AI_00146 AI-00146/10: Model numbers for a fixed point subtype with length clause If a length clause specifying small has been given for a fixed point type, T, then the value of small for any subtype of T is given by T'SMALL. 3 AI_00147 AI-00147/05: Declaring a fixed point type that occupies one word A fixed point type that occupies a full word can be declared as: DEL : constant := 1.0/2**(WORD_LENGTH - 1); type FRACTION is delta DEL range -1.0 .. 1.0 - DEL; 3 AI_00148 AI-00148/05: Legality of -1..10 in loops The range -1..10 is illegal as the discrete range in an iteration rule, constrained array type definition, and entry family declaration, since -1 is an expression having a form prohibited by 3.6.1(2), and the other rules of the language do not determine a unique type for the bounds. The possibility of adopting a more liberal rule in a future version of the language will be studied. Note, however, that instead of writing -1..10, one can always write INTEGER range -1..10 or declare -1 as a constant and use the constant name in place of the expression, -1; often it will be appropriate to use the attribute 'RANGE in place of an explicit range such as -1..10. 3 AI_00149 AI-00149/09: Activating a task before elaboration of its body If an attempt is made to activate a task before its body has been elaborated, PROGRAM_ERROR is raised. If more than one task is to be activated, the check for unelaborated bodies is performed before an attempt is made to activate any task. Consequently, if PROGRAM_ERROR is raised, no tasks have been activated. 3 AI_00150 AI-00150/04: Allocated objects belong to the designated subtype CONSTRAINT_ERROR is raised if an object specified by an allocator does not belong to the designated subtype for the allocator. 3 AI_00151 AI-00151/05: Case expression of a type derived from a generic formal type A type derived from a generic formal type cannot be used in the expression of a case statement. 3 AI_00153 AI-00153/05: Membership tests cannot use an incompletely declared private type The type mark for a private type cannot be used in a membership test before the end of the full declaration of the type. This restriction also applies to the use of a name that denotes a subtype of the private type and the use of a name that denotes any type or subtype that has a subcomponent of the private type. 3 AI_00154 AI-00154/06: Additional operations for composite and access types This Commentary gives details showing which operations are declared for certain composite and access types immediately after their declaration and which are declared later in a package body. 3 AI_00155 AI-00155/08: Evaluation of an attribute prefix having an undefined value The execution of a program is erroneous if the name of a deferred constant is evaluated before the full declaration of the constant has been elaborated. Evaluation of the name of a scalar variable is not erroneous, even if the variable has an undefined value, if the name occurs as the prefix for the attribute ADDRESS, FIRST_ BIT, LAST_BIT, POSITION, or SIZE. (In these cases, the value of the variable is not needed.) 3 AI_00157 AI-00157/05: Overloading resolution and parenthesized expressions The rule requiring aggregates to be given in named notation if they contain a single component association (4.3(4)) is to be considered a syntax rule for purposes of overloading resolution, and in particular, can be used to help resolve the type of a parenthesized expression. 3 AI_00158 AI-00158/05: The main program is elaborated before it is called The main program is elaborated before it is called. 3 AI_00163 AI-00163/05: Implicit conversion preserves staticness A static expression is static even if an implicit conversion is applied to it. 3 AI_00167 AI-00167/04: It is possible to access a task from outside its master A task can be accessed from outside its master, since a function can return a task object as its value, even a task that was activated inside the function. 3 AI_00169 AI-00169/06: Legality of incomplete null multidimensional array aggregates A multidimensional aggregate is illegal if a value is omitted in the specification of any dimension. 3 AI_00170 AI-00170/07: Renaming a slice A slice must not be renamed if renaming is prohibited for any of its components. 3 AI_00172 AI-00172/06: GET_LINE for interactive devices An implementation is allowed to assume that certain external files do not contain page terminators. Such external files might be used to represent interactive input devices. (To ensure that such files have no page terminators, an implementation may refuse to recognize any input sequence as a page terminator.) Under such an assumption, GET_LINE and SKIP_LINE can return as soon as a line terminator is read. 3 AI_00173 AI-00173/05: Completion of execution by exception propagation The execution of a task, block statement, or subprogram is completed if an exception is raised by the elaboration of its declarative part. The execution of a task, block statement, or subprogram is completed if an exception is raised before the first statement following the declarative part and there is no corresponding handler, or if there is one, when it has finished the execution of the corresponding handler. (TASKING_ERROR is the only exception that can be raised under these circumstances. It can be raised by unsuccessful attempts to activate one or more dependent tasks after elaboration of the declarative part and before beginning execution of the sequence of statements.) 3 AI_00177 AI-00177/04: Use of others in a multidimensional aggregate An others choice is allowed if an aggregate is not a subaggregate and is the expression of a component association of an enclosing (array or record) aggregate. An others choice is also allowed if an aggregate is a subaggregate of a multidimensional array aggregate that is in one of the contexts specified by 4.3.2(5-8). 3 AI_00179 AI-00179/08: The definition of attribute FORE The attribute 'FORE is defined in terms of the decimal representation of model numbers. 3 AI_00180 AI-00180/07: Elaboration checks for INTERFACE subprograms If a subprogram is named in an INTERFACE pragma, no check need be made that the subprogram body has been elaborated before it is called. 3 AI_00181 AI-00181/04: NUMERIC_ERROR for nonstatic universal operands When evaluating a nonstatic universal expression, NUMERIC_ERROR can be raised if any operand or the result is a real value that lies outside the range of safe numbers of the most accurate predefined floating point type (excluding universal_real) or an integer value that lies outside the range SYSTEM.MIN_INT .. SYSTEM.MAX_INT. 3 AI_00186 AI-00186/08: Pragmas recognized by an impl do not force default representation The intent of 2.8(9) is that an invalid pragma have the same effect as if it were absent. To ensure that this intent is realized, a pragma defined by the Standard or by an implementation is not allowed to contain an occurrence of a name or expression that forces the determination of the default represent- ation of a type, since such occurrences would make later representation clauses for the type illegal. Consequently, a representation clause for a type can be accepted even if the clause is given after a pragma that contains an expression that normally would force the default representation of the type to be determined (since such a pragma will be considered invalid, and ignored). (See AI-00322 for a similar rule for pragmas whose identifiers are not defined either by the Standard or by the implementation.) 3 AI_00187 AI-00187/06: Using a name decl by a renaming decl as an expanded name selector A name declared by a renaming declaration can be used as a selector in an expanded name. 3 AI_00190 AI-00190/05: A static expression cannot have a generic formal type A static expression is not allowed to have a generic formal type (including a type derived from a generic formal type, directly or indirectly). (Conse- quently, if an array's index subtype is a generic formal type, aggregates for that dimension of the array can have only a single component association and this component association must have a single choice.) 3 AI_00192 AI-00192/05: Allowed names of library units The name of a library unit cannot be a homograph of a name that is already declared in package STANDARD. 3 AI_00193 AI-00193/05: The value of 'FIRST's argument in overloading resolution Any overloaded identifiers occurring in the argument for 'FIRST(N), 'LAST(N), and 'RANGE(N) must be resolved independently of the context in which these attributes are used. 3 AI_00195 AI-00195/09: The intended use of CLOCK CLOCK returns a value that reflects the time of day in the external environment. 3 AI_00196 AI-00196/05: Use of 86_400.0 in TIME_OF If TIME_OF is called with a seconds value of 86_400.0, the value returned is equal to TIME_OF for the next day with a seconds value of 0.0. In addition, the SECONDS function always returns a value less than 86_400.0, even if the SECONDS argument of TIME_OF was 86_400.0. 3 AI_00197 AI-00197/07: With SYSTEM clause not needed for pragma PRIORITY Use of the pragma PRIORITY does not require the package SYSTEM to be named in a with clause for the enclosing compilation unit. 3 AI_00198 AI-00198/00: Termination of unactivated tasks If a taks is abnormally completed, then any task it has created by not yet activated becomes terminated and is never activated. If PROGRAM_ERROR is raised before attempting to activate one or more tasks because the body of at least one of these tasks has not yet been elaborated (see AI-00149), all the unactivated tasks become terminated. 3 AI_00199 AI-00199/08: Implicit declaration of library subprograms A subprogram body given in a compilation unit (following the context clause) is interpreted as a secondary unit if the program library already contains a subprogram declaration or generic subprogram declaration having the same identifier as the body. Otherwise, the subprogram body is interpreted as a library unit. Successfully compiling a subprogram body that is a library unit means the unit is added to the library, replacing any previously existing library unit having the same identifier. (The previously existing library unit can only be a package declaration, a generic package declaration, a generic instantiation, or a previously compiled subprogram body that is a library unit.) 3 AI_00200 AI-00200/08: Dependences created by inline of generic instantiations If inline inclusion of a subprogram call is achieved due to pragma INLINE, an implementation is allowed to create a dependence of the calling unit on the subprogram body; when such a dependence exists, the unit containing the call is obsolete if the subprogram body is obsolete. Such dependences can be created even when the subprogram is created as a result of a generic instantiation. 3 AI_00201 AI-00201/07: The relation between TICK, CLOCK, and the delay statement The value returned by successive calls to the CLOCK function can be expected to change at the frequency indicated by SYSTEM.TICK. There is no required relation between SYSTEM.TICK and DURATION'SMALL. Delay statements need not be executed with an accuracy that is related to SYSTEM.TICK or DURATION'SMALL; in particular, delay statements can be executed more accurately than SYSTEM.TICK implies. Execution with less accuracy than SYSTEM.TICK requires justification in terms of AI-00325. 3 AI_00205 AI-00205/06: The formula for MANTISSA is correct The number of mantissa bits for D decimal digits of accuracy is correctly given by the formula in the Standard, namely, the integer next above (D*log(10)/log(2)) + 1. 3 AI_00209 AI-00209/06: Exact evaluation of static universal real expressions An implementation can refuse to evaluate a static universal real expression only if there are insufficient resources to evaluate the expression exactly, e.g., if there is insufficient memory available. Inexact results must not be delivered. 3 AI_00210 AI-00210/04: Loop name in an exit statement as an expanded name An expanded name is allowed as the loop name in an exit statement. 3 AI_00215 AI-00215/05: Type of EXP should be FIELD The type of the EXP parameter for PUT is FIELD, not INTEGER. 3 AI_00217 AI-00217/05: The safe numbers of a floating point subtype The safe numbers of a floating point subtype are the safe numbers of its base type. 3 AI_00219 AI-00219/06: Use of & and 'IMAGE in static expressions In a static expression, every factor, term, simple expression, and relation must have a scalar type. 3 AI_00225 AI-00225/09: Secondary units for generic subprograms If a subprogram body given in a compilation unit has the same identifier as a library unit and the library unit is a generic subprogram declaration, then the subprogram body is interpreted as a secondary unit. 3 AI_00226 AI-00226/06: Applicability of context clauses to subunits The context clause of a library unit that is a declaration applies not only to the secondary unit that defines the corresponding body, but also to any subunits of the secondary unit. 3 AI_00231 AI-00231/03: Full declarations of incomplete types can have discriminants The full declaration of an incomplete type can be a derived type with unconstrained discriminants when no discriminant part is given in the incomplete type's declaration. 3 AI_00232 AI-00232/05: Full declarations that implicitly declare unconstrained types A full declaration of a private type can declare a constrained array subtype or a constrained type with discriminants. 3 AI_00234 AI-00234/05: Lower bound for 'IMAGE of enumeration values The lower bound of the string returned by the predefined attribute IMAGE is one. 3 AI_00235 AI-00235/05: Redundant parentheses enclosing universal_fixed expressions An expression having type universal_fixed can be enclosed in parentheses before begin converted to some other numeric type. 3 AI_00236 AI-00236/12: Pragma ELABORATE for bodiless packages with tasks If a package declares a task object but no package body is required or provided by a programmer, 9.3(5) says an implicit body is provided. The effect of a pragma ELABORATE that names such a package is to require that the implicitly provided package body be elaborated, thereby activating the task declared in the package. 3 AI_00237 AI-00237/06: Instances having implicit package bodies Given a generic package declaration that does not require a body and that has no explicit body, when the generic package is instantiated, if the instance specification requires a body, then an implicit instance body is created and is elaborated when the instantiation is elaborated. 3 AI_00239 AI-00239/11: ENUMERATION_IO and IMAGE for non-graphic characters If ENUM_IO is an instantiation of ENUMERATION_IO for a character type that contains a non-graphic character, e.g., package ENUM_IO is new ENUMERATION_IO (CHARACTER); then for each non-graphic character (such as ASCII.NUL), ENUM_ IO.PUT should output the corresponding sequence of characters used in the type definition (e.g., PUT(ASCII.NUL) should output the string "NUL" if SET has the value UPPER_CASE and WIDTH is less than 4). Furthermore, ENUM_IO.GET should be able to read the sequence of characters output by ENUM_IO.PUT for a non-graphic character, returning in its ITEM parameter the corresponding enumeration value. Similarly, the image of a non-graphic character (i.e., the result returned for the attribute designator IMAGE) should be the sequence of characters used in the type definition of CHARACTER (e.g., CHARACTER'IMAGE(ASCII.NUL) = "NUL"), and 'VALUE should accept such a string as representing the corresponding enumeration value. An implementation conforms to the Standard in this respect if the result produced by 'IMAGE for a non-graphic character is accepted by 'VALUE, and if the result (if any) produced by PUT can be read by GET; GET is also allowed to raise DATA_ERROR when attempting to read any string produced by PUT for a non-graphic character. This interpretation is non-binding, i.e., implementers are encouraged to conform to it but are not required to do so by the validation tests. A future version of the Standard may incorporate this interpretation. 3 AI_00240 AI-00240/05: Integer type definitions cannot contain a RANGE attribute A range attribute is not allowed in an integer type definition. 3 AI_00242 AI-00242/09: Subprogram names allowed in pragma INLINE If the pragma INLINE appears at the place of a declarative item, every name in the pragma must denote at least one subprogram or generic subprogram declared explicitly earlier in the same declarative part or package specification. If the pragma appears after a given library unit, the pragma must contain just the name of the library unit, and the library unit must be a subprogram or a generic subprogram. If a pragma INLINE appears at the place of a declarative item and a name in the pragma is overloaded, the pragma applies just to those subprograms whose declarations occur (explicitly) earlier in the same declarative part or package specification. If a name in a pragma INLINE is declared by a renaming declaration, and the denoted subprogram is explicitly declared earlier in the same declarative part or package specification, inline expansion is desired for every call of the denoted subprogram (whether the call uses the new or the old name). If a pragma INLINE applies to a subprogram, inline expansion is desired for every call of the subprogram, whether or not the call uses a name declared by a renaming declaration. 3 AI_00243 AI-00243/05: Overriding width format in TEXT_IO If the specification of WIDTH or FORE in a call of PUT is insufficiently large, the output is given with no leading spaces. 3 AI_00244 AI-00244/04: Record aggregates with multiple choices in a component association In a record aggregate, a component association having multiple choices denoting components of the same type is considered equivalent to a sequence of single choice component associations representing the same components. 3 AI_00245 AI-00245/08: Type conversion conformance for renamed subprogram /entry calls When a type conversion is used as an actual parameter corresponding to an in out or out formal parameter and the subprogram being called was declared by a renaming declaration (renaming either a subprogram or entry), the name given as the type mark (in the type conversion) must conform to the name given for the corresponding parameter of the denoted subprogram or entry (not the name given in the renaming declaration). 3 AI_00247 AI-00247/05: A non-null FORM argument can be required by an implementation An implementation can require that a non-null FORM argument be given to CREATE and/or OPEN by raising USE_ERROR if one is not provided. 3 AI_00251 AI-00251/05: Are types derived from generic formal types static subtypes? Types derived from generic formal types are not static subtypes. 3 AI_00257 AI-00257/04: Restricting generic unit bodies to compilations 10.3(9) allows an implementation to require that bodies and subunits of a generic unit appear in the same compilation. An implementation is allowed to apply this rule selectively, i.e., the conditions under which an implementation requires placement in a single compilation may depend on characteristics of the generic specification, body, or subunit. 3 AI_00258 AI-00258/06: 'POSITION etc. for renamed components The prefix for 'POSITION, 'FIRST_BIT, and 'LAST_BIT must have the form R.C, where R is a name denoting a record and C is the name of a component of the record. 3 AI_00260 AI-00260/06: Limited "full types" A full type declaration declares a limited type if an assignment operation is not visible for the type of some subcomponent at the place of the full type declaration. A formal parameter whose type mark denotes an incompletely declared private type cannot have mode OUT if the parameter's full type declaration declares a limited type. 3 AI_00261 AI-00261/03: "any error" -> "any illegal construct" An attempt to compile an illegal compilation unit has no effect on the program library (see also AI-00255). 3 AI_00263 AI-00263/06: A named number is not an object A number declaration declares a named number, which is not an object. The elaboration of a number declaration proceeds by evaluating the initialization expression and creating a named number. The value of the initialization expression then becomes the value of the named number. 3 AI_00265 AI-00265/05: Index subtype of an array aggregate The index subtype of an array type declared by a constrained array definition is the subtype defined by the corresponding discrete range. 3 AI_00266 AI-00266/09: A body cannot be compiled for a library unit instantiation If a generic package is instantiated as a library unit, it is illegal to attempt to compile a package body having the same identifier as that of the instantiation. After instantiating a generic subprogram as a library unit, any attempt to compile a subprogram body having the same identifier as that of the library unit instantiation causes the instantiation to be deleted from the library and replaced with the new library unit subprogram. 3 AI_00267 AI-00267/06: Evaluating expressions in case statements An exception is raised if the value of the expression in a case statement does not belong to the base type of the expression. 3 AI_00268 AI-00268/06: Activation of already abnormal tasks If a task is aborted before it is activated, no exception is raised when an attempt is made to activate the task. 3 AI_00276 AI-00276/07: Rendezvous that are "immediately possible" vs. timed entry calls A timed entry call with a zero or negative delay issues an entry call that is canceled only if a rendezvous is not immediately possible. 9.7.2(4) specifies the conditions under which an entry call is immediately possible. In a distributed implementation of Ada, it may take a non-negligible amount of time to determine whether an entry call is "immediately" possible. 3 AI_00279 AI-00279/09: Exceptions raised by calls of I/O subprograms Any exception can be raised when evaluating the actual parameters of a call of an input-output subprogram. In addition, STORAGE_ ERROR can be raised by the call itself before execution of the body has begun. But once execution of the body of an input- output subprogram has been started, the only exceptions that can be propagated to the caller are the exceptions defined in the package IO_EXCEPTIONS and the exceptions PROGRAM_ERROR and STORAGE_ERROR. In particular, if CONSTRAINT_ERROR, NUMERIC_ ERROR, or TASKING_ERROR is not raised by the evaluation of any argument, then none of these exceptions will be raised by the call. Furthermore, PROGRAM_ERROR can only be raised due to errors made by the user of the input-output subprogram. 3 AI_00282 AI-00282/06: Compatibility of constraint defined by discrete range The constraint defined by a discrete range is compatible with a subtype if each bound of the discrete range belongs to the subtype, or if the discrete range defines a null range; otherwise the constraint is not compatible with the subtype. 3 AI_00286 AI-00286/11: Declarations visible in a generic subprogram decl and body Except within the body of a generic subprogram, the declaration of a generic unit is not a declaration for which overloading is allowed. In particular, any declarations occurring in an outer declarative region or made potentially visible by a use clause are not directly visible in the generic formal part if they have the same identifier as the subprogram. Within the body of a generic subprogram, overloading is defined for the generic subprogram declaration in the same way as for a nongeneric subprogram. In particular, overloadable declarations occurring in an outer declarative region or made potentially visible by a use clause can be directly visible in the body even though they are not directly visible in the generic formal part. 3 AI_00287 AI-00287/05: Resolving overloaded entry calls A call to an overloaded entry is resolved using the same kind of information as is used for resolving overloaded procedure calls (the name of the entry, the number of parameters, the types and the order of the actual parameters, and the names of the formal parameters). 3 AI_00288 AI-00288/06: Effect of priorities during activation A task activation should be performed with the priority of the task being activated or the priority of the task causing the activation, whichever is higher. 3 AI_00289 AI-00289/05: Ancestor unit names in separate clauses must be simple names If P is a library unit, then the name in a "separate" clause for a subunit of P must be P and not STANDARD.P. 3 AI_00292 AI-00292/05: Derived types with address clauses for entries An address clause applied to an entry of a task type also applies to a type derived (directly or indirectly) from the task type. 3 AI_00293 AI-00293/05: Null others choice for array aggregates The others choice in an array aggregate can specify no components. 3 AI_00294 AI-00294/05: The name given in pragma CONTROLLED The type name given in a pragma CONTROLLED cannot be declared by a subtype declaration nor can it be a first named subtype since a derived type is not allowed. 3 AI_00295 AI-00295/05: Evaluating the variable in an actual parameter type conversion For an actual parameter (of any type) of mode in out or out that is a type conversion, the variable name is evaluated before the call and therefore determines the denoted entity. 3 AI_00298 AI-00298/05: Interaction between pragmas ELABORATE and INTERFACE A pragma ELABORATE can be applied to a library unit whose body is supplied by a pragma INTERFACE. 3 AI_00300 AI-00300/07: Prefixes of attributes in length clauses The prefix of the attribute that appears in a length clause must be a simple name. An expanded name, or the name T'BASE, is not allowed. 3 AI_00305 AI-00305/05: T'ADDRESS when T is a task type yields the task object address If T denotes a task type, then within the body of task unit T, the T in T'ADDRESS is considered to refer to the name of the task object that designates the task currently executing the body, i.e., T'ADDRESS returns the address of the object. 3 AI_00306 AI-00306/15: Pragma INTERFACE; allowed names and illegalities If a pragma INTERFACE names a language that is acceptable to an implementation, the subprogram name must denote one or more subprograms declared explicitly earlier in the same declarative part or package specification. (The pragma has no effect if no named subprogram satisfies the requirements.) The pragma is applied to all such subprograms other than enumeration literals and subprograms declared by generic instantiation. If a subprogram named in the pragma was declared by a renaming declaration, the pragma applies to the denoted subprogram, but only if the denoted subprogram otherwise satisfies the above requirements. It is illegal to apply a pragma INTERFACE to a subprogram for which a pragma INTERFACE has already been applied. If a pragma INTERFACE applies to a subprogram, it is illegal to provide a body for the subprogram. 3 AI_00307 AI-00307/04: GET at end of file and from a null string END_ERROR is raised (not DATA_ERROR) when attempting to read integer, real, or enumeration values from a string that is null or that only contains blanks. END_ERROR (not DATA_ERROR) is raised when attempting to read integer, real, or enumeration values from a file that has no remaining elements or whose only remaining elements are blanks, line terminators, or page terminators. 3 AI_00308 AI-00308/05: Checking default initialization of discriminants for compatibility When an object of a type with discriminants is created either by an object declaration or an allocator, and the values of the object's discriminants are determined by default, each discriminant value is checked for compatibility, as defined in 3.7.2(5). CONSTRAINT_ERROR is raised if this check fails. 3 AI_00310 AI-00310/04: OTHERS choices and static index constraints An others choice is static if the corresponding index subtype is static and if the corresponding index bounds were specified with a static discrete range in the applicable index constraint. 3 AI_00311 AI-00311/06: No NUMERIC_ERROR for null strings When computing the upper bound of a null string literal, NUMERIC_ERROR must not be raised, even if the lower bound has no predecessor (but see AI-00325). 3 AI_00312 AI-00312/04: NUMERIC_ERROR when evaluating null aggregates and slices When determining the length of a null aggregate or slice, it is usually easy for an implementation to avoid raising NUMERIC_ ERROR. This exception should be raised in these circumstances only when relevant restrictions in the execution or compilation environment make it impractical or impossible to avoid raising the exception (see AI-00325). 3 AI_00313 AI-00313/03: Non-null bounds belong to the index subtype CONSTRAINT_ERROR is raised if a non-null choice of an aggregate does not belong to the corresponding index subtype. For conversion to an unconstrained array type, CONSTRAINT_ERROR is raised if a non-null dimension of the operand has bounds that do not belong to the corresponding index subtype of the target type. 3 AI_00314 AI-00314/05: The safe numbers for IBM-370 floating point The safe and model numbers for IBM-370 32-bit floating point have the following characteristics: DIGITS = 6 MANTISSA = 21 EMAX = 84 SAFE_EMAX = 252 3 AI_00316 AI-00316/05: Definition of blank, inclusion of horizontal tab A blank is defined as a space or a horizontal tabulation character. 3 AI_00319 AI-00319/09: Checking for subtype incompatibility No object can have a subcomponent with an incompatible discriminant or index constraint. In particular, even when a discriminant constraint is applied to a private type before its full declaration or to an incomplete type (before its full declaration) and a discriminant is used to constrain a subcomponent, no object of the type can be created if it would have a subcomponent with an incompatible discriminant or index constraint. 3 AI_00320 AI-00320/06: Sharing external files If several file objects are associated with the same external file, some effects are implementation dependent. For example, if two sequential file objects are associated with the same external file, applying a read or write operation to one file object can change the effect of applying these operations (or the end of file operation) to the other file object. Other effects are specified by the language. In particular, if two text file objects are associated with a single external file (e.g., a terminal), the page, line, and column numbers for the output file object cannot be updated implicitly after reading from the input file object, and vice versa. 3 AI_00321 AI-00321/02: Forcing occurrence of index subtype A forcing occurrence of the name of an array type or subtype forces the default determination of each index subtype, and similarly, for forcing occurrences of any type or subtype having a subcomponent of such an array type. 3 AI_00322 AI-00322/02: Forcing occurrences in unknown pragmas An occurrence of a name within an expression is not a forcing occurrence if the expression occurs in a pragma whose identifier is not defined either by the Standard or by the implementation. 3 AI_00324 AI-00324/06: Checking the subtype of a non-null access value An access value of type T belongs to every subtype of T if T's designated type is neither an array type nor a type with discriminants. 3 AI_00325 AI-00325/04: Implementation-dependent limitations Implementation-dependent limitations must be justified. An implementation- dependent limitation is justified if it is impossible or impractical to remove it, given an implementation's execution environment. 3 AI_00328 AI-00328/08: Legality of uninstantiated generic units The legality of a generic unit must be checked even if the generic unit is never instantiated. 3 AI_00330 AI-00330/12: Explicit declaration of enumeration literals If an enumeration literal is declared with an enumeration type definition, then a function having the same identifier as the enumeration literal and the same parameter and result type profile cannot also be declared immediately within the same declarative region. Similarly, a non-overloadable declaration of the enumeration literal's identifier is not allowed immediately within the declarative region containing the enumeration type definition. 3 AI_00331 AI-00331/07: The effect of a constraint in an allocator When a discriminant or index constraint is imposed on the type mark in an allocator and the type mark denotes an access type, the constraint does not affect the subtype of the allocated object (which in this case has an access value). Similarly, when the type mark in an allocator denotes a scalar type, the subtype denoted by the type mark does not affect the subtype of the allocated (scalar) object. 3 AI_00332 AI-00332/04: NAME_ERROR or USE_ERROR raised when I/O not supported CREATE and OPEN can raise USE_ERROR or NAME_ERROR if file creation or opening is not allowed for any file. 3 AI_00336 AI-00336/05: Address clause for subprogram bodies An address clause cannot be given for a subprogram whose body acts as its declaration. 3 AI_00339 AI-00339/04: Allow non-English characters in comments An implementation is allowed (but not required) to accept an extended character set (i.e., graphic characters whose codes do not belong to the ISO seven-bit coded character set (ISO standard 646)) as long as the additional characters appear only in comments. 3 AI_00343 AI-00343/05: Decimal fixed point representations An implementation can use decimal or binary representations for fixed point values as long as all model numbers are represented exactly. 3 AI_00350 AI-00350/04: Lexical elements not changed by allowable character replacements Lexical elements differing only in their use of allowable replacements of characters (as defined in 2.10) are considered as the same. In particular, use of the allowable replacements does not affect the conformance of formal parts, discriminant parts, or actual parameters. 3 AI_00354 AI-00354/03: On the elaboration of library units There is no requirement that the body of a library unit be elaborated as soon as possible after the library unit is elaborated. In particular, the pragma ELABORATE should be used if it is important that a library package's body be elaborated before another package is elaborated. 3 AI_00355 AI-00355/06: Pragma ELABORATE for predefined library packages An attempt to use an entity declared within a predefined library unit or a unit declared within a predefined library package must raise PROGRAM_ERROR if a required body has not been elaborated (3.9(5-8)). An implementation is not allowed to raise PROGRAM_ ERROR for this reason, however, if a pragma ELABORATE has been given for the library unit. (In particular, if the library unit body provided by the implementation depends on other (implementation-defined) library units, the implementation must ensure prior elaboration of the required bodies, e.g., by providing appropriate ELABORATE pragmas.) 3 AI_00356 AI-00356/08: Access values that designate deallocated objects The storage occupied by a designated object can be reclaimed immediately after applying an instance of the unchecked deallocation procedure to an access variable that designates the object. If two objects having non-null access values designate the same object and an instance of the unchecked deallocation procedure is applied to one of the objects, the other object is considered to have an undefined value; any attempt to use such a value makes execution of the program erroneous. Similarly, if a name declared by a renaming declaration denotes a subcomponent of an object that is later freed by calling an instance of the unchecked deallocation procedure, the name is considered to have an undefined value; any attempt to evaluate the name (e.g., by assigning a value to it) makes execution of the program erroneous. 3 AI_00357 AI-00357/05: CLOSE or RESET of a sequential file from OUT_FILE mode If a sequential input-output file having mode OUT_FILE is closed or reset, the most recently written element since the last open or reset is the last element that can be read from the file. If no elements have been written, the closed or reset file is empty. (As a consequence, opening a sequential input-output file with mode OUT_FILE or resetting a sequential input-output file to mode OUT_FILE has the effect of deleting the previous contents of the file.) 3 AI_00358 AI-00358/10: Discriminant checks for non-existent subcomponents When checking the compatibility of a discriminant constraint, 3.7.2(5) requires that a discriminant's value be substituted in component subtype definitions that depend on the discriminant. This substitution is performed only for those subcomponents that exist in the subtype defined by the constraint. 3 AI_00362 AI-00362/03: "component of a record" for representation attributes The prefix of 'POSITION, 'FIRST_BIT, or 'LAST_BIT must denote a component of a record object. 3 AI_00365 AI-00365/05: Actual parameter names are evaluated in generic instantiations In a generic instantiation, the names appearing as actual parameters are evaluated. 3 AI_00366 AI-00366/07: The value of SYSTEM.TICK for different execution environments SYSTEM.TICK should have a value that reflects the precision of the clock in the main program's execution environment. If SYSTEM.TICK does not have an appropriate value, the effect of executing the program is not defined. 3 AI_00367 AI-00367/06: Deriving from types declared in a generic package The rules concerning derivable subprograms in the visible part of a nongeneric package are applicable in the visible part of a generic package. (The effect of a derived type declaration in an instance of a generic unit is discussed in AI-00398.) 3 AI_00370 AI-00370/06: Visibility of subprogam names within instantiations Any declaration with the same designator as a subprogram instantiation is not visible, even by selection, within the instantiation. 3 AI_00371 AI-00371/05: Representation clauses containing forcing occurrences An expression in a representation clause is illegal if it contains a forcing occurrence for the type whose representation is being specified. 3 AI_00374 AI-00374/06: An attempt to access an undefined constant is erroneous The execution of a program is erroneous if it attempts to evaluate a scalar constant with an undefined value. 3 AI_00375 AI-00375/05: Restricting the allowed values of a floating point subtype If a floating point constraint in a subtype indication includes a range constraint, the range of the values that belong to the subtype (i.e., that satisfy the constraint) is defined by the range constraint. If no range constraint is present, the range of values that belong to the subtype is not affected, even though the accuracy of the subtype may be reduced. 3 AI_00376 AI-00376/04: Universal real operands with fixed point * and / An expression having type universal_real is not allowed as an operand of a fixed point multiplication or division operation. The possibility of adopting a more liberal rule in a future version of the language will be studied. This commentary extends the conclusions of AI-0020 to cover all expressions of type universal_real, not just those having the form of a real literal. 3 AI_00379 AI-00379/03: Address clauses for entries of task types If an interrupt is linked to an entry of more than one task object (of the same type), the program is erroneous. 3 AI_00384 AI-00384/05: Use of an incomplete private type in a formal type declaration An incompletely declared private type cannot be used in the declaration of a generic formal type. 3 AI_00387 AI-00387/05: Raising CONSTRAINT_ERROR instead of NUMERIC_ERROR Wherever the Standard requires that NUMERIC_ERROR be raised (other than by a raise statement), CONSTRAINT_ERROR should be raised instead. This interpretation is non-binding. 3 AI_00388 AI-00388/06: Pragmas are allowed in a generic formal part Pragmas are allowed in a generic formal part. 3 AI_00396 AI-00396/03: Correction to discussion of AI-00025 The discussion section of AI-00025/07 should be corrected. Instead of saying, 1. "The effect of the call, CALL_Q_NOW.CALL_Q.Q(Y), is to assign an invalid value to P.Z" the discussion should say, 1. "The effect of elaborating CALL_Q_NOW is to assign an invalid value to P.Z". 3 AI_00397 AI-00397/04: Checking the designated subtype for an allocator When evaluating an allocator, a check is made that the designated object belongs to the allocator's designated subtype. CONSTRAINT_ ERROR is raised if this check fails. This check can be made any time before evaluation of the allocator is complete. In particular, it is not defined whether this check is performed before creation of a designated object, evaluation of any default initialization expressions, or evaluation of any expressions contained in the allocator. 3 AI_00398 AI-00398/08: Operations declared for types declared in instances If the parent type in a derived type definition is a generic formal type, the operations declared for the derived type in the template are determined by the class of the formal type. The operations declared for the derived type in the instance are determined by the type denoted by the formal parameter. Similarly, if the component type of an array type is a generic formal type or if the designated type of an access type is a generic formal type, the operations declared for the array and access type in the template depend on the class of the formal type. If the array and access type declarations do not occur in the generic formal part, then the operations declared for these types in a generic instance are determined by the type denoted by the formal parameter in the instance. If the designated type in an access type declaration is an incomplete type, additional operations can be declared for the access type by the full declaration of the incomplete type (7.4.2(7-8)). If the full declaration declares a type derived from a generic formal type, the additional operations (if any) declared for the access type in the template are determined by the class of the formal type. The additional operations declared for the access type in the instance are determined by the type denoted by the formal parameter. Similar rules apply when the parent type, component type, or designated type is derived, directly or indirectly, from a generic formal type. 3 AI_00405 AI-00405/06: One nonstatic operand for a universal real relation If the operands of a relational operator or membership test have the type universal_real and one or more of the operands is nonstatic, the static operands must be evaluated exactly. Doing so, however, does not impose a run time overhead. 3 AI_00406 AI-00406/05: Evaluating parameters of a call before raising PROGRAM_ERROR It is not defined whether the check that the body of a subprogram has been elaborated is made before or after the actual parameters of a call have been evaluated. Similarly, it is not defined whether the check that the body of a generic unit has been elaborated is made before or after the generic actual parameters of an instantiation have been evaluated. 3 AI_00407 AI-00407/06: The operations of a subtype with reduced accuracy When assigning a fixed or floating point value to a variable, the stored value need only be represented as a model number of the variable's subtype. Furthermore, if no exception is raised by the assignment, the stored value belongs to the subtype of the variable. If a real subtype is used as the type mark in a membership test, qualification, or explicit conversion, the corresponding operation is performed with the accuracy of the base type and the range of the subtype. For a real subtype, the value of the attributes FIRST or LAST is represented with at least the accuracy of the base type. The values of other attributes of a real subtype are given exactly. 3 AI_00408 AI-00408/11: Effect of compiling generic unit bodies separately An implementation is allowed to create a dependence on a generic unit body such that successfully compiling (or recompiling) the body separately makes previously compiled units obsolete if they contain an instantiation of the generic unit. A similar dependence can be created for separately compiled subunits of a generic unit. 3 AI_00409 AI-00409/05: Static subtype names created by instantiation A subtype can be nonstatic in a generic template and static in a corresponding instance. 3 AI_00412 AI-00412/06: Expanded names for generic formal parameters A formal parameter of a generic unit can be denoted by an expanded name. 3 AI_00418 AI-00418/06: Self-referencing with clauses Circular dependences among library units are not allowed, i.e., the library unit being compiled cannot have the same name as a previously compiled library unit if a with clause for the unit being compiled establishes a direct or indirect dependence on the previously compiled unit. 3 AI_00422 AI-00422/06: Representation clauses for derived enumeration and record types An enumeration representation clause or a record representation clause can be given for an enumeration type or a record type declared by a derived type declaration. The index subtype for the aggregate used in an enumeration representation clause is the base type of the enumeration type. A record representation clause for a first named subtype can specify the representation of any component that belongs to the record's base type, even if the subtype is constrained. 3 AI_00426 AI-00426/05: Operations on undefined array values If both operands of a predefined logical operator do not have the same number of components, CONSTRAINT_ERROR is raised, even if one of the operands has a scalar component with an undefined value. 3 AI_00430 AI-00430/05: Using an enumeration literal does not raise PROGRAM_ ERROR The use of an enumeration literal (i.e., a call of the corresponding parameterless function) does not raise PROGRAM_ ERROR. 3 AI_00431 AI-00431/05: Boolean operators producing out of range results Predefined logical operations on boolean arrays are performed on a component-by-component basis, using the predefined logical operation for the component type (even if a user-defined logical operation for the component type is visible and hides the predefined one.) 3 AI_00441 AI-00441/06: A task without dependents can be completed but not terminated A task that has no dependent tasks can be completed but not yet terminated, i.e., T'CALLABLE can be FALSE when T'TERMINATED is not yet TRUE. 3 AI_00444 AI-00444/05: Conditional entry calls can be queued momentarily A conditional entry call may (momentarily) increase the COUNT attribute of an entry, even if the conditional call is not accepted. 3 AI_00446 AI-00446/05: Raising an exception in an abnormally completed task An exception can be propagated to an abnormally completed task that is engaged in a rendezvous or that is waiting for a task to be activated. If this occurs, the exception has no effect. 3 AI_00449 AI-00449/04: Evaluating default discriminant expressions Default discriminant expressions are not evaluated when a subtype indication is elaborated. 3 AI_00455 AI-00455/05: Raising an exception before the sequence of statements If an exception is raised due to the attempt to activate a task and the exception is raised after elaboration of a declarative part and just before execution of a sequence of statements, the sequence of statements is not executed and control is transferred in the same manner as for an exception raised in the sequence of statements. 3 AI_00464 AI-00464/05: Delay statements executed by the environment task Delay statements can be executed by the environment task when a library package is elaborated. Such statements delay the environment task. 3 AI_00466 AI-00466/04: I/O performed by library tasks The language does not define what happens to external files after the completion of the main program and before completion of all the library tasks. 3 AI_00475 AI-00475/05: Multiplication of fixed point values by negative integers If the integer in an integer multiplication of a fixed point value is negative, the multiplication is equivalent to changing the sign of the fixed point value followed by repeated addition. 3 AI_00493 AI-00493/05: Operator symbols that represent the same operator Two string literals serving as operator symbols represent the same operator if the string literals are identical or if the only difference is that some letters appear in upper case rather than lower case. 3 AI_00508 AI-00508/03: The safe numbers of a fixed point subtype The safe numbers of a fixed point subtype are the safe numbers of its base type. 3 AI_00516 AI-00516/05: The safe interval for a fixed/integer result When a fixed point value is divided by an integer value, the result model interval is determined by considering the integer value to be a model interval consisting of a single integer value. Status: 200 OK Content-Type: text/plain; charset=ISO-8859-1 Last-Modified: Fri, 24 Jun 2011 18:47:48 GMT Script-Control: X-stream-mode=1 1 ADAMAP ADAMAP is an informational tool, intended to help users understand the correspondence between Compaq Ada commands and GNAT commands. NOTE Before using ADAMAP, execute the command file ADA$EXAMPLES:ADAMAP.COM to set up the necessary symbol. Format ADAMAP [qualifiers] [input-file] 2 Parameters ADAMAP has two modes of operation: interactive and file-driven. If you specify an input-file, ADAMAP reads the input-file. If you do not specify an input-file, ADAMAP prompts for input. 2 Command_Qualifiers /OUTPUT [=file-spec] The /OUTPUT qualifier redirects output to a file. If a file-spec is given, ADAMAP writes to that file. If the file-spec is omitted, ADAMAP writes to a file with the file-name of the input-file and the extension .GRPT. /OUTPUT only applies to file-driven mode. /PAGE [=number-of-lines] The /PAGE qualifier controls screen output. If no-of-lines is specified, ADAMAP outputs that number of lines followed by the message "PRESS RETURN TO CONTINUE" and a blank line. If no-of-lines is not specified, the default is 23. /BRIEF The /BRIEF qualifier suppresses redundant informational messages.