TOC PREV NEXT INDEX DOC LIST MASTER INDEX




Function Is_Equal

Expanded Name Asis.Elements.Is_Equal

Returns a Boolean value indicating whether the specified elements represent the same physical semantic component from the same physical compilation unit.

Description

Returns True if:

Otherwise, this function returns False.

Parameters

Specifies the first element.

Specifies the second element.

Returns True if the specified elements represent the same physical semantic component from the same physical compilation unit.

Errors

None.

Examples

Cross-References

Related subprograms:

Related concept:


Function Is_Identical

Expanded Name Asis.Elements.Is_Identical

Returns a Boolean value indicating whether the specified elements represent the same physical semantic component from the same physical compilation unit and were derived from the same library variable.

Description

Returns True if:

Otherwise, this function returns False.

Parameters

Specifies the first element.

Specifies the second element.

Returns True if the specified elements represent the same physical semantic component from the same physical compilation unit and were derived from the same library variable.

Errors

None.

Examples

Cross-References

Related subprograms:

Related concept:


Function Is_Nil

Expanded Name Asis.Elements.Is_Nil

Returns a Boolean value indicating whether the specified element list has a 'Length attribute value of 0 or the specified element is Asis.Nil_Element.

Description

An element is nil if its value is Asis.Nil_Element.

An element list is nil if the value of its 'Length attribute is 0.

Parameters

Specifies the element list to query.

Specifies the element to query.

Returns True if the specified element list has a 'Length attribute value of 0 or the specified element is Asis.Nil_Element.

Errors

None.

Examples

Cross-References

Related subprograms:

Related concept:


Function Is_Predefined

Expanded Name Asis.Elements.Is_Predefined

Returns a Boolean value indicating whether the specified pragma element represents a predefined language pragma (LRM Annex B).

Description

The predefined language pragmas are defined in Annex B of the LRM. Type Pragma_Kinds includes a value for each predefined language pragma, as well as An_Implementation_Defined-
_Pragma, An_Unknown_Pragma, and Not_A_Pragma.

Is_Predefined returns True if the value returned by the Name function corresponds to a Pragma_Kinds enumeration value other than An_Implementation_Defined_Pragma, An_Unknown_Pragma, and Not_A_Pragma.

A pragma that does not test as Is_Predefined may be An_Implementation_Defined_Pragma or An_Unknown_Pragma. You can determine which by calling the Pragma_Kind function.

Process implementation-defined or unknown pragmas based on the name of the pragma. The name can be obtained with the Name function.

Parameters

Specifies the pragma to query. The pragma element must be of the following kind
Element_Kinds

A_Pragma

:

Returns True for all elements in the above table that also represent a predefined language pragma and False for all other elements.

Errors

None.

Examples

Cross-References

Related subprograms:

Related concept:


Function Name

Expanded Name Asis.Elements.Name

Returns the name of the specified pragma.

Description

Pragmas are partially defined by the following syntax:

Ada83 LRM 2.8, Ada95 LRM 2.8

 pragma ::=
  pragma identifier [(argument_association
   {, argument_association})];

This function returns the identifier of the specified pragma.

The case of names returned by this function will vary among vendors. Vendors are encouraged, but not required, to return names in the same case used in the original compilation text.

The case of the returned name from Rational ASIS under Apex has not yet been determined.

To be supplied: Update this when it is known.

Parameters

Specifies the pragma that should be queried. The pragma element must be of the following kind:
Element_Kinds

A_Pragma

Returns the name of the specified pragma.

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 Pragma_Kind

Expanded Name Asis.Elements.Pragma_Kind

Returns the kind of the specified pragma.

Description

Elements of kind A_Pragma are returned in the following lists:

Most of the functions that return the above kinds of lists contain an Include_Pragmas parameter. If Include_Pragmas is specified as True, A_Pragma elements are included in the returned list; otherwise, they do not appear in the returned list. This allows you to ignore pragmas while processing the constructs related to these interfaces.

