![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Function Subtype_Constraint
function Subtype_Constraint (Subtype_Indication : in Asis.Subtype_Indication) return Asis.Constraint;Expanded Name Asis.Type_Definitions.Subtype_Constraint
Returns the constraint applied to the specified subtype
indication.Description
Subtype indications are partially defined by the following syntax:
Ada83 LRM 3.2.2, Ada95 LRM 3.3.2
subtype_indication ::= type_mark [constraint]This function returns the constraint from the specified subtype indication.
If a constraint is not present, Asis.Nil_Element is returned.
Subtype indications appear in the following constructs:
- Access-type definitions (Ada83 LRM 3.8, Ada95 LRM 3.10)
- Allocators (Ada83 LRM 4.8, Ada95 LRM 4.8)
- Component subtype definitions (Ada83 LRM 3.7, Ada95 LRM 3.8)
- Constrained and unconstrained-array definitions (Ada83 LRM 3.6, Ada95 LRM 3.6)
- Derived-type definitions (Ada83 LRM 3.4, Ada95 LRM 3.4)
- Discrete ranges (Ada83 LRM 3.6, Ada95 LRM 3.6)
- Object declarations (Ada83 LRM 3.2, Ada95 LRM 3.3)
- Subtype declarations (Ada83 LRM 3.3.2, Ada95 LRM 3.2.2)
Parameters
Subtype_Indication : in Asis.Subtype_Indication;Specifies the subtype declaration that should be queried. The subtype indication must be of the following kinds:
Element_Kinds Discrete_Range_Kinds
A_Subtype_Indication ——
A_Discrete_Range A_Discrete_Subtype_Indication
return Asis.Constraint;The returned element is of the following kind:
Element_Kinds
A_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
- "Processing Subtype Declarations and Type Marks"
- "Processing Constraints"
- Ada83 LRM 3.2, Ada95 LRM 3.3
- Ada83 LRM 3.2.2, Ada95 LRM 3.3.2
- Ada83 LRM 3.4, Ada95 LRM 3.4
- Ada83 LRM 3.6, Ada95 LRM 3.6
- Ada83 LRM 3.7, Ada95 LRM 3.7
- Ada83 LRM 3.8, Ada95 LRM 3.10
- Ada83 LRM 4.8, Ada95 LRM 4.8
Function Subtype_Definition_Subtype_Indication
function Subtype_Definition_Subtype_Indication (Type_Definition : in Asis.Type_Definition) return Asis.Subtype_Indication;Expanded Name Asis.Type_Definitions.Subtype_Definition_Subtype-
_IndicationReturns the subtype indication from the specified subtype
definition.Description
Object declarations are partially defined by the following syntax:
Ada83 LRM 3.2, Ada95 LRM 3.3
object_declaration ::=
identifier_list :
[constant] subtype_indication
[:= expression];
| identifier_list :
[constant] constrained_array_definition
[:= expression];This function returns the subtype indication from the specified subtype definition. The subtype definition for an object declaration is obtained with the Declarations.Object_Declaration-
_Definition function.Parameters
Type_Definition : in Asis.Type_Definition;Specifies the subtype declaration that should be queried. The type definition must be of the following kinds:
Element_Kinds Type_Definition_Kinds
A_Type_Definition A_Subtype_Definition
return Asis.Subtype_Indication;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
Function Task_Type_Declarative_Items
function Task_Type_Declarative_Items (Type_Definition : in Asis.Type_Definition; Include_Pragmas : in Boolean := False) return Asis.Declarative_Item_List;Expanded Name Asis.Type_Definitions.Task_Type_Declarative_Items
Returns a list of all entry declarations, representation clauses, and, optionally, pragmas that are present in the specified task- type declaration.
Description
Task types 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}]This function returns a list containing all the entry declarations, representation clauses, and, optionally, pragmas contained in the specified task-type specification.
The declarations, representations, 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 Declarations.Task_Declaration_Declarative_Items function can be used to obtain the same information for a task specification.
Parameters
Type_Definition : in Asis.Type_Definition;Specifies the task-type specification that should be queried. The type definition must be of the following kinds:
Element_Kinds Type_Definition_Kinds
A_Type_Definition A_Task_Type_Definition
Include_Pragmas : in Boolean := False;Specifies whether pragma definitions should be included in the returned list.
return Asis.Declarative_Item_List;The returned list contains elements of the following kinds:
Element_Kinds Declaration_Kinds
A_Declaration An_Entry_Declaration
A_Pragma ——
A_Representation_Clause ——
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 Declarations.Names
- function Declarations.Task_Body_Block
- function Declarations.Task_Declaration_Declarative_Items
- function Elements.Argument_Associations
- function Elements.Is_Predefined
- function Elements.Name
- function Elements.Pragma_Kind
- function Elements.Pragmas
- function Representation_Clauses.Associated_Type
- function Representation_Clauses.Kind
- function Representation_Clauses.Length_Clause_Attribute
- function Representation_Clauses.Length_Clause_Attribute-_Kind
- "Processing Task-Type Specifications"
- package Declarations, "Processing Task Declarations"
- package Elements, "Processing Pragmas"
- package Representation_Clauses, "Determining Representation Kind"
- Ada83 LRM 9.1, Ada95 LRM 9.1
Function Type_Definition_Declaration
function Type_Definition_Declaration (Type_Definition : in Asis.Type_Definition) return Asis.Declaration;Expanded Name Asis.Type_Definitions.Type_Definition_Declaration
Returns the type declaration or the object declaration associated with the specified type definition.
Description
The declaration is the Elements.Enclosing_Element of the definition. See package Elements, "Enclosing Elements" for more information.
Parameters
Type_Definition : in Asis.Type_Definition;Specifies the type definition that should be queried. The type definition must be of the following kind:
Element_Kinds
A_Type_Definition
return Asis.Declaration;The returned element is of the following kind:
Element_Kinds
A_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
Type Type_Definition_Kinds
type Type_Definition_Kinds is (...)Expanded Name Asis.Type_Definitions.Type_Definition_Kinds
Describes the kinds of type definitions available.
Description
Enumerations
A_Derived_Type_DefinitionIndicates that the element represents a derived-type definition (Ada83 LRM 3.4, Ada95 LRM 3.4).
A_Fixed_Type_DefinitionIndicates that the element represents a fixed-point type definition (Ada83 LRM 3.5.9, Ada95 LRM 3.5.9).
A_Float_Type_DefinitionIndicates that the element represents a floating-point type definition (Ada83 LRM 3.5.7, Ada95 LRM 3.5.7).
A_Generic_Access_Type_DefinitionIndicates that the element represents an access-type definition from a generic-parameter declaration (Ada83 LRM 12.1, Ada95 LRM 12.1).
A_Generic_Array_Type_DefinitionIndicates that the element represents an array-type definition from a generic-parameter declaration (Ada83 LRM 12.1, Ada95 LRM 12.1).
A_Generic_Discrete_Subtype_DefinitionIndicates that the element represents an enumeration- or integer-type definition from a generic-parameter declaration (Ada83 LRM 12.1, Ada95 LRM 12.1).
A_Generic_Fixed_Subtype_DefinitionIndicates that the element represents a fixed-point real-type definition from a generic-parameter declaration (Ada83 LRM 12.1, Ada95 LRM 12.1).
A_Generic_Float_Subtype_DefinitionIndicates that the element represents a floating-point real-type definition from a generic-parameter declaration (Ada83 LRM 12.1, Ada95 LRM 12.1).
A_Generic_Integer_Subtype_DefinitionIndicates that the element represents an integer-type definition from a generic-parameter declaration (Ada83 LRM 12.1, Ada95 LRM 12.1).
A_Generic_Limited_Private_Type-_DefinitionIndicates that the element represents a limited private-type definition from a generic-parameter declaration (Ada83 LRM 12.1, Ada95 LRM 12.1).
A_Generic_Private_Type_DefinitionIndicates that the element represents a private-type definition from the generic-parameter declaration (Ada83 LRM 12.1, Ada95 LRM 12.1).
A_Limited_Private_Type_DefinitionIndicates that the element represents a limited private-type declaration (Ada83 LRM 7.4, Ada95 LRM 7.3).
A_Private_Type_DefinitionIndicates that the element represents a private-type declaration (Ada83 LRM 7.4, Ada95 LRM 7.3).
A_Record_Type_DefinitionIndicates that the element represents a record-type definition (Ada83 LRM 3.7, Ada95 LRM 3.8).
A_Subtype_DefinitionIndicates that the element represents a subtype definition (Ada83 LRM 3.3.2, Ada95 LRM 3.2.2). This is distinct from a subtype indication (which is an Element_Kinds).
A_Task_Type_DefinitionIndicates that the element represents a task-type specification (Ada83 LRM 9.1, Ada95 LRM 9.1).
A_Universal_Fixed_DefinitionIndicates that the element represents a universal fixed-point definition (Ada83 LRM 3.5.9, Ada95 LRM 3.5.9).
A_Universal_Integer_DefinitionIndicates the element represents a universal integer definition (Ada83 LRM 3.5.4, Ada95 LRM 3.5.4).
A_Universal_Real_DefinitionIndicates that the element represents a universal real definition (Ada83 LRM 3.5.6, Ada95 LRM 3.5.6).
An_Access_Type_DefinitionIndicates that the element represents an access-type definition (Ada83 LRM 3.8, Ada95 LRM 3.10).
An_Array_Type_DefinitionIndicates that the element represents an array-type definition (Ada83 LRM 3.6, Ada95 LRM 3.6).
An_Enumeration_Type_DefinitionIndicates that the element represents an enumeration-type definition (Ada83 LRM 3.5.1, Ada95 LRM 3.5.1).
An_Integer_Type_DefinitionIndicates that the element represents an integer-type definition (Ada83 LRM 3.5.4, Ada95 LRM 3.5.4).
Not_A_Type_DefinitionIndicates that the element does not represent a type definition.
Cross-References
Function Type_Mark
function Type_Mark (Subtype_Indication : in Asis.Subtype_Indication) return Asis.Expression;Expanded Name Asis.Type_Definitions.Type_Mark
Returns the type mark from a subtype indication or discrete-range subtype indication.
Description
Subtype indications are defined by the following syntax:
Ada83 LRM 3.2.2, Ada95 LRM 3.3.2
subtype_indication ::= type_mark [constraint]Discrete ranges are defined by the following syntax:
Ada83 LRM 3.6, Ada95 LRM 3.6
discrete_range ::=
discrete_subtype_indication | rangeThis function returns the type mark from the specified subtype indication or discrete range.
Parameters
Subtype_Indication : in Asis.Subtype_Indication;Specifies the subtype indicator or discrete range that should be queried. The subtype indication must be of the following kinds:
Element_Kinds Discrete_Range_Kind
A_Discrete_Range ——
A_Subtype_Indication A_Discrete_Subtype_Indication
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 Access_To
- function Component_Subtype_Indication
- function Discrete_Ranges
- function Parent_Subtype
- function Subtype_Definition_Subtype_Indication
- function Expressions.Name
- "Processing Discrete Ranges"
- "Processing Subtype Declarations and Type Marks"
- package Expressions, "Processing Expressions"
- Ada83 LRM 3.3.2, Ada95 LRM 3.2.2
- Ada83 LRM 3.6, Ada95 LRM 3.6
Function Type_Structure
function Type_Structure (Type_Definition : in Asis.Type_Definition) return Asis.Type_Definition;Expanded Name Asis.Type_Definitions.Type_Structure
Returns the type structure from which the specified type definition has been derived.
Description
The function unwinds recursive derivations and subtyping until the type definition derives a new representation (Ada83 LRM 13.6, Ada95 LRM 13.6) or is no longer derived.
Parameters
Type_Definition : in Asis.Type_Definition;Specifies the type definition that should be queried. The type definition must be of the following kind:
Element_Kinds
A_Type_Definition
return Asis.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
- function Base_Type
- function Ground_Type
- function Is_Predefined
- function Last_Constraint
- function Last_Subtype
- function Parent_Subtype
- function Parent_Type
Function Upper_Bound
function Upper_Bound (Constraint : in Asis.Range_Constraint) return Asis.Expression;Expanded Name Asis.Type_Definitions.Upper_Bound
Returns the simple expression that represents the upper 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_expressionDiscrete ranges are defined by the following syntax:
Ada83 LRM 3.6, Ada95 LRM 3.6
discrete_range ::=
discrete_subtype_indication | rangeThis function returns the upper-bound simple expression of the specified range constraint or discrete range.
Parameters
Constraint : in Asis.Range_Constraint;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
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 Choice_Discrete_Range
- function Discrete_Range_Kind
- function Discrete_Ranges
- function Fixed_Point_Range_Constraint
- function Floating_Point_Range_Constraint
- function Integer_Constraint
- function Lower_Bound
- "Processing Discrete Ranges"
- package Expressions, "Processing Expressions"
- Ada83 LRM 3.5, Ada95 LRM 3.5
- Ada83 LRM 3.6, Ada95 LRM 3.6
Function Variant_Choices
function Variant_Choices (Variant : in Asis.Variant) return Asis.Choice_List;Expanded Name Asis.Type_Definitions.Variant_Choices
This function returns the choices contained in the specified record variant.
Description
Record variants are partially defined by the following syntax:
Ada83 LRM 3.7.3, Ada95 LRM 3.8.1
variant ::=
when choice {| choice} =>
component_listThis function returns a list of the choices contained in the specified variant.
Parameters
Variant : in Asis.Variant;Specifies the record variant that should be queried. The variant must be of the following kind:
Element_Kinds
A_Variant
return Asis.Choice_List;The returned list contains elements of the following kind:
Element_Kinds
A_Choice
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 Choice_Discrete_Range
- function Choice_Kind
- function Choice_Name
- function Choice_Simple_Expression
- function Variants
Function Variant_Components
function Variant_Components (Variant : in Asis.Variant; Include_Pragmas : in Boolean := False) return Asis.Variant_Component_List;Expanded Name Asis.Type_Definitions.Variant_Components
Returns a list of all components, and, optionally, pragmas that are present in the specified record variant.
Description
Record variants are partially defined by the following syntax:
Ada83 LRM 3.7.3, Ada95 LRM 3.8.1
variant ::=
when choice {| choice} =>
component_listThis function returns the component list contained in the specified variant.
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_Variant_Components function.
Parameters
Variant : in Asis.Variant;Specifies the record variant that should be queried. The variant must be of the following kind:
Element_Kinds
A_Variant
Include_Pragmas : in Boolean := False;Specifies whether pragma definitions should be included in the returned list.
return Asis.Variant_Component_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
- function Component_Kind
- function Implicit_Variant_Components
- function Variants
- function Declarations.Object_Declaration_Definition
- function Elements.Argument_Associations
- function Elements.Is_Predefined
- function Elements.Name
- function Elements.Pragma_Kind
- "Processing Record-Type Definitions"
- Ada83 LRM 3.7.3, Ada95 LRM 3.8.1
- Ada83 LRM 13.4, Ada95 LRM
13.5.1
Function Variants
function Variants (Variant_Part : in Asis.Record_Component) return Asis.Variant_List;Expanded Name Asis.Type_Definitions.Variants
Returns a list of the variants that are contained within the specified variant part.
Description
Record variant parts are partially defined by the following syntax:
Ada83 LRM 3.7.3, Ada95 LRM 3.8.1
variant_part ::=
case discriminant_simple_name is
variant
{variant}
end case;This function returns a list of the variants that make up the specified variant part.
The variants are returned in their order of appearance in the source code.
Parameters
Variant_Part : in Asis.Record_Component;Specifies the record variant part that should be queried. The variant part must be of the following kinds:
Element_Kinds Component_Kinds
A_Variant_Part A_Variant_Part
return Asis.Variant_List;The returned list contains elements of the following kind:
Element_Kinds
A_Variant
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 Component_Kind
- function Record_Components
- function Variant_Choices
- function Variant_Components
- "Processing Record-Type Definitions"
- Ada83 LRM 3.7.3, Ada95 LRM 3.8.1
Package Operations
package Operations is -- For Type_Definition_Kinds function "=" (Left, Right : ... -- For Constraint_Kinds function "=" (Left, Right : ... -- For Discrete_Range_Kinds function "=" (Left, Right : ... -- For Choice_Kinds function "=" (Left, Right : ... -- For Component_Kinds function "=" (Left, Right : ...end Operations;Expanded Name Asis.Type_Definitions.Operations
Package Operations provides a simple way to obtain visibility to operators for types used in package Type_Definitions. The package typically is referenced in a use clause by an
application.Cross-References
Related subprograms and types:
- function Choice_Kind
- type Choice_Kinds
- function Constraint_Kind
- type Constraint_Kinds
- function Component_Kind
- type Component_Kinds
- function Discrete_Range_Kind
- type Discrete_Range_Kinds
- function Kind
- type Type_Definition_Kinds
- "Processing Choices"
- "Processing Constraints"
- "Processing Discrete Ranges"
- "Processing Record-Type Definitions"
- "Obtaining Definition Kinds and Declarations"
Rational Software Corporation
http://www.rational.com support@rational.com techpubs@rational.com Copyright © 1993-2001, Rational Software Corporation. All rights reserved. |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |