3 -- Grant of Unlimited Rights
5 -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
6 -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
7 -- unlimited rights in the software and documentation contained herein.
8 -- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
9 -- this public release, the Government intends to confer upon all
10 -- recipients unlimited rights equal to those held by the Government.
11 -- These rights include rights to use, duplicate, release or disclose the
12 -- released technical data and computer software in whole or in part, in
13 -- any manner and for any purpose whatsoever, and to have or permit others
18 -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
19 -- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
20 -- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
21 -- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
22 -- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
23 -- PARTICULAR PURPOSE OF SAID MATERIAL.
27 -- Check that access to subprogram may be stored within array
28 -- objects, and that the access to subprogram can subsequently
32 -- Declare an access to procedure type in a package specification.
33 -- Declare an array of the access type. Declare three different
34 -- procedures that can be referred to by the access to procedure type.
36 -- In the main program, build the array by dereferencing the access
41 -- 06 Dec 94 SAIC ACVC 2.0
49 Left_Turn
: Integer := 1;
51 Right_Turn
: Integer := 1;
53 Center_Turn
: Integer := 1;
55 -- Type accesses to any procedure
56 type Action_Ptr
is access procedure;
58 -- Array of access to procedure
59 type Action_Array
is array (Integer range <>) of Action_Ptr
;
62 procedure Rotate_Left
is
68 procedure Rotate_Right
is
82 Report
.Test
("C3A0004", "Check that access to subprogram may be "
83 & "stored within data structures, and that the "
84 & "access to subprogram can subsequently be called");
86 ------------------------------------------------------------------------
89 Total_Actions
: constant := 3;
90 Action_Sequence
: Action_Array
(1 .. Total_Actions
);
94 -- Build the action sequence
95 Action_Sequence
:= (Rotate_Left
'Access, Center
'Access,
98 -- Assign actions by invoking subprogram designated by access value
99 for I
in Action_Sequence
'Range loop
100 Action_Sequence
(I
).all;
103 If Left_Turn
/= 2 or Right_Turn
/= 3
104 or Center_Turn
/= 0 then
105 Report
.Failed
("Incorrect Action sequence result");
110 ------------------------------------------------------------------------