TOC PREV NEXT INDEX DOC LIST MASTER INDEX




Function Initial_Value

Expanded Name Asis.Declarations.Initial_Value

Returns the initial-value expression in the specified declaration.

Description

Object and number declarations are partially defined by the following syntax:

Ada83 LRM 3.2, Ada95 LRM 3.3  

object_declaration ::=
   identifier_list :
    [constant] subtype_indication
     [:= expression];
  | identifier_list :
    [constant] constrained_array_definition
     [:= expression];

 number_declaration ::=
   identifier_list : constant :=
    universal_static_expression;

Record component declarations are defined by the following syntax:

Ada83 LRM 3.7, Ada95 LRM 3.8 

component_declaration ::=
  identifier_list :
   component_subtype_definition
    [:= expression];

Discriminant specifications for type declarations are defined by the following syntax:

Ada83 LRM 3.7.1, Ada95 LRM 3.7

 discriminant_specification ::=
  identifier_list : type_mark [:= expression]

Parameter specifications for subprogram declarations are defined by the following syntax:

Ada83 LRM 6.1, Ada95 LRM 6.1

 parameter_specification ::=
  identifier_list : mode type_mark
   [:= expression]

Deferred constants are defined by the following syntax:

Ada83 LRM 7.4, Ada95 LRM 7.3 

deferred_constant_declaration ::=
  identifier_list : constant type_mark;

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 default expression in the specified object declaration, number declaration, deferred-constant declaration, component declaration, discriminant specification, parameter specification, or generic-parameter declaration.

If the declaration does not include an initial value, Asis.Nil_Element is returned.

If the declaration kind is A_Generic_Formal_Object_Declaration or A_Parameter_Specification, Asis.Nil_Element is always returned for those declarations with a Parameter_Mode_Kinds of An_Out_Mode or An_In_Out_Mode.

Parameters

Specifies the declaration for which the initialization status should be returned. The declaration must be of the following kinds:
Element_Kinds
Declaration_Kinds
A_Declaration
A_Component_Declaration
A_Constant_Declaration
A_Discriminant_Specification
A_Generic_Formal_Object_Declaration
Parameter_Mode_Kinds
A_Default_In_Mode
An_In_Mode
An_In_Out_Mode
An_Out_Mode
A_Loop_Parameter_Specification
A_Parameter_Specification
Parameter_Mode_Kinds
A_Default_In_Mode
An_In_Mode
An_In_Out_Mode
An_Out_Mode
A_Real_Number_Declaration
An_Integer_Number_Declaration
An_Object_Rename_Declaration

The returned element is of the following kind:
Element_Kinds

An_Expression

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 Is_Body_Stub

Expanded Name Asis.Declarations.Is_Body_Stub

Returns a Boolean value indicating whether the specified declaration is a body stub.

Description

Body stubs 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;

This function returns True if the specified declaration represents a body stub.

Parameters

Specifies the declaration to be checked to determine whether it is a body stub. The declaration must be of the following kinds
Element_Kinds
Declaration_Kinds
A_Declaration
A_Function_Body_Stub
A_Package_Body_Stub
A_Procedure_Body_Stub
A_Task_Body_Stub

:

Returns True for all elements in the above table and False for all other elements.

Errors

None.

Examples

For example:

The element that represents the separate procedure implementation is a Declaration_Kinds of A_Procedure_Body. The Is-
_Body_Stub
function returns True when called with this element.

Cross-References

Related subprograms:

Related concepts:


Function Is_Character_Literal

Expanded Name Asis.Declarations.Is_Character_Literal

Returns a Boolean value indicating whether the specified enumeration-literal declaration is a character literal.

Description

Enumeration-literal specifications are defined by the following syntax:

Ada83 LRM 3.5.1, Ada95 LRM 3.5.1 

enumeration_literal ::=
  identifier | character_literal

This function returns True if the specified enumeration-literal specification represents a character literal.

