![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Function Attribute_Time
function Attribute_Time (Compilation_Unit : in Asis.Compilation_Unit; Attribute : in Asis.Asis_String) return Asis.Asis_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:
- The compilation unit is Asis.Nil_Compilation_Unit
- The compilation unit does not have the specified attribute
- The implementation does not support compilation-unit attributes (see the Environment.Attributes_Are_Supported function)
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
Function Attribute_Value_Delimiter
function Attribute_Value_Delimiter return Asis.Asis_String;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
Examples
Cross-References
Function Attribute_Values
function Attribute_Values (Compilation_Unit : in Asis.Compilation_Unit; Attribute : in Asis.Asis_String) return Asis.Asis_String;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:
- The compilation unit is Asis.Nil_Compilation_Unit
- The compilation unit does not have the specified attribute
- The compilation unit has the specified attribute but the attribute has no value
- The implementation does not support compilation-unit attributes (see the Environment.Attributes_Are_Supported function)
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
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_String;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
- function Attribute_Time
- function Attribute_Value_Delimiter
- function Has_Attribute
- function Environment.Attributes_Are_Supported
Function Body_Is_Optional
function Body_Is_Optional (Compilation_Unit : in Asis.Compilation_Unit) return Boolean;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
Compilation_Unit : in Asis.Compilation_Unit;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
- "Miscellaneous Properties"
- Ada83 LRM 7.1, Ada95 LRM
7.1
Function Can_Be_Main_Program
function Can_Be_Main_Program (Compilation_Unit : in Asis.Compilation_Unit) return Boolean;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
Compilation_Unit : in Asis.Compilation_Unit;Specifies the compilation unit to query. All Compilation_Unit_Kinds are appropriate.
return Boolean;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:
- "Miscellaneous Properties"
- Ada83 LRM 10.1 , Ada95 LRM
10.1.1
Function Compilation_Command_Line_Options
function Compilation_Command_Line_Options (Compilation_Unit : in Asis.Compilation_Unit) return Asis.Asis_String;Expanded Name Asis.Compilation_Units.
Compilation_Command_Line_OptionsReturns an Asis.Asis_String containing the command-line options used to compile the specified compilation unit.
Description
Returns Asis.Nil_Asis_String if:
- The compilation unit is Asis.Nil_Compilation_Unit
- The Compilation_Unit_Kinds is A_Nonexistent_Library_Unit or A_Nonexistent_Secondary_Unit
- The command-line options are not available for any reason
Rational ASIS does not support command-line options; it always returns Asis.Nil_Asis_String.
Parameters
Compilation_Unit : in Asis.Compilation_Unit;Specifies the compilation unit to query. All Compilation_Unit_Kinds are appropriate.
return Asis.Asis_String;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
Function Compilation_Cpu_Time
function Compilation_Cpu_Time (Compilation_Unit : in Asis.Compilation_Unit) return Asis.Asis_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 compilation unit is Asis.Nil_Compilation_Unit
- The Compilation_Unit_Kinds is A_Nonexistent_Library_Unit or A_Nonexistent_Secondary_Unit
- The amount of CPU time not available for any reason
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
Compilation_Unit : in Asis.Compilation_Unit;Specifies the compilation unit to query. All Compilation_Unit_Kinds are appropriate.
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
Function Compilation_Order
function Compilation_Order (Compilation_Units : in Asis.Compilation_Unit_List; Dependent_Units : in Asis.Compilation_Unit_List; Library : in Asis.Library; Relation : in Relation_Kinds) return Asis.Relationship;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:
- Dependent_Units list Is_Nil, the search context is the entire library. The returned Asis.Relationship includes all direct dependents or dependents of the specified compilation units.
- Dependent_Units is not Is_Nil, the search context is restricted to the extended families of the Dependent_Units. The returned Asis.Relationship includes only the direct dependents or dependents of the specified compilation units that also exist in the extended families of the Dependent_Units.
Parameters
Compilation_Units : in Asis.Compilation_Unit_List;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
Dependent_Units : in Asis.Compilation_Unit_List;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
Library : in Asis.Library;Specifies the library to be searched and to which the returned compilation units must belong.
Relation : in Relation_Kinds;Specifies the required relationship between the specified compilation units and the units returned compilation-unit values.
return Asis.Relationship;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
Function Compilation_Pragmas
function Compilation_Pragmas (Compilation_Unit : in Asis.Compilation_Unit) return Asis.Pragma_Element_List;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:
- Appear after the terminating semicolon of the unit and affect the compilation of the unit
- Appear anywhere in the file containing the unit, and possibly other units, and affect the compilation of the unit
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
Compilation_Unit : in Asis.Compilation_Unit;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
- function Context_Clause_Elements
- function Unit_Declaration
- function Elements.Argument_Associations
- function Elements.Name
- function Elements.Pragmas
Type Compilation_Unit_Kinds
type Compilation_Unit_Kinds is (...);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
A_Generic_DeclarationIndicates that the compilation unit is a generic specification (Ada83 LRM 12.1, Ada95 LRM 12.1).
A_Generic_InstantiationIndicates that the compilation unit is a generic instantiation (Ada83 LRM 12.3, Ada95 LRM 12.3).
A_Nonexistent_Library_UnitIndicates 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.
A_Nonexistent_Secondary_UnitIndicates 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.
A_Package_BodyIndicates 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).
A_Package_DeclarationIndicates that the compilation unit is a package specification (Ada83 LRM 7.1, Ada95 LRM 7.1).
A_Subprogram_BodyIndicates 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).
A_Subprogram_DeclarationIndicates 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).
A_SubunitIndicates that the compilation unit is a proper body (Ada83 LRM 10.2, Ada95 LRM 10.2) of a separate subprogram, package, or task.
Not_A_Compilation_UnitIndicates 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.
UnknownIndicates 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:
- The unit has been syntax checked (Compile:Syntax) but never analyzed or compiled (Compile:Analyze or Compile:Compile)
- The unit was analyzed or compiled but has since been cleaned (Compile:Clean)
- The unit was analyzed or compiled but has since been edited
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
- "Determining Compilation-Unit Kind"
- Ada83 LRM 6.1, Ada95 LRM 6.1
- Ada83 LRM 6.3, Ada95 LRM 6.3
- Ada83 LRM 7.1, Ada95 LRM
7.1- Ada83 LRM 10.1, Ada95 LRM
10.1.1- Ada83 LRM 12.1, Ada95 LRM 12.1
- Ada83 LRM 12.3, Ada95 LRM 12.3
Type Compilation_Unit_Origins
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:
- An Ada program library is created: units created when a library is created are typically Ada predefined units but can also be vendor-supplied units
- A library management tool is used: units created by a library tool are typically vendor-supplied units, such as a math library, or user-defined units
- A compilation is performed: units created by a compilation are typically user-defined units
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
A_Compiler_Predefined_UnitIndicates 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.
A_Predefined_UnitIndicates that the unit is an Ada predefined unit (LRM Annex C).
The following are predefined units:
- Calendar
- Standard
- System
- Unchecked_Conversion
- Unchecked_Deallocation
Vendors that provide I/O facilities will have, and must recognize, the following predefined units:
- Direct_Io
- Io_Exceptions
- Low_Level_Io
- Sequential_Io
- Text_Io
If machine code insertions are supported, the vendor will have, and must recognize, the following predefined unit:
- Machine_Code
A_User_Defined_UnitIndicates that the unit is neither A_Compiler_Predefined_Unit nor A_Predefined_Unit.
Not_A_Compilation_UnitIndicates that the unit is Asis.Nil_Compilation_Unit.
Cross-References
Function Compilation_Units
function Compilation_Units (Library : in Asis.Library) return Asis.Compilation_Unit_List;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
Library : in Asis.Library;Specifies the library to return the compilation units from.
return Asis.Compilation_Unit_List;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
Rational Software Corporation
http://www.rational.com support@rational.com techpubs@rational.com Copyright © 1993-2001, Rational Software Corporation. All rights reserved. |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |