]>
Commit | Line | Data |
---|---|---|
6aba47ca | 1 | -- Copyright 2005, 2007 Free Software Foundation, Inc. |
2336bb58 JB |
2 | -- |
3 | -- This program is free software; you can redistribute it and/or modify | |
4 | -- it under the terms of the GNU General Public License as published by | |
5 | -- the Free Software Foundation; either version 2 of the License, or | |
6 | -- (at your option) any later version. | |
7 | -- | |
8 | -- This program is distributed in the hope that it will be useful, | |
9 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of | |
10 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
11 | -- GNU General Public License for more details. | |
12 | -- | |
13 | -- You should have received a copy of the GNU General Public License | |
14 | -- along with this program; if not, write to the Free Software | |
15 | -- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, | |
16 | -- MA 02110-1301, USA | |
17 | ||
18 | procedure P is | |
19 | type Index is (One, Two, Three); | |
20 | ||
21 | type Table is array (Integer range 1 .. 3) of Integer; | |
22 | type ETable is array (Index) of Integer; | |
23 | type RTable is array (Index range Two .. Three) of Integer; | |
24 | type UTable is array (Positive range <>) of Integer; | |
25 | ||
26 | type PTable is array (Index) of Boolean; | |
27 | pragma Pack (PTable); | |
28 | ||
29 | function Get_UTable (I : Integer) return UTable is | |
30 | begin | |
31 | return Utable'(1 => I, 2 => 2, 3 => 3); | |
32 | end Get_UTable; | |
33 | ||
34 | One_Two_Three : Table := (1, 2, 3); | |
35 | E_One_Two_Three : ETable := (1, 2, 3); | |
36 | R_Two_Three : RTable := (2, 3); | |
37 | U_One_Two_Three : UTable := Get_UTable (1); | |
38 | P_One_Two_Three : PTable := (False, True, True); | |
39 | ||
40 | Few_Reps : UTable := (1, 2, 3, 3, 3, 3, 3, 4, 5); | |
41 | Many_Reps : UTable := (1, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 5); | |
42 | ||
43 | Empty : array (1 .. 0) of Integer := (others => 0); | |
44 | ||
45 | begin | |
46 | One_Two_Three (1) := 4; -- START | |
47 | E_One_Two_Three (One) := 4; | |
48 | R_Two_Three (Two) := 4; | |
49 | U_One_Two_Three (U_One_Two_Three'First) := 4; | |
50 | P_One_Two_Three (One) := True; | |
51 | ||
52 | Few_Reps (Few_Reps'First) := 2; | |
53 | Many_Reps (Many_Reps'First) := 2; | |
54 | ||
55 | Empty := (others => 1); | |
56 | end P; |