TOC PREV NEXT INDEX DOC LIST MASTER INDEX




Function Related_Compilation_Units

Expanded Name Asis.Compilation_Units.Related_Compilation_Units

Returns a record containing units with the specified Relation to the specified compilation units.

Description

The list of related compilation units 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 compilation order containing units with the specified Relation to the specified compilation units. The specified compilation units are returned as part of the Relationship.

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:


Type Relation_Kinds

Expanded Name Asis.Compilation_Units.Relation_Kinds

Defines the kinds of relations between compilation units.

Description

Because of the hierarchical nature of Ada compilation units, they form groups that are related in various ways. For example, the units in a given unit's with clause are dependents of that unit.

ASIS provides a number of functions that return lists of units that are related. This type defines the kinds of relationships possible.

Enumerations

Indicates all compilation units that must be recompiled if the compilation unit is recompiled; that is, all units made obsolete by the unit's recompilation. A compilation unit's dependents include:

Dependencies can also be introduced by:

A unit that depends on a given unit is also dependent on the supporters of that unit. See the Direct_Dependents and Supporters enumeration values for more information.

Indicates those units that are directly related to a compilation unit. Dependents of a compilation unit are all those compilation units that must be recompiled if the compilation unit is recompiled; that is, all those units made obsolete by the unit's recompilation.

Direct dependents of a compilation unit include:

A unit that depends on a given unit is also dependent on the supporters of that unit.

See the Dependents and Supporters enumeration values for more information.

Indicates those units that are directly related to a compilation unit. Supporters of a compilation unit are all those compilation units that must be successfully compiled before the compilation unit itself can be successfully compiled.

Direct supporters of a compilation unit include:

Package Standard is a supporter of every unit, but it is not considered to be a direct supporter unless it is mentioned in a with clause.

See the Supporters enumeration value for more information.

Indicates the specification, body, subunits, supporters, and recursively, the extended family of each supporting unit. The extended family consists of all units required to create an executable.

The extended family of a unit is also commonly referred to as the program closure of a unit.

See the Family enumeration value for more information.

Indicates the specification, body, subunits, and recursively, all subunits of subunits.

See the Extended_Family enumeration value for more information.

Indicates all those compilation units that must be successfully compiled before the compilation unit itself can be successfully compiled.

Supporters of a compilation unit include:

See the Direct_Supporters enumeration value for more information.

Cross-References

Related subprograms:

Related concepts:


Function Secondary_Unit

Expanded Name Asis.Compilation_Units.Secondary_Unit

Returns the secondary unit with the specified simple name or expanded name, belonging to the specified library.

Description

Secondary units are defined by the following syntax:

Ada83 LRM 10.1, Ada95 LRM 10.1.1 

secondary_unit ::= library_unit_body | subunit

This function returns the compilation unit of the library_unit_body with the specified simple name ("A") or the subunit with the specified expanded name ("A.B"), belonging to the specified library.

If a secondary 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_Secondary_Unit.

If a non-nil compilation unit is returned, the Enclosing_Library is Libraries.Is_Identical to the specified library.

Parameters

Specifies the simple or expanded name of the compilation unit desired.

Specifies the library to which the unit must belong.

The returned compilation unit is of the following kinds:
Compilation_Unit_Kinds

A_Package_Body

A_Subprogram_Body

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

Related subprograms:

Related concepts:


Function Secondary_Units

Expanded Name Asis.Compilation_Units.Secondary_Units

Returns a list containing the secondary units belonging to the specified library.

Description

Secondary units are defined by the following syntax:

Ada83 LRM 10.1, Ada95 LRM 10.1.1 

secondary_unit ::= library_unit_body | subunit

This function returns a list containing the secondary_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 secondary 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_Nonexistent_Secondary_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_Package_Body

A_Subprogram_Body

A_Subunit

Unknown

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 Subunit_Ancestor

Expanded Name Asis.Compilation_Units.Subunit_Ancestor

Returns the first parent compilation unit of the specified subunit that is not itself a subunit.

Description

Body stubs and subunits are defined by the following syntax:

