TOC PREV NEXT INDEX DOC LIST MASTER INDEX




Function Generic_Formal_Parameters

Expanded Name Asis.Declarations.Generic_Formal_Parameters

Returns a list of all generic-formal parameters and, optionally, pragmas that are present in the specified generic function, package, or procedure declaration.

Description

Generic package and subprogram specifications are defined by the following syntax:

Ada83 LRM 12.1, Ada95 LRM 12.1

 generic_specification ::=
   generic_formal_part
    subprogram_specification
  | generic_formal_part package_specification

 generic_formal_part ::= generic
  {generic_parameter_declaration}

 generic_parameter_declaration ::=
   identifier_list : [in [out]] type_mark
    [:= expression];
  | type identifier is
    generic_type_definition;

  | private_type_declaration
  | with subprogram_specification [is name];
  | with subprogram_specification [is <>];

This function returns a list of the generic-parameter declarations for the specified generic specification.

The list of parameters and pragmas is returned in their order of appearance in the source code.

Parameters

Specifies the declaration for which the formal parameters should be returned. The declaration must be of the following kinds:
Element_Kinds
Declaration_Kinds
A_Declaration
A_Generic_Function_Declaration
A_Generic_Package_Declaration
A_Generic_Procedure_Declaration

Specifies whether pragma definitions should be included in the returned list.

The returned list contains elements of the following kinds
Element_Kinds
Declaration_Kinds
A_Declaration
A_Generic_Formal_Function_Declaration
A_Generic_Formal_Object_Declaration
A_Generic_Formal_Private_Type-
_Declaration
A_Generic_Formal_Procedure_Declaration
A_Pragma

:

Errors

Asis_Inappropriate_Element is raised and Environment.Status is set to Value_Error if a parameter references a library variable that is no longer open, or a parameter is specified that is not appropriate for the query.

Examples

Cross-References

Related subprograms and types:

Related concepts:


Function Generic_Formal_Subprogram_Default

Expanded Name Asis.Declarations.Generic_Formal_Subprogram_Default

Returns the name following the reserved word is for the specified generic-formal-subprogram parameter declaration.

Description

Generic package and subprogram generic parameter declarations are partially defined by the following syntax:

Ada83 LRM 12.1, Ada95 LRM 12.1 

generic_parameter_declaration ::=
   identifier list : [in [out]] type_mark
    [:= expression]

  | type identifier is     generic_type_definition;
  | private_type_declaration
  | with subprogram_specification [is name];
  | with subprogram_specification [is <>];

This function returns the name following the reserved word is for the specified generic-parameter declaration.

If the Generic_Formal_Subprogram_Default_Kind for the specified declaration is not A_Name, Asis_Inappropriate_Element is raised and Environment.Status is set to Value_Error. This function never returns Asis.Nil_Element.

Parameters

Specifies the declaration for which the name following the reserved word is should be returned. The declaration must be of the following kinds:
Element_Kinds
Declaration_Kinds
A_Declaration
A_Generic_Formal_Function_Declaration
A_Generic_Formal_Procedure_Declaration

Additionally, the Generic_Formal_Subprogram_Default_Kinds of the declaration must be A_Name.

The returned element is of the following kinds:
Element_Kinds
Expression_Kinds
An_Expression
A_Character_Literal
A_Simple_Name
An_Enumeration_Literal
An_Operator_Symbol

Errors

Asis_Inappropriate_Element is raised and Environment.Status
is set to Value_Error if the Generic_Formal_Subprogram-
_Default_Kind
for the parameter is not A_Name.

Asis_Inappropriate_Element is raised and Environment.Status is set to Value_Error if a parameter references a Library variable that is no longer open.

Examples

Cross-References

Related subprograms:

Related concepts:


Function Generic_Formal_Subprogram_Default-
_Kind

Expanded Name Asis.Declarations.Generic_Formal_Subprogram-
_Default_Kind

Returns the kind of the default generic-formal subprogram for the specified declaration.

Description

Generic package and subprogram generic-parameter declarations are partially defined by the following syntax:

Ada83 LRM 12.1, Ada95 LRM 12.1 

generic_parameter_declaration ::=
   identifier list : [in [out]] type_mark
    [:= expression]

  | type identifier is     generic_type_definition;
  | private_type_declaration
  | with subprogram_specification [is name];
  | with subprogram_specification [is <>];

This function returns the subprogram default kind specified after the reserved word is for the specified generic-parameter
declaration.

Parameters

Specifies the declaration for which the generic-formal subprogram default kind should be returned. The declaration must be of the following kinds:
Element_Kinds
Declaration_Kinds
A_Declaration
A_Generic_Formal_Function_Declaration
A_Generic_Formal_Procedure_Declaration

Returns the formal subprogram default kind for all elements in the above table or Not_A_Generic_Formal_Subprogram_Default for all other elements.

Errors

None.

Examples

Cross-References

Related subprograms and types:

Related concepts:


Type Generic_Formal_Subprogram_Default-
_Kinds