The Type_Definitions.Enumeration_Literal_Declarations function can be used to obtain the list of enumeration literals defined by an enumeration-type definition.

Parameters

Specifies the enumeration literal to be checked to determine whether it is a character. This function returns True for the following kind
Element_Kinds
Declaration_Kinds
A_Declaration
An_Enumeration_Literal_Specification
s:

Returns True for all elements in the above table and False for all other elements.

Errors

None.

Examples

Cross-References

Related subprogram:

Related concepts:


Function Is_Constant

Expanded Name Asis.Declarations.Is_Constant

Returns a Boolean value indicating whether the specified declaration is a constant.

Description

The following declarations represent constants:

Parameters

Specifies the object declaration to be checked to determine whether it is a constant. This function returns True for the following kinds
Element_Kinds
Declaration_Kinds
A_Declaration
A_Constant_Declaration
A_Deferred_Constant_Declaration
A_Generic_Formal_Object_Declaration
Parameter_Mode_Kinds
A_In_Mode
A_Default_In_Mode
A_Loop_Parameter_Specification
A_Parameter_Specification
Parameter_Mode_Kinds
A_In_Mode
A_Default_In_Mode
A_Real_Number_Declaration
An_Integer_Number_Declaration
An_Object_Rename_Declaration

:

Returns True for all elements in the above table or for An-
_Object_Rename_Declaration that references a constant and False for all other elements.

Errors

None.

Examples

Cross-References

Related subprograms:

Related concepts:


Function Is_Discriminated

Expanded Name Asis.Declarations.Is_Discriminated

Returns a Boolean value indicating whether the base type of the specified type declaration has discriminants.

Description

Appropriate type declarations are defined by the following syntax:

Ada83 LRM 3.3.1, Ada95 LRM 3.2.1

 full_type_declaration ::=
  type identifier [discriminant_part] is
   type_definition;

Ada83 LRM 3.3.2, Ada95 LRM 3.2.2

 subtype_declaration ::=
  subtype identifier is subtype_indication;

Ada83 LRM 3.8.1, Ada95 LRM 3.10.1 

incomplete_type_declaration ::=
  type identifier [discriminant_part];

Ada83 LRM 7.4, Ada95 LRM 7.3 

private_type_declaration ::=
  type identifier [discriminant_part] is
   [limited] private;

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 True if the base type of the specified full-type declaration, subtype declaration, incomplete-type declaration, or private-type declaration contains a discriminant part or the declaration represents a generic-parameter declaration of a private-type declaration that contains a discriminant part.

Parameters

Specifies the declaration to be checked to determine whether it has discriminants. This function returns True for the following kind
Element_Kinds
Declaration_Kinds
A_Declaration
A_Full_Type_Declaration
A_Generic_Formal_Private_Type-
_Declaration
A_Private_Type_Declaration
A_Subtype_Declaration
An_Incomplete_Type_Declaration

s:

Returns True for all elements in the above table and False for all other elements.

Errors

None.

Examples

Cross-References

Related subprograms:

Related concepts:


Function Is_Function

Expanded Name Asis.Declarations.Is_Function

Returns a Boolean value indicating whether the specified declaration is a function specification or body.

Description

Subprogram specifications are partially defined by the following syntax:

Ada83 LRM 6.1, Ada95 LRM 6.1 

subprogram_specification ::=
   procedure identifier [formal_part]
  | function designator [formal_part]
    return type_mark

Every subprogram specification must have an associated subprogram body.

Renaming clauses are defined by the following syntax:

Ada83 LRM 8.5, Ada95 LRM 8.5

 renaming_declaration ::=
   identifier : type_mark renames
    object_name;
  | identifier : exception renames

    exception_name;
  | package identifier renames package_name;
  | subprogram_specification renames
    subprogram_or_entry_name;

Body stubs 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;

Generic package and subprogram specifications are partially 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 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

This function returns True if the specified declaration is a function subprogram specification, a renaming declaration of
a function, a function body stub, a function proper body of a subunit, a generic specification of a function subprogram
specification, or a generic instantiation of a function.

Parameters

Specifies the declaration to be checked to determine whether it is a function declaration. This function returns True for the following kinds:
Element_Kinds
Declaration_Kinds
A_Declaration
A_Generic_Formal_Function-
_Declaration
A_Generic_Function_Declaration
A_Function_Body_Declaration
A_Function_Body_Stub
A_Function_Declaration
A_Function_Instantiation
A_Function_Rename_Declaration

Returns True for all elements in the above table and False for all other elements.

Errors

None.

Examples

Cross-References

Related subprograms:

Related concepts:


Function Is_Generic

Expanded Name Asis.Declarations.Is_Generic

Returns a Boolean value indicating whether the specified declaration is a generic specification or a generic body.

Description

Renaming clauses are defined by the following syntax:

Ada83 LRM 8.5, Ada95 LRM 8.5 

renaming_declaration ::=
   identifier : type_mark renames
    object_name;
  | identifier : exception renames
    exception_name;
  | package identifier renames package_name;
  | subprogram_specification renames
    subprogram_or_entry_name;

Body stubs 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;

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

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

This function returns True if the specified declaration is a renaming declaration of an instantiation of a package or subprogram, the body stub or subunit from a generic instantiation, a generic specification, a subprogram specification from a generic-parameter declaration, or generic instantiation.

Parameters

Specifies the declaration to be checked to determine whether it represents a generic specification or generic body. This function returns True for the following kinds:
Element_Kinds
Declaration_Kinds
A_Declaration
A_Function_Body_Declaration
A_Function_Body_Stub
A_Function_Declaration
A_Function_Instantiation
A_Function_Rename_Declaration
A_Generic_Formal_Function_Declaration
A_Generic_Formal_Procedure_Declaration
A_Generic_Function_Declaration
A_Generic_Package_Declaration
A_Generic_Procedure_Declaration
A_Package_Body_Declaration
A_Package_Body_Stub
A_Package_Declaration
A_Package_Instantiation
A_Package_Rename_Declaration
A_Procedure_Body_Declaration
A_Procedure_Body_Stub
A_Procedure_Declaration
A_Procedure_Rename_Declaration

Returns True for all elements in the table under the Declaration parameter, where the declaration kind of the corresponding specification of the specified declaration is:

Errors

None.

Examples

Cross-References

Related subprograms:

Related concepts:


Function Is_Generic_Formal

Expanded Name Asis.Declarations.Is_Generic_Formal

Returns a Boolean value indicating whether the specified declaration is a generic formal parameter.

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

 generic_association ::=
  [generic_formal_parameter =>]
   generic_actual_parameter

This function returns True if the specified declaration represents a generic-formal parameter.

Parameters

Specifies the declaration to be checked to determine whether it represents a generic-formal parameter. This function returns True for the following kinds:
Element_Kinds
Declaration_Kinds
A_Declaration
A_Generic_Formal_Function_Declaration
A_Generic_Formal_Private_Type-
_Declaration
A_Generic_Formal_Procedure_Declaration
A_Generic_Formal_Object_Declaration
A_Generic_Formal_Type_Declaration

Returns True for all elements in the above table and False for all other elements.

Errors

None.

Examples

Cross-References

Related subprograms:

Related concepts:


Function Is_Generic_Instantiation

Expanded Name Asis.Declarations.Is_Generic_Instantiation

Returns a Boolean value indicating whether the specified declaration is a generic instantiation.

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

This function returns True if the specified declaration is a generic instantiation.

Parameters

Specifies the declaration to be checked to determine whether it represents a generic instantiation. This function returns True for the following kinds:
Element_Kinds
Declaration_Kinds
A_Declaration
A_Function_Instantiation
A_Package_Instantiation
A_Procedure_Instantiation

Returns True for all elements in the above table and False for all other elements.

Errors

None.

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