![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Function Corresponding_Discriminant_Simple-_Name
function Corresponding_Discriminant_Simple_Name (Variant_Part : in Asis.Record_Component) return Asis.Simple_Name;Expanded Name Asis.Type_Definitions.Corresponding_Discriminant-_Simple_Name
Returns the discriminant simple name associated with 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 the discriminant simple name for the specified variant part.
Parameters
Variant_Part : in Asis.Record_Component;Specifies the variant 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.Simple_Name;The returned element is of the following kinds:
Element_Kinds Expression_Kinds
An_Expression A_Simple_Name
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 Record-Type Definitions"
- Ada83 LRM 3.7.3, Ada95 LRM 3.8.1
Function Discrete_Range_Kind
function Discrete_Range_Kind (Discrete_Range : in Asis.Discrete_Range) return Discrete_Range_Kinds;Expanded Name Asis.Type_Definitions.Discrete_Range_Kind
Returns the kind of discrete range represented by the specified Discrete_Range parameter.
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 kind of discrete range associated with the specified range or discrete range.
Parameters
Discrete_Range : in Asis.Discrete_Range;Specifies the discrete range that should be queried. The discrete range must be of the following kind:
Element_Kinds
A_Discrete_Range
return Discrete_Range_Kinds;Returns the kind of range represented by the Discrete_Range parameter or Not_A_Discrete_Range if the specified Discrete-_Range parameter does not represent a discrete range.
Errors
Examples
Cross-References
Related subprograms and types:
- function Choice_Discrete_Range
- type Discrete_Range_Kinds
- function Discrete_Ranges
- function Lower_Bound
- function Range_Attribute
- function Subtype_Constraint
- function Type_Mark
- function Upper_Bound
- function Declarations.Family_Index
- function Expressions.Slice_Range
- function Representation_Clauses.Component_Clause_Range
- function Statements.Loop_Parameter_Range
- "Processing Index and Range Constraints"
- "Processing Discrete Ranges"
- Ada83 LRM 3.5, Ada95 LRM 3.5
- Ada83 LRM 3.6, Ada95 LRM 3.6
Type Discrete_Range_Kinds
type Discrete_Range_Kinds is (...);Expanded Name Asis.Type_Definitions.Discrete_Range_Kinds
Describes the kinds of components that can make up a range 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_expressionDiscrete ranges are defined by the following syntax:
Ada83 LRM 3.6, Ada95 LRM 3.6
discrete_range ::=
discrete_subtype_indication | rangeThis type describes the kind of component represented by a range or discrete range.
Enumerations
A_Discrete_Subtype_IndicationIndicates that the element represents a discrete subtype indication (Ada83 LRM 3.6, Ada95 LRM 3.6).
A_Simple_RangeIndicates that the element represents a simple-expression range (Ada83 LRM 3.5, Ada95 LRM 3.5).
A_Range_AttributeIndicates that the element represents a range attribute (Ada83 LRM 3.5, Ada95 LRM 3.5).
Not_A_Discrete_RangeIndicates that the element does not represent a range or discrete range.
Cross-References
Function Discrete_Ranges
function Discrete_Ranges (Constraint : in Asis.Constraint) return Asis.Discrete_Range_List;Expanded Name Asis.Type_Definitions.Discrete_Ranges
Returns a list of the discrete ranges associated with the specified index constraint.
Description
Constrained-array index constraints are partially defined by the following syntax:
Ada83 LRM 3.6, Ada95 LRM 3.6
constrained_array_definition ::=
array index_constraint of
component_subtype_indication
index_constraint ::=
(discrete_range {, discrete_range})This function returns a list of the discrete ranges that make up the specified index constraint.
Parameters
Constraint : in Asis.Constraint;Specifies the index constraint that should be queried. The constraint must be of the following kinds:
Element_Kinds Constraint_Kinds
A_Constraint An_Index_Constraint
return Asis.Discrete_Range_List;The returned list contains elements 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
- "Processing Array-Type Definitions"
- Ada83 LRM 3.6, Ada95 LRM 3.6
Function Discriminant_Associations
function Discriminant_Associations (Constraint : in Asis.Constraint; Normalized : in Boolean := False) return Asis.Discriminant_Association_List;Expanded Name Asis.Type_Definitions.Discriminant_Associations
Returns a list of the discriminant associations associated with the specified discriminant constraint.
Description
Discriminant constraints are defined by the following syntax:
Ada83 LRM 3.7.2, Ada95 LRM 3.7.1
discriminant_constraint ::=
(discriminant_association
{, discriminant_association})discriminant_association ::=
[discriminant_simple_name
{| discriminant_simple_name} =>]
expressionThis function returns a list of the discriminant associations associated with the specified discriminant constraint.
An ASIS implementation may choose to always normalize parameter lists and include defaulted parameters in the parameter list. If parameter lists are always normalized, this function behaves as if the Normalized parameter has been specified as True.
- It contains only those arguments that appear in the source code and is ordered according to their order of appearance.
- The parameter associations are not Elements.Is_Equal to a parameter association from a normalized list.
- It includes defaulted parameters and is ordered according to their order of appearance in the declaration of the formal parameters.
- The parameter associations are Expressions.Is_Normalized.
- The parameter associations are Declarations.Is_Part_Of-_Implicit.
For more information on parameter names, defaulted parameters, and list normalization, see package Environment, "Default Parameter Processing" and "Normalization of Parameter Lists," the Environment.Discriminant_Associations_Include_Defaults function, and the Environment.Discriminant_Associations-_Normalized function.
Parameters
Constraint : in Asis.Constraint;Specifies the discriminant constraint that should be queried. The constraint must be of the following kinds:
Element_Kinds Constraint_Kinds
A_Constraint A_Discriminant_Constraint
Normalized : in Boolean := False;Specifies whether the parameter list should contain normalized or unnormalized associations.
return Asis.Discriminant_Association_List;The returned list contains elements of the following kind:
Element_Kinds
A_Discriminant_Association
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 Discriminant_Expression
- function Discriminant_Simple_Names
- function Subtype_Constraint
- function Environment.Discriminant_Associations_Include_Defaults
- function Environment.Discriminant_Associations_Normalized
- "Processing Discriminant Constraints"
- package Environment, "Default Parameter Processing"
- package Environment, "Normalization of Parameter Lists"
- Ada83 LRM 3.7.3, Ada95 LRM 3.8.1
Function Discriminant_Expression
function Discriminant_Expression (Association : in Asis.Discriminant_Association) return Asis.Expression;Expanded Name Asis.Type_Definitions.Discriminant_Expression
Returns the expression associated with the specified discriminant association.
Description
Discriminant constraints and associations are defined by the following syntax:
Ada83 LRM 3.7.2, Ada95 LRM 3.7.1
discriminant_constraint ::=
(discriminant_association
{, discriminant_association})discriminant_association ::=
[discriminant_simple_name
{| discriminant_simple_name} =>]
expressionThis function returns the expression for the specified discriminant association.
The expression and the enclosing element of the expression depend on the source code, the handling of normalized and defaulted parameter lists by ASIS, and the value of the Normalized parameter. They are defined as follows:
- If the association is from an unnormalized list, the element returned references the expression provided in the source code. The enclosing element of the expression is A_Discriminant_Association itself.
- If the association is from a normalized list and the discriminant association did not appear in the source code, the element returned references the default value defined in the record-type definition. The enclosing element of the expression is A_Discriminant_Specification for the discriminant in the record-type definition.
- If the association is from a normalized list and the discriminant association appears in the source code, the element returned references the expression provided in the source code. The enclosing element is A_Discriminant_Association itself.
Parameters
Association : in Asis.Discriminant_Association;Specifies the discriminant association that should be queried. The association must be of the following kind:
Element_Kinds
A_Discriminant_Association
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
- "Processing Discriminant Constraints"
- package Expressions, "Processing Expressions"
- Ada83 LRM 3.7.2, Ada95 LRM 3.7.1
Function Discriminant_Simple_Names
function Discriminant_Simple_Names (Association : in Asis.Discriminant_Association) return Asis.Simple_Name_List;Expanded Name Asis.Type_Definitions.Discriminant_Simple_Names
Returns a list of the simple names associated with the specified discriminant association.
Description
Discriminant constraints and associations are partially defined by the following syntax:
Ada83 LRM 3.7.2, Ada95 LRM 3.7.1
discriminant_constraint ::=
(discriminant_association
{, discriminant_association})discriminant_association ::=
[discriminant_simple_name
{| discriminant_simple_name} =>]
expressionThis function returns a list of the discriminant simple names for the specified discriminant association.
The content of the returned list depends on whether the discriminant association is obtained from a normalized or unnormalized list.
If the discriminant association is from an unnormalized list:
- The association does not test as Expressions.Is_Normalized.
- If the discriminant was specified in positional notation, Asis.Nil_Element_List is returned.
- If the discriminant was specified in named notation, the association contains the specified names. The names are returned in the order of their appearance in the source code.
- The enclosing element of each A_Simple_Name is the A_Discriminant_Association from which it was obtained.
If the discriminant association is from a normalized list:
- The association tests as Expressions.Is_Normalized.
- The association contains a single element that references An_Entity_Name_Definition, which is a component of the record-type declaration.
- The enclosing element of each An_Entity_Name_Definition is A_Discriminant_Specification in the record-type declaration.
Parameters
Association : in Asis.Discriminant_Association;Specifies the discriminant association that should be queried. The association must be of the following kind:
Element_Kinds
A_Discriminant_Association
return Asis.Simple_Name_List;The returned list contains elements of the following kinds:
Element_Kinds Expression_Kinds
An_Expression A_Simple_Name
An_Entity_Name_Association
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 Discriminant Constraints"
- Ada83 LRM 3.7.2, Ada95 LRM 3.7.1
Function Discriminants
function Discriminants (Type_Definition : in Asis.Type_Definition) return Asis.Discriminant_Specification_List;Expanded Name Asis.Type_Definitions.Discriminants
Returns a list of the discriminants on the specified record-type
definition.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;Record discriminants are partially defined by the following syntax:
Ada83 LRM 3.7.1, Ada95 LRM 3.7
discriminant_part ::=
(discriminant_specification
{; discriminant_specification})This function returns a list of the discriminant specifications on the specified full-type declaration. The full-type declaration must be a record-type definition.
If the record-type definition does not contain a discriminant part, Asis.Nil_Element_List is returned.
The subprograms in the package Declarations can be used to analyze the returned discriminant specifications.
Parameters
Type_Definition : in Asis.Type_Definition;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
return Asis.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 Is_Discriminated
- function Declarations.Initial_Value
- function Declarations.Is_Initialized
- function Declarations.Names
- function Declarations.Type_Mark
- "Processing Record-Type Definitions"
- Ada83 LRM 3.3.1, Ada95 LRM 3.2.1
- Ada83 LRM 3.7, Ada95 LRM 3.8
- Ada83 LRM 3.7.1, Ada95 LRM 3.7
Function Enumeration_Literal_Declarations
function Enumeration_Literal_Declarations (Type_Definition : in Asis.Type_Definition) return Asis.Declaration_List;Expanded Name Asis.Type_Definitions.Enumeration_Literal_Declarations
Returns a list of the literals declared in the specified enumeration-type definition.
Description
Enumeration-type definitions are defined by the following syntax:
Ada83 LRM 3.5.1, Ada95 LRM 3.5.1
enumeration_type_definition ::=
(enumeration_literal_specification
{, enumeration_literal_specification})This function returns a list of elements representing the enumeration-literal specifications from the specified enumeration-type definition. Each element is An_Enumeration_Literal_Specification. The literal specifications are returned in their order or appearance in the source code.
Each An_Enumeration_Literal_Specification element represents a function of the form:
function <An_Entity_Name_Definition> return <A_Simple_Name>If an enumeration-literal specification is from a derived type, each element will test as Declarations.Is_Part_Of_Implicit.
Passing An_Enumeration_Literal_Specification element to the Declarations.Names function returns a single-entry name list. For each enumeration literal, the element represented by the name-list value is the same element returned by the Enumeration_Literal_Names function.
Parameters
Type_Definition : in Asis.Type_Definition;Specifies the enumeration-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
An_Enumeration_Type_Definition
1 Whose parent type is an enumeration type.
return Asis.Declaration_List;The returned list contains elements of the following kinds:
Element_Kinds Declaration_Kinds
A_Declaration An_Enumeration_Literal_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 Enumeration_Literal_Names
- function Declarations.Is_Part_Of_Implicit
- function Declarations.Names
Function Enumeration_Literal_Names
function Enumeration_Literal_Names (Type_Definition : in Asis.Type_Definition) return Asis.Entity_Name_Definition_List;Expanded Name Asis.Type_Definitions.Enumeration_Literal_Names
Returns a list of the enumeration literals associated with the specified enumeration-type definition.
Description
Enumeration-type definitions are defined by the following syntax:
Ada83 LRM 3.5.1, Ada95 LRM 3.5.1
enumeration_type_definition ::=
(enumeration_literal_specification
{, enumeration_literal_specification})enumeration_literal_specification ::=
enumeration_literalenumeration_literal ::=
identifier | character_literalThis function returns a list of elements representing enumeration literals from the specified enumeration-type definition. There is an entry for each enumeration literal in the definition.
This function returns a list of elements representing the enumeration-literal specifications that make up the specified enumeration-type definition. Each element is An_Enumeration_Literal-_Specification. The literal specifications are returned in their order or appearance in the source code.
If an enumeration literal is from a derived type, each element will test as Declarations.Is_Part_Of_Implicit.
The function returns a list of An_Entity_Name_Definitions with an Expression_Kinds of An_Enumeration_Literal or A_Char-acter_Literal.
Parameters
Type_Definition : in Asis.Type_Definition;Specifies the enumeration-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
An_Enumeration_Type_Definition
1 Whose parent type is an enumeration type.
return Asis.Entity_Name_Definition_List;The returned list contains elements of the following kinds:
Element_Kinds Expression_Kinds
An_Entity_Name_Definition A_Character_Literal
An_Enumeration_Literal
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. |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |