![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Function Supporters
function Supporters (Compilation_Unit : in Asis.Compilation_Unit; Compilation_Units : in Asis.Compilation_Unit_List) return Asis.Compilation_Unit_List;
function Supporters (Compilation_Unit : in Asis.Compilation_Unit; Compilation_Units : in Asis.Compilation_Unit_List; Library : in Asis.Library) return Asis.Compilation_Unit_List;Expanded Name Asis.Compilation_Units.Supporters
Returns a list of the units directly supporting the specified compilation unit that also exist in the specified compilation-unit list.
Description
If the specified compilation unit does not belong to the specified library, all components of the returned Relationship will be Is_Nil.
The returned list of compilation units contains only those units that are supporters of the specified compilation unit, that exist in the candidate compilation-unit list, and that belong to the specified library. A compilation unit is not a direct supporter of itself and will not exist in the returned list.
See the enumeration value Supporters in the Relation_Kinds type for a description of what units constitute supporting units.
The specified library need not be the Enclosing_Library of the specified compilation unit. By specifying a different library, you can obtain an Is_Equal compilation-unit value from a different library.
The returned list can include Is_Identical compilation-unit values if duplicates appear in the candidate compilation-unit list.
Parameters
Compilation_Unit : in Asis.Compilation_Unit;Specifies the compilation unit for which the list of supporting units 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
A_Subunit
Unknown
:
Compilation_Units : in Asis.Compilation_Unit_List;Specifies the list of candidate compilation units. All Compilation_Unit_Kinds are appropriate.
Library : in Asis.Library;Specifies the library to which the returned units must belong.
If a library is not specified, the Enclosing_Library of the compilation unit is assumed. These calls produce identical results:
Library_Unit := Asis.Compilation_Units. Supporters (Compilation_Unit, Compilation_Units);Library_Unit := Asis.Compilation_Units. Supporters (Compilation_Unit, Compilation_Units, Asis.Compilation_Units.Enclosing_Library (Asis.Compilation_Units. Enclosing_Compilation_Unit (Compilation_Unit));
return Asis.Compilation_Unit_List;Returns a list of the units that are supporters of the specified compilation unit and that also appear in the list of candidate compilation units. All kinds of compilation units can appear in the returned list.
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 Dependents
- function Direct_Dependents
- function Direct_Supporters
- function Libraries.Is_Equal
- function Libraries.Is_Identical
Function Text_File_Form
function Text_File_Form (Compilation_Unit : in Asis.Compilation_Unit) return Asis.Asis_String;Expanded Name Asis.Compilation_Units.Text_File_Form
Returns the Form parameter (for Text_Io.Open) of the text file or other structure that was the source for the compilation of 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 Form parameter value is not available for any reason
Rational ASIS does not support the retrieval of the text file Form parameter; it always returns Asis.Nil_Asis_String. However, a Form parameter is not required to access source files, so a nil string can always be specified in Text_Io.Open.
Parameters
Compilation_Unit : in Asis.Compilation_Unit;Specifies the compilation unit for which the Text_Io.Open Form parameter is desired. All Compilation_Unit_Kinds are appropriate.
return Asis.Asis_String;Rational ASIS 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 Text_File_Name
function Text_File_Name (Compilation_Unit : in Asis.Compilation_Unit) return Asis.Asis_String;Expanded Name Asis.Compilation_Units.Text_File_Name
Returns the name of the text file or other structure that was the source for the compilation of 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 text file name is not available for any reason
If the specified compilation unit is a library unit, the returned string references a file with a ".1.ada" suffix. If the specified compilation unit is a secondary unit, the returned string references a file with a ".2.ada" suffix. In both cases, the name is a fully expanded path name.
Parameters
Compilation_Unit : in Asis.Compilation_Unit;Specifies the compilation unit for which the file name is desired. All Compilation_Unit_Kinds are appropriate.
return Asis.Asis_String;Returns the fully qualified path name of the unit image.
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 Time_Of_Last_Update
function Time_Of_Last_Update (Compilation_Unit : in Asis.Compilation_Unit) return Asis.Asis_Time;Expanded Name Asis.Compilation_Units.Time_Of_Last_Update
Returns the time that the representation of the specified compilation unit was last updated in the Ada library.
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 last update time is not available for any reason or is not meaningful
Rational ASIS returns the file system modification time of the file containing the Ada source corresponding to the specified compilation unit.
Parameters
Compilation_Unit : in Asis.Compilation_Unit;Specifies the compilation unit for which the last update time is desired. All Compilation_Unit_Kinds are appropriate.
return Asis.Asis_Time;Returns the time that the representation of the specified compilation unit was last updated in the Ada library.
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 Unique_Name
function Unique_Name (Compilation_Unit : in Asis.Compilation_Unit) return Asis.Asis_String;Expanded Name Asis.Compilation_Units.Unique_Name
Returns an Asis.Asis_String containing a name that uniquely identifies, within the underlying Ada library implementation, the specified compilation unit.
Description
The result will vary depending on the ASIS implementation. The unique name can include the name and parameters of the library, file system paths, sub-library names, version numbers, unit kind, or any other information that a vendor needs to uniquely identify the compilation unit.
If Asis.Nil_Compilation_Unit is specified, Asis.Nil_Asis_String is returned.
Under Apex, the name remains the same until the unit is removed.
Parameters
Compilation_Unit : in Asis.Compilation_Unit;Specifies the compilation unit for which the unique name is desired. All Compilation_Unit_Kinds are appropriate.
return Asis.Asis_String;Returns the unique name for the specified compilation unit.
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 Unit_Declaration
function Unit_Declaration (Compilation_Unit : in Asis.Compilation_Unit) return Asis.Declaration;Expanded Name Asis.Compilation_Units.Unit_Declaration
Returns the element representing the declaration of the specified compilation unit.
Description.
If the specified compilation unit has a Compilation_Unit_Kinds of Unknown, Asis.Nil_Element is returned.
A subprogram body is treated as a secondary unit when a library unit with the same name already exists. If such a library unit does not exist, the subprogram body is treated as a library unit. In either case, the unit has a Compilation_Unit_Kinds of A_Subprogram_Declaration. In the later case, it has a Declarations.Declaration_Kinds of A_Procedure_Body_Declaration or A_Function_Body_Declaration rather than A_Procedure_Declaration or A_Function_Declaration.
Analysis of compilation units is performed with the elements that comprise the unit. Initial analysis is performed with the functions in package Declarations.
Parameters
Compilation_Unit : in Asis.Compilation_Unit;Specifies the compilation unit for which the declaration 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
A_Subunit
Unknown
:
return Asis.Declaration;The returned element is of the following kinds:
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
- "Element Gateway and Context Clause Decomposition"
- package Declarations, "Determining Declaration Kinds and Names"
Package Operations
package Operations is -- For Asis.Compilation_Unit -- and Asis.Compilation_Unit_List function "&" (Left : Asis.Compilation_Unit_List; Right : Asis.Compilation_Unit_LIst) return Asis.Compilation_Unit_List; function "&" (Left : Asis.Compilation_Unit_List; Right : Asis.Compilation_Unit) return Asis.Compilation_Unit_List; function "&" (Left : Asis.Compilation_Unit; Right : Asis.Compilation_Unit_List) return Asis.Compilation_Unit_List; function "&" (Left : Asis.Compilation_Unit; Right : Asis.Compilation_Unit) return Asis.Compilation_Unit_List; function Is_Nil (Right : Asis.Compilation_Unit) ... function Is_Nil (Right : Asis.Compilation_Unit_List) ... function Is_Equal (Left, Right : Asis.Compilation_Unit) ... function Is_Identical (Left, Right : Asis.Compilation_Unit) ... -- For Compilation_Unit_Kinds function "&" (Left, Right : ... -- For Relation_Kinds function "&" (Left, Right : ...end Operations.Expanded Name Asis.Compilation_Units.Operations
Package Operations provides a simple way to obtain visibility to operators for types used in package Compilation_Units. The package typically is referenced in a use clause by an
application.Cross-References
Rational Software Corporation
http://www.rational.com support@rational.com techpubs@rational.com Copyright © 1993-2001, Rational Software Corporation. All rights reserved. |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |