TOC PREV NEXT INDEX DOC LIST MASTER INDEX




Function Kind

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_unit

 library_unit ::=
   subprogram_declaration
  | package_declaration
  | generic_declaration
  | generic_instantiation
  | subprogram_body

 secondary_unit ::= library_unit_body | subunit

 library_unit_body ::=
   subprogram_body
  | package_body

Parameters

Specifies the compilation unit to query. All compilation-unit kinds are appropriate.

This function returns:

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 type:

Related concepts:


Function Library_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_body

Parameters

Specifies the simple name of the compilation unit desired.

Specifies the library to which the unit must belong.

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

Related subprograms:

Related concepts:


Function Library_Units

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_body

This 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

Specifies the library to which the units must belong.

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

Related subprograms:

Related concepts:


Function Name

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

Specifies the compilation unit for which the file name is desired. All Compilation_Unit_Kinds are appropriate.

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

Related subprograms:

Related concepts:


Function Object_File_Form

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:

Rational ASIS does not support the retrieval of the object file Form parameter; it always returns Asis.Nil_Asis_String.

Parameters

Specifies the compilation unit for which the Text_Io.Open Form parameter is desired. All Compilation_Unit_Kinds are appropriate.

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

Related subprograms:

Related concept:


Function Object_File_Name

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:

Rational ASIS does not support the retrieval of object file names; it always returns Asis.Nil_Asis_String.

Parameters

Specifies the compilation unit for which the object file name is desired. All Compilation_Unit_Kinds are appropriate.

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

Related subprograms:

Related concept:


Function Origin

Expanded Name Asis.Compilation_Units.Origin

Returns the origin of the specified compilation unit.

Parameters

Specifies the compilation unit for which the origin is desired. All Compilation_Unit_Kinds are appropriate.

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:

Related concept:


Function Recompilation_Order

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

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. 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:

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 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

Related subprograms:

Related concept:


Function Referenced_Units

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

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

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