![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Function Slice_Range
function Slice_Range (Expression : in Asis.Expression) return Asis.Discrete_Range;Expanded Name Asis.Expressions.Slice_Range
Returns the discrete range from the specified slice expression.
Description
Slices are defined by the following syntax:
Ada83 LRM 4.1.2, Ada95 LRM 4.1.2
slice ::= prefix(discrete_range)
This function returns the discrete range from the specified slice.
You can further analyze the returned discrete range with functions in package Type_Definitions.
Parameters
Expression : in Asis.Expression;Specifies the slice that should be queried. The expression must be of the following kinds:
Element_Kinds Expression_Kinds
An_Expression A_Slice
return Asis.Discrete_Range;The returned element is 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 Slices"
- package Type_Definitions, "Processing Discrete Ranges"
- Ada83 LRM 4.1.2, Ada95 LRM 4.1.2
Function Special_Operation_Kind
function Special_Operation_Kind (Expression : in Asis.Expression) return Special_Operation_Kinds;Expanded Name Asis.Expressions.Special_Operation_Kind
Returns the kind of special operation represented by the specified expression.
Description
Special operations are defined as short-circuit control forms and membership tests. These are contained within the expression and relation syntax components.
Expressions are defined by the following syntax:
expression ::=
relation {and relation}
| relation {and then relation}
| relation {or relation}
| relation {[or else relation}
| relation {xor relation}The reserved words and then and or else represent the short-circuit control forms.
Relations are defined by the following syntax:
relation ::=
simple_expression
[relational_operator simple_expression]
| simple_expression [not] in range
| simple_expression [not] in type_markThe reserved words in and not in represent membership tests.
This function returns the kind of special operation represented by the specified expression.
Parameters
Expression : in Asis.Expression;Specifies the special operation that should be queried. The expression must be of the following kinds:
Element_Kinds Expression_Kinds
An_Expression A_Special_Operation
return Special_Operation_Kinds;Returns the special operation kind of the specified expression. If an unexpected expression is specified, Not_A_Special_Opera-tion 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
Type Special_Operation_Kinds
type Special_Operation_Kinds is (...);Expanded Name Asis.Expressions.Special_Operation_Kinds
Describes the kinds of short-circuit control forms and membership tests.
Description
The short-circuit control forms are:
- and then
- or else
- [not] in range
- [not] in type_mark
Enumerations
A_Not_In_RangeIndicates that the element represents a "not in range" membership test (Ada83 LRM 4.5.2, Ada95 LRM 4.5.2).
A_Not_In_TypeIndicates that the element represents a "not in type_mark" membership test (Ada83 LRM 4.5.2, Ada95 LRM 4.5.2).
An_And_ThenIndicates that the element represents an "and then" short-circuit control form (Ada83 LRM 4.5.1, Ada95 LRM 4.5.1).
An_In_RangeIndicates that the element represents an "in range" membership test (Ada83 LRM 4.5.2, Ada95 LRM 4.5.2).
An_In_TypeIndicates that the element represents an "in type_mark" membership test (Ada83 LRM 4.5.2, Ada95 LRM 4.5.2).
An_Or_ElseIndicates that the element represents an "or else" short-circuit control form (Ada83 LRM 4.5.1, Ada95 LRM 4.5.1).
Not_A_Special_OperationIndicates that the element does not represent a short-circuit control form or a membership test.
Cross-References
- "Processing Special Operations"
- Ada83 LRM 4.4, Ada95 LRM 4.4
Function Special_Operation_Left_Hand_Side
function Special_Operation_Left_Hand_Side (Expression : in Asis.Expression) return Asis.Expression;Expanded Name Asis.Expressions.Special_Operation_Left_Hand_Side
Returns the expression on the left side of the specified special operation expression.
Description
This function returns the parameter value on the left side for all special operations.
Expressions are defined by the following syntax:
expression ::=
relation {and relation}
| relation {and then relation}
| relation {or relation}
| relation {[or else relation}
| relation {xor relation}If the specified expression represents a short-circuit control form, this function returns the expression representing the relation.
Relations are defined by the following syntax:
relation ::=
simple_expression
[relational_operator simple_expression]
| simple_expression [not] in range
| simple_expression [not] in type_markIf the specified expression represents a membership test, this function returns the expression representing the simple
expression.Parameters
Expression : in Asis.Expression;Specifies the special operation that should be queried. The expression must be of the following kinds:
Element_Kinds Expression_Kinds
An_Expression A_Special_Operation
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 In_Range_Operation_Right_Hand_Side
- function In_Type_Operation_Right_Hand_Side
- function Short_Circuit_Operation_Right_Hand_Side
- function Special_Operation_Kind
- "Processing Membership Tests"
- "Processing Short-Circuit Control Forms"
- "Processing Special Operations"
- Ada83 LRM 4.4, Ada95 LRM 4.4
Function Static_Value
function Static_Value (Expression : in Asis.Expression) return String;Expanded Name Asis.Expressions.Static_Value
Returns the text image of the specified static expression.
Description
If the specified expression represents a string literal, the returned text image will contain the enclosing quotation characters and any interior quotation characters are doubled (Ada83 LRM 2.6, Ada95 LRM 2.6).
Similarly, character literals are enclosed within apostrophes (Ada83 LRM 2.5, Ada95 LRM 2.5).
The case and base of numbers returned by this function will vary among vendors. Vendors are encouraged, but not required, to return values in the same case and base as was used in the original compilation text.
Rational Apex returns the value as it appears in the source code.
If the specified expression does not represent a static value, a null string is returned. Note that if the expression represents a null string, the returned text image will contain two quotation characters and thus no confusion can result between a value that is not static and a null string.
Parameters
Expression : in Asis.Expression;Specifies the expression that should be queried. The expression must be of the following kind:
Element_Kinds
An_Expression
return String;Returns the text image of the specified static 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 Subprogram_Derivation
function Subprogram_Derivation (Name : in Asis.Element) return Asis.Declaration;Expanded Name Asis.Expressions.Subprogram_Derivation
Returns the declaration from which the specified implicit derived subprogram was ultimately derived.
Description
The returned declaration may be an implicit subprogram but will not be a derived subprogram.
Parameters
Name : in Asis.Element;Specifies the naming expression for the subprogram that should be queried. The name must be of the following kinds:
Element_Kinds Expression_Kinds
An_Entity_Name_Definition A_Simple_Name
An_Operator_Symbol
An_Expression A_Simple_Name
An_Operator_Symbol
return Asis.Declaration;The returned element is of the following kinds:
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 Enviromnment.Status is set to Value_Error if the name does not reference a derived subprogram.
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 Type_Mark
function Type_Mark (Expression : in Asis.Expression) return Asis.Expression;Expanded Name Asis.Expressions.Type_Mark
Returns the type mark 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:
type_conversion ::= type_mark(expression)
Qualified expressions are defined by the following syntax:
qualified_expression ::=
type_mark'(expression) | type_mark'aggregateThis function returns the type mark from the specified type conversion or qualified expression.
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_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
Package Operations
package Operations is -- For Attribute_Designator_Kinds function "=" (Left, Right : ... -- For Expression_Kinds function "=" (Left, Right : ... -- For Operator_Kinds function "=" (Left, Right : ... -- For Selection_Kinds function "=" (Left, Right : ... -- For Special_Operation_Kinds function "=" (Left, Right : ...end Operations;Expanded Name Asis.Expressions.Operations
Package Operations provides a simple way to obtain visibility to operators for types used in package Expressions. The package typically is referenced in a use clause by an application.
Cross-References
- function Attribute_Designator_Kind
- type Attribute_Designator_Kinds
- type Expression_Kinds
- function Kind
- function Operator_Kind
- type Operator_Kinds
- function Selection_Kind
- type Selection_Kinds
- function Special_Operation_Kind
- type Special_Operation_Kinds
Rational Software Corporation
http://www.rational.com support@rational.com techpubs@rational.com Copyright © 1993-2001, Rational Software Corporation. All rights reserved. |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |