OSDN Git Service

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