DocAda(tm) is a productivity tool of KSCE

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

4.1.1 Indexed Components

An indexed_component denotes either a component of an array or an entry in a family of entries.

Syntax

   
       indexed_component ::= prefix(expression {, expression})

Name Resolution Rules

The prefix of an indexed_component with a given number of expressions shall resolve to denote an array (after any implicit dereference) with the corresponding number of index positions, or shall resolve to denote an entry family of a task or protected object (in which case there shall be only one expression).

The expected type for each expression is the corresponding index type.

Static Semantics

When the prefix denotes an array, the indexed_component denotes the component of the array with the specified index value(s). The nominal subtype of the indexed_component is the component subtype of the array type.

When the prefix denotes an entry family, the indexed_component denotes the individual entry of the entry family with the specified index value.

Dynamic Semantics

For the evaluation of an indexed_component, the prefix and the expressions are evaluated in an arbitrary order. The value of each expression is converted to the corresponding index type. A check is made that each index value belongs to the corresponding index range of the array or entry family denoted by the prefix. Constraint_Error is raised if this check fails.

Examples

Examples of indexed components:

   
        My_Schedule(Sat)     --  a component of a one-dimensional array  (see 3.6.1)
        Page(10)             --  a component of a one-dimensional array  (see 3.6)
        Board(M, J + 1)      --  a component of a two-dimensional array  (see 3.6.1)
        Page(10)(20)         --  a component of a component              (see 3.6)
        Request(Medium)      --  an entry in a family of entries         (see 9.1)
        Next_Frame(L)(M, N)  --  a component of a function call          (see 6.1)

About DocAda Light: Preface / Preliminary / Help / TOC / Copyright
DocAda Online at the Ada Home: Complete RM95 / Updates / News
____ | 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