![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Function Allocation_Type
function Allocation_Type (Expression : in Asis.Expression) return Asis.Subtype_Indication;Expanded Name Asis.Expressions.Allocation_Type
Returns the subtype indication from the specified allocator expression.
Description
Allocators are defined by the following syntax:
Ada83 LRM 4.8 , Ada95 LRM 4.8
allocator ::=
new subtype_indication
| new qualified_expressionThis function returns the subtype indication from the specified allocator.
Parameters
Expression : in Asis.Expression;Specifies the allocator expression that should be queried. The expression must be of the following kinds:
Element_Kinds Expression_Kinds
An_Expression An_Allocation_From_Subtype
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
- "Processing Allocators"
- Ada83 LRM 4.8, Ada95 LRM 4.8
Function Attribute_Designator_Argument
function Attribute_Designator_Argument (Expression : in Asis.Expression) return Asis.Expression;Expanded Name Asis.Expressions.Attribute_Designator_Argument
Returns the static expression association with the specified attribute expression.
Description
Attributes are defined by the following syntax:
Ada83 LRM 4.1.4, Ada95 LRM 4.1.4
attribute ::= prefix'attribute_designatorattribute_designator ::=
simple_name [(universal_static_expression)]This function returns the universal static expression from the specified attribute.
If a universal static expression does not exist, Asis.Nil_Element is returned.
This function is used for attributes such as 'Length(1) and 'First (3). It is not used for attributes that are classified as functions (Ada83 LRM 3.5.5, Ada95 LRM 3.5.5). Use the Function_Call_Parameters function to obtain the arguments to an attribute function.
You can obtain the value of the static expression with the Static_Value function.
Parameters
Expression : in Asis.Expression;Specifies the expression that should be queried. The expression must be of the following kinds:
Element_Kinds Expression_Kinds
An_Expression An_Attribute
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 Attributes"
- Ada83 LRM 4.1.4 , Ada95 LRM 4.1.4
Function Attribute_Designator_Kind
function Attribute_Designator_Kind (Name : Asis.Simple_Name) return Attribute_Designator_Kinds;Expanded Name Asis.Expressions.Attribute_Designator_Kind
Returns the kind of attribute indicated by the specified name.
Description
Attributes are defined by the following syntax:
Ada83 LRM 4.1.4 , Ada95 LRM 4.1.4
attribute ::= prefix'attribute_designatorattribute_designator ::=
simple_name [(universal_static_expression)]This function returns the kind of attribute indicated by the specified attribute simple name.
The simple name is obtained with the Attribute_Designator_Name function.
The Ada language allows vendors to introduce additional attributes. This function returns An_Implementation_Defined-_Attribute for vendor-defined attributes.
Rational Apex does not define any vendor-defined attributes.
Parameters
Name : Asis.Simple_Name;Specifies the name that should be queried. The name must be of the following kinds:
Element_Kinds Expression_Kinds
An_Expression A_Simple_Name
return Attribute_Designator_Kinds;Returns the attribute kind of the specified name. If an unexpected name is specified, Not_An_Attribute is returned.
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.
Examples
Cross-References
- "Processing Attributes"
- Ada83 LRM 4.1.4 , Ada95 LRM 4.1.4
Type Attribute_Designator_Kinds
type Attribute_Designator_Kinds is (...);Expanded Name Asis.Expressions.Attribute_Designator_Kinds
Describes the kinds of attributes available.
Description
This type describes the predefined language attributes (LRM Annex A).
The enumeration also includes values for unknown attributes, implementation-defined attributes, and for elements that do not represent attributes.
Enumerations
A_Base_Attribute
A_Callable_Attribute
A_Constrained_Attribute
A_Count_Attribute
A_Delta_Attribute
A_Digits_Attribute
A_First_Attribute
A_First_Bit_Attribute
A_Fore_Attribute
A_Large_Attribute
A_Last_Attribute
A_Last_Bit_Attribute
A_Length_Attribute
A_Machine_Emax_Attribute
A_Machine_Emin_Attribute
A_Machine_Mantissa_Attribute
A_Machine_Overflows_Attribute
A_Machine_Radix_Attribute
A_Machine_Rounds_Attribute
A_Mantissa_Attribute
A_Pos_Attribute
A_Position_Attribute
A_Pred_Attribute
A_Range_Attribute
A_Safe_Emax_Attribute
A_Safe_Large_Attribute
A_Safe_Small_Attribute
A_Size_Attribute
A_Small_Attribute
A_Storage_Size_Attribute
A_Succ_Attribute
A_Terminated_Attribute
A_Val_Attribute
A_Value_Attribute
A_Width_Attribute
An_Address_Attribute
An_Aft_Attribute
An_Emax_Attribute
An_Epsilon_Attribute
An_Image_Attribute
An_Implementation_Defined_AttributeIndicates that the element represents a compiler-specific attribute.
An_Unknown_AttributeIndicates that the element represents a name that could be an attribute, but it does not represent a known attribute.
Not_An_AttributeIndicates that the element does not represent an attribute.
Cross-References
Function Attribute_Designator_Name
function Attribute_Designator_Name (Expression : in Asis.Expression) return Asis.Expression;Expanded Name Asis.Expressions.Attribute_Designator_Name
Returns the simple name from the specified attribute expression.
Description
Attributes are defined by the following syntax:
Ada83 LRM 4.1.4 , Ada95 LRM 4.1.4
attribute ::= prefix'attribute_designatorattribute_designator ::=
simple_name [(universal_static_expression)]This function returns the expression representing the simple name of the specified attribute.
If the prefix itself represents an attribute, as in T'Base'First, the simple name returned is the name following the rightmost apostrophe. The Prefix function returns everything to the left of this apostrophe. The returned prefix is an expression with an Expression_Kinds of An_Attribute. This expression can be provided to Attribute_Designator_Name to obtain the next simple name.
Parameters
Expression : in Asis.Expression;Specifies the expression that should be queried. The expression must be of the following kinds:
Element_Kinds Expression_Kinds
An_Expression An_Attribute
return Asis.Expression;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 Attributes"
- Ada83 LRM 4.1.4 , Ada95 LRM 4.1.4
Function Called_Function
function Called_Function (Expression : in Asis.Expression) return Asis.Declaration;Expanded Name Asis.Expressions.Called_Function
Returns the declaration of the function for the specified function call or attribute function expression.
Description
The returned declaration can be a derived, implicit, or explicit function declaration.
If an attribute function is specified, the declaration is returned. If any other attribute is specified, Asis.Nil_Element is returned. The following attributes are defined as attribute functions (Ada83 LRM 3.5.5 , Ada95 LRM 3.5.5 ):
- 'Pos
- 'Val
- 'Succ
- 'Pred
- 'Image
- 'Value
The only difference between an attribute function and other function calls is that the prefix of the call has an Expression_Kinds of An_Attribute. You can determine the kind of attribute represented with the Attribute_Kind function.
Parameters
Expression : in Asis.Expression;Specifies the expression that should be queried. The expression must be of the following kinds:
Element_Kinds Expression_Kinds
An_Expression A_Function_Call
An_Attribute (function)
return Asis.Declaration;The returned element is of the following kinds:
Element_Kinds Declaration_Kinds
An_Expression A_Function_Body_Declaration
A_Function_Declaration
A_Function_Instantiation
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_Inappropriate_Element is raised and Environment.Status is set to Value_Error if an attribute expression is specified that is not an attribute function call.
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 Attribute_Kind
- function Prefix
- function Subprogram_Derivation
- "Processing Function Calls"
- Ada83 LRM 3.5.5 , Ada95 LRM 3.5.5
Function Component_Choices
function Component_Choices (Association : in Asis.Component_Association) return Asis.Choice_List;Expanded Name Asis.Expressions.Component_Choices
Returns a list of the choices in the specified aggregate component association.
Description
Aggregate component associations are defined by the following syntax:
Ada83 LRM 4.3 , Ada95 LRM 4.3
component_association ::=
[choice {| choice} => ] expressionThis function returns a list of the choices associated with the specified aggregate component association.
If the component association is from a normalized list:
- The returned list contains a single choice.
- Both the component association and the returned choice are Elements.Is_Normalized.
- The Elements.Enclosing_Element of each choice is the normalized component-association element from which it was obtained.
If the association is from an unnormalized list:
- If the component association was given in positional notation, Asis.Nil_Element_List is returned.
- If the component association was given in named notation, the returned list contains the choices in their order of appearance in the source code.
- Neither the component association nor the returned choices are Elements.Is_Normalized.
- The Elements.Enclosing_Element of each choice is the given component-association element.
You can call the Type_Definitions.Choice_Kind, Choice-_Simple_Expression, and Choice_Discrete_Range functions to further analyze the choices in the returned list.
Parameters
Association : in Asis.Component_Association;Specifies the aggregate component association that should be queried. The association must be of the following kind:
Element_Kinds
A_Component_Association
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.
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 Component_Expression
- function Components
- function Type_Definitions.Choice_Discrete_Range
- function Type_Definitions.Choice_Kind
- function Type_Definitions.Choice_Simple_Expression
Function Component_Expression
function Component_Expression (Association : in Asis.Component_Association) return Asis.Expression;Expanded Name Asis.Expressions.Component_Expression
Returns the expression from the specified component
association.Description
Aggregate component associations are defined by the following syntax:
Ada83 LRM 4.3 , Ada95 LRM 4.3
component_association ::=
[choice {| choice} => ] expressionThis function returns the expression from the specified component association.
An association is a pairing of a name and a value. In component associations, the choices are the name and the expression is the value.
Lists of component associations can be obtained in unnormalized or normalized form except for array aggregates. Array-aggregate component associations are available only in
unnormalized form.Unnormalized associations are called actual associations because they represent the actual content of the source code. The offset of an expression in the component-association list is identical to the position of the parameter in the aggregate. Only if named notation was used in the source code will the choices portion of the component association exist. For more information, see the Component_Choices function.
Normalized associations are called artificial associations because they are constructed by ASIS. Normalized associations do not represent the aggregate as specified in the source code. Rather, they represent the aggregate in the order of the declaration of the record.
The enclosing element of the expression depends on whether the element was obtained from an unnormalized or normalized list.
If the component-association element is from an unnormalized list, and thus represents the actual source code, the enclosing element of the expression is the specified component
association.If the component-association element is from a normalized list, which is an artificial ASIS creation, the enclosing element of the expression is the actual component-association element that the expression would have been associated with if the expression had been obtained from a component association from an unnormalized list.
Parameters
Association : in Asis.Component_Association;Specifies the aggregate component association that should be queried. The association must be of the following kind:
Element_Kinds
A_Component_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
Function Components
function Components (Expression : in Asis.Expression; Normalized : in Boolean := False) return Asis.Component_Association_List;Expanded Name Asis.Expressions.Components
Returns a list of the the component associations contained within the specified aggregate expression.
Description
Aggregates are defined by the following syntax:
Ada83 LRM 4.3 , Ada95 LRM 4.3
aggregate ::=
(component_association
{, component_association})This functions returns a list of the component associations for the specified aggregate.
An ASIS implementation may choose to always normalize component-association lists. If component-association lists are always normalized, this function behaves as if the Normalized parameter has been specified as True, except for array aggregates. Array aggregates are not available in normalized form.
- It contains only those associations that appear in the source code and is ordered according to their order of appearance.
- The component associations are not Elements.Is_Equal to component associations from a normalized list.
- The component-association choices are represented as a list of elements with an Expression_Kinds of An_Expression.
- It is ordered according to the order of declaration of the record discriminants and components.
- The parameter associations are Expressions.Is_Normalized.
- The parameter associations are Declarations.Is_Part_Of-_Implicit.
- The component-association choices are represented as elements with an Expression_Kinds of An_Entity_Name-_Definition.
For more information on list normalization, see package Environment, "Normalization of Parameter Lists" and the Environment.-Components_Normalized function.
To be supplied: After the above passes must update all other functions which return a Choice_List.
Parameters
Expression : in Asis.Expression;Specifies the aggregate expression that should be queried. The expression must be of the following kinds:
Element_Kinds Expression_Kinds
An_Expression An_Aggregate
Normalized : in Boolean := False;Specifies whether the parameter list should contain normalized or unnormalized associations.
return Asis.Component_Association_List;The returned list contains elements of the following kind:
Element_Kinds
A_Component_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.
Asis_Inappropriate_Element is raised and Environment.Status is set to Value_Error if an array-aggregate expression is specified and Normalized is specified as True.
Examples
Cross-References
- "Processing Aggregates"
- package Environment, "Normalization of Parameter Lists"
- Ada83 LRM 4.3 , Ada95 LRM 4.3
Function Converted_Or_Qualified_Expression
function Converted_Or_Qualified_Expression (Expression : in Asis.Expression) return Asis.Expression;Expanded Name Asis.Expressions.Converted_Or_Qualified_Expression
Returns the expression from the specified qualified expression or type conversion expression.
Description
This function accepts a type conversion or qualified expression as a parameter.
Type conversions are defined by the following syntax:
Ada83 LRM 4.6 , Ada95 LRM 4.6
type_conversion ::= type_mark(expression)Qualified expressions are defined by the following syntax:
Ada83 LRM 4.7 , Ada95 LRM 4.7
qualified_expression ::=
type_mark'(expression) | type_mark'aggregateThis function returns the expression from the specified type conversion or qualified expression.
Parameters
Expression : in Asis.Expression;Specifies the type conversion or qualified expression that should be queried. The expression must be of the following kinds:
Element_Kinds Expression_Kinds
An_Expression A_Qualified_Expression
A_Type_Conversion
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 Qualified Expressions"
- "Processing Type Conversions"
- Ada83 LRM 4.6 , Ada95 LRM 4.6
- Ada83 LRM 4.7 , Ada95 LRM 4.7
Function Expression_Associated_Type
function Expression_Associated_Type (Reference : in Asis.Expression) return Asis.Type_Definition;Expanded Name Asis.Expressions.Expression_Associated_Type
Returns the type definition that caused the creation of the specified implicit derived subprogram, operator, or attribute function reference.
Description
Any derived subprogram can be specified, including those derived from an explicit operator overload or an explicit derivable subprogram.
You can obtain the list of all implicit derived subprograms for the returned type with the Declarations.Implicit_Derived_Sub-programs function. You can obtain the list of just the implicit operators with the Declarations.Implicit_Predefined_Operators function and just the implicit attribute functions with the Declara-tions.Implicit_Attribute_Functions function.
Parameters
Reference : in Asis.Expression;Specifies the name of the derived subprogram, operator, or attribute that should be queried. The reference must be of the following kinds:
Element_Kinds Expression_Kinds
An_Expression A_Character_Literal
A_Simple_Name
An_Enumeration_Literal
An_Operator_Symbol
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_Inappropriate_Element is raised and Environment.Status is set to Value_Error if the specified reference is not Is_Derived.
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
Rational Software Corporation
http://www.rational.com support@rational.com techpubs@rational.com Copyright © 1993-2001, Rational Software Corporation. All rights reserved. |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |