TOC PREV NEXT INDEX DOC LIST MASTER INDEX




Function Attribute_Time

Expanded Name Asis.Compilation_Units.Attribute_Time

Returns the time associated with the specified compilation-unit attribute for the specified compilation unit.

Description

Returns Asis.Nil_Asis_Time if:

Rational ASIS does not support compilation-unit attributes; it always returns Asis.Nil_Asis_Time.

Parameters

Compilation_Unit
: in Asis.Compilation_Unit;

Specifies the compilation unit to query. All Compilation_Unit_Kinds are appropriate.

Attribute : in Asis.Asis_String;

Specifies the name of the compilation-unit attribute to query.

return Asis.Asis_Time;

Rational ASIS always returns Asis.Nil_Asis_Time.

Errors

Asis_Inappropriate_Compilation_Unit is raised and Environment.Status is set to Value_Error if a compilation-unit parameter references a library that is no longer open.

Examples

Cross-References

Related subprograms:

Related concepts:


Function Attribute_Value_Delimiter

Expanded Name Asis.Compilation_Units.Attribute_Value_Delimiter

Returns the Asis.Asis_String used as a delimiter to separate individual lines in the value of a compilation-unit attribute.

Description

A portable ASIS application should not depend on a particular value or a value of a particular length being returned.

Attribute values are not terminated with an Image_Delimiter.

Asis.Nil_Asis_String can be returned by implementations that do not support compilation-unit attribute values and for implementations that do not support multiple values for a single attribute.

Parameters

return Asis.Asis_String;

Rational ASIS does not support compilation-unit attributes; it always returns Asis.Nil_Asis_String.

Errors

None.

Examples

Cross-References

Related subprograms:

Related concepts:


Function Attribute_Values

Expanded Name Asis.Compilation_Units.Attribute_Values

Returns the value associated with the specified compilation-unit attribute for the specified compilation unit.

Description

Returns Asis.Nil_Asis_String if:

If the attribute contains multiple values, they are separated with the value returned by the Attribute_Value_Delimeter function. The returned attribute value is not terminated with an Attribute_Value_Delimeter string.

Rational ASIS does not support compilation-unit attributes; it always returns Asis.Nil_Asis_String.

Parameters

Specifies the compilation unit to query. All Compilation_Unit_Kinds are appropriate.

Specifies the name of the compilation-unit attribute to query.

Rational ASIS always returns Asis.Nil_Asis_String.

Errors

Asis_Inappropriate_Compilation_Unit is raised and Environment.Status is set to Value_Error if a compilation-unit parameter references a library that is no longer open.

Examples

Cross-References

Related subprograms:

Related concepts:


Function Body_Is_Optional

Expanded Name Asis.Compilation_Units.Body_Is_Optional

Returns a Boolean value indicating whether the body of the specified compilation unit is optional (Ada83 LRM 7.1, Ada95 LRM 7.1).

Description

The function returns False for Asis.Nil_Compilation_Unit or a unit with a Compilation_Unit_Kinds of A_Nonexistent_Library_Unit or A_Nonexistent_Secondary_Unit. The function can return True or False for units with a Compilation_Unit_Kinds of Unknown; the implementation is implementation-defined.

The value returned by this function does not indicate whether the compilation unit for the body actually exists in the library. You can use the Corresponding_Secondary_Unit function to attempt to obtain the compilation-unit value for the body.

Parameters

Specifies the compilation unit to query. All Compilation_Unit_Kinds are appropriate.

return Boolean;

Returns True if the specified compilation unit does not require a body.

Errors

Asis_Inappropriate_Compilation_Unit is raised and Environment.Status is set to Value_Error if a compilation-unit parameter references a library that is no longer open.

Examples

Cross-References

Related subprogram:

Related concepts:


Function Can_Be_Main_Program

Expanded Name Asis.Compilation_Units.Can_Be_Main_Program

Returns a Boolean value indicating whether the specified compilation unit can be a main program (Ada83 LRM 10.1, Ada95 LRM 10.1.1).

Description

The compilation units that can be main units vary among Ada implementations. Typically, the compilation unit must have a Compilation_Unit_Kinds of A_Subprogram_Declaration or A_Generic_Instantiation and a Declaration_Kinds that represents a procedure or a function that returns an integer value. Typically, the these subprograms must not have any parameters.

See the Appendix F for your Ada environment for the requirements for your implementation.

Whether a compilation unit can be a main program or not does not indicate that the unit is consistent and can be linked into an executable; use the Is_Consistent function to determine if this is the case.

Parameters

Specifies the compilation unit to query. All Compilation_Unit_Kinds are appropriate.

Returns True if the specified compilation unit can be used as a main program.

Errors

Asis_Inappropriate_Compilation_Unit is raised and Environment.Status is set to Value_Error if a compilation-unit parameter references a library that is no longer open.

Examples

Cross-References

Related subprograms and types:

Related concepts:


Function Compilation_Command_Line_Options

Expanded Name Asis.Compilation_Units.
Compilation_Command_Line_Options

Returns an Asis.Asis_String containing the command-line options used to compile the specified compilation unit.

Description

Returns Asis.Nil_Asis_String if:

Rational ASIS does not support command-line options; it always returns Asis.Nil_Asis_String.

Parameters

Specifies the compilation unit to query. All Compilation_Unit_Kinds are appropriate.

Rational ASIS always returns Asis.Nil_Asis_String.

Errors

Asis_Inappropriate_Compilation_Unit is raised and Environment.Status is set to Value_Error if a compilation-unit parameter references a library that is no longer open.

Examples

Cross-References

Related subprograms:

Related concept:


Function Compilation_Cpu_Time

Expanded Name Asis.Compilation_Units.Compilation_Cpu_Time

Returns the amount of CPU time last required to compile the physical compilation unit associated with the specified compilation unit.

Description

Returns Asis.Nil_Asis_Time if:

The value returned is relative to Asis.Nil_Asis_Time. If you subtract Asis.Nil_Asis_Time from the Compilation_Cpu_Time, and the compilation took a day or less, you will obtain the Duration of the compilation.

Rational ASIS does not support compilation CPU times; it always returns Asis.Nil_Asis_Time.

Parameters

Specifies the compilation unit to query. All Compilation_Unit_Kinds are appropriate.

Rational ASIS always returns Asis.Nil_Asis_Time.

Errors

Asis_Inappropriate_Compilation_Unit is raised and Environment.Status is set to Value_Error if a compilation-unit parameter references a library that is no longer open.

Examples

Cross-References

Related subprograms:

Related concept:


Function Compilation_Order

Expanded Name Asis.Compilation_Units.Compilation_Order

Returns a compilation order containing units with the specified Relation to the specified compilation units.

Description

For any particular set of compilation units and Relation values, multiple compilation orders might be possible. This function returns one of those orders.

The list of compilation units to be compiled is placed into the Existing component of the returned Relationship. The compilation units should be compiled in the order in which they appear. For a description of the other Asis.Relationship record components, see "Finding Related Compilation Units."

Dependent_Units are required only when Relation has a value of Direct_Dependents or Dependents; otherwise, the parameter is ignored. If Dependent_Units is required and:

Parameters

Specifies a list of compilation units. The Compilation_Units must be of the following kinds:
Compilation_Unit_Kinds

A_Generic_Declaration

A_Generic_Instantiation

A_Package_Body

A_Package_Declaration

A_Subprogram_Body

A_Subprogram_Declaration

A_Subunit

Unknown

Specifies dependent compilation units used to limit the query. The Dependent_Units must be of the following kinds:
Compilation_Unit_Kinds

A_Generic_Declaration

A_Generic_Instantiation

A_Package_Body

A_Package_Declaration

A_Subprogram_Body

A_Subprogram_Declaration

A_Subunit

Unknown

Specifies the library to be searched and to which the returned compilation units must belong.

Specifies the required relationship between the specified compilation units and the units returned compilation-unit values.

Returns a compilation order containing units with the specified Relation to the specified compilation units. The specified compilation units are also returned as part of the Relationship.

The Enclosing_Library of all returned compilation units is the specified library.

Errors

Asis_Inappropriate_Library is raised and Environment.Status is set to Value_Error if a library variable is specified that is no longer open.

