annotate gcc/testsuite/ada/acats/support/f340a000.a @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 -- F340A000.A
kono
parents:
diff changeset
2 --
kono
parents:
diff changeset
3 -- Grant of Unlimited Rights
kono
parents:
diff changeset
4 --
kono
parents:
diff changeset
5 -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
kono
parents:
diff changeset
6 -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
kono
parents:
diff changeset
7 -- unlimited rights in the software and documentation contained herein.
kono
parents:
diff changeset
8 -- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
kono
parents:
diff changeset
9 -- this public release, the Government intends to confer upon all
kono
parents:
diff changeset
10 -- recipients unlimited rights equal to those held by the Government.
kono
parents:
diff changeset
11 -- These rights include rights to use, duplicate, release or disclose the
kono
parents:
diff changeset
12 -- released technical data and computer software in whole or in part, in
kono
parents:
diff changeset
13 -- any manner and for any purpose whatsoever, and to have or permit others
kono
parents:
diff changeset
14 -- to do so.
kono
parents:
diff changeset
15 --
kono
parents:
diff changeset
16 -- DISCLAIMER
kono
parents:
diff changeset
17 --
kono
parents:
diff changeset
18 -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
kono
parents:
diff changeset
19 -- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
kono
parents:
diff changeset
20 -- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
kono
parents:
diff changeset
21 -- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
kono
parents:
diff changeset
22 -- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
kono
parents:
diff changeset
23 -- PARTICULAR PURPOSE OF SAID MATERIAL.
kono
parents:
diff changeset
24 --*
kono
parents:
diff changeset
25 --
kono
parents:
diff changeset
26 -- FOUNDATION DESCRIPTION:
kono
parents:
diff changeset
27 -- This file simulates a generic linked list abstraction for use in tests
kono
parents:
diff changeset
28 -- covering tagged types and type extensions.
kono
parents:
diff changeset
29 --
kono
parents:
diff changeset
30 -- TEST FILES:
kono
parents:
diff changeset
31 -- This foundation consists of the following files:
kono
parents:
diff changeset
32 --
kono
parents:
diff changeset
33 -- => F340A000.A
kono
parents:
diff changeset
34 -- F340A001.A
kono
parents:
diff changeset
35 --
kono
parents:
diff changeset
36 -- CHANGE HISTORY:
kono
parents:
diff changeset
37 -- 06 Dec 94 SAIC ACVC 2.0
kono
parents:
diff changeset
38 -- 12 Jun 96 SAIC ACVC 2.1: Modified prologue. Added pragma
kono
parents:
diff changeset
39 -- Elaborate_Body.
kono
parents:
diff changeset
40 --
kono
parents:
diff changeset
41 --!
kono
parents:
diff changeset
42
kono
parents:
diff changeset
43 generic -- Singly-linked list abstraction.
kono
parents:
diff changeset
44 type Parent_Type is tagged private; -- Actual is parent
kono
parents:
diff changeset
45 package F340A000 is -- tagged type.
kono
parents:
diff changeset
46
kono
parents:
diff changeset
47 pragma Elaborate_Body;
kono
parents:
diff changeset
48
kono
parents:
diff changeset
49
kono
parents:
diff changeset
50 -- Declarations for visible linked list nodes:
kono
parents:
diff changeset
51
kono
parents:
diff changeset
52 type Node_Type;
kono
parents:
diff changeset
53
kono
parents:
diff changeset
54 type Node_Ptr is access Node_Type;
kono
parents:
diff changeset
55
kono
parents:
diff changeset
56 type Node_Type is new Parent_Type with record -- Record extension
kono
parents:
diff changeset
57 Next : Node_Ptr := null; -- of parent type.
kono
parents:
diff changeset
58 end record;
kono
parents:
diff changeset
59
kono
parents:
diff changeset
60
kono
parents:
diff changeset
61 -- Inherits primitive operations of actual type corresponding
kono
parents:
diff changeset
62 -- to Parent_Type.
kono
parents:
diff changeset
63
kono
parents:
diff changeset
64 -- Add node at head of list.
kono
parents:
diff changeset
65 procedure Add (Item : in Node_Ptr;
kono
parents:
diff changeset
66 Head : in out Node_Ptr);
kono
parents:
diff changeset
67
kono
parents:
diff changeset
68 -- Remove node from head of list and return it.
kono
parents:
diff changeset
69 procedure Remove (Head : in out Node_Ptr;
kono
parents:
diff changeset
70 Item : out Node_Ptr);
kono
parents:
diff changeset
71
kono
parents:
diff changeset
72
kono
parents:
diff changeset
73
kono
parents:
diff changeset
74 -- Declarations for private linked list nodes:
kono
parents:
diff changeset
75
kono
parents:
diff changeset
76 type Priv_Node_Type is new Parent_Type with private; -- Private extension
kono
parents:
diff changeset
77 -- of parent type.
kono
parents:
diff changeset
78
kono
parents:
diff changeset
79 -- Inherits primitive operations of actual parameter corresponding
kono
parents:
diff changeset
80 -- to Parent_Type.
kono
parents:
diff changeset
81
kono
parents:
diff changeset
82
kono
parents:
diff changeset
83 type Priv_Node_Ptr is access Priv_Node_Type;
kono
parents:
diff changeset
84
kono
parents:
diff changeset
85
kono
parents:
diff changeset
86 -- Add node at head of list.
kono
parents:
diff changeset
87 procedure Add (Item : in Priv_Node_Ptr;
kono
parents:
diff changeset
88 Head : in out Priv_Node_Ptr);
kono
parents:
diff changeset
89
kono
parents:
diff changeset
90 -- Remove node from head of list and return it.
kono
parents:
diff changeset
91 procedure Remove (Head : in out Priv_Node_Ptr;
kono
parents:
diff changeset
92 Item : out Priv_Node_Ptr);
kono
parents:
diff changeset
93
kono
parents:
diff changeset
94
kono
parents:
diff changeset
95 private
kono
parents:
diff changeset
96
kono
parents:
diff changeset
97 type Priv_Node_Type is new Parent_Type with record
kono
parents:
diff changeset
98 Next : Priv_Node_Ptr := null;
kono
parents:
diff changeset
99 end record;
kono
parents:
diff changeset
100
kono
parents:
diff changeset
101 end F340A000;
kono
parents:
diff changeset
102
kono
parents:
diff changeset
103
kono
parents:
diff changeset
104 --==================================================================--
kono
parents:
diff changeset
105
kono
parents:
diff changeset
106
kono
parents:
diff changeset
107 package body F340A000 is -- Singly-linked list abstraction.
kono
parents:
diff changeset
108
kono
parents:
diff changeset
109 procedure Add (Item : in Node_Ptr;
kono
parents:
diff changeset
110 Head : in out Node_Ptr) is
kono
parents:
diff changeset
111 begin
kono
parents:
diff changeset
112 if Item /= null then
kono
parents:
diff changeset
113 Item.Next := Head;
kono
parents:
diff changeset
114 Head := Item;
kono
parents:
diff changeset
115 end if;
kono
parents:
diff changeset
116 end Add;
kono
parents:
diff changeset
117
kono
parents:
diff changeset
118
kono
parents:
diff changeset
119 procedure Remove (Head : in out Node_Ptr;
kono
parents:
diff changeset
120 Item : out Node_Ptr) is
kono
parents:
diff changeset
121 begin
kono
parents:
diff changeset
122 Item := Head;
kono
parents:
diff changeset
123 if Head /= null then
kono
parents:
diff changeset
124 Head := Head.Next;
kono
parents:
diff changeset
125 end if;
kono
parents:
diff changeset
126 end Remove;
kono
parents:
diff changeset
127
kono
parents:
diff changeset
128
kono
parents:
diff changeset
129 procedure Add (Item : in Priv_Node_Ptr;
kono
parents:
diff changeset
130 Head : in out Priv_Node_Ptr) is
kono
parents:
diff changeset
131 begin
kono
parents:
diff changeset
132 if Item /= null then
kono
parents:
diff changeset
133 Item.Next := Head;
kono
parents:
diff changeset
134 Head := Item;
kono
parents:
diff changeset
135 end if;
kono
parents:
diff changeset
136 end Add;
kono
parents:
diff changeset
137
kono
parents:
diff changeset
138
kono
parents:
diff changeset
139 procedure Remove (Head : in out Priv_Node_Ptr;
kono
parents:
diff changeset
140 Item : out Priv_Node_Ptr) is
kono
parents:
diff changeset
141 begin
kono
parents:
diff changeset
142 Item := Head;
kono
parents:
diff changeset
143 if Head /= null then
kono
parents:
diff changeset
144 Head := Head.Next;
kono
parents:
diff changeset
145 end if;
kono
parents:
diff changeset
146 end Remove;
kono
parents:
diff changeset
147
kono
parents:
diff changeset
148
kono
parents:
diff changeset
149 end F340A000;