DocAda(tm) is a productivity tool of KSCE

Prev | Up | Next | Back | Forward
About DocAda Light: Preface / Preliminary / Help / TOC / Copyright
DocAda Online at the Ada Home: Complete RM95 / Updates / News

4.1.3 Selected Components

Selected_components are used to denote components (including discriminants), entries, entry families, and protected subprograms; they are also used as expanded names as described below.

Syntax

   
       selected_component ::= prefix . selector_name

       selector_name ::= identifier | character_literal | operator_symbol

Name Resolution Rules

A selected_component is called an expanded name if, according to the visibility rules, at least one possible interpretation of its prefix denotes a package or an enclosing named construct (directly, not through a subprogram_renaming_declaration or generic_renaming_declaration).

A selected_component that is not an expanded name shall resolve to denote one of the following:

An expanded name shall resolve to denote a declaration that occurs immediately within a named declarative region, as follows:

Dynamic Semantics

The evaluation of a selected_component includes the evaluation of the prefix.

For a selected_component that denotes a component of a variant, a check is made that the values of the discriminants are such that the value or object denoted by the prefix has this component. The exception Constraint_Error is raised if this check fails.

Examples

Examples of selected components:

    
         Tomorrow.Month     --  a record component                   (see 3.8)
         Next_Car.Owner     --  a record component                   (see 3.10.1)
         Next_Car.Owner.Age --  a record component                   (see 3.10.1)
                            --  the previous two lines involve implicit dereferences
         Writer.Unit        --  a record component (a discriminant)  (see 3.8.1)
         Min_Cell(H).Value  --  a record component of the result     (see 6.1)
                            --  of the function call Min_Cell(H)
         Control.Seize      --  an entry of a protected object       (see 9.4)
         Pool(K).Write      --  an entry of the task Pool(K)         (see 9.4)

Examples of expanded names:

    
         Key_Manager."<"      --  an operator of the visible part of a package (see 7.3.1)
         Dot_Product.Sum      --  a variable declared in a function body    (see 6.1)
         Buffer.Pool          --  a variable declared in a protected unit   (see 9.11)
         Buffer.Read          --  an entry of a protected unit              (see 9.11)
         Swap.Temp            --  a variable declared in a block statement  (see 5.6)
         Standard.Boolean     --  the name of a predefined type             (see A.1)

About DocAda Light: Preface / Preliminary / Help / TOC / Copyright
DocAda Online at the Ada Home: Complete RM95 / Updates / News
Prev | Up | Next | Back | Forward


Copyright © 1994-1997 by Kempe Software Capital Enterprises. All Rights Reserved. For comments on this DocAda(tm) hypertext document, please write to KSCE, at docada@ksce.com