Asis_Inappropriate_Compilation_Unit is raised and Environment.Status is set to Value_Error if a compilation-unit parameter references a library that is no longer open.

Examples

Cross-References

Related subprograms:

Related concept:


Function Compilation_Pragmas

Expanded Name Asis.Compilation_Units.Compilation_Pragmas

Returns a list of the pragmas that apply to the whole of the compilation that contained the specified compilation unit.

Description

The only pragmas returned in the list are those that:

The function returns only pragmas that affect the whole of the compilation. For example, Elaborate pragmas are not returned because they affect only a single unit from the compilation.

You can use the Context_Clause_Elements function to obtain the list of the pragmas found within the context clauses.

The pragmas returned by this function can be duplicates of some or all of the pragmas returned by the Context_Clause_Elements function. The duplication is a result of the physical placement, because pragmas that affect the whole of a compilation can be specified within the context clauses of a unit.

You can obtain all pragmas within a given context with the Elements.Pragmas function. By specifying the element representing the unit declaration, as returned by the Unit_Declaration function, you can obtain a list of all pragmas in the unit.

Ada predefined program units, such as package Standard and the Unchecked_Conversion function, might or might not have pragmas available. These units might not have a physical representation. Whether pragmas and a physical representation exist is implementation-defined. You can use the Origin function to determine whether a compilation unit represents A_Predefined_Unit.

Rational ASIS provides a physical representation for all predefined packages and subprograms except package Standard. If a pragma was specified that affected the whole of the compilation, in any predefined unit except package Standard, it is returned by this function.

Parameters

Specifies the compilation unit for which the compilation pragmas should be returned. The Compilation_Unit must be of the following kinds:
Compilation_Unit_Kinds

A_Generic_Declaration

A_Generic_Instantiation

A_Package_Body

A_Package_Declaration

A_Subprogram_Body

A_Subprogram_Declaration

Unknown

return Asis.Pragma_Element_List;

The returned list contains elements of the following kind:
Element_Kinds

A_Pragma

To the extent that order is meaningful, the pragmas are normally returned in their order of appearance in the source code. However, the order is implementation-defined and many pragmas have the same effect regardless of order. Rational ASIS returns the pragmas in their order of appearance.

If no applicable pragmas exist, or the Compilation_Unit_Kinds of the specified compilation unit is Unknown, Asis.Nil_Element_List is returned.

Use the functions in package Elements to further analyze the pragmas returned.

Errors

Asis_Inappropriate_Compilation_Unit is raised and Environment.Status is set to Value_Error if a compilation-unit parameter references a library that is no longer open.

Examples

Cross-References

Related subprograms:

Related concepts:


Type Compilation_Unit_Kinds

Expanded Name Asis.Compilation_Units.Compilation_Unit_Kinds

Describes the kinds of compilation units.

Description

Compilation_Unit_Kinds includes values for known, nonexistent, and unknown units.

The definitions for nonexistent units exist solely to provide a means of expressing deducible inter-unit dependencies. Compilation units with these kinds can appear in the list returned by the Subunits function and in the Asis.Relationship record returned by a number of other functions. Compilation units with these kinds will not be returned by any other function.

Enumerations

Indicates that the compilation unit is a generic specification (Ada83 LRM 12.1, Ada95 LRM 12.1).

Indicates that the compilation unit is a generic instantiation (Ada83 LRM 12.3, Ada95 LRM 12.3).

Indicates that the compilation unit does not exist in the library, but that it was mentioned in a with clause in another unit or that it would be the specification for a body currently in the library. The unit does not have semantic information (elements) available.

Indicates that the compilation unit does not exist in the library, but that it is required by the presence of a body stub in a parent unit or would be the body of a specification that is in the library. The unit has no semantic information (elements) available.

Indicates that the compilation unit is a package body (Ada83 LRM 7.1, Ada95 LRM 7.1) or the body of a generic package specification (Ada83 LRM 12.1, Ada95 LRM 12.1).

Indicates that the compilation unit is a package specification (Ada83 LRM 7.1, Ada95 LRM 7.1).

