TOC PREV NEXT INDEX DOC LIST MASTER INDEX




Function Allocation_Type

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_expression

This function returns the subtype indication from the specified allocator.

Parameters

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

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 Attribute_Designator_Argument

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_designator

 attribute_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

Specifies the expression that should be queried. The expression must be of the following kinds:
Element_Kinds
Expression_Kinds
An_Expression
An_Attribute

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 Attribute_Designator_Kind

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_designator

 attribute_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

Specifies the name that should be queried. The name must be of the following kinds:
Element_Kinds
Expression_Kinds
An_Expression
A_Simple_Name

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

Related subprograms:

Related concepts:


Type Attribute_Designator_Kinds

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

Indicates that the element represents a compiler-specific attribute.

Indicates that the element represents a name that could be an attribute, but it does not represent a known attribute.

Indicates that the element does not represent an attribute.

Cross-References

Related subprogram:

Related concept:


Function Attribute_Designator_Name

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_designator

 attribute_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

Specifies the expression that should be queried. The expression must be of the following kinds:
Element_Kinds
Expression_Kinds
An_Expression
An_Attribute

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

Related subprogram:

Related concepts:


Function Called_Function

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 ):

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

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)

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

Related subprograms:

Related concepts:


Function Component_Choices

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} => ] expression

This function returns a list of the choices associated with the specified aggregate component association.

If the component association is from a normalized list:

If the association is from an unnormalized list:

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

Specifies the aggregate component association that should be queried. The association must be of the following kind:
Element_Kinds

A_Component_Association

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

Related subprograms:

Related concepts:


Function Component_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} => ] expression

This 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

Specifies the aggregate component association that should be queried. The association must be of the following kind:
Element_Kinds

A_Component_Association

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 concept:


Function Components

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.

If a list is unnormalized:

If a list is normalized:

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

Specifies the aggregate expression that should be queried. The expression must be of the following kinds:
Element_Kinds
Expression_Kinds
An_Expression
An_Aggregate

Specifies whether the parameter list should contain normalized or unnormalized associations.

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

Related subprograms:

Related concepts:


Function Converted_Or_Qualified_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'aggregate

This function returns the expression from the specified type conversion or qualified expression.

Parameters

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

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 Expression_Associated_Type

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

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

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

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