A Pragma_Element_List is returned by the Associated_Pragmas and Pragmas functions. These functions allow you to obtain the pragmas associated with a statement or declaration, or within a context. Contexts include structures such as statement lists and declarative regions.

Parameters

Specifies the pragma that should be queried. The pragma element must be of the following kind:
Element_Kinds

A_Pragma

Returns the kind of the specified pragma. If an unexpected element is specified, Not_A_Pragma is returned.

Errors

None.

Examples

Cross-References

Related subprograms and types:

Related concept:


Type Pragma_Kinds

Expanded Name Asis.Elements.Pragma_Kinds

Describes the kinds of pragmas available.

Description

Elements that represent pragmas fall into three categories:

The enumeration value Not_A_Pragma is reserved for those elements that do not represent pragmas.

Enumerations

The pragma name associated with each enumeration value is presented below. The third column indicates the paragraph number in LRM Annex B where the pragma is described.
Enumeration Value
Pragma Name
Paragraph
A_Controlled_Pragma
Controlled
2
A_List_Pragma
List
6
A_Memory_Size_Pragma
Memory_Size
7
A_Pack_Pragma
Pack
9
A_Page_Pragma
Page
10
A_Priority_Pragma
Priority
11
A_Shared_Pragma
Shared
12
A_Storage_Unit_Pragma
Storage_Unit
13
A_Suppress_Pragma
Suppress
14
A_System_Name_Pragma
System_Name
15
An_Elaborate_Pragma
Elaborate
3
An_Inline_Pragma
Inline
4
An_Interface_Pragma
Interface
5
An_Optimize_Pragma
Optimize
8

Cross-References

Related subprogram:

Related concepts:


Function Pragmas

Expanded Name Asis.Elements.Pragmas

Returns a list of the pragmas that exist within the specified context.

Description

The pragmas are returned in their order of appearance in the source code.

Only the pragmas that exist immediately within the specified context are returned. For example, if a declarative region contains pragmas as well as a record type definition that contains pragmas, this function will return, when provided with the context of the declarative region, only those pragmas directly within the region. If the function is provided with the context of the record type definition, it returns the pragmas contained within the record type definition.

If there are no pragmas in the specified context, Asis.Nil_Element-_List is returned.

Most functions that return lists of declarations, declaration components (such as record variants), and statements contain an Include_Pragmas parameter. The Include_Pragmas parameter specifies whether pragmas included within the context provided to these functions should be included in the returned lists. This function returns the same pragma definitions that can appear as components of those returned lists.

Parameters

Specifies the context that should be queried. The context must be of the following kinds:
Element_Kinds

A_Case_Statement_Alternative
A_Declaration
Declaration_Kinds
A_Function_Body_Declaration
A_Generic_Function_Declaration
A_Generic_Package_Declaration
A_Generic_Procedure_Declaration
A_Package_Body_Declaration
A_Package_Declaration
A_Procedure_Body_Declaration
A_Task_Body_Declaration
A_Task_Declaration
A_Task_Type_Declaration

A_Representation_Clause
A_Select_Alternative

A_Select_Statement_Arm
A_Statement
Statement_Kinds
A_Block_Statement
A_Case_Statement
A_Conditional_Entry_Call_Statement
A_Loop_Statement
A_Selective_Wait_Statement
A_Timed_Entry_Call_Statement
An_Accept_Statement
An_If_Statement

A_Variant

A_Variant_Part

An_Exception_Handler
An_If_Statement_Arm

The returned list contains elements of the following kind:

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:


Type Traverse_Control

Expanded Name Asis.Elements.Traverse_Control

Defines the methods of element-tree traversal.

Description

Enumerations

Prevents traversal of the current element's child elements. Traversal resumes with the next sibling element of the current element. In a Post_Operation procedure, this is the same as Continue, because all child elements will already have been traversed.

Prevents the traversal of the current element's sibling elements. Traversal resumes with the parent element. In a Pre_Operation procedure, this skips the associated Post_Operation.

Siblings are found in association lists of subprogram calls, entry calls, generic instantiations, discriminants, and pragmas.

Continues the normal traversal.

Terminates the traversal. Neither the Pre_Operation nor the Post_Operation procedure is called for any additional elements.

Cross-References

Related subprogram:

Related concept:


Generic Procedure Traverse_Element

Expanded Name Asis.Elements.Traverse_Element

Traverses the specified element and all its component elements, in top-to-bottom and left-to-right order.

Description

A component element is a child element. The child's parent element is its enclosing element. Child elements with the same parent element are sibling elements of each other.

In typical use, the Control parameter is set to Continue. At this setting, the formal procedure Pre_Operation is called when first visiting an element. All component elements are then visited, and finally the formal procedure Post_Operation is called when returning from visiting all component elements.

Regardless of the initial setting of Control, the formal procedure Pre_Operation is called with the initially specified element.

You can change the value of the Control parameter to alter what portions of the element tree are traversed. The effect of each Traverse_Control value is described in the following table:
Traverse_Control Value
Effect
Abandon_Children
Prevents traversal of the current element's child elements. Traversal resumes with the next sibling element of the current element. In a Post_Operation, this is the same as Continue, because all child elements will already have been traversed.
Abandon_Siblings
Prevents the traversal of the current element's sibling elements. Traversal resumes with the parent element. In a Pre_Operation, this skips the associated Post_Operation.
Continue
Continues the normal traversal.
Terminate_Immediately
Terminates the traversal. Neither Pre_Operation nor Post_Operation is called for any additional elements.

Traversal of Implicit Elements

Elements that are Declarations.Is_Part_Of_Implicit are not normally reached by a traversal that starts with an element that is not Is_Part_Of_Implicit. This means that implicit predefined and implicit derived subprogram declarations are not visited when A_Type_Definition is traversed, generic instances are not visited when a generic instantiation is traversed, and all parameter and argument lists are traversed in their unnormalized forms.

Exceptions to this are:

Element structures that are Is_Part_Of_Implicit can be traversed by starting the traversal with an Is_Part_Of_Implicit element. Typically, the traversal will start with the outermost enclosing element. This would be any of:

Implicit declarations, generic instances, and normalized parameter and argument lists can be made part of a traversal by explicitly calling the appropriate interfaces when a type definition, generic instantiation, call, or aggregate is encountered.

Traversal of Association Lists

Argument association lists for procedure calls, function calls, entry calls, generic instantiations, and aggregates are traversed in their unnormalized forms.

Applications that need to traverse the normalized association list can do so by querying at the appropriate locations to obtain the normalized list. This list then can be traversed by calling the instantiation of the traversal generic for each element. Once the association list traversal has completed, you can skip the unnormalized list and continue the traversal with the appropriate element by setting the Control parameter to Abandon_Children.

Parameters

Specifies a user-defined type that contains state information pertinent to the calling application.You must specify a value of this type when calling the Traverse_Element procedure. This value is then provided by ASIS to your Pre_Operation and Post_Operation procedures.

Specifies the procedure ASIS should call when first visiting an element on the way down the tree. You can set the value of the Control parameter to indicate how the traversal should proceed.

Specifies the procedure ASIS should call when returning from visiting all component elements on the way up the tree. You can set the value of the Control parameter to indicate how the traversal should proceed.

Specifies the element where the traversal should begin. This element is considered to be part of the tree being traversed. At a minimum, Pre_Operation is called with this element.

Specifies how the tree traversal should proceed.

Specifies user-defined state information.

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.

Asis_Inappropriate_Element is raised and Environment.Status is set to Value_Error if Asis.Nil_Element is specified.

Examples

Cross-References

Related subprograms and types:

Related concept:


Package Operations

Expanded Name Asis.Elements.Operations

Package Operations provides a simple way to obtain visibility to operators for types used in package Elements. The package typically is referenced in a use clause by an application.

Cross-References

Related subprograms and types:

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