Access types

access subtype_indication

By declaring an access type an access type is declared which can later be used for declaring an index variable.

type identifier

By giving an incomplete type declaration it is possible to model recursive structures. The complete type declaration has to be made in the same declarative range.

Access types address and buffer_ptr are declared. memory and buffer are target types .

TYPE address IS ACCESS memory ;
TYPE buffer_ptr IS ACCESS buffer ;

A recursive structure is created. At first type cell is declared incompletely. As a consequence the access type link is declared on the type cell .

Afterwards type cell is declared completely as Record. The elements succ and pred are declared as index types. By doing so an interlinked list can be created in which every element receives an index to both its predecessor and its successor.

TYPE cell ;
TYPE link IS ACCESS cell ;
TYPE cell IS
      value : integer ;
      succ  : link ;
      pred  : link ;