------------------------------------------------------------------------------
--                                                                          --
--                         GNAT RUNTIME COMPONENTS                          --
--                                                                          --
-- A D A . S T R I N G S . W I D E _ M A P S . W I D E _ C O N S T A N T S  --
--                                                                          --
--                                 S p e c                                  --
--                                                                          --
--                            $Revision: 1.7 $                              --
--                                                                          --
--           Copyright (c) 1992,1993,1994 NYU, All Rights Reserved          --
--                                                                          --
-- GNAT is free software;  you can  redistribute it  and/or modify it under --
-- terms of the  GNU General Public License as published  by the Free Soft- --
-- ware  Foundation;  either version 2,  or (at your option) any later ver- --
-- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License --
-- for  more details.  You should have  received  a copy of the GNU General --
-- Public License  distributed with GNAT;  see file COPYING.  If not, write --
-- to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. --
--                                                                          --
------------------------------------------------------------------------------


with Ada.Characters.Wide_Latin_1; use Ada.Characters.Wide_Latin_1;

package Ada.Strings.Wide_Maps.Wide_Constants is

   Control_Set           : constant Wide_Maps.Wide_Character_Set;
   Graphic_Set           : constant Wide_Maps.Wide_Character_Set;
   Letter_Set            : constant Wide_Maps.Wide_Character_Set;
   Lower_Set             : constant Wide_Maps.Wide_Character_Set;
   Upper_Set             : constant Wide_Maps.Wide_Character_Set;
   Basic_Set             : constant Wide_Maps.Wide_Character_Set;
   Decimal_Digit_Set     : constant Wide_Maps.Wide_Character_Set;
   Hexadecimal_Digit_Set : constant Wide_Maps.Wide_Character_Set;
   Alphanumeric_Set      : constant Wide_Maps.Wide_Character_Set;
   Special_Graphic_Set   : constant Wide_Maps.Wide_Character_Set;
   ISO_646_Set           : constant Wide_Maps.Wide_Character_Set;
   Character_Set         : constant Wide_Maps.Wide_Character_Set;

   Lower_Case_Map        : constant Wide_Maps.Wide_Character_Mapping;
   --  Maps to lower case for letters, else identity

private

   function To_Set_R
     (Ranges : in Wide_Character_Ranges)
      return   Wide_Character_Set
   renames To_Set;

   function To_Set_S
     (Span : in Wide_Character_Range)
      return Wide_Character_Set
   renames To_Set;

   subtype WC is Wide_Character;

   Control_Set           : constant Wide_Character_Set := To_Set_R (
     ((NUL,                 US),
      (DEL,                 APC)));

   Graphic_Set           : constant Wide_Character_Set := To_Set_R (
     ((' ',                 Tilde),
      (WC'Val (256),        WC'Last)));

   Letter_Set            : constant Wide_Character_Set := To_Set_R (
     (('A',                 'Z'),
      ('a',                 'z'),
      (UC_A_Grave,          UC_O_Diaeresis),
      (UC_O_Oblique_Stroke, LC_O_Diaeresis),
      (LC_O_Oblique_Stroke, LC_Y_Diaeresis)));

   Lower_Set             : constant Wide_Character_Set := To_Set_R (
     (('a',                 'z'),
      (LC_German_Sharp_S,   LC_O_Diaeresis),
      (LC_O_Oblique_Stroke, LC_Y_Diaeresis)));

   Upper_Set             : constant Wide_Character_Set := To_Set_R (
     (('A',                 'Z'),
      (UC_A_Grave,          UC_O_Diaeresis),
      (UC_O_Oblique_Stroke, UC_Icelandic_Thorn)));

   Basic_Set             : constant Wide_Character_Set := To_Set_R (
     (('A',                 'Z'),
      ('a',                 'z'),
      (UC_AE_Diphthong,     UC_AE_Diphthong),
      (LC_AE_Diphthong,     LC_AE_Diphthong),
      (LC_German_Sharp_S,   LC_German_Sharp_S),
      (UC_Icelandic_Thorn,  UC_Icelandic_Thorn),
      (LC_Icelandic_Thorn,  LC_Icelandic_Thorn),
      (UC_Icelandic_Eth,    UC_Icelandic_Eth),
      (LC_Icelandic_Eth,    LC_Icelandic_Eth)));

   Decimal_Digit_Set     : constant Wide_Character_Set := To_Set_S
     (('0',                 '9'));

   Hexadecimal_Digit_Set : constant Wide_Character_Set := To_Set_R (
     (('0',                 '9'),
      ('A',                 'F'),
      ('a',                 'f')));

   Alphanumeric_Set      : constant Wide_Character_Set := To_Set_R (
     (('0',                 '9'),
      ('A',                 'Z'),
      ('a',                 'z'),
      (UC_A_Grave,          UC_O_Diaeresis),
      (UC_O_Oblique_Stroke, LC_O_Diaeresis),
      (LC_O_Oblique_Stroke, LC_Y_Diaeresis)));

   Special_Graphic_Set   : constant Wide_Character_Set := To_Set_R (
     ((Wide_Space,          Solidus),
      (Colon,               Commercial_At),
      (Left_Square_Bracket, Grave),
      (Left_Curly_Bracket,  Tilde),
      (No_Break_Space,      Inverted_Question),
      (Multiplication_Sign, Multiplication_Sign),
      (Division_Sign,       Division_Sign)));

   ISO_646_Set           : constant Wide_Character_Set := To_Set_S
     ((NUL,                 DEL));

   Character_Set         : constant Wide_Character_Set := To_Set_S
     ((NUL,                 WC'Val (255)));

   Lower_Case_Map : constant Wide_Character_Mapping    := To_Mapping
     ("ABCDEFGHIJKLMNOPQRSTUVWXYZ"  &
       UC_A_Grave                   &
       UC_A_Acute                   &
       UC_A_Circumflex              &
       UC_A_Tilde                   &
       UC_A_Diaeresis               &
       UC_A_Ring                    &
       UC_AE_Diphthong              &
       UC_C_Cedilla                 &
       UC_E_Grave                   &
       UC_E_Acute                   &
       UC_E_Circumflex              &
       UC_E_Diaeresis               &
       UC_I_Grave                   &
       UC_I_Acute                   &
       UC_I_Circumflex              &
       UC_I_Diaeresis               &
       UC_Icelandic_Eth             &
       UC_N_Tilde                   &
       UC_O_Grave                   &
       UC_O_Acute                   &
       UC_O_Circumflex              &
       UC_O_Tilde                   &
       UC_O_Diaeresis               &
       UC_O_Oblique_Stroke          &
       UC_U_Grave                   &
       UC_U_Acute                   &
       UC_U_Circumflex              &
       UC_U_Diaeresis               &
       UC_Y_Acute                   &
       UC_Icelandic_Thorn,

      "abcdefghijklmnopqrstuvwxyz"  &
       LC_A_Grave                   &
       LC_A_Acute                   &
       LC_A_Circumflex              &
       LC_A_Tilde                   &
       LC_A_Diaeresis               &
       LC_A_Ring                    &
       LC_AE_Diphthong              &
       LC_C_Cedilla                 &
       LC_E_Grave                   &
       LC_E_Acute                   &
       LC_E_Circumflex              &
       LC_E_Diaeresis               &
       LC_I_Grave                   &
       LC_I_Acute                   &
       LC_I_Circumflex              &
       LC_I_Diaeresis               &
       LC_Icelandic_Eth             &
       LC_N_Tilde                   &
       LC_O_Grave                   &
       LC_O_Acute                   &
       LC_O_Circumflex              &
       LC_O_Tilde                   &
       LC_O_Diaeresis               &
       LC_O_Oblique_Stroke          &
       LC_U_Grave                   &
       LC_U_Acute                   &
       LC_U_Circumflex              &
       LC_U_Diaeresis               &
       LC_Y_Acute                   &
       LC_Icelandic_Thorn);

end Ada.Strings.Wide_Maps.Wide_Constants;
