TOC PREV NEXT INDEX DOC LIST MASTER INDEX



Ada LRM to ASIS Mapping

This appendix describes Ada syntax rules in terms of:

The LRM uses a simple variant of Backus-Naur Form (BNF) to describe the Ada language. Each construct in the language is defined in terms of a BNF syntax rule. Each rule, is in turn, composed of syntactic categories, reserved words, and so on.

This appendix presents a mapping between the Ada syntax rules and ASIS. The mapping is accomplished by taking an Ada syntax rule and replacing the syntactic categories with ASIS function names. Each function name is then described, showing the data types (typically elements) returned.

The descriptions are presented in another BNF variant, referred to as "ASIS Syntax Notation." The notation is described below.

The following topics are covered in this chapter:


Key Concepts

ASIS Syntax Notation

The concepts behind the ASIS syntax notation are similar to those used by Ada, as described in Ada83 LRM 1.5, Ada95 LRM 1.1.4. You should be generally familiar with that notation before proceeding.

Syntax Rules

The rules used by the ASIS syntax notation are:

Notation
Meaning
Language font
Denotes reserved words, subprogram names, types, or enumeration values. For example:
pragma
then
Name
An_Expression

[ ]
(brackets)

Indicates an optional portion of a statement. For example: AA [, BB] indicates that either "AA" or "AA, BB" is valid.
{ }
(braces)

Encloses repeated items. For example: AA {, BB} indicates that "AA" must be specified, followed by any number of instances of ", BB".
|
(vertical bar)

Separates two syntactic categories that are alternatives to each other. For example: AA | BB indicates that either "AA" or "BB" must be specified. If the vertical bar appears immediately after an opening brace, it stands for itself. For example: CC {| DD} indicates that "CC" must be specified, followed by any number of instances of "| BB".

Special Syntax Rules

Statement Forms

ASIS syntax notation contains two statement forms:

The syntactic categories are described as follows:

Ada Syntax to ASIS Syntax Correlation

Often there is not a one-for-one correlation between an Ada syntax rule and an ASIS syntax rule. Two kinds of differences exist:

ASIS Syntax Category Changes

ASIS sometimes identifies syntactic categories differently than Ada. This has been done to simplify or clarify the interfaces. No information is lost by these transformations; ASIS provides sufficient interfaces such that you can always obtain the information required to uniquely identify a syntactic category in terms of the Ada syntax.

For example, pragma argument-associations are defined by the following Ada syntax:

ASIS uses the following syntax:

ASIS does not distinguish between an argument association that contains a name and one that contains an expression. You can make this determination however, by examining the kind of the element described by the actual parameter.

In this instance the ASIS syntax rule simplified the Ada syntax rule. In other cases, multiple ASIS syntax rules appear to describe a single Ada syntax rule.

Returned Data Type Definitions

Additional ASIS syntax rules often exist. These rules describe the kinds of data returned by the functions that have been substituted into the Ada syntax rule.

For examples, the LRM describes pragmas as follows:

ASIS describes pragmas as follows:

The component functions are described as follows:

The descriptions of the component functions indicate the kinds of data returned by the functions substituted into the pragma definition line.

ASIS Syntax Example

To illustrate the ASIS syntax notation, we show how pragmas and their argument associations are described. The LRM syntax rules are presented first, followed by the ASIS syntax rules intermixed with descriptions of their meaning. In the mapping portion of this appendix the rules are not described.

Pragmas

The LRM describes Pragmas as follows:

ASIS describes pragmas as follows:

This statement corresponds to the first form for the language. The text following the "::=" symbol is the Ada syntax rule with the syntactic categories replaced with ASIS function names.

The syntactic categories are described as follows:

The ASIS syntax rule for a pragma references the Name and Argument_Associations functions. The following two ASIS syntax rules illustrate what these functions return:

These statements corresponds to the second form for the language. The syntactic categories are described as follows:

Argument Associations

The LRM describes argument associations as follows:

ASIS describes argument associations as follows:

The component functions are described as follows:

Ada Syntax to ASIS Mapping

The mapping of the syntax rules is presented in LRM order. Section 1. of the LRM contains no rules and is not described. All other sections that have rules with related ASIS subprograms are described.

Certain syntax rules —— for example, those presented in section 2.1 —— describe syntactic categories below the level of semantic significance to ASIS. Unless other information pertinent to ASIS exists in such a section, the section is omitted.

In each included section that contains a syntax rule, the Ada syntax is presented first, followed by the ASIS syntax. Other useful information is often presented in or after the ASIS syntax. This can include:


2. Lexical Elements

The following sections from LRM chapter 2, have related functions or concepts in ASIS:

2.1 Character Set

(Ada83 LRM 2.1, Ada95 LRM 2.1)

This LRM section describes the character set and basic character categories used by Ada. These categories are used to define the lexical elements that comprise the language.

ASIS is not defined in terms of the character set, but rather in terms of lexical elements. Should analysis be required to the level of the character set, ASIS contains functions that return the text image for all explicitly described lexical elements (such as numeric literals), and you can easily construct the text image for implicitly described lexical elements (such as reserved words).

2.2 Lexical Elements, Separators, and Delimiters

(Ada83 LRM 2.2, Ada95 LRM 2.2)

This LRM section describes the text of a program in terms of its lexical elements, separators, and delimiters. Each lexical element is either a delimiter, an identifier (which might be a reserved word), a numeric literal, a character literal, a string literal, or a comment. ASIS describes these lexical elements as follows:

Lexical Element
How described
character literal
By elements.
comment
If your ASIS implementation supports text images of compilations and of commentary, you can obtain source code commentary.
delimiter
Delimiters that represent operators are explicitly described by elements. Delimiters enclosing character and string literals are returned as part of the image of the character or string. All other delimiters are implicit.1
identifier
Reserved words are not described, other identifiers are described by elements.
numeric literal
By elements.
string literal
By elements.
1 Remember that a special character might not be a delimiter in a certain context. For example, period is not a delimiter in a numeric literal, and none of the special characters are delimiters in a comment.

2.3 Identifiers

(Ada83 LRM 2.3, Ada95 LRM 2.3)

In Ada, identifiers are used as names and also as reserved words. The LRM describes identifiers as follows:

ASIS does not explicitly represent reserved words, and thus identifiers represent names only.

ASIS distinguishes between identifiers appearing in two contexts:

ASIS describes identifiers in entity definitions as follows:

Character literals and operator symbols also have defining instances. These are represented by An_Entity_Name_Definition elements with an expression kinds of A_Character_Literal or An_Operator_Symbol.

ASIS describes references to previously-declared entities as follows:

Character literals and operator symbols can also be referenced. These are represented by An_Expression elements with an expression kinds of A_Character_Literal or An_Operator_Symbol.

To obtain the letter or digit components of an identifier, you must analyze the returned string. ASIS encourages, but does not specify, the case of the returned identifier. An ASIS implementation is free to upshift characters, downshift characters, or return the identifier in the case specified in the source code.

Entity Definitions and References

Identifier names are declared by an A_Declaration element. For example, the following package renames declaration:

Is represented by an (A_Declaration, A_Package_Rename_Declaration) element.

For each identifier that is declared, an entity name definition is also declared. The entity name definition for package Exp is represented by a (An_Entity_Name_Definition, A_Simple_Name) element.

