![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Function Elaboration_Order
function Elaboration_Order (Compilation_Units : in Asis.Compilation_Unit_List; Library : in Asis.Library) return Asis.Relationship;Expanded Name Asis.Compilation_Units.Elaboration_Order
Returns a relationship containing a valid elaboration order for the specified compilation units.
Description
The list of compilation units required to elaborate the specified units is placed into the Existing component of the returned Relationship. If a particular compilation unit is not consistent, no related units are added to the Existing list.
For any particular set of compilation units, multiple elaboration orders might be possible. This function returns one of those orders.
The compilation units will be elaborated in the order in which they appear. For a description of the other Relationship record components, see "Finding Related Compilation Units."
If all specified compilation units are Is_Consistent in the specified library, the first unit in the Existing list is always the package specification for package Standard. If one or more compilation units are inconsistent, no guarantee is made to the content of the Existing component.
The list can contain vendor-specific runtime packages.
Parameters
Compilation_Units : in Asis.Compilation_Unit_List;Specifies the compilation unit for which the elaboration order is desired. The Compilation_Units list must contain 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
Unknown
Library : in Asis.Library;Specifies the library to be searched and to which the returned compilation units belong.
return Asis.Relationship;Returns an elaboration order for the specified compilation units.
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 Enclosing_Compilation_Unit
function Enclosing_Compilation_Unit (Element : in Asis.Element) return Asis.Compilation_Unit;Expanded Name Asis.Compilation_Units.Enclosing_Compilation_Unit
Returns the compilation unit in which the specified element physically exists.
Description
The returned compilation-unit value is Is_Identical to the compilation-unit value that was used to transition from compilation units to elements.
Parameters
Element : in Asis.Element;
Specifies the element for which the enclosing compilation unit is desired. All Element_Kinds except Not_An_Element are appropriate.
return Asis.Compilation_Unit;
The returned compilation unit is 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
Errors
Asis_Inappropriate_Element is raised and Environment.Status is set to Value_Error if a parameter references a library that is no longer open or if the specified element is Asis.Nil_Element.
Examples
Cross-References
Function Enclosing_Library
function Enclosing_Library (Compilation_Unit : in Asis.Compilation_Unit) return Asis.Library;Expanded Name Asis.Compilation_Units.Enclosing_Library
Returns the library from which the specified compilation unit was obtained.
Description
Because the Library type is limited private, this function's primary use is to provide the library parameter to other functions.
Two compilation-unit values that represent the same physical compilation unit will test as Is_Equal if they were obtained with different library values. They will test as Is_Identical if they were obtained from the same ASIS library.
Parameters
Compilation_Unit : in Asis.Compilation_Unit;Specifies the compilation unit for which the enclosing library is desired. All Compilation_Unit_Kinds are appropriate.
return Asis.Library;Returns the library to which the specified compilation unit belongs.
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 or is Asis.Nil_Compilation_Unit.
Examples
Cross-References
Function Exists
function Exists (Compilation_Unit : in Asis.Compilation_Unit) return Boolean;Expanded Name Asis.Compilation_Units.Exists
Returns a Boolean value indicating whether the specified compilation unit exists.
Description
This function returns False if:
- The compilation unit is Asis.Nil_Compilation_Unit
- The Compilation_Unit_Kinds is A_Nonexistent_Library_Unit or A_Nonexistent_Secondary_Unit
Otherwise, this function returns True.
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 unit is not Asis.Nil_Compilation_Unit and does not have a Compilation_Unit_Kinds of A_Nonexistent_Library_Unit or A_Nonexistent_Secondary_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 Has_Attribute
function Has_Attribute (Compilation_Unit : in Asis.Compilation_Unit; Attribute : in Asis.Asis_String) return Boolean;Expanded Name Asis.Compilation_Units.Has_Attribute
Returns a Boolean value indicating whether the specified compilation unit has the associated compilation-unit attribute.
Description
Returns True if the specified compilation unit has the specified compilation-unit attribute.
- The compilation unit is Asis.Nil_Compilation_Unit
- The specified compilation unit does not have the specified compilation-unit attribute
- The implementation does not support compilation-unit attributes
Otherwise, this function returns True.
Rational ASIS does not support compilation-unit attributes; italways returns False.
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 Boolean;Rational ASIS always returns False.
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
- "Compilation-Unit Attributes"
- package Environment, "Miscellaneous Other Capabilities"
Function Is_Consistent
function Is_Consistent (Compilation_Unit : in Asis.Compilation_Unit) return Boolean;
function Is_Consistent (Compilation_Unit : in Asis.Compilation_Unit; Library : in Asis.Library) return Boolean;Expanded Name Asis.Compilation_Units.Is_Consistent
Returns a Boolean value indicating whether the specified compilation unit can be linked as part of an executable.
Description
At any given time and within a particular library, a compilation unit is either obsolete (Is_Obsolete) or consistent (Is_Consistent), but not both.
This function returns False if:
- The compilation unit is Asis.Nil_Compilation_Unit
- The Compilation_Unit_Kinds is A_Nonexistent_Library_Unit or A_Nonexistent_Secondary_Unit
- The compilation unit does not belong to the specified library
- The unit is obsolete (Is_Obsolete)
Otherwise, this function returns True.
Not all Compilation_Unit_Kinds can be main programs. You can determine whether a particular compilation unit can be a main program with the Can_Be_Main_Program function.
Parameters
Compilation_Unit : in Asis.Compilation_Unit;Specifies the compilation unit for which the program closure status is desired. All Compilation_Unit_Kinds are appropriate.
Library : in Asis.Library;Specifies the library in which the analysis should be performed.
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. Is_Consistent (Compilation_Unit);Library_Unit := Asis.Compilation_Units. Is_Consistent (Compilation_Unit, Asis.Compilation_Units.Enclosing_Library (Asis.Compilation_Units. Enclosing_Compilation_Unit (Compilation_Unit));
return Boolean;This function returns True if the specified compilation unit, and all compilation units of its extended family (or program closure), are available for linking into an executable (Ada83 LRM 10.3, Ada95 LRM 10.1.4).
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 Is_Equal
function Is_Equal (Left : in Asis.Compilation_Unit; Right : in Asis.Compilation_Unit) return Boolean;Expanded Name Asis.Compilation_Units.Is_Equal
Returns a Boolean value indicating whether two compilation units represent the same physical compilation unit.
Description
- The compilation units represent the same physical compilation unit. The two compilation units need not have been obtained from the same ASIS library.
- The compilation units are both equal to Asis.Nil_Compilation_Unit.
- The compilation units have a Compilation_Unit_Kinds of A_Nonexistant_Library_Unit or A_Nonexistant_Secondary_Unit and the Compilation_Units.Name values are identical.
Otherwise, this function returns False.
Parameters
Left : in Asis.Compilation_Unit;Specifies the first compilation unit. All Compilation_Unit_Kinds are appropriate.
Right : in Asis.Compilation_Unit;Specifies the second compilation unit. All Compilation_Unit_Kinds are appropriate.
return Boolean;Returns True if the two compilation-unit values represent the same physical 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 Is_Identical
function Is_Identical (Left : in Asis.Compilation_Unit; Right : in Asis.Compilation_Unit) return Boolean;Expanded Name Asis.Compilation_Units.Is_Identical
Returns a Boolean value indicating whether two compilation units represent the same physical compilation unit and were obtained from the same ASIS library.
Description
- The compilation units represent the same physical compilation unit and have been derived from the same ASIS library
- The compilation units are both equal to Asis.Nil_Compilation_Unit
- The compilation units have a Compilation_Unit_Kinds of A_Nonexistant_Library_Unit or A_Nonexistant_Secondary_Unit, the Compilation_Units.Name values are identical, and Compilation_Units.Enclosing_Library values are Is_Identical
Otherwise, this function returns False.
Parameters
Left : in Asis.Compilation_Unit;Specifies the first compilation unit. All Compilation_Unit_Kinds are appropriate.
Right : in Asis.Compilation_Unit;Specifies the second compilation unit. All Compilation_Unit_Kinds are appropriate.
return Boolean;Returns True if the two compilation-unit values represent the same physical compilation unit and have been derived from the same ASIS 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 Is_Nil
function Is_Nil (Right : in Asis.Compilation_Unit) return Boolean;
function Is_Nil (Right : in Asis.Compilation_Unit_List) return Boolean;Expanded Name Asis.Compilation_Units.Is_Nil
Returns a Boolean value indicating whether the specified compilation unit is Asis.Nil_Compilation_Unit or the specified compilation-unit list is empty.
Description
A compilation unit is nil if its value is Asis.Nil_Compilation_Unit.
A compilation-unit list is nil if the value of its 'Length attribute is 0.
Parameters
Right : in Asis.Compilation_Unit;Specifies the compilation unit. All Compilation_Unit_Kinds are appropriate.
Right : in Asis.Compilation_Unit_List;Specifies the compilation-unit list. All Compilation_Unit_Kinds are appropriate.
return Boolean;Returns True if the specified compilation unit is Asis.Nil_Compilation_Unit or the specified Compilation_Unit_List's 'Length attribute value is 0.
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 Is_Obsolete
function Is_Obsolete (Compilation_Unit : in Asis.Compilation_Unit) return Boolean;
function Is_Obsolete (Compilation_Unit : in Asis.Compilation_Unit; Library : in Asis.Library) return Boolean;Expanded Name Asis.Compilation_Units.Is_Obsolete
Returns a Boolean value indicating whether the specified compilation unit or any supporting unit is obsolete or missing.
Description
At any given time and within a particular library, a compilation unit is either obsolete (Is_Obsolete) or consistent (Is_Consistent), but not both.
This function returns True if:
- The compilation unit is Asis.Nil_Compilation_Unit
- The Compilation_Unit_Kinds is A_Nonexistent_Library_Unit or A_Nonexistent_Secondary_Unit
- The compilation unit does not belong to the specified library
- Any supporting units have been recompiled or no longer belong to the library
Otherwise, this function returns False.
Parameters
Compilation_Unit : in Asis.Compilation_Unit;Specifies the compilation unit for which the program closure is desired. All Compilation_Unit_Kinds are appropriate.
Library : in Asis.Library;Specifies the library in which the analysis should be performed.
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. Is_Obsolete (Compilation_Unit);Library_Unit := Asis.Compilation_Units. Is_Obsolete (Compilation_Unit, Asis.Compilation_Units.Enclosing_Library (Asis.Compilation_Units. Enclosing_Compilation_Unit (Compilation_Unit));
return Boolean;This function returns False if the specified compilation unit, or any compilation units of its extended family (or program closure), are not available for linking into an executable (Ada83 LRM 10.3, Ada95 LRM 10.1.4).
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 Is_Subunit
function Is_Subunit (Compilation_Unit : in Asis.Compilation_Unit) return Boolean;Expanded Name Asis.Compilation_Units.Is_Subunit
Returns a Boolean value indicating whether the specified compilation unit is a subunit.
Description
Compilation subunits are defined by the following syntax:
subunit ::=
separate (parent_unit_name) proper bodyThis function returns True if the specified compilation unit is a subunit.
Parameters
Specifies the compilation unit that should be queried. The Compilation_Unit must be of the following kind
Compilation_Unit_Kinds
A_Subunit
:
return Boolean;
Returns True for all compilation units in the above table and False for all other compilation units.
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
- "Analyzing Subunits"
- Ada83 LRM 10.2, Ada95 LRM 10.1.3
Rational Software Corporation
http://www.rational.com support@rational.com techpubs@rational.com Copyright © 1993-2001, Rational Software Corporation. All rights reserved. |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |