TOC PREV NEXT INDEX DOC LIST MASTER INDEX




Function Is_Discriminated

Expanded Name Asis.Type_Definitions.Is_Discriminated

Returns a Boolean value indicating whether the specified type definition is a record-type definition with discriminants.

Description

Full-type definitions 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;

To declare a record, the type definition must be a record-type definition.

Record-type definitions are partially defined by the following syntax:

Ada83 LRM 3.7, Ada95 LRM 3.8
 record_type_definition ::=
  record
   component_list
  end record

This function returns True if the specified full-type declaration is a record-type definition with a discriminant part.

Parameters

Specifies the record-type definition that should be queried. The type definition must be of the following kinds:
Element_Kinds
Type_Definition_Kinds
A_Type_Definition
A_Record_Type_Definition

Returns True for all elements in the above table that also contain discriminants and False for all other elements.

Errors

None.

Examples

Cross-References

Related subprogram:

Related concepts:


Function Is_Predefined

Expanded Name Asis.Type_Definitions.Is_Predefined

Returns a Boolean value indicating whether the specified type definition is the definition of a type in package Standard.

Description

Predefined types are those types declared in package Standard (Ada83 LRM 8.6, Ada95 LRM A.1and Annex C). Package Standard must include Ada predefined types, but it can also include other types defined by the compiler vendor. The Ada predefined types are:

Additionally, when package Standard is examined by an ASIS application, it will always include three explicit type definitions not available to Ada programs:

These universal declarations are not Declarations.Is_Part_Of-_Implicit.

This function returns True for all type definitions from package Standard and False for all other type definitions.

Parameters

Specifies the type definition that should be queried. The type definition must be of the following kind:
Element_Kinds

A_Type_Definition

Returns True for all elements in the above table that are also declarations in package Standard and False for all other elements.

Errors

None.

Examples

Cross-References

Related subprograms:

Related concepts:


Function Kind

Expanded Name Asis.Type_Definitions.Kind

Returns the kinds of the specified type definition.

Description

This function returns the kind of the specified type definition.

Elements of the kind A_Type_Definition are returned from the following functions:

The functions in this package are used primarily for traversing the type hierarchy. The functions in package Declarations are used to analyze anonymous array declarations as well as type and subtype declarations; they are also used for traversal between private-type declarations and their associated full-type declarations. The functions in package Expressions are used for obtaining the type of an expression.

Description (continued)

Elements of the kind A_Type_Definition are also returned in Declarative_Item_List. These lists are returned from the following functions:

You can use the Declarations.Is_Type_Declaration function to determine whether a particular element of a Declarative_Item-_List represents a type definition.

Parameters

Specifies the type definition that should be queried. The type definition must be of the following kind:
Element_Kinds

A_Type_Definition

Returns the kind of the specified type definition. If an unexpected element is specified, Not_A_Type_Definition is returned.

Errors

None.

Examples

Cross-References

Related subprograms and types:

Related concept:


Function Last_Constraint

Expanded Name Asis.Type_Definitions.Last_Constraint

Returns the type definition of the last type mark that includes a constraint for the specified subtype definition.

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;

 subtype_indication ::= type_mark [constraint]

This function recursively unwinds subtyping to arrive at a type definition that is either the base type or a subtype that imposes an explicit constraint.

If the specified type definition is not a subtype declaration, the function acts as an identity function and returns the argument.

Parameters

Specifies the type definition that should be queried. The type definition must be of the following kind:
Element_Kinds

A_Type_Definition

The returned element is of the following kind:
Element_Kinds

A_Type_Definition

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.

Asis_Failed is raised and Environment.Status is set to Obso-
lete_Reference_Error if a parameter is part of an obsolete
compilation unit.

Examples

Cross-References

Related subprograms:

Related concepts:


Function Last_Subtype

Expanded Name Asis.Type_Definitions.Last_Subtype

Returns the type definition of the type mark for the specified subtype definition.

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;

 subtype_indication ::= type_mark [constraint]

The function unwinds subtyping one step at a time to return a type definition that is either the base type or a subtype that imposes a constraint.

If the specified type definition is not a subtype declaration, the function acts as an identity function and returns the specified type definition.

Parameters

Specifies the type definition that should be queried. The type definition must be of the following kind:
Element_Kinds

A_Type_Definition

The returned element is of the following kind:
Element_Kinds

A_Type_Definition

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.

Asis_Failed is raised and Environment.Status is set to Obso-
lete_Reference_Error if a parameter is part of an obsolete
compilation unit.

Examples

Cross-References

Related subprograms:

Related concepts:


Function Lower_Bound

Expanded Name Asis.Type_Definitions.Lower_Bound

Returns the simple expression that represents the lower bound of the specified range constraint or discrete range constraint.

Description

Range constraints are partially defined by the following syntax:

Ada83 LRM 3.5, Ada95 LRM 3.5
 range_constraint ::= range range

 range ::= range_attribute
  | simple_expressions .. simple_expression

Discrete ranges are defined by the following syntax:

Ada83 LRM 3.6, Ada95 LRM 3.6
 discrete_range ::=
  discrete_subtype_indication | range

This function returns the lower-bound simple expression of the specified range constraint or discrete range.

Parameters

Specifies the range constraint or discrete range that should be queried. The constraint must be of the following kinds:
Element_Kinds
Constraint_Kinds
Discrete_Range-_Kind
A_Constraint
A_Simple_Range
——
A_Discrete_Range
A_Simple_Range
A_Simple_Range

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 Parent_Subtype

Expanded Name Asis.Type_Definitions.Parent_Subtype

Returns the subtype indication associated with the specified derived-type definition.

Description

Derived-type definitions are defined by the following syntax:

Ada83 LRM 3.4, Ada95 LRM 3.4
 derived_type_definition ::=
  new subtype_indication

This function returns the subtype indication for the specified derived-type definition.

Parameters

Specifies the derived-type definition that should be queried. The type definitions must be of the following kinds:
Element_Kinds
Type_Definition_Kinds
A_Type_Definition
A_Derived_Type_Definition

The returned element is of the following kind:
Element_Kinds

A_Subtype_Indication

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 Parent_Type

Expanded Name Asis.Type_Definitions.Parent_Type

Returns the parent-type definition of the specified derived-type definition.

Description

Derived-type definitions are defined by the following syntax:

Ada83 LRM 3.4, Ada95 LRM 3.4
 derived_type_definition ::=
  new subtype_indication

A derived-type definition defines a new (base) type whose characteristics are derived from those of a parent type (Ada83 LRM 3.4, Ada95 LRM 3.4).

This function returns the parent-type definition for a derived-type definition.

Parameters

Specifies the derived-type definition that should be queried. The type definition must be of the following kinds:
Element_Kinds
Type_Definition_Kinds
A_Type_Definition
A_Derived_Type_Definition

The returned element is of the following kind:
Element_Kinds

A_Type_Definition

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.

Asis_Failed is raised and Environment.Status is set to Obso-
lete_Reference_Error if a parameter is part of an obsolete
compilation unit.

Examples

Cross-References

Related subprograms:

Related concepts:


Function Range_Attribute

Expanded Name Asis.Type_Definitions.Range_Attribute

Returns the range attribute from the specified range constraint or discrete range.

Description

Range constraints are partially defined by the following syntax:

Ada83 LRM 3.5, Ada95 LRM 3.5
 range_constraint ::= range range

 range ::= range_attribute
  | simple_expressions .. simple_expression

Discrete ranges are defined by the following syntax:

Ada83 LRM 3.6, Ada95 LRM 3.6
 discrete_range ::=
  discrete_subtype_indication | range

This function returns the range attribute from the specified range constraint or discrete range.

Parameters

Specifies the range constraint or discrete range that should be queried. The constraint must be of the following kinds:
Element_Kinds
Constraint_Kinds
A_Constraint
A_Range_Attribute
A_Discrete_Range
A_Range_Attribute

The returned element is of the following kinds:
Element_Kinds
Expression_Kinds
An_Expression
An_Attribute

The An_Attribute referenced by the returned element is always '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:


Function Real_Type_Constraint

Expanded Name Asis.Type_Definitions.Real_Type_Constraint

Returns the constraint from the specified fixed-point or floating-point type definition.

Description

Real-type definitions are defined by the following syntax:

Ada83 LRM 3.5.6, Ada95 LRM 3.5.6
 real_type_definition ::=
   floating_point_constraint
  | fixed_point_constraint

Floating-point constraints are partially defined by the following syntax:

Ada83 LRM 3.5.7, Ada95 LRM 3.5.7
 floating_point_constraint ::=
  floating_accuracy_definition
    [range_constraint]

Fixed-point constraints are defined by the following syntax:

Ada83 LRM 3.5.9, Ada95 LRM 3.5.9
 fixed_point_constraint ::=
  fixed_accuracy_definition
    [range_constraint]

This function returns the floating-point constraint from the specified floating-point real-type definition or the fixed-point constraint from the specified fixed-point real-type definition.

Parameters

Specifies the fixed-point or floating-point type definition that should be queried. The type definition must be of the following kinds:
Element_Kinds
Type_Definition_Kinds
A_Type_Definition
A_Fixed_Type_Definition
A_Float_Type_Definition

The returned element is of the following kinds:
Element_Kinds
Constraint_Kinds
A_Constraint
A_Fixed_Point_Constraint
A_Floating_Point_Constraint

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 Record_Components

Expanded Name Asis.Type_Definitions.Record_Components

Returns a list of the all components and, optionally, pragmas that are present in the specified record-type definition.

Description

Record-type definitions are defined by the following syntax:

Ada83 LRM 3.7, Ada95 LRM 3.8
 record_type_definition ::=
  record
   component_list
  end record

 component_list ::=
   component_declaration
    {component_declaration}
  | {component_declaration} variant_part
  | null;

This function returns the component-list for the specified record-type definition.

The components and pragmas are returned in their order of appearance in the source code. A_Pragma elements do not appear in the list unless Include_Pragmas has been specified as True.

The list does not include any implementation-defined components (Ada83 LRM 13.4(8), Ada95 LRM 13.5.1). You can obtain these components with the Implicit_Components function.

Description (continued)

For further analysis:
Element_Kinds
Calls to Use
A_Declaration
Declarations.
(most subprograms)

A_Null_Component
——
A_Pragma
Elements.
Argument_Associations
Is_Predefined
Name
Pragma_Kind

A_Variant_Part
Type_Definitions.
Corresponding_Discriminant- _Simple_name
Variants

Parameters

Specifies the record-type definition that should be queried. The type definition must be of the following kinds:
Element_Kinds
Type_Definition_Kinds
A_Type_Definition
A_Derived_Type_Definition1 A_Record_Type_Definition
1 Whose parent type is a record type.

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
A_Component_Declaration
A_Null_Component
——
A_Pragma
——
A_Variant_Part
——

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