home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / gnat-2.06-src.tgz / tar.out / fsf / gnat / ada / a-swmwco.ads < prev    next >
Text File  |  1996-09-28  |  18KB  |  417 lines

  1. ------------------------------------------------------------------------------
  2. --                                                                          --
  3. --                         GNAT RUNTIME COMPONENTS                          --
  4. --                                                                          --
  5. -- 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  --
  6. --                                                                          --
  7. --                                 S p e c                                  --
  8. --                                                                          --
  9. --                            $Revision: 1.10 $                             --
  10. --                                                                          --
  11. --        Copyright (c) 1992,1993,1994,1995 NYU, All Rights Reserved        --
  12. --                                                                          --
  13. -- GNAT is free software;  you can  redistribute it  and/or modify it under --
  14. -- terms of the  GNU General Public License as published  by the Free Soft- --
  15. -- ware  Foundation;  either version 2,  or (at your option) any later ver- --
  16. -- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
  17. -- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
  18. -- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License --
  19. -- for  more details.  You should have  received  a copy of the GNU General --
  20. -- Public License  distributed with GNAT;  see file COPYING.  If not, write --
  21. -- to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. --
  22. --                                                                          --
  23. ------------------------------------------------------------------------------
  24.  
  25.  
  26. with Ada.Characters.Wide_Latin_1;
  27.  
  28. package Ada.Strings.Wide_Maps.Wide_Constants is
  29. pragma Preelaborate (Wide_Constants);
  30.  
  31.    use Ada.Characters.Wide_Latin_1;
  32.  
  33.    Control_Set           : constant Wide_Maps.Wide_Character_Set;
  34.    Graphic_Set           : constant Wide_Maps.Wide_Character_Set;
  35.    Letter_Set            : constant Wide_Maps.Wide_Character_Set;
  36.    Lower_Set             : constant Wide_Maps.Wide_Character_Set;
  37.    Upper_Set             : constant Wide_Maps.Wide_Character_Set;
  38.    Basic_Set             : constant Wide_Maps.Wide_Character_Set;
  39.    Decimal_Digit_Set     : constant Wide_Maps.Wide_Character_Set;
  40.    Hexadecimal_Digit_Set : constant Wide_Maps.Wide_Character_Set;
  41.    Alphanumeric_Set      : constant Wide_Maps.Wide_Character_Set;
  42.    Special_Graphic_Set   : constant Wide_Maps.Wide_Character_Set;
  43.    ISO_646_Set           : constant Wide_Maps.Wide_Character_Set;
  44.    Character_Set         : constant Wide_Maps.Wide_Character_Set;
  45.  
  46.    Lower_Case_Map        : constant Wide_Maps.Wide_Character_Mapping;
  47.    --  Maps to lower case for letters, else identity
  48.  
  49.    Upper_Case_Map        : constant Wide_Maps.Wide_Character_Mapping;
  50.    --  Maps to upper case for letters, else identity
  51.  
  52.    Basic_Map             : constant Wide_Maps.Wide_Character_Mapping;
  53.    --  Maps to basic letter for letters, else identity
  54.  
  55. private
  56.    subtype WC is Wide_Character;
  57.  
  58.    Control_Ranges           : aliased constant Wide_Character_Ranges :=
  59.      ((NUL, US),
  60.       (DEL, APC));
  61.  
  62.    Control_Set              : constant Wide_Character_Set            :=
  63.                                 Control_Ranges'Access;
  64.  
  65.    Graphic_Ranges           : aliased constant Wide_Character_Ranges :=
  66.      ((' ',          Tilde),
  67.       (WC'Val (256), WC'Last));
  68.  
  69.    Graphic_Set              : constant Wide_Character_Set            :=
  70.                                 Graphic_Ranges'Access;
  71.  
  72.    Letter_Ranges            : aliased constant Wide_Character_Ranges :=
  73.      (('A',                 'Z'),
  74.       ('a',                 'z'),
  75.       (UC_A_Grave,          UC_O_Diaeresis),
  76.       (UC_O_Oblique_Stroke, LC_O_Diaeresis),
  77.       (LC_O_Oblique_Stroke, LC_Y_Diaeresis));
  78.  
  79.    Letter_Set               : constant Wide_Character_Set            :=
  80.                                 Letter_Ranges'Access;
  81.  
  82.    Lower_Ranges             : aliased constant Wide_Character_Ranges :=
  83.      (1 => ('a',                 'z'),
  84.       2 => (LC_German_Sharp_S,   LC_O_Diaeresis),
  85.       3 => (LC_O_Oblique_Stroke, LC_Y_Diaeresis));
  86.  
  87.    Lower_Set                : constant Wide_Character_Set            :=
  88.                                 Lower_Ranges'Access;
  89.  
  90.    Upper_Ranges             : aliased constant Wide_Character_Ranges :=
  91.      (1 => ('A',                 'Z'),
  92.       2 => (UC_A_Grave,          UC_O_Diaeresis),
  93.       3 => (UC_O_Oblique_Stroke, UC_Icelandic_Thorn));
  94.  
  95.    Upper_Set                : constant Wide_Character_Set            :=
  96.                                 Upper_Ranges'Access;
  97.  
  98.    Basic_Ranges             : aliased constant Wide_Character_Ranges :=
  99.      (1 => ('A',                 'Z'),
  100.       2 => ('a',                 'z'),
  101.       3 => (UC_AE_Diphthong,     UC_AE_Diphthong),
  102.       4 => (LC_AE_Diphthong,     LC_AE_Diphthong),
  103.       5 => (LC_German_Sharp_S,   LC_German_Sharp_S),
  104.       6 => (UC_Icelandic_Thorn,  UC_Icelandic_Thorn),
  105.       7 => (LC_Icelandic_Thorn,  LC_Icelandic_Thorn),
  106.       8 => (UC_Icelandic_Eth,    UC_Icelandic_Eth),
  107.       9 => (LC_Icelandic_Eth,    LC_Icelandic_Eth));
  108.  
  109.    Basic_Set                : constant Wide_Character_Set            :=
  110.                                 Basic_Ranges'Access;
  111.  
  112.    Decimal_Digit_Ranges     : aliased constant Wide_Character_Ranges :=
  113.      (1 => ('0', '9'));
  114.  
  115.    Decimal_Digit_Set        : constant Wide_Character_Set :=
  116.                                 Decimal_Digit_Ranges'Access;
  117.  
  118.    Hexadecimal_Digit_Ranges : aliased constant Wide_Character_Ranges :=
  119.      (1 => ('0', '9'),
  120.       2 => ('A', 'F'),
  121.       3 => ('a', 'f'));
  122.  
  123.    Hexadecimal_Digit_Set    : constant Wide_Character_Set :=
  124.                                 Hexadecimal_Digit_Ranges'Access;
  125.  
  126.    Alphanumeric_Ranges      : aliased constant Wide_Character_Ranges :=
  127.      (1 => ('0',                 '9'),
  128.       2 => ('A',                 'Z'),
  129.       3 => ('a',                 'z'),
  130.       4 => (UC_A_Grave,          UC_O_Diaeresis),
  131.       5 => (UC_O_Oblique_Stroke, LC_O_Diaeresis),
  132.       6 => (LC_O_Oblique_Stroke, LC_Y_Diaeresis));
  133.  
  134.    Alphanumeric_Set         : constant Wide_Character_Set            :=
  135.                                 Alphanumeric_Ranges'Access;
  136.  
  137.    Special_Graphic_Ranges   : aliased constant Wide_Character_Ranges :=
  138.      (1 => (Wide_Space,          Solidus),
  139.       2 => (Colon,               Commercial_At),
  140.       3 => (Left_Square_Bracket, Grave),
  141.       4 => (Left_Curly_Bracket,  Tilde),
  142.       5 => (No_Break_Space,      Inverted_Question),
  143.       6 => (Multiplication_Sign, Multiplication_Sign),
  144.       7 => (Division_Sign,       Division_Sign));
  145.  
  146.    Special_Graphic_Set      : constant Wide_Character_Set            :=
  147.                                 Special_Graphic_Ranges'Access;
  148.  
  149.    ISO_646_Ranges           : aliased constant Wide_Character_Ranges :=
  150.      (1 => (NUL, DEL));
  151.  
  152.    ISO_646_Set              : constant Wide_Character_Set            :=
  153.                                 ISO_646_Ranges'Access;
  154.  
  155.    Character_Ranges         : aliased constant Wide_Character_Ranges :=
  156.      (1 => (NUL, WC'Val (255)));
  157.  
  158.    Character_Set            : constant Wide_Character_Set :=
  159.                                 Character_Ranges'Access;
  160.  
  161.    Lower_From : aliased constant Wide_Character_Sequence :=
  162.      "ABCDEFGHIJKLMNOPQRSTUVWXYZ"  &
  163.       UC_A_Grave                   &
  164.       UC_A_Acute                   &
  165.       UC_A_Circumflex              &
  166.       UC_A_Tilde                   &
  167.       UC_A_Diaeresis               &
  168.       UC_A_Ring                    &
  169.       UC_AE_Diphthong              &
  170.       UC_C_Cedilla                 &
  171.       UC_E_Grave                   &
  172.       UC_E_Acute                   &
  173.       UC_E_Circumflex              &
  174.       UC_E_Diaeresis               &
  175.       UC_I_Grave                   &
  176.       UC_I_Acute                   &
  177.       UC_I_Circumflex              &
  178.       UC_I_Diaeresis               &
  179.       UC_Icelandic_Eth             &
  180.       UC_N_Tilde                   &
  181.       UC_O_Grave                   &
  182.       UC_O_Acute                   &
  183.       UC_O_Circumflex              &
  184.       UC_O_Tilde                   &
  185.       UC_O_Diaeresis               &
  186.       UC_O_Oblique_Stroke          &
  187.       UC_U_Grave                   &
  188.       UC_U_Acute                   &
  189.       UC_U_Circumflex              &
  190.       UC_U_Diaeresis               &
  191.       UC_Y_Acute                   &
  192.       UC_Icelandic_Thorn;
  193.  
  194.    Lower_To : aliased constant Wide_Character_Sequence :=
  195.      "abcdefghijklmnopqrstuvwxyz"  &
  196.       LC_A_Grave                   &
  197.       LC_A_Acute                   &
  198.       LC_A_Circumflex              &
  199.       LC_A_Tilde                   &
  200.       LC_A_Diaeresis               &
  201.       LC_A_Ring                    &
  202.       LC_AE_Diphthong              &
  203.       LC_C_Cedilla                 &
  204.       LC_E_Grave                   &
  205.       LC_E_Acute                   &
  206.       LC_E_Circumflex              &
  207.       LC_E_Diaeresis               &
  208.       LC_I_Grave                   &
  209.       LC_I_Acute                   &
  210.       LC_I_Circumflex              &
  211.       LC_I_Diaeresis               &
  212.       LC_Icelandic_Eth             &
  213.       LC_N_Tilde                   &
  214.       LC_O_Grave                   &
  215.       LC_O_Acute                   &
  216.       LC_O_Circumflex              &
  217.       LC_O_Tilde                   &
  218.       LC_O_Diaeresis               &
  219.       LC_O_Oblique_Stroke          &
  220.       LC_U_Grave                   &
  221.       LC_U_Acute                   &
  222.       LC_U_Circumflex              &
  223.       LC_U_Diaeresis               &
  224.       LC_Y_Acute                   &
  225.       LC_Icelandic_Thorn;
  226.  
  227.    Lower_Case_Map : constant Wide_Character_Mapping :=
  228.      Wide_Character_Mapping' (Lower_From'Access, Lower_To'Access);
  229.  
  230.    Upper_From : aliased constant Wide_Character_Sequence :=
  231.      "abcdefghijklmnopqrstuvwxyz"  &
  232.       LC_A_Grave                   &
  233.       LC_A_Acute                   &
  234.       LC_A_Circumflex              &
  235.       LC_A_Tilde                   &
  236.       LC_A_Diaeresis               &
  237.       LC_A_Ring                    &
  238.       LC_AE_Diphthong              &
  239.       LC_C_Cedilla                 &
  240.       LC_E_Grave                   &
  241.       LC_E_Acute                   &
  242.       LC_E_Circumflex              &
  243.       LC_E_Diaeresis               &
  244.       LC_I_Grave                   &
  245.       LC_I_Acute                   &
  246.       LC_I_Circumflex              &
  247.       LC_I_Diaeresis               &
  248.       LC_Icelandic_Eth             &
  249.       LC_N_Tilde                   &
  250.       LC_O_Grave                   &
  251.       LC_O_Acute                   &
  252.       LC_O_Circumflex              &
  253.       LC_O_Tilde                   &
  254.       LC_O_Diaeresis               &
  255.       LC_O_Oblique_Stroke          &
  256.       LC_U_Grave                   &
  257.       LC_U_Acute                   &
  258.       LC_U_Circumflex              &
  259.       LC_U_Diaeresis               &
  260.       LC_Y_Acute                   &
  261.       LC_Icelandic_Thorn;
  262.  
  263.    Upper_To : aliased constant Wide_Character_Sequence :=
  264.      "ABCDEFGHIJKLMNOPQRSTUVWXYZ"  &
  265.       UC_A_Grave                   &
  266.       UC_A_Acute                   &
  267.       UC_A_Circumflex              &
  268.       UC_A_Tilde                   &
  269.       UC_A_Diaeresis               &
  270.       UC_A_Ring                    &
  271.       UC_AE_Diphthong              &
  272.       UC_C_Cedilla                 &
  273.       UC_E_Grave                   &
  274.       UC_E_Acute                   &
  275.       UC_E_Circumflex              &
  276.       UC_E_Diaeresis               &
  277.       UC_I_Grave                   &
  278.       UC_I_Acute                   &
  279.       UC_I_Circumflex              &
  280.       UC_I_Diaeresis               &
  281.       UC_Icelandic_Eth             &
  282.       UC_N_Tilde                   &
  283.       UC_O_Grave                   &
  284.       UC_O_Acute                   &
  285.       UC_O_Circumflex              &
  286.       UC_O_Tilde                   &
  287.       UC_O_Diaeresis               &
  288.       UC_O_Oblique_Stroke          &
  289.       UC_U_Grave                   &
  290.       UC_U_Acute                   &
  291.       UC_U_Circumflex              &
  292.       UC_U_Diaeresis               &
  293.       UC_Y_Acute                   &
  294.       UC_Icelandic_Thorn;
  295.  
  296.    Upper_Case_Map : constant Wide_Character_Mapping :=
  297.      Wide_Character_Mapping' (Upper_From'Access, Upper_To'Access);
  298.  
  299.    Basic_From : aliased constant Wide_Character_Sequence :=
  300.       UC_A_Grave                    &
  301.       UC_A_Acute                    &
  302.       UC_A_Circumflex               &
  303.       UC_A_Tilde                    &
  304.       UC_A_Diaeresis                &
  305.       UC_A_Ring                     &
  306.       UC_C_Cedilla                  &
  307.       UC_E_Grave                    &
  308.       UC_E_Acute                    &
  309.       UC_E_Circumflex               &
  310.       UC_E_Diaeresis                &
  311.       UC_I_Grave                    &
  312.       UC_I_Acute                    &
  313.       UC_I_Circumflex               &
  314.       UC_I_Diaeresis                &
  315.       UC_N_Tilde                    &
  316.       UC_O_Grave                    &
  317.       UC_O_Acute                    &
  318.       UC_O_Circumflex               &
  319.       UC_O_Tilde                    &
  320.       UC_O_Diaeresis                &
  321.       UC_O_Oblique_Stroke           &
  322.       UC_U_Grave                    &
  323.       UC_U_Acute                    &
  324.       UC_U_Circumflex               &
  325.       UC_U_Diaeresis                &
  326.       UC_Y_Acute                    &
  327.       LC_A_Grave                    &
  328.       LC_A_Acute                    &
  329.       LC_A_Circumflex               &
  330.       LC_A_Tilde                    &
  331.       LC_A_Diaeresis                &
  332.       LC_A_Ring                     &
  333.       LC_C_Cedilla                  &
  334.       LC_E_Grave                    &
  335.       LC_E_Acute                    &
  336.       LC_E_Circumflex               &
  337.       LC_E_Diaeresis                &
  338.       LC_I_Grave                    &
  339.       LC_I_Acute                    &
  340.       LC_I_Circumflex               &
  341.       LC_I_Diaeresis                &
  342.       LC_N_Tilde                    &
  343.       LC_O_Grave                    &
  344.       LC_O_Acute                    &
  345.       LC_O_Circumflex               &
  346.       LC_O_Tilde                    &
  347.       LC_O_Diaeresis                &
  348.       LC_O_Oblique_Stroke           &
  349.       LC_U_Grave                    &
  350.       LC_U_Acute                    &
  351.       LC_U_Circumflex               &
  352.       LC_U_Diaeresis                &
  353.       LC_Y_Acute                    &
  354.       LC_Y_Diaeresis;
  355.  
  356.    Basic_To : aliased constant Wide_Character_Sequence :=
  357.       'A'                           &  -- UC_A_Grave
  358.       'A'                           &  -- UC_A_Acute
  359.       'A'                           &  -- UC_A_Circumflex
  360.       'A'                           &  -- UC_A_Tilde
  361.       'A'                           &  -- UC_A_Diaeresis
  362.       'A'                           &  -- UC_A_Ring
  363.       'C'                           &  -- UC_C_Cedilla
  364.       'E'                           &  -- UC_E_Grave
  365.       'E'                           &  -- UC_E_Acute
  366.       'E'                           &  -- UC_E_Circumflex
  367.       'E'                           &  -- UC_E_Diaeresis
  368.       'I'                           &  -- UC_I_Grave
  369.       'I'                           &  -- UC_I_Acute
  370.       'I'                           &  -- UC_I_Circumflex
  371.       'I'                           &  -- UC_I_Diaeresis
  372.       'N'                           &  -- UC_N_Tilde
  373.       'O'                           &  -- UC_O_Grave
  374.       'O'                           &  -- UC_O_Acute
  375.       'O'                           &  -- UC_O_Circumflex
  376.       'O'                           &  -- UC_O_Tilde
  377.       'O'                           &  -- UC_O_Diaeresis
  378.       'O'                           &  -- UC_O_Oblique_Stroke
  379.       'U'                           &  -- UC_U_Grave
  380.       'U'                           &  -- UC_U_Acute
  381.       'U'                           &  -- UC_U_Circumflex
  382.       'U'                           &  -- UC_U_Diaeresis
  383.       'Y'                           &  -- UC_Y_Acute
  384.       'a'                           &  -- LC_A_Grave
  385.       'a'                           &  -- LC_A_Acute
  386.       'a'                           &  -- LC_A_Circumflex
  387.       'a'                           &  -- LC_A_Tilde
  388.       'a'                           &  -- LC_A_Diaeresis
  389.       'a'                           &  -- LC_A_Ring
  390.       'c'                           &  -- LC_C_Cedilla
  391.       'e'                           &  -- LC_E_Grave
  392.       'e'                           &  -- LC_E_Acute
  393.       'e'                           &  -- LC_E_Circumflex
  394.       'e'                           &  -- LC_E_Diaeresis
  395.       'i'                           &  -- LC_I_Grave
  396.       'i'                           &  -- LC_I_Acute
  397.       'i'                           &  -- LC_I_Circumflex
  398.       'i'                           &  -- LC_I_Diaeresis
  399.       'n'                           &  -- LC_N_Tilde
  400.       'o'                           &  -- LC_O_Grave
  401.       'o'                           &  -- LC_O_Acute
  402.       'o'                           &  -- LC_O_Circumflex
  403.       'o'                           &  -- LC_O_Tilde
  404.       'o'                           &  -- LC_O_Diaeresis
  405.       'o'                           &  -- LC_O_Oblique_Stroke
  406.       'u'                           &  -- LC_U_Grave
  407.       'u'                           &  -- LC_U_Acute
  408.       'u'                           &  -- LC_U_Circumflex
  409.       'u'                           &  -- LC_U_Diaeresis
  410.       'y'                           &  -- LC_Y_Acute
  411.       'y';                             -- LC_Y_Diaeresis
  412.  
  413.    Basic_Map : constant Wide_Character_Mapping :=
  414.      Wide_Character_Mapping' (Basic_From'Access, Basic_To'Access);
  415.  
  416. end Ada.Strings.Wide_Maps.Wide_Constants;
  417.