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