![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Function Initial_Value
function Initial_Value (Declaration : in Asis.Declaration) return Asis.Expression;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:
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:
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:
parameter_specification ::=
identifier_list : mode type_mark
[:= expression]Deferred constants are defined by the following syntax:
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
Declaration : in Asis.Declaration;Specifies the declaration for which the initialization status should be returned. The declaration must be of the following kinds:
return Asis.Expression;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
- function Corresponding_Constant_Declaration
- function Is_Constant
- function Is_Initialized
- function Is_Variable
- function Object_Declaration_Definition
- "Processing Object and Number Declarations"
- Ada83 LRM 3.2, Ada95 LRM 3.3
- Ada83 LRM 3.7, Ada95 LRM 3.8
- Ada83 LRM 3.7.1, Ada95 LRM 3.7
- Ada83 LRM 6.1, Ada95 LRM 6.1
- Ada83 LRM 12.1, Ada95 LRM 12.1
Function Is_Body_Stub
function Is_Body_Stub (Declaration : in Asis.Declaration) return Boolean;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
Declaration : in Asis.Declaration;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
:
return Boolean;Returns True for all elements in the above table and False for all other elements.
Errors
Examples
package body Sorting is procedure Quick_Sort (...) is separate;end Sorting;
separate (Sorting)procedure Quick_Sort (...) is ...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
- "Processing Body Stubs and Subunits"
- Ada83 LRM 10.2, Ada95 LRM 10.1.3
Function Is_Character_Literal
function Is_Character_Literal (Literal : in Asis.Declaration) return Boolean;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_literalThis 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
Literal : in Asis.Declaration;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:
return Boolean;Returns True for all elements in the above table and False for all other elements.
Errors
Examples
Cross-References
- "Processing Enumeration Literals"
- Ada83 LRM 3.5.1, Ada95 LRM 3.5.1
Function Is_Constant
function Is_Constant (Declaration : in Asis.Declaration) return Boolean;Expanded Name Asis.Declarations.Is_Constant
Returns a Boolean value indicating whether the specified declaration is a constant.
Description
The following declarations represent constants:
- Constants and number declarations (Ada83 LRM 3.2, Ada95 LRM 3.3)
- Deferred constants (Ada83 LRM 7.4, Ada95 LRM 7.3)
- Loop parameters (Ada83 LRM 5.5, Ada95 LRM 5.5)
- Subprogram and generic formal objects with a Parameter-
, Ada95 LRM 6.2)
_Mode_Kinds of A_Default_In_Mode or An_In_Mode (Ada83 LRM 6.2- A rename of a constant (Ada83 LRM 8.5, Ada95 LRM 8.5)
Parameters
Declaration : in Asis.Declaration;Specifies the object declaration to be checked to determine whether it is a constant. This function returns True for the following kinds
:
return Boolean;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
Examples
Cross-References
- function Corresponding_Constant_Declaration
- function Initial_Value
- function Is_Initialized
- function Is_Variable
- function Object_Declaration_Definition
- "Processing Object and Number Declarations"
- Ada83 LRM 3.2, Ada95 LRM 3.3
- Ada83 LRM 5.5, Ada95 LRM 5.5
- Ada83 LRM 6.2, Ada95 LRM 6.2
- Ada83 LRM 7.4, Ada95 LRM 7.3
- Ada83 LRM 8.5, Ada95 LRM 8.5
Function Is_Discriminated
function Is_Discriminated (Declaration : in Asis.Declaration) return Boolean;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];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
Declaration : in Asis.Declaration;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:
return Boolean;Returns True for all elements in the above table and False for all other elements.
Errors
Examples
Cross-References
- function Corresponding_Type_Declaration
- function Discriminants
- function Is_Limited
- function Is_Private
- function Is_Type_Declaration
- function Type_Declaration_Definition
- "Processing Incomplete- and Private-Type Declarations"
- Ada83 LRM 3.3.1, Ada95 LRM 3.2.1
- Ada83 LRM 3.3.2, Ada95 LRM 3.2.2
- Ada83 LRM 3.8.1, Ada95 LRM 3.10.1
- Ada83 LRM 7.4, Ada95 LRM 7.3
- Ada83 LRM 12.1, Ada95 LRM 12.1
Function Is_Function
function Is_Function (Declaration : in Asis.Declaration) return Boolean;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:
subprogram_specification ::=
procedure identifier [formal_part]
| function designator [formal_part]
return type_markEvery subprogram specification must have an associated subprogram body.
Renaming clauses are defined by the following syntax:
renaming_declaration ::=
identifier : type_mark renames
object_name;
| identifier : exception renamesexception_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_specificationGeneric 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_nameThis 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
Declaration : in Asis.Declaration;Specifies the declaration to be checked to determine whether it is a function declaration. This function returns True for the following kinds:
return Boolean;Returns True for all elements in the above table and False for all other elements.
Errors
Examples
Cross-References
- function Corresponding_Body
- function Corresponding_Specification
- function Is_Package
- function Is_Procedure
- function Is_Specification
- function Is_Subprogram
- function Is_Task
- "Processing Program Units"
- Ada83 LRM 6.1, Ada95 LRM 6.1
- Ada83 LRM 8.5, Ada95 LRM 8.5
- Ada83 LRM 10.2, Ada95 LRM 10.1.3
- Ada83 LRM 12.1, Ada95 LRM 12.1
- Ada83 LRM 12.3, Ada95 LRM 12.3
Function Is_Generic
function Is_Generic (Declaration : in Asis.Declaration) return Boolean;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:
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_nameThis 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
Declaration : in Asis.Declaration;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:
return Boolean;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:
- A_Generic_Function_Declaration
- A_Generic_Package_Declaration
- A_Generic_Procedure_Declaration
Errors
Examples
Cross-References
- function Corresponding_Generic_Element
- function Enclosing_Generic
- function Generic_Formal_Parameters
- function Generic_Formal_Subprogram_Default
- function Generic_Formal_Subprogram_Default_Kind
- function Is_Generic_Formal
- function Is_Part_Of_Instance
- "Processing Generic Package and Subprogram Specifications"
- Ada83 LRM 8.5, Ada95 LRM 8.5
- Ada83 LRM 10.2, Ada95 LRM 10.1.3
- Ada83 LRM 12.1, Ada95 LRM 12.1
- Ada83 LRM 12.3, Ada95 LRM 12.3
Function Is_Generic_Formal
function Is_Generic_Formal (Declaration : in Asis.Declaration) return Boolean;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_parameterThis function returns True if the specified declaration represents a generic-formal parameter.
Parameters
Declaration : in Asis.Declaration;Specifies the declaration to be checked to determine whether it represents a generic-formal parameter. This function returns True for the following kinds:
return Boolean;Returns True for all elements in the above table and False for all other elements.
Errors
Examples
Cross-References
- function Corresponding_Generic_Element
- function Enclosing_Generic
- function Generic_Formal_Parameters
- function Generic_Formal_Subprogram_Default
- function Generic_Formal_Subprogram_Default_Kind
- function Is_Generic
- function Is_Part_Of_Instance
Function Is_Generic_Instantiation
function Is_Generic_Instantiation (Declaration : in Asis.Declaration) return Boolean;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_nameThis function returns True if the specified declaration is a generic instantiation.
Parameters
Declaration : in Asis.Declaration;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
return Boolean;Returns True for all elements in the above table and False for all other elements.
Errors
Examples
Cross-References
- "Processing Generic Instantiations"
- Ada83 LRM 12.3, Ada95 LRM 12.3
Rational Software Corporation
http://www.rational.com support@rational.com techpubs@rational.com Copyright © 1993-2001, Rational Software Corporation. All rights reserved. |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |