![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Type Declaration_Kinds
type Declaration_Kinds is (...);Expanded Name Asis.Declarations.Declaration_Kinds
Describes the kinds of declarations that are available.
Description
Type Declaration_Kinds is a variety of Element.
Declaration_Kinds includes all declarations and specifications that declare named entities.
Certain Declaration_Kinds can be further categorized as shown below:
- A_Component_Declaration can be categorized by Type_Definitions.Component_Kinds. The value can be obtained with the Type_Definitions.Component_Kind function.
- A_Generic_Formal_Function_Declaration and A_Generic-
_Formal_Procedure_Declaration can be categorized by Generic_Formal_Subprogram_Default_Kinds. This value
can be obtained with the Generic_Formal_Subprogram-
_Default_Kind function.- A_Generic_Formal_Object_Declaration and A_Parameter-
_Specification can be categorized by Parameter_Mode-
_Kinds. This value can be obtained with the Parameter-
_Mode_Kind function.Every declaration has an explicit or implicit origin. The origin is described by the Declaration_Origins type and can be obtained with the Origin function.
Enumerations
A_Component_DeclarationIndicates that the element represents a component declaration (Ada83 LRM 3.7, Ada95 LRM 3.8).
A_Constant_DeclarationIndicates that the element represents a constant object declaration or number declaration (Ada83 LRM 3.2, Ada95 LRM 3.3).
A_Deferred_Constant_DeclarationIndicates that the element represents a deferred-constant declaration (Ada83 LRM 7.4, Ada95 LRM 7.3).
A_Discriminant_SpecificationIndicates that the element represents a discriminant specification (Ada83 LRM 3.7.1, Ada95 LRM 3.7).
A_Full_Type_DeclarationIndicates that the element represents a full-type declaration (Ada83 LRM 3.3.1, Ada95 LRM 3.2.1).
A_Function_Body_DeclarationIndicates that the element represents a subprogram-body declaration of a function (Ada83 LRM 6.3, Ada95 LRM 6.3).
A_Function_Body_StubIndicates that the element represents a body-stub declaration of a function (Ada83 LRM 10.2, Ada95 LRM 10.1.3).
A_Function_DeclarationIndicates that the element represents a subprogram specification of a function (Ada83 LRM 6.1, Ada95 LRM 6.1).
A_Function_InstantiationIndicates that the element represents a generic instantiation of a function (Ada83 LRM 12.1, Ada95 LRM 12.1).
A_Function_Rename_DeclarationIndicates that the element represents a renaming declaration of a function (Ada83 LRM 8.5, Ada95 LRM 8.5).
A_Generic_Formal_Function_DeclarationIndicates that the element represents the generic-parameter declaration of a function subprogram specification (Ada83 LRM 12.1, Ada95 LRM 12.1).
A_Generic_Formal_Object_DeclarationIndicates that the element represents a generic-parameter declaration of an object declaration (Ada83 LRM 12.1, Ada95 LRM 12.1).
A_Generic_Formal_Private_Type-_DeclarationIndicates that the element represents a generic-parameter declaration of a private-type declaration.
A_Generic_Formal_Procedure_DeclarationIndicates that the element represents the generic-parameter declaration of a procedure subprogram specification (Ada83 LRM 12.1, Ada95 LRM 12.1).
A_Generic_Formal_Type_DeclarationIndicates that the element represents the generic-parameter declaration of a type (Ada83 LRM 12.1, Ada95 LRM 12.1).
A_Generic_Function_DeclarationIndicates that the element represents the generic specification of a function subprogram specification (Ada83 LRM 12.1, Ada95 LRM 12.1).
A_Generic_Package_DeclarationIndicates that the element represents the generic specification of a package specification (Ada83 LRM 12.1, Ada95 LRM 12.1).
A_Generic_Procedure_DeclarationIndicates that the element represents the generic specification of a procedure subprogram specification (Ada83 LRM 12.1, Ada95 LRM 12.1).
A_Loop_Parameter_SpecificationIndicates that the element represents the identifier of a loop-parameter specification (Ada83 LRM 5.5, Ada95 LRM 5.5).
A_Package_Body_DeclarationIndicates that the element represents a package-body declaration (Ada83 LRM 7.1, Ada95 LRM 7.1).
A_Package_Body_StubIndicates that the element represents a body-stub declaration of a package (Ada83 LRM 10.2, Ada95 LRM 10.1.3).
A_Package_DeclarationIndicates that the element represents a package specification (Ada83 LRM 7.1, Ada95 LRM 7.1).
A_Package_InstantiationIndicates that the element represents a generic instantiation of a package (Ada83 LRM 12.1, Ada95 LRM 12.1).
A_Package_Rename_DeclarationIndicates that the element represents a renaming declaration of a package (Ada83 LRM 8.5, Ada95 LRM 8.5).
A_Parameter_SpecificationIndicates that the element represents a parameter specification (Ada83 LRM 6.1, Ada95 LRM 6.1).
A_Private_Type_DeclarationIndicates that the element represent a private-type declaration (Ada83 LRM 7.4, Ada95 LRM 7.3).
A_Procedure_Body_DeclarationIndicates that the element represents a subprogram-body declaration of a procedure (Ada83 LRM 6.3, Ada95 LRM 6.3).
A_Procedure_Body_StubIndicates that the element represents a body-stub declaration of a procedure (Ada83 LRM 10.2, Ada95 LRM 10.1.3).
A_Procedure_DeclarationIndicates that the element represents a subprogram specification of a procedure (Ada83 LRM 6.1, Ada95 LRM 6.1).
A_Procedure_InstantiationIndicates that the element represents a generic instantiation of a procedure (Ada83 LRM 12.1, Ada95 LRM 12.1).
A_Procedure_Rename_DeclarationIndicates that the element represents a renaming declaration of a procedure (Ada83 LRM 8.5, Ada95 LRM 8.5).
A_Real_Number_DeclarationIndicates that the element represents a real-number declaration (Ada83 LRM 3.2, Ada95 LRM 3.3).
A_Subtype_DeclarationIndicates that the element represents subtype declaration (Ada83 LRM 3.3.2, Ada95 LRM 3.2.2).
A_Task_Body_DeclarationIndicates that the element represents a task body (Ada83 LRM 9.1, Ada95 LRM 9.1).
A_Task_Body_StubIndicates that the element represents the body stub of a task (Ada83 LRM 10.2, Ada95 LRM 10.1.3).
A_Task_DeclarationIndicates that the element represents a task specification (Ada83 LRM 9.1, Ada95 LRM 9.1).
A_Task_Type_DeclarationIndicates that the element represents the task specification of a task type (Ada83 LRM 9.1, Ada95 LRM 9.1).
A_Variable_DeclarationIndicates that the element represents the declaration of a variable object declaration (Ada83 LRM 3.2, Ada95 LRM 3.3).
An_Entry_DeclarationIndicates that the element represents a task-entry declaration (Ada83 LRM 9.5, Ada95 LRM 9.5).
An_Enumeration_Literal_SpecificationIndicates that the element represents an enumeration-literal specification (Ada83 LRM 3.5.1, Ada95 LRM 3.5.1).
An_Exception_DeclarationIndicates that the element represents an exception declaration (Ada83 LRM 11.1, Ada95 LRM 11.1).
An_Exception_Rename_DeclarationIndicates that the element represents the renaming declaration of an exception declaration (Ada83 LRM 8.5, Ada95 LRM 8.5).
An_Incomplete_Type_DeclarationIndicates that the element represents an incomplete-type declaration (Ada83 LRM 3.8.1, Ada95 LRM 3.10.1).
An_Integer_Number_DeclarationIndicates that the element represents an integer-number declaration (Ada83 LRM 3.2, Ada95 LRM 3.3).
An_Object_Rename_DeclarationIndicates that the element represents the renaming declaration of an object declaration or a number declaration (Ada83 LRM 8.5, Ada95 LRM 8.5).
Not_A_DeclarationIndicates that the element does not represent a declaration.
Cross-References
- type Declaration_Origins
- function Generic_Formal_Subprogram_Default_Kind
- type Generic_Formal_Subprogram_Default_Kinds
- function Kind
- function Origin
- function Parameter_Mode_Kind
- type Parameter_Mode_Kinds
- function Type_Definitions.Component_Kinds
- type Type_Definitions.Component_Kind
Type Declaration_Origins
type Declaration_Origins is (...);Expanded Name Asis.Declarations.Declaration_Origins
Describes the origin of a declaration.
Description
A declaration can be either explicit or implicit. Explicit declarations are those that appear in the source code. Implicit declarations are those created by Ada when a type or derived type is declared. You can use the Origin function to determine whether the origin of a declaration is explicit or implicit and, if implicit, the method used in its creation.
Enumerations
An_Explicit_DeclarationIndicates that the element represents an explicit declaration that appears in the source code.
An_Implicit_Derived_DeclarationIndicates that the element represents an implicit derived declaration created by declaring a derived type (Ada83 LRM 3.4(12), Ada95 LRM 3.4).
An_Implicit_Predefined_DeclarationIndicates that the element represents an implicit declaration created by declaring or deriving a type (Ada83 LRM 4.5(6), Ada95 LRM 4.5).
Not_A_DeclarationIndicates that the element does not represent a declaration.
Cross-References
- "Determining Declaration Origin"
- Ada83 LRM 3.4, Ada95 LRM
3.4- Ada83 LRM 4.5, Ada95 LRM
4.5
Function Discriminants
function Discriminants (Declaration : in Asis.Declaration) return Asis.Discriminant_Specification_List;Expanded Name Asis.Declarations.Discriminants
Returns a list of the discriminant specifications associated with the specified declaration.
Description
Type declarations are partially defined by the following syntax:
Ada83 LRM 3.3.1, Ada95 LRM 3.2.1
type declaration ::= full_type_declaration
| incomplete_type_declaration
| private_type_declaration
full_type_declaration ::=
type identifier [discriminant_part] is
type_definition;Ada83 LRM 3.8.1, Ada95 LRM 3.10.1 i
ncomplete_type_declaration ::=
type identifier [discriminant_part];private_type_declaration ::=
type identifier [discriminant_part] is
[limited] private;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 function returns the discriminant part of the specified full-type declaration, incomplete-type declaration, private-type declaration, or generic-formal private-type declaration.
The discriminants are returned in their order of appearance in the source code.
Some ASIS implementations may normalize all multiname discriminant definitions into an equivalent sequence of single-name discriminant definitions (Ada83 LRM 3.7.1(4), Ada95 LRM 3.7). See the "Determining Declaration Kinds and Names" section for more details.
Parameters
Declaration : in Asis.Declaration;Specifies the declaration for which the discriminants should be returned. The declaration must be of the following kinds:
Element_Kinds Declaration_Kinds
A_Declaration A_Full_Type_Declaration
A_Generic_Formal_Private_Type-
_Declaration
A_Private_Type_Declaration
An_Incomplete_Type_Declaration
returnAsis.Discriminant_Specification_List;The returned list contains elements of the following kinds:
Element_Kinds Declaration_Kinds
A_Declaration A_Discriminant_Specification
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_Type_Declaration
- function Is_Discriminated
- function Is_Initialized
- function Is_Limited
- function Is_Private
- function Is_Type_Declaration
- function Names
- function Type_Declaration_Definition
- function Type_Mark
- function Type_Definitions.Discriminant_Expression
- "Processing Incomplete- and Private-Type Declarations"
- package Type_Definitions, "Processing Discriminant Constraints"
- Ada83 LRM 3.3.1, Ada95 LRM 3.2.1
- Ada83 LRM 3.7.1, Ada95 LRM 3.7
- 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 Enclosing_Generic
function Enclosing_Generic (Element : Asis.Element) return Asis.Element;Expanded Name Asis.Declarations.Enclosing_Generic
Returns the generic declaration or the generic-body declaration enclosing the specified element.
Description
If the specified element is part of a generic declaration, the element representing the generic declaration is returned.
If the specified element is part of a generic body, the element representing the generic body is returned.
If the specified element is not part of a generic declaration or generic body, Asis.Nil_Element is returned.
Parameters
Element : Asis.Element;Specifies an element that may be a part of a generic declaration or generic body.
return Asis.Element;The returned element is of the following kinds:
Element_Kinds Declaration_Kinds
A_Declaration A_Function_Body_Declaration
A_Generic_Declaration
A_Package_Body_Declaration
A_Procedure_Body_Declaration
Errors
Asis_Inappropriate_Element is raised and Environment.Status is set to Value_Error if Asis.Nil_Element is specified.
Examples
Cross-References
Related subprograms and types:
- function Corresponding_Generic_Element
- function Generic_Formal_Parameters
- function Generic_Formal_Subprogram_Default
- type Generic_Formal_Subprogram_Default_Kinds
- function Is_Generic
- function Is_Generic_Formal
- function Is_Part_Of_Instance
Function Entry_Declarations
function Entry_Declarations (Declaration : in Asis.Declaration; Include_Pragmas : in Boolean := False) return Asis.Entry_Declaration_List;Expanded Name Asis.Declarations.Entry_Declarations
Returns a list of the all entry declarations and, optionally, pragmas that are present in the specified task or task-type declaration.
Description
Task specifications and task-entry declarations are defined by the following syntax:
task_specification ::=
task [type] identifier [is
{entry_declaration}
{representation_clause}
end [task_simple_name}]entry_declaration ::=
entry identifier [(discrete_range)]
[formal_part];This function returns all entry declarations for the specified task specification or task-type specification.
The entries are returned in their order of appearance in the source code.
The list does not include any pragmas unless Include_Pragmas is specified as True.
The ASIS subprograms available for decomposing subprogram specifications can be used with entries.
Parameters
Declaration : in Asis.Declaration;Specifies the declaration for which the entry list should be returned. The declaration must be of the following kinds:
Element_Kinds Declaration_Kinds
A_Declaration A_Task_Declaration
A_Task_Type_Declaration
Include_Pragmas : in Boolean := False;Specifies whether pragma definitions should be included in the returned list.
return Asis.Entry_Declaration_List;The returned list contains elements of the following kinds:
Element_Kinds Declaration_Kinds
A_Declaration An_Entry_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.
Examples
Cross-References
Function Family_Index
function Family_Index (Declaration : in Asis.Declaration) return Asis.Discrete_Range;Expanded Name Asis.Declarations.Family_Index
Returns the family-index range associated with the specified entry declaration.
Description
Task-entry declarations are defined by the following syntax:
entry_declaration ::=
entry identifier [(discrete_range)]
[formal_part];This function returns the discrete range for the specified entry declaration.
If the entry declaration does not declare an entry family, Asis.Nil_Element is returned.
Parameters
Declaration : in Asis.Declaration;Specifies the declaration for which the family should be returned. The declaration must be of the following kinds:
Element_Kinds Declaration_Kinds
A_Declaration An_Entry_Declaration
return Asis.Discrete_Range;The returned element is of the following kind:
Element_Kinds
A_Discrete_Range
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
Rational Software Corporation
http://www.rational.com support@rational.com techpubs@rational.com Copyright © 1993-2001, Rational Software Corporation. All rights reserved. |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |