TOC PREV NEXT INDEX DOC LIST MASTER INDEX




Type Declaration_Kinds

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:

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

Indicates that the element represents a component declaration (Ada83 LRM 3.7, Ada95 LRM 3.8).

Indicates that the element represents a constant object declaration or number declaration (Ada83 LRM 3.2, Ada95 LRM 3.3).

Indicates that the element represents a deferred-constant declaration (Ada83 LRM 7.4, Ada95 LRM 7.3).

Indicates that the element represents a discriminant specification (Ada83 LRM 3.7.1, Ada95 LRM 3.7).

Indicates that the element represents a full-type declaration (Ada83 LRM 3.3.1, Ada95 LRM 3.2.1).

Indicates that the element represents a subprogram-body declaration of a function (Ada83 LRM 6.3, Ada95 LRM 6.3).

Indicates that the element represents a body-stub declaration of a function (Ada83 LRM 10.2, Ada95 LRM 10.1.3).

Indicates that the element represents a subprogram specification of a function (Ada83 LRM 6.1, Ada95 LRM 6.1).

Indicates that the element represents a generic instantiation of a function (Ada83 LRM 12.1, Ada95 LRM 12.1).

Indicates that the element represents a renaming declaration of a function (Ada83 LRM 8.5, Ada95 LRM 8.5).

Indicates that the element represents the generic-parameter declaration of a function subprogram specification (Ada83 LRM 12.1, Ada95 LRM 12.1).

Indicates that the element represents a generic-parameter declaration of an object declaration (Ada83 LRM 12.1, Ada95 LRM 12.1).

Indicates that the element represents a generic-parameter declaration of a private-type declaration.

Indicates that the element represents the generic-parameter declaration of a procedure subprogram specification (Ada83 LRM 12.1, Ada95 LRM 12.1).

Indicates that the element represents the generic-parameter declaration of a type (Ada83 LRM 12.1, Ada95 LRM 12.1).

Indicates that the element represents the generic specification of a function subprogram specification (Ada83 LRM 12.1, Ada95 LRM 12.1).

Indicates that the element represents the generic specification of a package specification (Ada83 LRM 12.1, Ada95 LRM 12.1).

Indicates that the element represents the generic specification of a procedure subprogram specification (Ada83 LRM 12.1, Ada95 LRM 12.1).

Indicates that the element represents the identifier of a loop-parameter specification (Ada83 LRM 5.5, Ada95 LRM 5.5).

Indicates that the element represents a package-body declaration (Ada83 LRM 7.1, Ada95 LRM 7.1).

Indicates that the element represents a body-stub declaration of a package (Ada83 LRM 10.2, Ada95 LRM 10.1.3).

Indicates that the element represents a package specification (Ada83 LRM 7.1, Ada95 LRM 7.1).

Indicates that the element represents a generic instantiation of a package (Ada83 LRM 12.1, Ada95 LRM 12.1).

Indicates that the element represents a renaming declaration of a package (Ada83 LRM 8.5, Ada95 LRM 8.5).

Indicates that the element represents a parameter specification (Ada83 LRM 6.1, Ada95 LRM 6.1).

Indicates that the element represent a private-type declaration (Ada83 LRM 7.4, Ada95 LRM 7.3).

Indicates that the element represents a subprogram-body declaration of a procedure (Ada83 LRM 6.3, Ada95 LRM 6.3).

Indicates that the element represents a body-stub declaration of a procedure (Ada83 LRM 10.2, Ada95 LRM 10.1.3).

Indicates that the element represents a subprogram specification of a procedure (Ada83 LRM 6.1, Ada95 LRM 6.1).

Indicates that the element represents a generic instantiation of a procedure (Ada83 LRM 12.1, Ada95 LRM 12.1).

Indicates that the element represents a renaming declaration of a procedure (Ada83 LRM 8.5, Ada95 LRM 8.5).

Indicates that the element represents a real-number declaration (Ada83 LRM 3.2, Ada95 LRM 3.3).

Indicates that the element represents subtype declaration (Ada83 LRM 3.3.2, Ada95 LRM 3.2.2).

Indicates that the element represents a task body (Ada83 LRM 9.1, Ada95 LRM 9.1).

Indicates that the element represents the body stub of a task (Ada83 LRM 10.2, Ada95 LRM 10.1.3).

Indicates that the element represents a task specification (Ada83 LRM 9.1, Ada95 LRM 9.1).

Indicates that the element represents the task specification of a task type (Ada83 LRM 9.1, Ada95 LRM 9.1).

Indicates that the element represents the declaration of a variable object declaration (Ada83 LRM 3.2, Ada95 LRM 3.3).

Indicates that the element represents a task-entry declaration (Ada83 LRM 9.5, Ada95 LRM 9.5).

Indicates that the element represents an enumeration-literal specification (Ada83 LRM 3.5.1, Ada95 LRM 3.5.1).

Indicates that the element represents an exception declaration (Ada83 LRM 11.1, Ada95 LRM 11.1).

Indicates that the element represents the renaming declaration of an exception declaration (Ada83 LRM 8.5, Ada95 LRM 8.5).

Indicates that the element represents an incomplete-type declaration (Ada83 LRM 3.8.1, Ada95 LRM 3.10.1).

Indicates that the element represents an integer-number declaration (Ada83 LRM 3.2, Ada95 LRM 3.3).

Indicates that the element represents the renaming declaration of an object declaration or a number declaration (Ada83 LRM 8.5, Ada95 LRM 8.5).

Indicates that the element does not represent a declaration.

Cross-References

Related subprograms:

Related concept:


Type Declaration_Origins

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

Indicates that the element represents an explicit declaration that appears in the source code.

Indicates that the element represents an implicit derived declaration created by declaring a derived type (Ada83 LRM 3.4(12), Ada95 LRM 3.4).

Indicates that the element represents an implicit declaration created by declaring or deriving a type (Ada83 LRM 4.5(6), Ada95 LRM 4.5).

Indicates that the element does not represent a declaration.

Cross-References

Related subprogram:

Related concepts:


Function Discriminants

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

Ada83 LRM 7.4, Ada95 LRM 7.3

 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

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

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

Related subprograms:

Related concepts:


Function Enclosing_Generic

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

Specifies an element that may be a part of a generic declaration or generic body.

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:

Related concept:


Function Entry_Declarations

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:

Ada83 LRM 9.1, Ada95 LRM 9.1

 task_specification ::=
  task [type] identifier [is
   {entry_declaration}
   {representation_clause}
  end [task_simple_name}]

Ada83 LRM 9.5, Ada95 LRM 9.5 

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

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

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

Related subprograms:

Related concepts:


Function Family_Index

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:

Ada83 LRM 9.5, Ada95 LRM 9.5 

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

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

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

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