TOC PREV NEXT INDEX DOC LIST MASTER INDEX




Function Is_Private

Expanded Name Asis.Declarations.Is_Private

Returns a Boolean value indicating whether the specified declaration is a private type or has been derived from a private type.

Description

Subtype declarations are partially defined by the following syntax:

Ada83 LRM 3.3.2, Ada95 LRM 3.2.2

 subtype_declaration ::=
  subtype identifier is subtype_indication;

Derived types are defined by the following syntax:

Ada83 LRM 3.4, Ada95 LRM 3.4

 derived_type_definition ::= new
  subtype_indication

Private-type declarations are defined by the following syntax:

Ada83 LRM 7.4, Ada95 LRM 7.3

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

Generic package and subprogram specifications 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 specified declaration is a subtype declaration of a private-type declaration, a derived-type definition of a private-type declaration, a private-type declaration, a private-type declaration of a generic-parameter declaration, or a record or array with components of a private type.

Parameters

Specifies the declaration to be checked to determine whether it represents a private-type declaration. 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_Generic_Formal_Type_Declaration
A_Private_Type_Declaration
A_Subtype_Declaration
A_Task_Type_Declaration
An_Incomplete_Type_Declaration

s:

Returns True for the following declaration kinds and False for all others:

Errors

None.

Examples

Cross-References

Related subprograms:

Related concepts:


Function Is_Procedure

Expanded Name Asis.Declarations.Is_Procedure

Returns a Boolean value indicating whether the specified declaration is a procedure 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 procedure subprogram specification, a renaming declaration of a procedure, a procedure body stub, a procedure proper body of a subunit, a generic specification of a procedure subprogram specification, or a generic instantiation of a procedure.

Parameters

Specifies the declaration to checked to determine whether it is a procedure declaration. This function returns True for the following kinds:
Element_Kinds
Declaration_Kinds
A_Declaration
A_Generic_Formal_Procedure_Declaration
A_Generic_Procedure_Declaration
A_Procedure_Body_Declaration
A_Procedure_Body_Stub
A_Procedure_Declaration
A_Procedure_Instantiation
A_Procedure_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_Renaming_Declaration

Expanded Name Asis.Declarations.Is_Renaming_Declaration

Returns a Boolean value indicating whether the specified declaration is an object, exception, package, or subprogram or entry renaming declaration.

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;

This function returns True if the specified declaration is a renaming declaration.

Parameters

Specifies the declaration to be checked to determine whether it is a renaming declaration. This function returns True for the following kinds:
Element_Kinds
Declaration_Kinds
A_Declaration
An_Exception_Rename_Declaration
A_Function_Rename_Declaration
An_Object_Rename_Declaration
A_Package_Rename_Declaration
A_Procedure_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 concept:


Function Is_Specification

Expanded Name Asis.Declarations.Is_Specification

Returns a Boolean value indicating whether the specified declaration is a function, procedure, package, or task specification.

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

Package specifications are defined by the following syntax:

Ada83 LRM 7.1, Ada95 LRM 7.1

 package_specification ::=
  package identifier is
   {basic_declarative_item}
  [private
    {basic_declarative_item}]
  end [package_simple_name]

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;

Task specifications 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}]

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

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 for a subprogram specification, package specification, renaming declaration of a package or subprogram, task specification or task-type specification, entry declaration, or a generic
instantiation.

Generic instantiations return True because the instantiation creates an implicit specification and body.

Parameters

Specifies the declaration to be checked to determine whether it is a specification. This function returns True for the following kinds:
Element_Kinds
Declaration_Kinds
A_Declaration
A_Function_Declaration
A_Function_Instantiation
A_Function_Rename_Declaration
A_Generic_Formal_Function_Declaration
A_Generic_Formal_Procedure_Declaration
A_Generic_Package_Declaration
A_Generic_Procedure_Declaration
A_Package_Declaration
A_Package_Instantiation
A_Package_Rename_Declaration
A_Procedure_Declaration
A_Procedure_Instantiation
A_Procedure_Rename_Declaration
A_Task_Declaration
A_Task_Type_Declaration
An_Entry_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_Subprogram

Expanded Name Asis.Declarations.Is_Subprogram

Returns a Boolean value indicating whether the specified declaration is a subprogram specification, body, generic, instantiation, or rename.

Description

This function returns True if the Is_Function or Is_Procedure functions return True with the same declaration.

Parameters

Specifies the declaration to be checked to determine whether it is a subprogram declaration. 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_Procedure_Declaration
A_Procedure_Body_Declaration
A_Procedure_Body_Stub
A_Procedure_Declaration
A_Procedure_Instantiation
A_Procedure_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 concept:


Function Is_Subunit

Expanded Name Asis.Declarations.Is_Subunit

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

Description

Subunits are defined by the following syntax:

 subunit ::=
  separate (parent_unit_name) proper body

This function returns True if the specified declaration represents a subunit.

Parameters

Specifies the declaration for which the subunit status should be returned. This function returns True for the following kinds
Element_Kinds
Declaration_Kinds
A_Declaration
A_Function_Body_Declaration
A_Package_Body_Declaration
A_Procedure_Body_Declaration
A_Task_Body_Declaration

Returns True for all elements in the above table that are also a subunit declaration and False for all other elements.

Errors

None.

Examples

For example:

The element that represents the separate procedure declaration in the body of package Sorting is a Declaration_Kinds of A_Procedure_Body_Stub. When Is_Subunit is called with this element, it returns True.

Cross-References

Related subprograms:

Related concepts:


Function Is_Task

Expanded Name Asis.Declarations.Is_Task

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

Description

Task specifications are defined by the following syntax:

Ada83 LRM 91, Ada95 LRM 9.1

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

Each task specification must have a corresponding task body.

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 task specification, task-type task specification, task-body declaration, or task body-stub declaration.

Parameters

Specifies the declaration to be checked to determine whether it is a task declaration. This function returns True for the following kinds:
Element_Kinds
Declaration_Kinds
A_Declaration
A_Task_Body_Declaration
A_Task_Body_Stub
A_Task_Declaration
A_Task_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_Type_Declaration

Expanded Name Asis.Declarations.Is_Type_Declaration

Returns a Boolean value indicating whether the specified declaration is a type or subtype declaration.

Description

Type declarations are partially 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;

Task specifications 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}]

Generic package and subprogram specifications 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 specified declaration is a full-type declaration, subtype declaration, incomplete-type declaration, private-type declaration, task specification that identifies a task type, or generic-formal or private-type declaration.

Parameters

Specifies the declaration to be checked to determine whether it represents a type declaration. 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_Generic_Formal_Type_Declaration
A_Private_Type_Declaration
A_Subtype_Declaration
A_Task_Type_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_Variable

Expanded Name Asis.Declarations.Is_Variable

Returns a Boolean value indicating whether the specified declaration is a variable, discriminant, component, or variable subprogram parameter or a renames of one of these items.

Description

The following declarations represent variables:

Parameters

Specifies the object declaration to be checked to determine whether it is a constant. This function returns True for the following kind
Element_Kinds
Declaration_Kinds
A_Declaration
A_Component_Declaration
A_Discriminant_Specification
A_Generic_Formal_Object_Declaration
Parameter_Mode_Kinds
An_In_Out_Mode
An_Out_Mode
A_Parameter_Specification
Parameter_Mode_Kinds
An_In_Out_Mode
An_Out_Mode
A_Real_Number_Declaration
A_Variable_Declartion
An_Integer_Number_Declaration

s:

Returns True for all elements in the above table or for An-
_Object_Rename_Declaration that references a variable, 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