The An_Entity_Name_Definition element(s) defined by an A_Declaration element can be obtained by passing the A_Declaration element to the Names function.

References to entities, for example to the package name ASIS.Expressions, are represented as An_Expression elements. In this case, the package name has an Expression_Kinds of A_Selected_Component. The prefix and selector of the selected component both have an Expression_Kinds of A_Simple_Name.

References can also take the form of character literals, enumeration literals, and operator symbols.

2.4 Numeric Literals

(Ada83 LRM 2.4, Ada95 LRM 2.4)

The LRM describes numeric literals as follows:

ASIS is not concerned with whether a literal is a decimal or based literal as this distinction is not significant from a semantic perspective. Instead, ASIS describes literals in terms of real literals and integer literals as follows:

You can determine whether a numeric literal represents a decimal or based literal by analyzing the text image of the string.

2.4.1 Decimal Literals

(Ada83 LRM 2.4.1, Ada95 LRM 2.4.1)

The LRM describes decimal literals as follows:

ASIS describes decimal literals as follows:

ASIS returns the entire decimal literal as a string. The representation returned is the same as that used by the programmer and includes all sharps, underlines, dots, exponents, and so on, as entered by the programmer. To obtain the integer or exponent components, you must analyze the returned string.

See "2.4 Numeric Literals" for the element kinds that represent numeric literals.

2.4.2 Based Literals

(Ada83 LRM 2.4.2, Ada95 LRM 2.4.2)

The LRM describes decimal literals as follows:

ASIS describes based literals as follows:

ASIS returns the entire based literal as a string. The representation returned is the same as that used by the programmer and includes all sharps, underlines, dots, exponents, and so on, as entered by the programmer. To obtain the base, based integer, or exponent components, you must analyze the returned string.

See "2.4 Numeric Literals" for the element kinds that represent numeric literals.

2.5 Character Literals

(Ada83 LRM 2.5, Ada95 LRM 2.5)

The LRM describes characters literals as follows:

ASIS describes character literals as follows:

The component function is described as follows:

The returned literal includes the apostrophes.

2.6 String Literals

(Ada83 LRM 2.6, Ada95 LRM 2.6)

The LRM describes string literals as follows:

ASIS describes string literals as follows:

The component function is described as follows:

The representation returned is the same as that used by the programmer and includes the quotation marks.

2.7 Comments

(Ada83 LRM 2.7, Ada95 LRM 2.7)

Comments from compilation units are available when Is_Commentary_Supported returns True.

Comments can be obtained by calling:

2.8 Pragmas

(Ada83 LRM 2.8, Ada95 LRM 2.8)

The LRM describes pragmas as follows:

ASIS describes pragmas as follows:

The component functions are describes as follows:

ASIS describes argument associations as follows:

The component functions are described as follows:

Related functions:

Function
Returns
Pragma_Kinds
The kind of pragma or whether the pragma is implementation defined or unknown to the implementation
Is_Predefined
Whether the pragma is a language predefined pragma (LRM Annex B)

Pragmas are available from the following functions:

Function
Returns These Pragmas
Compilation_Pragmas
Attached to a compilation unit
Context_Clause_Elements
The context clause of a unit
Pragmas
Contained in a particular element context
Associated_Pragmas
Associated with a declaration or a statement
Arm_Statements
An_If_Statement_Arm
Case_Statement_Alternative-_Statements
A_Case_Statement_Alternative
Loop_Statements
A_Loop_Statement
Declarative_Items
The declaration of A_Block_Statement
Block_Body_Statements
The body of a A_Block_Statement
Accept_Body_Statements
An_Accept_Statement
Select_Alternative_Statements
A_Select_Alternative
Timed_Entry_Call_Or_Statements
A_Timed_Entry_Call_Or_Arm
Else_Statements
Within the else portion of A_Select_Statement_Arm
Entry_Call_Statements
Within an entry call of A_Select_Statement_Arm
Visible_Part_Declarative_Items
Visible part of a package specification
Private_Part_Declarative_Items
Private part of a package specification
Task_Declaration_Declarative_Items
A_Task_Declaration
Generic_Formal_Parameters
The formal parameter region of a generic declaration
Record_Components
A_Record_Type_Definition
Variant_Components
A variant portion of A_Record_Type_Definition
Task_Type_Declarative_Items
Declarative region of A_Task_Type_Declaration
Record_Representation_Clause_Alignment_Clause_Pragmas
Appearing before the at mod reserved words of A_Record_Representation_Clause
Component_Clauses
The component clauses of A_Record_Representation_Clause

2.9 Reserved Words

(Ada83 LRM 2.9, Ada95 LRM 2.9)

ASIS does not directly represent Ada's reserved words. The Image function should, however, return whatever characters appeared in the source code including:

The case and spacing of characters in the returned text image should be identical to how they appeared in the source code.

See package Text for more information on obtaining the text images of an element.

Note: Whether the actual source code definition is returned in implementation-dependent. Rational Apex returns the values as they appeared in the source code.

2.10 Allowable Replacements of Characters

(Ada83 LRM 2.10, Ada95 LRM J)

ASIS does not directly represent replacement characters. The Image and Static_Value functions should, however, return whatever characters appeared in the source code.

Note: Whether the actual source code definition is returned in implementation-dependent. Rational Apex returns the values as they appeared in the source code.


3. Declarations and Types

The following sections from LRM chapter 3 have related functions or concepts in ASIS:

3.1 Declarations