Ada83 LRM 10.2, Ada95 LRM 10.1.3 

body_stub ::=
   subprogram_specification is separate;
  | package body package_simple_name
    is separate;
  | task body task_simple_name is separate;

 subunit ::=
  separate (parent_unit_name) proper_body

This function returns the first parent compilation unit containing the body_stub ancestor, of the specified subunit, that is not itself a subunit.

If the ancestor parent unit does not belong to the specified library, Asis.Nil_Compilation_Unit is returned.

If a non-nil compilation unit is returned, the Enclosing_Library is Libraries.Is_Identical to the specified library.

Parameters

Specifies the subunit for which the parent unit is desired. The Subunit must be of the following kind
Compilation_Unit_Kinds

A_Subunit

:

Library : in Asis.Library;

Specifies the library to which the parent unit must belong.

If a library is not specified, the Enclosing_Library of the parent unit is assumed. These calls produce identical results:

The returned compilation unit is of the following kinds:
Compilation_Unit_Kinds

A_Package_Body

A_Subprogram_Body

Unknown

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


Function Subunit_Parent

Expanded Name Asis.Compilation_Units.Subunit_Parent

Returns the compilation unit containing the body stub of the specified subunit.

Description

Body stubs and subunits are defined by the following syntax:

Ada83 LRM 10.2, Ada95 LRM 10.1.3 

body_stub ::=
   subprogram_specification is separate;
  | package body package_simple_name
    is separate;
  | task body task_simple_name is separate;

 subunit ::=
  separate (parent_unit_name) proper_body

This function returns the compilation unit containing the body_stub for the specified subunit.

If the parent unit does not belong to the specified library, Asis.Nil_Compilation_Unit is returned.

If a non-nil compilation unit is returned, the Enclosing_Library is Libraries.Is_Identical to the specified library.

Parameters

Subunit : in Asis.Compilation_Unit;

Specifies the subunit for which the parent unit is desired. The Subunit must be of the following kind
Compilation_Unit_Kinds

A_Subunit

:

Library : in Asis.Library;

Specifies the library to which the parent unit must belong.If a library is not specified, the Enclosing_Library of the parent unit is assumed. These calls produce identical results:

The returned compilation unit is of the following kinds:
Compilation_Unit_Kinds

A_Package_Body

A_Subprogram_Body

A_Subunit

Unknown

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


Function Subunits

Expanded Name Asis.Compilation_Units.Subunits

Returns a list of the subunits of the specified parent unit.

Description

Body stubs and subunits are defined by the following syntax:

Ada83 LRM 10.2, Ada95 LRM 10.1.3 

body_stub ::=
   subprogram_specification is separate;
  | package body package_simple_name
    is separate;
  | task body task_simple_name is separate;

 subunit ::=
  separate (parent_unit_name) proper_body

This function returns a list of the compilation units that correspond to the body_stubs in the specified parent unit. One subunit is returned for each body_stub declaration.

If the specified compilation unit does not contain any body_stubs, Asis.Nil_Compilation_Unit_List is returned.

Units in the returned list can have a Compilation_Unit_Kinds of A_Nonexistent_Secondary_Unit if the unit is not compiled.

You can determine whether the subunit is a subprogram, package, or task by analysis of the body_stub declaration. See package Declarations, "Processing Body Stubs and Subunits."

If a candidate compilation unit does not have the specified library as its enclosing library, it is first converted into an Is_Equal unit in the specified library. If a candidate compilation unit does not belong to the specified library, it is ignored and the unit does not appear in the returned relationship. Because of this conversion, each units in the returned relationship can be Is_Equal, rather than Is_Identical, to the specified units.

Compilation subunits can also be obtained with the Related_Compilation_Units function by specifying a Relation_Kinds of Family.

Parameters

Specifies the compilation unit for which the subunit list is to be returned. 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 parent unit is assumed. These calls produce identical results:

The returned list contains compilation units of the following kind:
Compilation_Unit_Kinds

A_Nonexistent_Secondary_Unit

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.

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 if Asis.Nil_Compilation_Unit is specified.

Examples

Cross-References

Related subprograms:

Related concepts:


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