Expanded Name Asis.Declarations.Generic_Formal_Subprogram-
_Default_Kinds

Describes the kinds of generic-formal subprograms that can appear in a generic specification after the reserved word is.

Description

Generic package and subprogram parameter declarations are partially defined by the following syntax:

Ada83 LRM 12.1, Ada95 LRM 12.1 

generic_parameter_declaration ::=
   identifier list : [in [out]] type_mark
    [:= expression]

  | type identifier is     generic_type_definition;
  | private_type_declaration
  | with subprogram_specification [is name];
  | with subprogram_specification [is <>];

This type describes the kinds of default parameters that can appear after the subprogram specification.

Enumerations

Indicates that box notation follows the reserved word is (Ada83 LRM 12.1.3(2), Ada95 LRM 12.1).

Indicates that a subprogram or entry name follows the reserved word is (Ada83 LRM 12.1.3(2), Ada95 LRM 12.1).

Indicates that neither box notation nor a subprogram or entry name follows the reserved word is.

Indicates that the parameter does not represent a generic-formal subprogram default declaration.

Cross-References

Related subprogram:

Related concepts:


Function Generic_Parameters

Expanded Name Asis.Declarations.Generic_Parameters

Returns a list of the parameter associations associated with the specified generic-instantiation declaration.

Description

Generic instantiations are partially defined by the following syntax:

Ada83 LRM 12.3, Ada95 LRM 12.3

 generic_instantiation ::=
   package identifier is
    new generic_package_name
     [generic_actual_part];
  | procedure identifier is
    new generic_procedure_name
     [generic_actual_part];
  | function designator is
    new generic_function_name
     [generic_actual_part];
  | function designator is
    new generic_function_name

     [generic_actual_part];

 generic_actual_part ::=
  (generic_association {, generic_association})

This function returns the generic actual part of the specified generic instantiation.

The Statements.Formal_Parameter function can be used with elements of the returned association list to obtain information on the formal parameters. The Statements.Actual_Parameter function can be used to obtain information on the actual
parameters.

The generic parameters can be obtained in unnormalized or normalized form:

Because of variations in Ada library content, some ASIS implementations are not able to present an identical view of parameter lists with respect to the use of named associations. An ASIS implementation can choose to always return parameter lists in normalized format. To determine whether the ASIS implementation always normalizes parameter lists, and ignores the value provided by the Normalize argument, use the Environment.Generic_Parameters_Normalized function.

An ASIS implementation may choose to always include defaulted parameters in the parameter list. If the implementation always includes defaulted parameters, the Normalized parameter is always assumed to be True. In this case, the Statements.Actual_Parameter values derived from the normalized and unnormalized lists will be the same, although the order can differ if the instantiation order does not match the declaration order. To determine whether the ASIS implementation always includes defaulted parameters, use the Environment.Generic_Parameters_Include_Defaults function.

For more information on normalization of parameter lists and default processing, see "Normalization of Parameter Lists" and "Default Parameter Processing" in package Environment.

Parameters

Specifies the generic instantiation for which the parameter list should be returned. The declaration must be of the following kinds:
Element_Kinds
Declaration_Kinds
A_Declaration
A_Function_Instantiation
A_Package_Instantiation
A_Procedure_Instantiation

Specifies whether the parameter list should be returned in normalized or unnormalized form.

The returned list contains elements of the following kind:
Element_Kinds

A_Parameter_Association

Errors

Asis_Inappropriate_Element is raised and Environment.Status is set to Value_Error if a parameter references a library variable that is no longer open, or a parameter is specified that is not appropriate for the query.

Examples

Cross-References

Related subprograms:

Related concepts:


Function Generic_Unit_Name

Expanded Name Asis.Declarations.Generic_Unit_Name

Returns the expression representing the name following the reserved word new in the specified generic-instantiation
declaration.

Description

Generic instantiations are partially defined by the following syntax:

Ada83 LRM 12.3, Ada95 LRM 12.3 

generic_instantiation ::=
   package identifier is
    new generic_package_name
     [generic_actual_part];
  | procedure identifier is
    new generic_procedure_name
     [generic_actual_part];
  | function designator is

This function returns the generic package name, generic procedure name, or generic function name of the specified generic instantiation.

Parameters

Specifies the generic instantiation for which the name should be returned. The declaration must be of the following kinds:
Element_Kinds
Declaration_Kinds
A_Declaration
A_Function_Instantiation
A_Package_Instantiation
A_Procedure_Instantiation

The returned element is of the following kinds:
Element_Kinds
Expression_Kinds
An_Expression
A_Selected_Component
A_Simple_Name

Errors

Asis_Inappropriate_Element is raised and Environment.Status is set to Value_Error if a parameter references a library variable that is no longer open, or a parameter is specified that is not appropriate for the query.

Examples

Cross-References

Related subprograms:

Related concepts:


Function Implicit_Attribute_Functions

Expanded Name Asis.Declarations.Implicit_Attribute_Functions

Returns a list of the a predefined attribute functions that have been implicitly declared for the specified type definition.

Description

If no attribute functions are predefined for the specified type (Ada83 LRM 3.5.5, Ada95 LRM 3.5.5), Asis.Nil_Element_List is returned.

Based on the type, a list containing none, some, or all of the following function declarations is returned:

A vendor can provide implementation-defined attributes. Vendors are encouraged to return declarations for these functions. Rational Apex does not contain any implementation-defined attributes.

Attributes that are not functions are represented by elements having and expression kind of An_Attribute. See package Expressions, "Processing Attributes," for information on processing attributes that appear in expressions.

Any ASIS subprogram that accepts an Element_Kinds of A_Function_Declaration can be used for further analysis.

Each returned function declaration will be Is_Part_Of_Implicit.

The enclosing element for each of the returned function declarations is the specified type definition.

Parameters

Specifies the type for which the implicitly specified attribute functions should be returned. The type definition must be of the following kinds:
Element_Kinds
Type_Definition_Kinds
A_Type_Definition
Any Type_Definition_Kinds except A_Subtype_Declaration

The returned list contains elements of the following kinds:
Element_Kinds
Type_Definition_Kinds
A_Declaration
A_Function_Declaration

Errors

Asis_Inappropriate_Element is raised and Environment.Status is set to Value_Error if a parameter references a library variable that is no longer open, or a parameter is specified that is not appropriate for the query.

Asis_Failed is raised and Environment.Status is set to Obso lete_Reference_Error if a parameter is part of an obsolete compilation unit.

Examples

Cross-References

Related subprograms:

Related concepts:


Function Implicit_Derived_Subprograms

Expanded Name Asis.Declarations.Implicit_Derived_Subprograms

Returns a list of the derived subprograms that have been implicitly declared for the specified derived-type definition.

Description

If there are no derived subprograms for the specified derived type, Asis.Nil_Element_List is returned.

The list does not include hidden derived subprograms (Ada83 LRM 8.3(17), Ada95 LRM 8.3). See "Processing Implicit and Derived Operations" for more information on hidden derived subprograms.

Each returned subprogram declaration will be Is_Part_Of-
_Implicit
.

The name of each returned subprogram declaration can be obtained by calling the Names function. The kind of operator defined by the subprogram can be obtained by calling Expressions.Operator_Kind with the element returned from Names.

The enclosing element for each of the returned subprogram declarations is the specified type definition.

Parameters

Specifies the derived type for which the derived subprograms should be returned. The type definition must be of the following kinds:
Element_Kinds
Type_Definition_Kinds
A_Type_Definition
A_Derived_Type_Definition

The returned list contains elements of the following kinds:
Element_Kinds
Type_Definition_Kinds
A_Declaration
A_Function_Declaration
A_Procedure_Declaration

Errors

Asis_Inappropriate_Element is raised and Environment.Status is set to Value_Error if a parameter references a library variable that is no longer open, or a parameter is specified that is not appropriate for the query.

Asis_Failed is raised and Environment.Status is set to Obso-
lete_Reference_Error if a parameter is part of an obsolete
compilation unit.

Examples

Cross-References

Related subprograms:

Related concepts:


Function Implicit_Predefined_Operators

Expanded Name Asis.Declarations.Implicit_Predefined_Operators

Returns a list of the operators (functions) that have been implicitly defined for the specified type definition.

Description

The returned list includes only those operators appropriate for the type (Ada83 LRM , Ada95 LRM 4.5.1 through Ada83 LRM 4.5.7, Ada95 LRM 4.6). If no operators are defined, a Nil_Element_List is returned.

The list does not include hidden predefined operators or the programmer-defined overloads that cause such hiding (Ada83 LRM 8.3(17), Ada95 LRM 8.3). See "Processing Implicit and Derived Operations" for more information on hidden derived subprograms.

Each returned subprogram declaration will be Is_Part_Of- _Implicit and Is_Operator_Definition.

The name of each returned function declaration can be obtained by calling the Names function. The kind of operator defined by the subprogram can be obtained by calling Expressions.Operator_Kind with the element returned from Names.

The equality operator can be overloaded for limited private types. Because of variability in underlying Ada implementations, the operation of ASIS varies. See "Processing Implicit and Derived Operations" for how the equality operator is handled.

The enclosing element for each of the returned subprogram declarations is the specified type definition.

Parameters

Specifies the derived type for which the implicitly declared operators should be returned. The type definition must be of the following kinds:
Element_Kinds
Type_Definition_Kinds
A_Type_Definition
A_Derived_Type_Definition

The returned list contains elements of the following kinds:
Element_Kinds
Type_Definition_Kinds
A_Declaration
A_Function_Declaration

Errors

Asis_Inappropriate_Element is raised and Environment.Status is set to Value_Error if a parameter references a library variable that is no longer open, or a parameter is specified that is not appropriate for the query.

Asis_Failed is raised and Environment.Status is set to Obsolete_Reference_Error if a parameter is part of an obsolete compilation unit.

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