Indicates that the compilation unit is a subprogram body (Ada83 LRM 6.3, Ada95 LRM 6.3) or the body of a generic subprogram specification (Ada83 LRM 12.1, Ada95 LRM 12.1).

Indicates that the compilation unit is a subprogram specification (Ada83 LRM 6.1, Ada95 LRM 6.1) or a subprogram body that has no specification (Ada83 LRM 6.3, Ada95 LRM 6.3).

Indicates that the compilation unit is a proper body (Ada83 LRM 10.2, Ada95 LRM 10.2) of a separate subprogram, package, or task.

Indicates that the compilation unit is Asis.Nil_Compilation_Unit, that the unit does not exist in the library, or that the compilation unit exists in the library but is known to be damaged, incomplete, or otherwise unusable.

Indicates that the compilation unit exists in the library but does not have semantic information (elements) available. These units might contain dependency data, be used to create an executable, or contain proprietary run-time modules.

This value can be returned under Apex if:

Certain kinds of information, for example, a compilation unit's supporters, might be available depending on the reason the unit's kind is unknown. In general, information is not available, and processing of unknown compilation units should be avoided.

Cross-References

Related subprogram:

Related concepts:


Type Compilation_Unit_Origins

Expanded Name Asis.Compilation_Units.Compilation_Unit_Origins

Describes the origins of compilation units.

Description

Compilation units can be added to an Ada program library when:

This type describes whether a compilation unit is an Ada predefined unit (LRM Annex C), some other unit provided by the compiler vendor, a user-created unit, or not a unit at all.

Rational ASIS cannot identify A_Compiler_Predefined_Unit; such units appear to be A_User_Defined_Unit.

Under Apex, whether a unit is an Ada predefined unit is based on the name; a user-defined unit having the same name as an Ada predefined unit will incorrectly be reported as being that Ada predefined unit.

Enumerations

Indicates that the unit was supplied by the compiler vendor but is not an Ada predefined unit (LRM Annex C). This can represent internal vendor run-time units or other units in vendor-supplied libraries. Whether this compilation-unit origin value is used is implementation-defined. If this value is not used, vendor-supplied units will have the value A_User_Defined_Unit.

Indicates that the unit is an Ada predefined unit (LRM Annex C).

The following are predefined units:

Vendors that provide I/O facilities will have, and must recognize, the following predefined units:

If machine code insertions are supported, the vendor will have, and must recognize, the following predefined unit:

Indicates that the unit is neither A_Compiler_Predefined_Unit nor A_Predefined_Unit.

Indicates that the unit is Asis.Nil_Compilation_Unit.

Cross-References

Related subprogram:

Related concepts:


Function Compilation_Units

Expanded Name Asis.Compilation_Units.Compilation_Units

Returns a list containing the compilation units belonging to the specified library (Ada83 LRM 10.1, Ada95 LRM 10.1.1).

Description

The returned list contains all library units (specifications) and secondary units (bodies).

The order of appearance of the compilation units in the list is not defined.

An individual compilation unit will only appear in the list once.

If the specified library does not contain any compilation units, Asis.Nil_Compilation_Unit_List is returned. Note that an Ada implementation might place units into a newly created library. Asis.Nil_Compilation_Unit_List might never be returned under such an implementation.

Under Rational Apex, the contents of a newly created library are determined by the model specified when the library was created. The minimal library content is package Standard; all other Ada predefined units will typically also exist. Additionally, all compilation units imported into the model will exist.

Parameters

Specifies the library to return the compilation units from.

The returned list contains compilation units of the following kinds:
Compilation_Unit_Kinds

A_Generic_Declaration

A_Generic_Instantiation

A_Package_Body

A_Package_Declaration

A_Subprogram_Body

A_Subprogram_Declaration

A_Subunit

Errors

Asis_Inappropriate_Library is raised and Environment.Status is set to Value_Error if a library variable is specified that is no longer open.

Examples

Cross-References

Related subprograms:

Related concept:


Rational Software Corporation  http://www.rational.com
support@rational.com
techpubs@rational.com
Copyright © 1993-2001, Rational Software Corporation. All rights reserved.
TOC PREV NEXT INDEX DOC LIST MASTER INDEX TECHNOTES APEX TIPS