(Ada83 LRM 3.1, Ada95 LRM 3.1

There are several forms of declaration. A basic declaration is described as follows:

ASIS describes declarations in terms of elements with an element kind of A_Declaration and a sub-kind of Declarations_Kind.

ASIS often provides more detail on a declaration than indicated by the above syntax rule. The relationships between the Ada basic declarations and the ASIS declaration kinds are shown in the following table:

Ada Basic Declaration
ASIS Declaration_Kinds
deferred_constant_declaration
A_Deferred_Constant_Declaration
exception_declaration
An_Exception_Declaration
generic_declaration
A_Generic_Function_Declaration
A_Generic_Package_Declaration
A_Generic_Procedure_Declaration

generic_instantiation
A_Function_Instantiation
A_Package_Instantiation
A_Procedure_Instantiation

number_declaration
A_Constant_Declaration
object_declaration
A_Real_Number_Declaration
A_Variable_Declaration
An_Integer_Number_Declaration

package_declaration
A_Package_Declaration
A_Package_Body_Declaration

renaming_declaration
A_Function_Rename_Declaration
A_Package_Rename_Declaration
A_Procedure_Rename_Declaration
An_Exception_Rename_Declaration
An_Object_Rename_Declaration

subprogram_declaration
A_Function_Body_Declaration
A_Function_Declaration
A_Procedure_Body_Declaration
A_Procedure_Declaration

subtype_declaration
A_Subtype_Declaration
task_declaration
A_Task_Body_Declaration
A_Task_Declaration
A_Task_Type_Declaration

type_declaration
A_Full_Type_Declaration
A_Private_Type_Declaration
An_Incomplete_Type_Declaration

The Declaration_Kinds enumeration contains additional values for items that represent implicit declarations (such as discriminant specification) or declarations that are a part of the above definitions (such as entry declarations and generic formal objects).

3.2 Objects and Named Numbers

(Ada83 LRM 3.2, Ada95 LRM 3.3)

The LRM describes objects and named numbers as follows:

ASIS describes variable object-declarations, including the identifier list, as follows:

ASIS describes constant object-declarations, including the identifier list, as follows:

Deferred constants are discussed in "7.4 Private Types and Deferred Constant Declarations."

ASIS describes number declarations as follows:

The component functions of object and named-number declarations are described as follows:

Related functions:

Function
Returns
In_Initialized
Whether an initial value appears on an object declaration
Is_Variable
Whether an object declaration is a variable rather than a constant
Is_Constant
Whether an object declaration is a constant rather than a variable
Object_Declaration_Definition
The subtype definition or the constrained array definition following the colon in the object declaration
Corresponding_Constant_Declaration
The corresponding full constant declaration given the deferred constant declaration or the deferred constant declaration given the full constant declaration

3.3 Types and Subtypes

The following LRM sections have related functions or concepts in ASIS:

3.3.1 Type Declarations

(Ada83 LRM 3.3.1, Ada95 LRM 3.2.1)

The LRM describes type declarations as follows:

ASIS describes type declarations as follows:

ASIS describes full type declarations as follows:

The component functions are described as follows:

ASIS describes type definitions in terms of elements with an element kind of A_Type_Definition and a sub-kind of Type_Definition_Kinds.

ASIS often provides more detail on a type definition than indicated by the above Ada syntax rule. The relationships between the Ada type definitions and the ASIS type definition kinds are shown in the following table:

Ada Type_Definition
ASIS Type_Definition_Kinds
access_type_definition
An_Access_Type_Definition
array_type_definition
An_Array_Type_Definition
derived_type_definition
A_Derived_Type_Definition
enumeration_type_defintion
An_Enumeration_Type-_Definition
integer_type_definition
An_Integer_Type_Definition
real_type_definition
A_Fixed_Type_Definition A_Float_Type_Definition
record_type_definition
A_Record_Type_Definition

The Type_Definition_Kinds enumeration contains additional values for items that represent task types, private and limited private type, generic formal types, and universal types.

Related functions:

Function
Returns
Type_Operators
A list of operators defined for the specified type definition
Base_Type
The base type of the specified type definition
Is_Predefined
Whether the base type of a type definition is predefined in package Standard
Type_Definition_Declaration
The type declaration or object declaration associated with the specified type definition
Ground_Type
Unwinds type derivations and subtyping and returns a type definition that is neither a derived type or a subtype
Type_Structure
Unwinds type derivations and subtyping and returns a type definition that imposes a new representation or that is no longer derived

3.3.2 Subtype Declarations

(Ada83 LRM 3.3.2, Ada95 LRM 3.2.2)

The LRM describes subtype declarations as follows:

ASIS describes subtype declarations as follows:

The component functions are described as follows:

Subtype definition is not an LRM term; it is used by ASIS to differentiate between subtype declarations and subtype indications. Subtype declarations declare subtypes and ASIS creates an associated subtype definition for these declarations. Subtype indications appear as components of several other type definition kinds and have no associated subtype definitions.

In the context of a subtype definition, subtype declarations can also be described as follows:

The component functions are described as follows:

ASIS describes subtype indications, including the type mark and constraint as follows:

The component functions are described as follows:

ASIS describes constraints in terms of elements with an element kind of A_Constraint and a sub-kind of Constraint_Kinds.

ASIS provides more detail on a range constraint than indicated by the above Ada syntax rule.The relationships between the constraints and the ASIS constraint kinds are shown in the following table:

Ada Constraint
ASIS Constraint_Kinds
discriminant_constraint
A_Discriminant_Constraint
fixed_point_constraint
A_Fixed_Point_Constraint
floating_point_constraint
A_Floating_Point_Constraint
index_constraint
An_Index_Constraint
range_constraint
A_Range_Attribute A_Simple_Range

Related functions:

Function
Returns
Last_Constraint
The last subtype that imposed an explicit constraint or the base type associated with the specified type definition
Last_Subtype
The prior subtype or the base type of the specified subtype definition
Subtype_Definition_-
Subtype_Indication

The subtype indication associated with the specified subtype definition

3.3.3 Classification of Operations

(Ada83 LRM 3.3.3, Ada95 LRM 3.2.3)

ASIS provides functions that return the operations (operators and attribute functions) related to a type definition:

Function
Returns
Implicit_Attribute_Functions
A list of the a predefined attribute functions that have been implicitly declared for the specified type definition
Implicit_Derived_Subprograms
A list of the derived subprograms that have been implicitly declared for the specified derived-type definition
Implicit_Predefined_Operators
A list of the operators (functions) that have been implicitly defined for the specified type definition
Type_Operators
A list of operators defined for the specified type definition

3.4 Derived Types

(Ada83 LRM 3.4, Ada95 LRM 3.4)

The LRM describes derived type definitions as follows:

ASIS describes derived type definitions as follows:

The component function is described as follows:

Related function:

Function
Returns
Parent_Type
Returns the parent type of the specified derived type definition

3.5 Scalar Types

(Ada83 LRM 3.5, Ada95 LRM 3.5)

The LRM describes range constraints as follows:

ASIS describes range constraints as follows:

The element kinds for ranges are defined as follows:

ASIS describes ranges as follows:

The component functions are described as follows:

ASIS describes range constraints in terms of elements with an element kind of A_Constraint and a sub-kind of Discrete_Range_Kinds.

The following LRM sections have related functions or concepts in ASIS:

3.5.1 Enumeration Types

(Ada83 LRM 3.5.1, Ada95 LRM 3.5.1)

The LRM describes enumeration type definitions as follows:

ASIS describes enumeration type definitions as follows:

The component function is described as follows:

Ada represents enumeration literal specifications with a function declaration, described as follows:

ASIS describes this as follows:

The component functions are described as follows:

Related functions:

Function
Returns
Enumeration_Literal_Declarations
A list of the literals declared in the type definition. Each element is a declaration
Enumeration_Literal_Names
A list of the literals declared in the type definition. Each element is an entity name definition
Position_Number_Image
The image of the cardinality of the specified enumeration literal
Representation_Value_Image
The image of the internal representation of the specified enumeration literal

3.5.2 Character Types

(Ada83 LRM 3.5.2, Ada95 LRM 3.5.2)

The predefined Character type can be found by searching the package Standard.

Related functions:

Function
Returns
Enumeration_Literal_Names
A list of the literals declared in the type definition. Each element is an entity name definition
Position_Number_Image
The image of the cardinality of the specified character literal
Representation_Value_Image
The image of the internal representation of the specified character literal

3.5.3 Boolean Types

(Ada83 LRM 3.5.3, Ada95 LRM 3.5.3)

The predefined Boolean type can be found by searching the package Standard.

3.5.4 Integer Types

(Ada83 LRM 3.5.4, Ada95 LRM 3.5.4)

The LRM describes integer type definitions as follows:

ASIS describes integer type definitions as follows:

The component function is described as follows:

3.5.5 Operations of Discrete Types

(Ada83 LRM 3.5.5, Ada95 LRM 3.5.5)

The operations listed in LRM 3.5.5 are described by ASIS as follows:

Operation
ASIS Representation
Assignment
Explicit elements, see "6. Subprograms"
Explicit conversion
Explicit elements, see "4.6 Type Conversions"
Implicit conversion of universal integers
No elements
Membership tests
Explicit elements, see "4.4 Expressions"
Qualification
Explicit elements, see "4.7 Qualified Expressions"
Short-circuit control forms
Explicit elements, see "4.4 Expressions"

The basic operations also include the attribute 'Width and the attribute functions:

There is no implicit declaration of the attribute 'Width; there are implicit declarations for the attribute functions. Attribute function information is returned from:

3.5.6 Real Types

(Ada83 LRM 3.5.6, Ada95 LRM 3.5.6)

The LRM describes real type definitions as follows:

ASIS describes real type definitions as follows:

The component function is described as follows:

3.5.7 Floating Point Types

(Ada83 LRM 3.5.7, Ada95 LRM 3.5.7)

The LRM describes floating point constraints as follows:

ASIS describes floating point, including the accuracy definition, constraints as follows:

The component functions are described as follows:

3.5.8 Operations of Floating Point Types

(Ada83 LRM 3.5.8, Ada95 LRM 3.5.8)

The operations list in LRM 3.5.8 are described by ASIS as follows:

Operation
ASIS Representation
Assignment
Explicit elements, see "6. Subprograms"
Explicit conversion
Explicit elements, see "4.6 Type Conversions"
Implicit conversion of universal floats
No elements
Membership tests
Explicit elements, see "4.4 Expressions"
Qualification
Explicit elements, see "4.7 Qualified Expressions"

3.5.9 Fixed Point Types

(Ada83 LRM 3.5.9, Ada95 LRM 3.5.9)

The LRM describes fixed point constraints as follows:

ASIS describes fixed point constraints, including the accuracy definition, as follows:

The component functions are described as follows:

3.5.10 Operations of Fixed Point Types

(Ada83 LRM 3.5.10, Ada95 LRM 3.5.10)

The operations listed in LRM 3.5.10 are described by ASIS as follows:

Operation
ASIS Representation
Assignment
Explicit elements, see "6. Subprograms"
Explicit conversion
Explicit elements, see "4.6 Type Conversions"
Implicit conversion of universal floats
No elements.
Membership tests
Explicit elements, see "4.4 Expressions"
Qualification
Explicit elements, see "4.7 Qualified Expressions"

3.6 Array Types

(Ada83 LRM 3.6, Ada95 LRM 3.6)

The LRM describes array type definitions as follows:

ASIS describes constrained array-type definitions as follows:

The component functions are described as follows:

ASIS describes unconstrained array-type definitions as follows:

The component functions are described as follows:

ASIS defines index-subtype definitions as follows:

The component function is described as follows:

ASIS defines index constraints as follows:

The component function is described as follows:

ASIS defines discrete ranges as follows:

To determine what Discrete_Range_Kinds is represented, call the Discrete_Range_Kind function.

Related function:

Function
Returns
Is_Constrained_Array
Whether an array type definition represents a constrained array

3.6.2 Operations of Array Types

(Ada83 LRM 3.6.2, Ada95 LRM 3.6.2)

The operations listed in LRM 3.6.2 are described by ASIS as follows:

Operation
ASIS Representation
Aggregates
Explicit elements, see "4.3 Aggregates"
Assignment
Explicit elements, see "6. Subprograms"
Explicit conversion
Explicit elements, see "4.6 Type Conversions"
Indexed components
Explicit elements, see "4.1.1 Indexed Components"
Membership tests
Explicit elements, see "4.4 Expressions"
Qualification
Explicit elements, see "4.7 Qualified Expressions"
Slices
Explicit elements, see "4.1.2 Slices"

3.6.3 The Type String

(Ada83 LRM 3.6.3, Ada95 LRM 3.6.3)

The predefined String type can be found by searching package Standard.

3.7 Record Types

(Ada83 LRM 3.7, Ada95 LRM 3.8)

The LRM describes record type definitions as follows:

ASIS describes record type definitions as follows:

ASIS describes component lists as follows:

ASIS describes component declarations, including the component subtype-definition, as follows:

The component functions are described as follows:

Ada record components are described by the Component_Kinds type. The relationship between the components and ASIS component kinds is shown in the following table:

Ada Record Component
ASIS Component_Kinds
component_declaration
A_Component_Declaration
null;
A_Null_Component
variant_part
A_Variant_Part

Related functions:

Function
Returns
Is_Discriminated
Whether the record type definition contains discriminants
Implicit_Components
A list of all implementation-defined components in the type definition

3.7.1 Discriminants

(Ada83 LRM 3.7.1, Ada95 LRM 3.7)

The LRM describes discriminants as follows:

ASIS describes discriminants as follows:

The component function is described as follows:

ASIS describes discriminant specifications as follows:

The component functions are described as follows:

3.7.2 Discriminant Constraints

(Ada83 LRM 3.7.2, Ada95 LRM 3.7.1)

The LRM describes discriminant constraints as follows:

ASIS describes discriminant constraints as follows:

The component function is described as follows:

ASIS describes discriminant associations as follows:

The component functions are described as follows:

Related function:

Function
Returns
Is_Normalized
Whether the discriminant association was obtained from a normalized list

3.7.3 Variant Parts

(Ada83 LRM 3.7.3, Ada95 LRM 3.8.1)

The LRM describes variant parts as follows:

ASIS describes variant parts as follows:

The component functions are described as follows:

ASIS describes variants as follows:

The component functions are described as follows:

ASIS categorizes variant choices by Choice_Kinds as follows:

To determine what Choice_Kinds is represented, call the Choice_Kind function.

The component functions of variant choices are described as follows:

3.7.4 Operations of Record Types

(Ada83 LRM 3.7.4)

The operations listed in LRM 3.7.4 are described by ASIS as follows:

Operation
ASIS Representation
Aggregates
Explicit elements, see "4.3 Aggregates"
Assignment
Explicit elements, see "6. Subprograms"
Explicit conversion
Explicit elements, see "4.6 Type Conversions"
Membership tests
Explicit elements, see "4.4 Expressions"
Qualification
Explicit elements, see "4.7 Qualified Expressions"
Selection of components
Explicit elements, see "4.1.3 Selected Components"

3.8 Access Types

(Ada83 LRM 3.8, Ada95 LRM 3.10)

The LRM describes access type definition as follows:

ASIS describes access type definitions as follows:

The component function is described as follows:

3.8.1 Incomplete Type Declarations

(Ada83 LRM 3.8.1, Ada95 LRM 3.10.1)

The LRM describes incomplete type declarations as follows:

ASIS describes incomplete type declarations as follows:

The component functions are described as follows:

3.8.2 Operations of Access Types

(Ada83 LRM 3.8.2, Ada95 LRM 3.10.2)

The operations listed in LRM 3.8.2 are described by ASIS as follows:

Operation
ASIS Representation
Allocators
Explicit elements, see "4.8 Allocators"
Assignment
Explicit elements, see "6. Subprograms"
Explicit conversion
Explicit elements, see "4.6 Type Conversions"
Indexed components
Explicit elements, see "4.1.1 Indexed Components"
The literal null
Explicit elements, see "4.4 Expressions"
Membership tests
Explicit elements, see "4.4 Expressions"
Qualification
Explicit elements, see "4.7 Qualified Expressions"
Selection of components, discriminants, and use of the reserved word all
Explicit elements, see "4.1.3 Selected Components"
Slices
Explicit elements, see "4.1.2 Slices"

3.9 Declarative Parts

(Ada83 LRM 3.9, Ada95 LRM 3.11)

The LRM describes declarative parts as follows:

ASIS does not directly represent the concepts of basic and later declarative items. All declarations made in a particular context are returned, in their order of appearance, when a context is analyzed.


4. Names and Expressions

The following LRM sections have related functions or concepts in ASIS:

4.1 Names

(Ada83 LRM 4.1, Ada95 LRM 4.1)

The LRM describes names as follows:

ASIS describes names, including simple names, as components of expressions. These components are defined in terms of Expression_Kinds as follows:

See "4.4 Expressions," for more information on expression kinds.

ASIS describes prefixes as follows:

See "4.4 Expressions," for more information on function calls as a primary.

4.1.1 Indexed Components

(Ada83 LRM 4.1.1, Ada95 LRM 4.1.1)

The LRM describes indexed components as follows:

ASIS describes indexed components as follows:

The component functions are described as follows:

4.1.2 Slices

(Ada83 LRM 4.1.2, Ada95 LRM 4.1.2)

The LRM describes slices as follows:

ASIS describes slices as follows:

The component functions are described as follows:

4.1.3 Selected Components

(Ada83 LRM 4.1.3, Ada95 LRM 4.1.3)

The LRM describes selected components as follows:

ASIS describes selected components, including selectors, as follows:

The component functions are described as follows:

Ada selectors are described by the Selection_Kinds type. The relationship between ASIS selection kinds and selectors is based on the form of selected component described in LRM section 4.1.3 as follows:

Selection_Kinds
Corresponding LRM Section
A_Discriminant
a
A_Record_Component
b
A_Task_Entry
c
An_Access_Object (.all)
d
An_Expanded_Name
e and f

To determine what kind of selection is represented, call the Selection_Kind function.

Related functions:

Function
Returns
Selected_Component
A_Discriminant_Specification or A_Component_Declaration Declaration_Kinds element for A_Discriminant or A_Record_-Component selector
Selected_Task_Entry
The An_Entry_Declaration Declaration_Kinds element for A_Task_Entry selector
Selected_Designated_Subtype
A_Declaration Element_Kinds element for An_Expanded_Name selector that designates a type or subtype

4.1.4 Attributes

(Ada83 LRM 4.1.4, Ada95 LRM 4.1.4)

The LRM describes attributes as follows:

ASIS describes attributes, other than attribute functions, including the attribute designator, as follows:

ASIS describes attribute functions, including the attribute designator, as follows:

The component functions of attributes and attribute functions are described as follows:

ASIS describes the predefined attributes in terms of the Attribute_Designator_Kinds type. To determine what attribute is represented by the element returned from the Attribute_Designator _Name function, call the Attribute_Designator_Kind function.

Related functions:

Function
Returns
Is_Normalized
Whether the parameter association was obtained from a normalized list
Is_Parameter_Association
Whether the specified element represents a parameter association

4.2 Literals

(Ada83 LRM 4.2, Ada95 LRM 4.2)

Related function:

Function
Returns
Is_Literal
Whether the specified expression is a literal

4.3 Aggregates

(Ada83 LRM 4.3, Ada95 LRM 4.3)

The LRM describes aggregates as follows:

ASIS describes aggregates as follows:

The component function is described as follows:

ASIS describes component associations as follows:

The components functions are described as follows:

Related function:

Function
Returns
Is_Normalized
Whether the component association was obtained from a normalized list

4.4 Expressions

(Ada83 LRM 4.4, Ada95 LRM 4.4)

The LRM describes expressions as follows:

ASIS categorizes the short-circuit control forms and membership tests in terms of elements with an Expression_Kinds of A_Special_Operation and a sub-sub-kind of Special_Operation_Kinds. The relationship between the Ada syntactic categories and the special operation kinds are shown in the following table:

Ada Syntactic Category
ASIS Special_Operation_Kinds
and then
An_And_Then
or else
An_Or_Else
in range
An_In_Range
not in range
A_Not_In_Range
in type_mark
An_In_Type
not in type_mark
A_Not_In_Type

To determine what Special_Operation_Kinds is represented, call the Special_Operation_Kind function.

There are no explicit ASIS functions that analyze the logical operators (and, or, and xor) in the syntactic category expression. The logical operators are represented as An_Expression elements with an Expression_Kinds of A_Function_Call; the function contains two parameter associations. The name of the function is An_Expression element with an Expression_Kinds of An_Operator_Symbol.

ASIS represents the short-circuit control forms as follows:

The component functions are described as follows:

There are no explicit ASIS functions that analyze the relational operators in the syntactic category relation. The relational operators are represented as An_Expression elements with an Expression_Kinds of A_Function_Call; the function contains two parameter associations. The name of the function is An_Expression element with an Expression_Kinds of An_Operator_Symbol.

ASIS represents membership tests as follows:

The component functions are described as follows:

There are no explicit ASIS functions that analyze the syntactic categories simple expression, term, or factor. The unary adding operators, binary adding operators, multiplying operators, and highest precedence operators contained in these syntactic categories are represented as An_Expression elements with an Expression_Kinds of A_Function_Call; the function contains one parameter association for unary operators and two parameter associations for all other operators. The name of the function is An_Expression element with an Expression_Kinds of An_Operator_Symbol.

ASIS describes primaries as follows:

Related functions:

Function
Returns
Expression_Type
The type definition for the expression
Is_Prefix_Call
Whether a function call appeared in prefix notation
Is_Referenced
Whether a specified entity is referenced within a specified context
Name_Definition
The first definition of the specified entity
Name_Declaration
The declaration of the specified entity
References
All direct references to the specified entity with a specified context

4.6 Type Conversions

(Ada83 LRM 4.6, Ada95 LRM 4.6)

The LRM describes type conversions as follows:

ASIS describes type conversions as follows:

The component functions are described as follows:

4.7 Qualified Expressions

(Ada83 LRM 4.7, Ada95 LRM 4.7)

The LRM describes qualified expressions as follows:

ASIS describes qualified expressions as follows:

The component functions are described as follows:

4.8 Allocators

(Ada83 LRM 4.8, Ada95 LRM 4.8)

The LRM describes allocators as follows:

ASIS describes allocators as follows:

The component functions are described as follows:

4.9 Static Expressions and Static Subtypes

(Ada83 LRM 4.9, Ada95 LRM 4.9)

Related functions:

Function
Returns
Is_Static
Whether an expression is a static value
Static_Value
The static value of the specified expression

4.10 Universal Expressions

(Ada83 LRM 4.10)

Related function:

Function
Returns
Is_Universal
Whether an expression return a universal integer or universal real value


5. Statements

The following LRM sections have related functions or concepts in ASIS:

5.1 Simple and Compound Statements - Sequences of Statements

(Ada83 LRM 5.1, Ada95 LRM 5.1)

The LRM describes statements as follows:

Sequences of statements are available from the following functions in package Statements:

Function
Returns Statements From
Accept_Body_Statements
An_Accept_Statement
Arm_Statements
An_If_Statement_Arm
Block_Body_Statements
A_Block_Statement
Case_Statement-_Alternative_Statements
A_Case_Statement_Alternative
Else_Statements
A_Conditional_Entry_Call_Else_Arm
A_Selective_Wait_Else_Arm

Entry_Call_Statements
A_Conditional_Entry_Call_Select_Arm
A_Timed_Entry_Call_Select_Arm

Handler_Statements
An_Exception_Handler
Loop_Statements
A_Loop_Statement
Select_Alternative-_Statements
A_Delay_Alternative
A_Terminate_Alternative
1
An_Accept_Alternative
Timed_Entry_Call_Or-_Statements
A_Timed_Entry_Call_Or_Arm
1 A Nil_Element_List is always returned.

ASIS describes statements as follows:

The component function is described as follows:

Related function:

Function
Returns
Is_Labeled
Whether a statement contains one or more preceding labels

ASIS does not distinguish between simple statements and compound statements. For conformity of representation however, we show the ASIS definitions in terms of these syntactic categories.

ASIS would describe simple statements as follows:

ASIS would describe compound statements as follows:

Because of the select statement's complexity, it is defined in terms of its components. The LRM describes select statements as follows:

ASIS describes select statements as follows:

To determine what Statement_Kinds is represented, call the Kind function.

ASIS describes null statements as follows:

5.2 Assignment Statement

(Ada83 LRM 5.2, Ada95 LRM 5.2)

The LRM describes assignment statements as follows:

ASIS describes assignment statements as follows:

The component functions are described as follows:

5.3 If Statements

(Ada83 LRM 5.3, Ada95 LRM 5.3)

The LRM describes if statements as follows:

ASIS describes if statements as follows:

ASIS categorizes if-statement arms by If_Statement_Arm_Kinds as follows:

To determine what If_Statement_Arm_Kinds is represented, call the If_Statement_Arm_Kind function.

The component functions are described as follows:

5.4 Case Statements

(Ada83 LRM 5.4, Ada95 LRM 5.4)

The LRM describes case statements as follows:

ASIS describes case statements as follows:

The component functions are described as follows:

ASIS describes case-statement alternatives as follows:

The component functions are described as follows:

ASIS categorizes case-statement alternative choices by Choice_Kinds as follows:

Related function:

Function
Returns
Is_When_Others
Whether a case statement alternative represents the reserved word others

The component functions of case-statement alternative choices are described as follows:

5.5 Loop Statements

(Ada83 LRM 5.5, Ada95 LRM 5.5)

The LRM describes loop statements as follows:

ASIS categorizes loop statements, including the iteration scheme, by Loop_Kinds as follows:

To determine what Loop_Kinds is represented, call the Loop_Kind function.

The component functions are described as follows:

The loop parameter specification is described as follows:

The component functions are described as follows:

Related function:

Function
Returns
Is_Reverse_Loop_Parameter
Whether the reserved word reverse appears in the loop parameter specification

5.6 Block Statements

(Ada83 LRM 5.6, Ada95 LRM 5.6)

The LRM describes block statements as follows:

The component functions are described as follows:

5.7 Exit Statements

(Ada83 LRM 5.7, Ada95 LRM 5.7)

The LRM describes exit statements as follows:

ASIS describes exit statements as follows:

The component functions are described as follows:

Related function:

Function
Returns
Loop_Exited
The loop statement the exit applies to

5.8 Return Statements

(Ada83 LRM 5.8, Ada95 LRM 6.5)

The LRM describes return statements as follows:

ASIS describes return statements as follows:

The component function is described as follows:

5.9 Goto Statements

(Ada83 LRM 5.9, Ada95 LRM 5.8)

The LRM describes goto statements as follows:

ASIS describes returns statements as follows:

The component function is described as follows:

Related function:

Function
Returns
Destination_Statement
The target statement of the goto statement


6. Subprograms

The following LRM sections have related functions or concepts in ASIS:

6.1 Subprogram Declarations

(Ada83 LRM 6.1, Ada95 LRM 6.1)

The LRM describes subprogram declarations as follows:

ASIS describes subprogram specifications including the formal part as follows:

The component functions are described as follows:

The An_Entity_Name_Definition element returned by the Names function can represent an identifier or an operator symbol.

Related function:

Function
Returns
Corresponding_Body
The element representing the declaration of the subprogram body

ASIS describes parameter specifications as follows:

The component functions are described as follows:

Ada parameter modes are describe the Parameter_Mode_Kinds type. The relationship between parameter modes and ASIS parameter mode kinds is shown in the following table:

Ada Mode
ASIS Parameter_Mode_Kinds
none
A_Default_In_Mode1
in
An_In_Mode
in out
An_In_Out_Mode
out
An_Out_Mode
1 If Default_In_Mode_Support returns False, this value is never returned. If a default in mode was specified in the source code, An_In_Mode is returned instead.

6.3 Subprogram Bodies

(Ada83 LRM 6.3, Ada95 LRM 6.3)

The LRM describes subprogram bodies as follows:

ASIS describes subprogram bodies as follows:

The component functions are described as follows:

See "5.6 Block Statements" for how to obtain the declarative part, sequence of statements, and exception handlers from the element representing the subprogram body block.

Related function:

Function
Returns
Corresponding_Specification
The element representing the declaration of the subprogram specification

6.4 Subprogram Calls

(Ada83 LRM 6.4, Ada95 LRM 6.4)

The LRM describes subprogram calls as follows:

ASIS describes procedure call statements including the actual parameter part as follows:

The component functions are described as follows:

Related function:

Function
Returns
Called_Procedure
The declaration of the called procedure or entry

ASIS describes function calls including the actual parameter part as follows:

 The component functions are described as follows:

ASIS describes parameter associations as follows:

The component functions are described as follows:

The Formal_Parameters function returns An_Expression if the A_Parameter_Association is from a normalized list; An_Entity_Name_Definition is returned from an unnormalized list.

Related functions:

Function
Returns
Is_Normalized
Whether the parameter association was obtained from a normalized list
Is_Parameter_Association
Whether the specified element represents a parameter association
Is_Prefix_Call
Whether a function call appeared in prefix notation


7. Packages

The following LRM sections have related functions or concepts in ASIS:

7.1 Package Structure

(Ada83 LRM 7.1, Ada95 LRM 7.1)

The LRM describes package specifications as follows:

ASIS describes package specifications as follows:

The component functions are described as follows:

Related function:

Function
Returns
Corresponding_Body
The element representing the declaration of the package body

ASIS describes package bodies as follows:

The component functions are described as follows:

See "5.6 Block Statements" for how to obtain the declarative part, sequence of statements, and exception handlers from the element representing the package body block.

Related function:

Function
Returns
Corresponding_Specification
The element representing the declaration of the package

7.4 Private Types and Deferred Constant Declarations

(Ada83 LRM 7.4, Ada95 LRM 7.3, 7.4)

The LRM describes private-type and deferred-constant declarations as follows:

ASIS describes private-type declarations as follows:

The component functions are described as follows:

Related functions:

Function
Returns
Is_Limited
Whether the type definition represents a limited or limited private type
Corresponding_Type_Declaration
The corresponding full type declaration when given the private type declaration or the private type declaration when given the full type declaration

ASIS describes deferred-constant declarations as follows:

The component functions are described as follows:

You can obtain the corresponding full type declaration by calling the Corresponding_Constant_Declaration function.

Related function:

Function
Returns
Corresponding_Constant_Declaration
The corresponding full constant declaration when given the partial constant declaration or the partial constant declaration when given the full constant declaration


8. Visibility Rules

The following LRM sections have related functions or concepts in ASIS:

8.4 Use Clauses

(Ada83 LRM 8.4, Ada95 LRM 8.4)

The LRM describes use clauses as follows:

ASIS describes use clauses as follows:

The component functions are described as follows:

Use Compilation_Clause_Elements to obtain the use clauses that appear in a unit's context clause. Use Named_Packages for all other use clauses.

The use clauses returned by the Context_Clause_Elements function can be further analyzed with the Referenced_Units function.

8.5 Renaming Declarations

(Ada83 LRM 8.5 , Ada95 LRM 8.5)

The LRM describes renaming declarations as follows:

ASIS describes renaming declarations as follows:

The component functions are described as follows:


9. Tasks

The following LRM sections have related functions or concepts in ASIS:

9.1 Task Specifications and Task Bodies

(Ada83 LRM 9.1, Ada95 LRM 9.1)

The LRM describes task specifications and task bodies as follows:

ASIS describes task specifications as follows:

The component functions are described as follows:

Related function:

Function
Returns
Corresponding_Body
The element representing the declaration of the task body

ASIS describes task bodies as follows:

The component functions are described as follows:

See "5.6 Block Statements" for how to obtain the declarative part, sequence of statements, and exception handlers from the element representing the task body block.

Related function:

Function
Returns
Corresponding_Specification
The element representing the declaration of the task specification

9.5 Entries, Entry Calls, and Accept Statements

(Ada83 LRM 9.5, Ada95 LRM 9.5.2)

The LRM describes entries, entry calls, and accept statements as follows:

ASIS describes entry declarations as follows:

The component functions are described as follows:

    Note: Family_Index is in package Declarations.

ASIS describes an entry call statement as follows:

The component functions are described as follows:

    Note: Family_Index is in package Declarations.

ASIS describes accept statements, including the entry index, as follows:

The component functions are described as follows:

    Note: Family_Index is in package Statements.

Related functions:

Function
Returns
Is_Normalized
Whether the parameters association was obtained from a normalized list
Is_Parameter_Association
Whether the specified element represents a parameter association
Accepted_Entry
The declaration of the entry accepted by the statement

9.6 Delay Statements, Duration, and Time

(Ada83 LRM 9.6, Ada95 LRM 9.6)

The LRM describes delay statements as follows:

ASIS describes delay statements as follows:

The component function is described as follows:

9.7 Select Statements

(Ada83 LRM 9.7, Ada95 LRM 9.7)

The following LRM sections have related functions or concepts in ASIS:

The LRM describes select statements as follows:

ASIS describes select statements as follows:

9.7.1 Selective Waits

(Ada83 LRM 9.7.1, Ada95 LRM 9.7.1)

The LRM describes selective wait statements as follows:

ASIS describes selective-wait statements as follows:

The component function is described as follows:

The A_Select_Statement_Arm elements returned can be categorized by the Select_Statement_Arm_Kind function into elements of a particular Select_Statement_Arm_Kinds. Taking the select statement arm kinds into consideration, selective-wait call statements can be described as follows:

The correlation between the ASIS functions and the appropriate select statement arm kinds are:

ASIS Function
Select_Statement_Arm_Kinds
Arm_Select_Alternative
A_Selective_Wait_Select_Arm
A_Selective_Wait_or_Arm

Else_Statements
A_Selective_Wait_Else_Arm

The component functions are described as follows:

ASIS describes select alternatives as follows:

The component functions are described as follows:

Related function:

Function
Returns
Is_Guarded
Whether a guard exists on the select alternative

ASIS describes selective wait alternatives and the component syntactic categories in terms of Select_Alternative_Kinds as follows:

The component function is described as follows:

The element list returned by Select_Alternative_Statements function for the accept alternative includes the accept statement. Similarly, the list returned for the delay alternative includes the delay statement. The function can be called for the terminate alternative but an Asis.Nil_Element_List is always returned; the reserved word terminate is implicit.

9.7.2 Conditional Entry Calls

(Ada83 LRM 9.7.2, Ada95 LRM 9.7.3)

The LRM describes conditional-entry call statements as follows:

ASIS describes conditional-entry call statements as follows:

The component function is described as follows:

The A_Select_Statement_Arm elements returned can be categorized by the Select_Statement_Arm_Kind function into elements of a particular Select_Statement_Arm_Kinds. Taking the select statement arm kinds into consideration, conditional-entry call statements can be described as follows:

The correlation between the ASIS functions and the appropriate select statement arm kinds are:

ASIS Function
Select_Statement_Arm_Kinds
Entry_Call_Statements
A_Conditional_Entry_Call_Select_Arm
Else_Statements
A_Conditional_Entry_Call_Or_Arm

The component functions are described as follows:

9.7.3 Timed Entry Calls

(Ada83 LRM 9.7.3, Ada95 LRM 9.7.2)

The LRM describes timed-entry call statements as follows:

ASIS describes timed-entry call statements as follows:

The component function is described as follows:

The A_Select_Statement_Arm elements returned can be categorized by the Select_Statement_Arm_Kind function into elements of a particular Select_Statement_Arm_Kinds. Taking the select statement arm kinds into consideration, timed-entry call statements can be described as follows:

The correlation between the ASIS functions and the appropriate select statement arm kinds are:

ASIS Function
Select_Statement_Arm_Kinds
Entry_Call_Statements
A_Timed_Entry_Call_Select_Arm
Timed_Entry_Call_Or_Statements
A_Timed_Entry_Call_Or_Arm

The component functions are described as follows:

9.10 Abort Statements

(Ada83 LRM 9.10, Ada95 LRM 9.8)

The LRM describes abort statements as follows:

ASIS describes abort statements as follows:

The component function is describes as follows:


10. Program Structure and Compilation Issues

The following LRM sections have related functions or concepts in ASIS:

10.1 Compilation Units - Library Units

(Ada83 LRM 10.1, Ada95 LRM 10.1.1)

The LRM describes compilation units as follows:

ASIS provides support for the LRM definition allowing multiple compilation units per compilation. The Rational Environment however, does not allow multiple compilation units per compilation. Apex however, does not allow multiple compilation units per compilation. Whether multiple compilation units appear in a compilation can only be determined by:

ASIS describes compilation units as follows:

The component functions are described as follows:

ASIS describes library units and secondary units in terms of Compilation_Unit_Kinds. The relationships between Ada compilation units and ASIS compilation unit kinds are shown in the following table:

Ada Compilation_Unit
ASIS Compilation_Unit_Kinds
generic_declaration
A_Generic_Declaration
generic_instantiation
A_Generic_Instantiation
package_body
A_Package_Body
package_declaration
A_Package_Declaration
subprogram_body
A_Subprogram_Body
subprogram_declaration
A_Subprogram_Declaration
subunit
A_Subunit

The Compilation_Unit_Kinds enumeration contains additional values for units that must exist but are currently missing and for implementation-defined units.

Before a compilation unit can be analyzed, an element representing the declaration of the unit must be obtained with the Unit_Declaration function. This element has a kinds of A_Declaration and a sub-kinds based on the compilation unit. The relationship between the compilation unit kinds and the declaration kinds is shown in the following table:

Compilation_Unit_Kinds
Declaration_Kinds
A_Generic_Declaration
A_Generic_Function_Declaration
A_Generic_Package_Declaration
A_Generic_Procedure_Declaration

A_Generic_Instantiation
A_Generic_Function_Instantiation
A_Generic_Package_Instantiation
A_Generic_Procedure_Instantiation

A_Package_Body
A_Package_Body_Declaration
A_Package_Declaration
A_Package_Declaration
A_Subprogram_Body
A_Function_Body_Declaration
A_Procedure_Body_Declaration

A_Subprogram_Declaration
A_Function_Declaration
A_Procedure_Declaration

A_Subunit
A_Function_Body_Declaration
A_Package_Body_Declaration
A_Procedure_Body_Declaration
A_Task_Body_Declaration

Subprograms that return properties, pragmas, and related compilation units are described in package Compilation_Units.

10.1.1 Context Clauses - With Clauses

(Ada83 LRM 10.1.1, Ada95 LRM 10.1.2)

The LRM describes context clauses as follows:

ASIS describes context clauses as follows:

The component function is described as follows:

ASIS describes with clauses as follows:

The component function is described as follows:

10.2 Subunits of Compilation Units

(Ada83 LRM 10.2, Ada95 LRM 10.1.3)

The LRM describes subunits of compilation units as follows:

ASIS categorizes body stubs by Declaration_Kinds as follows:

The component functions are defined as follows:

To convert a body stub declaration to a declaration that represents the subunit, use the Subunit function.

ASIS categorizes subunits by Declaration_Kinds as follows:

The component functions are described as follows:

ASIS does not provide an explicit function to obtain the parent unit name. One possible method is to:

1 . Call Enclosing_Compilation_Unit to obtain the compilation unit of the separate.

2 . Call Subunit_Parent to obtain the compilation unit of the parent unit.

3 . Call Name to obtain the name of the parent unit.


11. Exceptions

The following LRM sections have related functions or concepts in ASIS:

11.1 Exception Declarations

(Ada83 LRM 11.1, Ada95 LRM 11.1)

The LRM describes exception declarations as follows:

ASIS describes exception declarations as follows:

The component function is described as follows:

11.2 Exception Handlers

(Ada83 LRM 11.2, Ada95 LRM 11.2)

The LRM describes exception handlers as follows:

ASIS describes exception handlers as follows:

The component functions are described as follows:

ASIS categorizes exception choices by Choice_Kinds as follows:

Related function:

Function
Returns
Is_Others_Handler
Whether the specified exception choice represents the others reserved word

The component functions of exception choices are described as follows:

11.3 Raise Statements

(Ada83 LRM 11.3, Ada95 LRM 11.3)

The LRM describes raise statements as follows:

ASIS describes raise statements as follows:

The component function is described as follows:


12. Generic Units

The following LRM sections have related functions or concepts in ASIS:

12.1 Generic Declarations

(Ada83 LRM 12.1, Ada95 LRM 12.1)

The LRM described generic declarations as follows:

ASIS describes generic specifications including the generic formal part as follows:

The component functions are described as follows:

Related function:

Function
Returns
Corresponding_Body
The element representing the declaration of the generic body

ASIS describes generic-parameter declarations as follows:

The component functions are described as follows:

Related functions:

Function
Returns
Generic_Formal_Subprogram_Default_Kind
Whether a generic formal subprogram declaration uses box notation, specifies a default subprogram, or does neither
Is_Discriminated
Whether the specified generic formal type declaration has discriminants
Is_Limited
Whether the specified generic formal type declaration is for a limited private type
Is_Private
Whether the specified generic formal type declaration is for a private type

ASIS describes generic-type definitions as follows:

12.2 Generic Bodies

(Ada83 LRM 12.2, Ada95 LRM 12.2)

See "5.6 Block Statements" for how to obtain the declarative part, sequence of statements, and exception handlers from the element representing the generic body block.

Related function:

Function
Returns
Corresponding_Specification
The element representing the generic specification

12.3 Generic Instantiation

(Ada83 LRM 12.3, Ada95 LRM 12.3)

The LRM describes generic instantiations as follows:

ASIS describes generic instantiations including the generic actual part as follows:

The component functions are described as follows:

ASIS describes generic associations including the generic formal and actual parameter components as follows:

The component functions are described as follows:

The Formal_Parameter function returns An_Expression if the A_Parameter_Association is from a normalized list; An_Entity_Name_Definition is returned from an unnormalized list.

Related functions:

Function
Returns
Is_Normalized
Whether the parameter association was obtained from a normalized list
Is_Parameter_Association
Whether the specified element represents a parameter association


13. Representation Clauses and Implementation-Dependent Features

The following LRM sections have related functions or concepts in ASIS:

13.1 Representation Clauses

(Ada83 LRM 13.1, Ada95 LRM 13.1)

The LRM describes representation clauses as follows:

ASIS categorizes representation clauses by Representation_Clause_Kinds as follows:

To determine what Representation_Clause_Kinds is represented, call the Kind function.

Related function:

Function
Returns
Associated_Type
The type definition of the type named in the specified representation clause

13.2 Length Clauses

(Ada83 LRM 13.2, Ada95 LRM 13.3(7))

The LRM describes length clauses as follows:

ASIS describes length clauses as follows:

The component functions are described as follows:

To determine what Length_Clause_Attribute_Kind is represented, call the Length_Clause_Attribute_Kind function.

Related function:

Function
Returns
Associated_Length_Clause_Representations
A list containing the length clauses associated with the specified type definition

13.3 Enumeration-Representation Clauses

(Ada83 LRM 13.3, Ada95 LRM 13.4)

The LRM describes enumeration-representation clauses as follows:

ASIS describes enumeration-representation clauses as follows:

The component functions are described as follows:

Related function:

Function
Returns
Associated_Enumeration_Type_Representation
The enumeration representation clause associated with the specified type definition

13.4 Record Representation Clauses

(Ada83 LRM 13.4, Ada95 LRM 13.5.1)

The LRM describes record representation clauses as follows:

ASIS describes record representation clauses, including the alignment clause, as follows:

The component functions are described as follows:

Related function:

Function
Returns
Associated_Record_Type_Representation
The record representation clause associated with the specified type definition

ASIS describes component clauses as follows:

The component functions are described as follows:

13.5 Address Clauses

(Ada83 LRM 13.5, Ada95 LRM 13.3(12))

The LRM describes address clauses as follows:

ASIS describes address clauses as follows:

The component functions are described as follows:

Related function:

Function
Returns
Associated_Address_Representation
The address representation clause associated with the specified type definition

13.8 Machine Code Insertions

(Ada83 LRM 13.8, Ada95 LRM 13.8)

The LRM describes machine code insertions as follows:

ASIS describes machine code insertions as follows:

The component function is described as follows:


Rational Software Corporation 
http://www.rational.com
support@rational.com
techpubs@rational.com
Copyright © 1993-2002, Rational Software Corporation. All rights reserved.
TOC PREV NEXT INDEX DOC LIST MASTER INDEX TECHNOTES APEX TIPS