![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Function Kind
function Kind (Compilation_Unit : in Asis.Compilation_Unit) return Compilation_Unit_Kinds;Expanded Name Asis.Compilation_Units.Kind
Returns the kind of the specified compilation unit.
Description
Compilation units are defined by the following syntax, which also describes the different kinds of possible compilation units:
Ada83 LRM 10.1, Ada95 LRM 10.1.1
compilation_unit ::=
context_clause library_unit
| context_clause secondary_unitlibrary_unit ::=
subprogram_declaration
| package_declaration
| generic_declaration
| generic_instantiation
| subprogram_bodysecondary_unit ::= library_unit_body | subunit
library_unit_body ::=
subprogram_body
| package_bodyParameters
Compilation_Unit : in Asis.Compilation_Unit;Specifies the compilation unit to query. All compilation-unit kinds are appropriate.
return Compilation_Unit_Kinds;
- Not_A_Compilation_Unit if the compilation unit is Asis.Nil_Compilation_Unit.
- Unknown for a compilation unit that exists but that does not have any semantic information (elements) available. Such a unit might contain dependency data, be used to create an executable, or contain proprietary run-time modules.
- A_Nonexistent_Library_Unit or A_Nonexistent_Secondary_Unit that has name-only entries in the library. The entry can exist because it:
- Was referenced by an existing unit but the referenced unit has never been supplied or compiled.
- Represents a separate subunit that has never been supplied or compiled.
- Existed at some point in time but the semantic information is no longer available. The information might have become obsolete, been removed through a utility or other library operation, or is no longer available for other reasons.
- The kind of the specified compilation_unit (Ada83 LRM 10.1, Ada95 LRM 10.1.1) for all other 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
- "Determining Compilation-Unit Kind"
- Ada83 LRM 10.1, Ada95 LRM 10.1.1
Function Library_Unit
function Library_Unit (Name : in String; Library : in Asis.Library) return Asis.Compilation_Unit;Expanded Name Asis.Compilation_Units.Library_Unit
Returns the library unit with the specified simple name, belonging to the specified library.
Description
Library units are defined by the following syntax, which also describes the kinds of compilation units that can be returned by this function:
Ada83 LRM 10.1, Ada95 LRM 10.1.1
library_unit ::=
subprogram_declaration
| package_declaration
| generic_declaration
| generic_instantiation
| subprogram_bodyParameters
Name : in String;Specifies the simple name of the compilation unit desired.
Library : in Asis.Library;Specifies the library to which the unit must belong.
return Asis.Compilation_Unit;Returns the library unit with the specified simple name, belonging to the specified library. The returned compilation unit is of the following kinds:
Compilation_Unit_Kinds
A_Generic_Declaration
A_Generic_Instantiation
A_Package_Declaration
A_Subprogram_Declaration
Unknown
If a library unit with the specified name does not belong to the specified library, Asis.Nil_Compilation_Unit is returned.
This function never returns a compilation unit with a Compilation_Unit_Kinds of A_Nonexistent_Library_Unit or A_Nonexistent_Secondary_Unit.
If a non-nil compilation unit is returned, the Enclosing_Library is Libraries.Is_Identical to 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.
Examples
Cross-References
- function Corresponding_Secondary_Unit
- function Library_Units
- function Secondary_Unit
- function Secondary_Units
- "Library Content"
- Ada83 LRM 10.1, Ada95 LRM 10.1.1
Function Library_Units
function Library_Units (Library : in Asis.Library) return Asis.Compilation_Unit_List;Expanded Name Asis.Compilation_Units.Library_Units
Returns a list containing the library units belonging to the specified library.
Description
Library units are defined by the following syntax:
Ada83 LRM 10.1 , Ada95 LRM 10.1.1
library_unit ::=
subprogram_declaration
| package_declaration
| generic_declaration
| generic_instantiation
| subprogram_bodyThis function returns a list containing the library_units belonging to the specified library.
The order of appearance of units in the list is not defined. Individual units will only appear once.
If the specified library does not contain any library 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.
This function never returns a compilation unit with a Compilation_Unit_Kinds of A_Nonexeistent_Library_Unit.
The Enclosing_Library for each unit in the returned list is Libraries.Is_Identical to the specified library.
Parameters
Library : in Asis.Library;Specifies the library to which the units must belong.
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_Declaration
A_Subprogram_Body
A_Subprogram_Declaration
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
- "Library Content"
- Ada83 LRM 10.1., Ada95 LRM 10.1.1
Function Name
function Name (Compilation_Unit : in Asis.Compilation_Unit) return String;Expanded Name Asis.Compilation_Units.Name
Returns the fully expanded name of the specified compilation unit.
Description
The name can be a simple name ("A"), as in the case of package or subprogram, or an expanded name ("A.B"), as in the case of a nested package or subunit.
If Asis.Nil_Compilation_Unit is specified, Asis.Nil_Asis_String is returned.
The case of names returned by this function will vary among vendors. Vendors are encouraged, but not required, to return names in the same case as was used in the original compilation text.
Rational ASIS under Apex returns the name in uppercase.
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 String;Returns the fully expanded name of 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 Object_File_Form
function Object_File_Form (Compilation_Unit : in Asis.Compilation_Unit) return Asis.Asis_String;Expanded Name Asis.Compilation_Units.Object_File_Form
Returns the Form parameter (for Text_Io.Open) of the object file or other structure that contains the machine-code result of 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 object file Form parameter; it always returns Asis.Nil_Asis_String.
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 Object_File_Name
function Object_File_Name (Compilation_Unit : in Asis.Compilation_Unit) return Asis.Asis_String;Expanded Name Asis.Compilation_Units.Object_File_Name
Returns the name of the object file or other structure that contains the machine-code result of 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
Rational ASIS does not support the retrieval of object file names; it always returns Asis.Nil_Asis_String.
Parameters
Compilation_Unit : in Asis.Compilation_Unit;Specifies the compilation unit for which the object file name 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 Origin
function Origin (Compilation_Unit : Asis.Compilation_Unit) return Compilation_Unit_Origins;Expanded Name Asis.Compilation_Units.Origin
Returns the origin of the specified compilation unit.
Parameters
Compilation_Unit : in Asis.Compilation_Unit;Specifies the compilation unit for which the origin is desired. All Compilation_Unit_Kinds are appropriate.
return Compilation_Unit_Origins;Returns the origin of the specified compilation unit. Apex cannot identify A_Compiler_Predefined_Unit; such units appear to be A_User_Defined_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
Related subprograms and types:
Function Recompilation_Order
function Recompilation_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.Recompilation_Order
Returns a recompilation order containing units that have the specified Relation to the specified compilation units and need recompilation.
Description
For any set of compilation units and Relation values, multiple recompilation orders might be possible. This function returns one of those orders.
The list of compilation units to be recompiled is placed into the Existing component of the returned Relationship. For a description of the other Relationship record components, see "Finding Related Compilation Units."
The Enclosing_Library of all returned compilation units is the specified library.
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. 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 the:
- Dependent_Units list Is_Nil, the context for the search is the entire library. The returned Relationship includes all direct dependents or dependents of the specified compilation units.
- Dependent_Units list is not Is_Nil, the context for the search is restricted to the extended families of the Dependent_Units. The returned Relationship includes only the direct dependents or dependents of the specified compilation units that also exist in the extended families of the Dependent_Units.
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 recompilation order containing units with the specified Relation to the specified compilation units and that are in need of recompilation. The specified compilation units are returned as part of the Relationship if they are in need of recompilation.
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 Referenced_Units
function Referenced_Units (Clause : in Asis.Context_Clause) return Asis.Simple_Name_List;Expanded Name Asis.Compilation_Units.Referenced_Units
Returns a list of the simple names that appear in the specified context clause.
Description
The names are returned in their order of appearance in the source code.
Some ASIS implementations normalize all multiname with or use clauses into an equivalent sequence of single-name clauses. In this case, the returned list always contains a single entry. See the Context_Clause_Elements function for more information.
Rational ASIS does not normalize multiname with or use clauses.
Parameters
Clause : in Asis.Context_Clause;Specifies the context clause for which the simple names are desired.The Clause must be of the following kinds:
Element_Kinds
A_Use_Clause1
A_With_Clause
1 Only use clause elements returned by the Context_Clause_Elements function are appropriate. The Expressions.Named_Packages function should be used to analyze use clauses that are declarative items.
return Asis.Simple_Name_List;
The returned list contains elements of the following kinds:
Element_Kinds Expression_Kinds
An_Expression A_Simple_Name
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
Rational Software Corporation
http://www.rational.com support@rational.com techpubs@rational.com Copyright © 1993-2001, Rational Software Corporation. All rights reserved. |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |