Remove some compile time warnings about duplicate definitions.
[official-gcc.git] / gcc / ada / csets.adb
blob6855f4dc0afcd631396fa875e8349d681bb14631
1 ------------------------------------------------------------------------------
2 -- --
3 -- GNAT COMPILER COMPONENTS --
4 -- --
5 -- C S E T S --
6 -- --
7 -- B o d y --
8 -- --
9 -- $Revision: 1.25 $
10 -- --
11 -- Copyright (C) 1992-2001, Free Software Foundation, Inc. --
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, 59 Temple Place - Suite 330, Boston, --
22 -- MA 02111-1307, USA. --
23 -- --
24 -- As a special exception, if other files instantiate generics from this --
25 -- unit, or you link this unit with other files to produce an executable, --
26 -- this unit does not by itself cause the resulting executable to be --
27 -- covered by the GNU General Public License. This exception does not --
28 -- however invalidate any other reasons why the executable file might be --
29 -- covered by the GNU Public License. --
30 -- --
31 -- GNAT was originally developed by the GNAT team at New York University. --
32 -- It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). --
33 -- --
34 ------------------------------------------------------------------------------
36 with Opt; use Opt;
38 with System.WCh_Con; use System.WCh_Con;
40 package body Csets is
42 X_80 : constant Character := Character'Val (16#80#);
43 X_81 : constant Character := Character'Val (16#81#);
44 X_82 : constant Character := Character'Val (16#82#);
45 X_83 : constant Character := Character'Val (16#83#);
46 X_84 : constant Character := Character'Val (16#84#);
47 X_85 : constant Character := Character'Val (16#85#);
48 X_86 : constant Character := Character'Val (16#86#);
49 X_87 : constant Character := Character'Val (16#87#);
50 X_88 : constant Character := Character'Val (16#88#);
51 X_89 : constant Character := Character'Val (16#89#);
52 X_8A : constant Character := Character'Val (16#8A#);
53 X_8B : constant Character := Character'Val (16#8B#);
54 X_8C : constant Character := Character'Val (16#8C#);
55 X_8D : constant Character := Character'Val (16#8D#);
56 X_8E : constant Character := Character'Val (16#8E#);
57 X_8F : constant Character := Character'Val (16#8F#);
58 X_90 : constant Character := Character'Val (16#90#);
59 X_91 : constant Character := Character'Val (16#91#);
60 X_92 : constant Character := Character'Val (16#92#);
61 X_93 : constant Character := Character'Val (16#93#);
62 X_94 : constant Character := Character'Val (16#94#);
63 X_95 : constant Character := Character'Val (16#95#);
64 X_96 : constant Character := Character'Val (16#96#);
65 X_97 : constant Character := Character'Val (16#97#);
66 X_98 : constant Character := Character'Val (16#98#);
67 X_99 : constant Character := Character'Val (16#99#);
68 X_9A : constant Character := Character'Val (16#9A#);
69 X_9B : constant Character := Character'Val (16#9B#);
70 X_9C : constant Character := Character'Val (16#9C#);
71 X_9D : constant Character := Character'Val (16#9D#);
72 X_9E : constant Character := Character'Val (16#9E#);
73 X_9F : constant Character := Character'Val (16#9F#);
74 X_A0 : constant Character := Character'Val (16#A0#);
75 X_A1 : constant Character := Character'Val (16#A1#);
76 X_A2 : constant Character := Character'Val (16#A2#);
77 X_A3 : constant Character := Character'Val (16#A3#);
78 X_A4 : constant Character := Character'Val (16#A4#);
79 X_A5 : constant Character := Character'Val (16#A5#);
80 X_A6 : constant Character := Character'Val (16#A6#);
81 X_A7 : constant Character := Character'Val (16#A7#);
82 X_A8 : constant Character := Character'Val (16#A8#);
83 X_A9 : constant Character := Character'Val (16#A9#);
84 X_AA : constant Character := Character'Val (16#AA#);
85 X_AB : constant Character := Character'Val (16#AB#);
86 X_AC : constant Character := Character'Val (16#AC#);
87 X_AD : constant Character := Character'Val (16#AD#);
88 X_AE : constant Character := Character'Val (16#AE#);
89 X_AF : constant Character := Character'Val (16#AF#);
90 X_B0 : constant Character := Character'Val (16#B0#);
91 X_B1 : constant Character := Character'Val (16#B1#);
92 X_B2 : constant Character := Character'Val (16#B2#);
93 X_B3 : constant Character := Character'Val (16#B3#);
94 X_B4 : constant Character := Character'Val (16#B4#);
95 X_B5 : constant Character := Character'Val (16#B5#);
96 X_B6 : constant Character := Character'Val (16#B6#);
97 X_B7 : constant Character := Character'Val (16#B7#);
98 X_B8 : constant Character := Character'Val (16#B8#);
99 X_B9 : constant Character := Character'Val (16#B9#);
100 X_BA : constant Character := Character'Val (16#BA#);
101 X_BB : constant Character := Character'Val (16#BB#);
102 X_BC : constant Character := Character'Val (16#BC#);
103 X_BD : constant Character := Character'Val (16#BD#);
104 X_BE : constant Character := Character'Val (16#BE#);
105 X_BF : constant Character := Character'Val (16#BF#);
106 X_C0 : constant Character := Character'Val (16#C0#);
107 X_C1 : constant Character := Character'Val (16#C1#);
108 X_C2 : constant Character := Character'Val (16#C2#);
109 X_C3 : constant Character := Character'Val (16#C3#);
110 X_C4 : constant Character := Character'Val (16#C4#);
111 X_C5 : constant Character := Character'Val (16#C5#);
112 X_C6 : constant Character := Character'Val (16#C6#);
113 X_C7 : constant Character := Character'Val (16#C7#);
114 X_C8 : constant Character := Character'Val (16#C8#);
115 X_C9 : constant Character := Character'Val (16#C9#);
116 X_CA : constant Character := Character'Val (16#CA#);
117 X_CB : constant Character := Character'Val (16#CB#);
118 X_CC : constant Character := Character'Val (16#CC#);
119 X_CD : constant Character := Character'Val (16#CD#);
120 X_CE : constant Character := Character'Val (16#CE#);
121 X_CF : constant Character := Character'Val (16#CF#);
122 X_D0 : constant Character := Character'Val (16#D0#);
123 X_D1 : constant Character := Character'Val (16#D1#);
124 X_D2 : constant Character := Character'Val (16#D2#);
125 X_D3 : constant Character := Character'Val (16#D3#);
126 X_D4 : constant Character := Character'Val (16#D4#);
127 X_D5 : constant Character := Character'Val (16#D5#);
128 X_D6 : constant Character := Character'Val (16#D6#);
129 X_D7 : constant Character := Character'Val (16#D7#);
130 X_D8 : constant Character := Character'Val (16#D8#);
131 X_D9 : constant Character := Character'Val (16#D9#);
132 X_DA : constant Character := Character'Val (16#DA#);
133 X_DB : constant Character := Character'Val (16#DB#);
134 X_DC : constant Character := Character'Val (16#DC#);
135 X_DD : constant Character := Character'Val (16#DD#);
136 X_DE : constant Character := Character'Val (16#DE#);
137 X_DF : constant Character := Character'Val (16#DF#);
138 X_E0 : constant Character := Character'Val (16#E0#);
139 X_E1 : constant Character := Character'Val (16#E1#);
140 X_E2 : constant Character := Character'Val (16#E2#);
141 X_E3 : constant Character := Character'Val (16#E3#);
142 X_E4 : constant Character := Character'Val (16#E4#);
143 X_E5 : constant Character := Character'Val (16#E5#);
144 X_E6 : constant Character := Character'Val (16#E6#);
145 X_E7 : constant Character := Character'Val (16#E7#);
146 X_E8 : constant Character := Character'Val (16#E8#);
147 X_E9 : constant Character := Character'Val (16#E9#);
148 X_EA : constant Character := Character'Val (16#EA#);
149 X_EB : constant Character := Character'Val (16#EB#);
150 X_EC : constant Character := Character'Val (16#EC#);
151 X_ED : constant Character := Character'Val (16#ED#);
152 X_EE : constant Character := Character'Val (16#EE#);
153 X_EF : constant Character := Character'Val (16#EF#);
154 X_F0 : constant Character := Character'Val (16#F0#);
155 X_F1 : constant Character := Character'Val (16#F1#);
156 X_F2 : constant Character := Character'Val (16#F2#);
157 X_F3 : constant Character := Character'Val (16#F3#);
158 X_F4 : constant Character := Character'Val (16#F4#);
159 X_F5 : constant Character := Character'Val (16#F5#);
160 X_F6 : constant Character := Character'Val (16#F6#);
161 X_F7 : constant Character := Character'Val (16#F7#);
162 X_F8 : constant Character := Character'Val (16#F8#);
163 X_F9 : constant Character := Character'Val (16#F9#);
164 X_FA : constant Character := Character'Val (16#FA#);
165 X_FB : constant Character := Character'Val (16#FB#);
166 X_FC : constant Character := Character'Val (16#FC#);
167 X_FD : constant Character := Character'Val (16#FD#);
168 X_FE : constant Character := Character'Val (16#FE#);
169 X_FF : constant Character := Character'Val (16#FF#);
171 -----------------------------
172 -- Definitions for Latin-1 --
173 -----------------------------
175 Fold_Latin_1 : Translate_Table := Translate_Table'(
177 'a' => 'A', X_E0 => X_C0, X_F0 => X_D0,
178 'b' => 'B', X_E1 => X_C1, X_F1 => X_D1,
179 'c' => 'C', X_E2 => X_C2, X_F2 => X_D2,
180 'd' => 'D', X_E3 => X_C3, X_F3 => X_D3,
181 'e' => 'E', X_E4 => X_C4, X_F4 => X_D4,
182 'f' => 'F', X_E5 => X_C5, X_F5 => X_D5,
183 'g' => 'G', X_E6 => X_C6, X_F6 => X_D6,
184 'h' => 'H', X_E7 => X_C7,
185 'i' => 'I', X_E8 => X_C8, X_F8 => X_D8,
186 'j' => 'J', X_E9 => X_C9, X_F9 => X_D9,
187 'k' => 'K', X_EA => X_CA, X_FA => X_DA,
188 'l' => 'L', X_EB => X_CB, X_FB => X_DB,
189 'm' => 'M', X_EC => X_CC, X_FC => X_DC,
190 'n' => 'N', X_ED => X_CD, X_FD => X_DD,
191 'o' => 'O', X_EE => X_CE, X_FE => X_DE,
192 'p' => 'P', X_EF => X_CF,
193 'q' => 'Q',
194 'r' => 'R',
195 's' => 'S',
196 't' => 'T',
197 'u' => 'U',
198 'v' => 'V',
199 'w' => 'W',
200 'x' => 'X',
201 'y' => 'Y',
202 'z' => 'Z',
204 'A' => 'A', X_C0 => X_C0, X_D0 => X_D0,
205 'B' => 'B', X_C1 => X_C1, X_D1 => X_D1,
206 'C' => 'C', X_C2 => X_C2, X_D2 => X_D2,
207 'D' => 'D', X_C3 => X_C3, X_D3 => X_D3,
208 'E' => 'E', X_C4 => X_C4, X_D4 => X_D4,
209 'F' => 'F', X_C5 => X_C5, X_D5 => X_D5,
210 'G' => 'G', X_C6 => X_C6, X_D6 => X_D6,
211 'H' => 'H', X_C7 => X_C7,
212 'I' => 'I', X_C8 => X_C8, X_D8 => X_D8,
213 'J' => 'J', X_C9 => X_C9, X_D9 => X_D9,
214 'K' => 'K', X_CA => X_CA, X_DA => X_DA,
215 'L' => 'L', X_CB => X_CB, X_DB => X_DB,
216 'M' => 'M', X_CC => X_CC, X_DC => X_DC,
217 'N' => 'N', X_CD => X_CD, X_DD => X_DD,
218 'O' => 'O', X_CE => X_CE, X_DE => X_DE,
219 'P' => 'P', X_CF => X_CF, X_DF => X_DF, X_FF => X_FF,
220 'Q' => 'Q',
221 'R' => 'R',
222 'S' => 'S',
223 'T' => 'T',
224 'U' => 'U',
225 'V' => 'V',
226 'W' => 'W',
227 'X' => 'X',
228 'Y' => 'Y',
229 'Z' => 'Z',
231 '0' => '0',
232 '1' => '1',
233 '2' => '2',
234 '3' => '3',
235 '4' => '4',
236 '5' => '5',
237 '6' => '6',
238 '7' => '7',
239 '8' => '8',
240 '9' => '9',
242 '_' => '_',
244 others => ' ');
246 -----------------------------
247 -- Definitions for Latin-2 --
248 -----------------------------
250 Fold_Latin_2 : Translate_Table := Translate_Table'(
252 'a' => 'A', X_E0 => X_C0, X_F0 => X_D0,
253 'b' => 'B', X_E1 => X_C1, X_F1 => X_D1, X_B1 => X_A1,
254 'c' => 'C', X_E2 => X_C2, X_F2 => X_D2,
255 'd' => 'D', X_E3 => X_C3, X_F3 => X_D3, X_B3 => X_A3,
256 'e' => 'E', X_E4 => X_C4, X_F4 => X_D4,
257 'f' => 'F', X_E5 => X_C5, X_F5 => X_D5, X_B5 => X_A5,
258 'g' => 'G', X_E6 => X_C6, X_F6 => X_D6, X_B6 => X_A6,
259 'h' => 'H', X_E7 => X_C7,
260 'i' => 'I', X_E8 => X_C8, X_F8 => X_D8,
261 'j' => 'J', X_E9 => X_C9, X_F9 => X_D9, X_B9 => X_A9,
262 'k' => 'K', X_EA => X_CA, X_FA => X_DA, X_BA => X_AA,
263 'l' => 'L', X_EB => X_CB, X_FB => X_DB, X_BB => X_AB,
264 'm' => 'M', X_EC => X_CC, X_FC => X_DC, X_BC => X_AC,
265 'n' => 'N', X_ED => X_CD, X_FD => X_DD,
266 'o' => 'O', X_EE => X_CE, X_FE => X_DE, X_BE => X_AE,
267 'p' => 'P', X_EF => X_CF, X_FF => X_DF, X_BF => X_AF,
268 'q' => 'Q',
269 'r' => 'R',
270 's' => 'S',
271 't' => 'T',
272 'u' => 'U',
273 'v' => 'V',
274 'w' => 'W',
275 'x' => 'X',
276 'y' => 'Y',
277 'z' => 'Z',
279 'A' => 'A', X_C0 => X_C0, X_D0 => X_D0,
280 'B' => 'B', X_C1 => X_C1, X_D1 => X_D1, X_A1 => X_A1,
281 'C' => 'C', X_C2 => X_C2, X_D2 => X_D2,
282 'D' => 'D', X_C3 => X_C3, X_D3 => X_D3, X_A3 => X_A3,
283 'E' => 'E', X_C4 => X_C4, X_D4 => X_D4,
284 'F' => 'F', X_C5 => X_C5, X_D5 => X_D5, X_A5 => X_A5,
285 'G' => 'G', X_C6 => X_C6, X_D6 => X_D6, X_A6 => X_A6,
286 'H' => 'H', X_C7 => X_C7,
287 'I' => 'I', X_C8 => X_C8, X_D8 => X_D8,
288 'J' => 'J', X_C9 => X_C9, X_D9 => X_D9, X_A9 => X_A9,
289 'K' => 'K', X_CA => X_CA, X_DA => X_DA, X_AA => X_AA,
290 'L' => 'L', X_CB => X_CB, X_DB => X_DB, X_AB => X_AB,
291 'M' => 'M', X_CC => X_CC, X_DC => X_DC, X_AC => X_AC,
292 'N' => 'N', X_CD => X_CD, X_DD => X_DD,
293 'O' => 'O', X_CE => X_CE, X_DE => X_DE, X_AE => X_AE,
294 'P' => 'P', X_CF => X_CF, X_DF => X_DF, X_AF => X_AF,
295 'Q' => 'Q',
296 'R' => 'R',
297 'S' => 'S',
298 'T' => 'T',
299 'U' => 'U',
300 'V' => 'V',
301 'W' => 'W',
302 'X' => 'X',
303 'Y' => 'Y',
304 'Z' => 'Z',
306 '0' => '0',
307 '1' => '1',
308 '2' => '2',
309 '3' => '3',
310 '4' => '4',
311 '5' => '5',
312 '6' => '6',
313 '7' => '7',
314 '8' => '8',
315 '9' => '9',
317 '_' => '_',
319 others => ' ');
321 -----------------------------
322 -- Definitions for Latin-3 --
323 -----------------------------
325 Fold_Latin_3 : Translate_Table := Translate_Table'(
327 'a' => 'A', X_E0 => X_C0,
328 'b' => 'B', X_E1 => X_C1, X_F1 => X_D1, X_B1 => X_A1,
329 'c' => 'C', X_E2 => X_C2, X_F2 => X_D2,
330 'd' => 'D', X_F3 => X_D3,
331 'e' => 'E', X_E4 => X_C4, X_F4 => X_D4,
332 'f' => 'F', X_E5 => X_C5, X_F5 => X_D5, X_B5 => X_A5,
333 'g' => 'G', X_E6 => X_C6, X_F6 => X_D6, X_B6 => X_A6,
334 'h' => 'H', X_E7 => X_C7,
335 'i' => 'I', X_E8 => X_C8, X_F8 => X_D8,
336 'j' => 'J', X_E9 => X_C9, X_F9 => X_D9, X_B9 => X_A9,
337 'k' => 'K', X_EA => X_CA, X_FA => X_DA, X_BA => X_AA,
338 'l' => 'L', X_EB => X_CB, X_FB => X_DB, X_BB => X_AB,
339 'm' => 'M', X_EC => X_CC, X_FC => X_DC, X_BC => X_AC,
340 'n' => 'N', X_ED => X_CD, X_FD => X_DD,
341 'o' => 'O', X_EE => X_CE, X_FE => X_DE,
342 'p' => 'P', X_EF => X_CF, X_BF => X_AF,
343 'q' => 'Q',
344 'r' => 'R',
345 's' => 'S',
346 't' => 'T',
347 'u' => 'U',
348 'v' => 'V',
349 'w' => 'W',
350 'x' => 'X',
351 'y' => 'Y',
352 'z' => 'Z',
354 'A' => 'A', X_C0 => X_C0,
355 'B' => 'B', X_C1 => X_C1, X_D1 => X_D1, X_A1 => X_A1,
356 'C' => 'C', X_C2 => X_C2, X_D2 => X_D2,
357 'D' => 'D', X_D3 => X_D3,
358 'E' => 'E', X_C4 => X_C4, X_D4 => X_D4,
359 'F' => 'F', X_C5 => X_C5, X_D5 => X_D5, X_A5 => X_A5,
360 'G' => 'G', X_C6 => X_C6, X_D6 => X_D6, X_A6 => X_A6,
361 'H' => 'H', X_C7 => X_C7,
362 'I' => 'I', X_C8 => X_C8, X_D8 => X_D8,
363 'J' => 'J', X_C9 => X_C9, X_D9 => X_D9, X_A9 => X_A9,
364 'K' => 'K', X_CA => X_CA, X_DA => X_DA, X_AA => X_AA,
365 'L' => 'L', X_CB => X_CB, X_DB => X_DB, X_AB => X_AB,
366 'M' => 'M', X_CC => X_CC, X_DC => X_DC, X_AC => X_AC,
367 'N' => 'N', X_CD => X_CD, X_DD => X_DD,
368 'O' => 'O', X_CE => X_CE, X_DE => X_DE,
369 'P' => 'P', X_CF => X_CF, X_AF => X_AF,
370 'Q' => 'Q',
371 'R' => 'R',
372 'S' => 'S',
373 'T' => 'T',
374 'U' => 'U',
375 'V' => 'V',
376 'W' => 'W',
377 'X' => 'X',
378 'Y' => 'Y',
379 'Z' => 'Z',
381 '0' => '0',
382 '1' => '1',
383 '2' => '2',
384 '3' => '3',
385 '4' => '4',
386 '5' => '5',
387 '6' => '6',
388 '7' => '7',
389 '8' => '8',
390 '9' => '9',
392 '_' => '_',
394 others => ' ');
396 -----------------------------
397 -- Definitions for Latin-4 --
398 -----------------------------
400 Fold_Latin_4 : Translate_Table := Translate_Table'(
402 'a' => 'A', X_E0 => X_C0, X_F0 => X_D0,
403 'b' => 'B', X_E1 => X_C1, X_F1 => X_D1, X_B1 => X_A1,
404 'c' => 'C', X_E2 => X_C2, X_F2 => X_D2,
405 'd' => 'D', X_E3 => X_C3, X_F3 => X_D3, X_B3 => X_A3,
406 'e' => 'E', X_E4 => X_C4, X_F4 => X_D4,
407 'f' => 'F', X_E5 => X_C5, X_F5 => X_D5, X_B5 => X_A5,
408 'g' => 'G', X_E6 => X_C6, X_F6 => X_D6, X_B6 => X_A6,
409 'h' => 'H', X_E7 => X_C7,
410 'i' => 'I', X_E8 => X_C8, X_F8 => X_D8,
411 'j' => 'J', X_E9 => X_C9, X_F9 => X_D9, X_B9 => X_A9,
412 'k' => 'K', X_EA => X_CA, X_FA => X_DA, X_BA => X_AA,
413 'l' => 'L', X_EB => X_CB, X_FB => X_DB, X_BB => X_AB,
414 'm' => 'M', X_EC => X_CC, X_FC => X_DC, X_BC => X_AC,
415 'n' => 'N', X_ED => X_CD, X_FD => X_DD,
416 'o' => 'O', X_EE => X_CE, X_FE => X_DE, X_BE => X_AE,
417 'p' => 'P', X_EF => X_CF,
418 'q' => 'Q',
419 'r' => 'R',
420 's' => 'S',
421 't' => 'T',
422 'u' => 'U',
423 'v' => 'V',
424 'w' => 'W',
425 'x' => 'X',
426 'y' => 'Y',
427 'z' => 'Z',
429 'A' => 'A', X_C0 => X_C0, X_D0 => X_D0,
430 'B' => 'B', X_C1 => X_C1, X_D1 => X_D1, X_A1 => X_A1,
431 'C' => 'C', X_C2 => X_C2, X_D2 => X_D2,
432 'D' => 'D', X_C3 => X_C3, X_D3 => X_D3, X_A3 => X_A3,
433 'E' => 'E', X_C4 => X_C4, X_D4 => X_D4,
434 'F' => 'F', X_C5 => X_C5, X_D5 => X_D5, X_A5 => X_A5,
435 'G' => 'G', X_C6 => X_C6, X_D6 => X_D6, X_A6 => X_A6,
436 'H' => 'H', X_C7 => X_C7,
437 'I' => 'I', X_C8 => X_C8, X_D8 => X_D8,
438 'J' => 'J', X_C9 => X_C9, X_D9 => X_D9, X_A9 => X_A9,
439 'K' => 'K', X_CA => X_CA, X_DA => X_DA, X_AA => X_AA,
440 'L' => 'L', X_CB => X_CB, X_DB => X_DB, X_AB => X_AB,
441 'M' => 'M', X_CC => X_CC, X_DC => X_DC, X_AC => X_AC,
442 'N' => 'N', X_CD => X_CD, X_DD => X_DD,
443 'O' => 'O', X_CE => X_CE, X_DE => X_DE, X_AE => X_AE,
444 'P' => 'P', X_CF => X_CF,
445 'Q' => 'Q',
446 'R' => 'R',
447 'S' => 'S',
448 'T' => 'T',
449 'U' => 'U',
450 'V' => 'V',
451 'W' => 'W',
452 'X' => 'X',
453 'Y' => 'Y',
454 'Z' => 'Z',
456 '0' => '0',
457 '1' => '1',
458 '2' => '2',
459 '3' => '3',
460 '4' => '4',
461 '5' => '5',
462 '6' => '6',
463 '7' => '7',
464 '8' => '8',
465 '9' => '9',
467 '_' => '_',
469 others => ' ');
471 --------------------------------------------
472 -- Definitions for IBM PC (Code Page 437) --
473 --------------------------------------------
475 -- Note: Code page 437 is the typical default in DOS, Windows and OS/2
476 -- for PC's in the US, it corresponds to the original PC character set.
477 -- See also the definitions for code page 850.
479 Fold_IBM_PC_437 : Translate_Table := Translate_Table'(
481 'a' => 'A',
482 'b' => 'B',
483 'c' => 'C',
484 'd' => 'D',
485 'e' => 'E',
486 'f' => 'F',
487 'g' => 'G',
488 'h' => 'H',
489 'i' => 'I',
490 'j' => 'J',
491 'k' => 'K',
492 'l' => 'L',
493 'm' => 'M',
494 'n' => 'N',
495 'o' => 'O',
496 'p' => 'P',
497 'q' => 'Q',
498 'r' => 'R',
499 's' => 'S',
500 't' => 'T',
501 'u' => 'U',
502 'v' => 'V',
503 'w' => 'W',
504 'x' => 'X',
505 'y' => 'Y',
506 'z' => 'Z',
508 'A' => 'A',
509 'B' => 'B',
510 'C' => 'C',
511 'D' => 'D',
512 'E' => 'E',
513 'F' => 'F',
514 'G' => 'G',
515 'H' => 'H',
516 'I' => 'I',
517 'J' => 'J',
518 'K' => 'K',
519 'L' => 'L',
520 'M' => 'M',
521 'N' => 'N',
522 'O' => 'O',
523 'P' => 'P',
524 'Q' => 'Q',
525 'R' => 'R',
526 'S' => 'S',
527 'T' => 'T',
528 'U' => 'U',
529 'V' => 'V',
530 'W' => 'W',
531 'X' => 'X',
532 'Y' => 'Y',
533 'Z' => 'Z',
535 X_80 => X_80, -- C cedilla
536 X_81 => X_9A, -- u umlaut
537 X_82 => X_90, -- e acute
538 X_83 => X_83, -- a circumflex
539 X_84 => X_8E, -- a umlaut
540 X_85 => X_85, -- a grave
541 X_86 => X_8F, -- a ring
542 X_87 => X_80, -- c cedilla
543 X_88 => X_88, -- e circumflex
544 X_89 => X_89, -- e umlaut
545 X_8A => X_8A, -- e grave
546 X_8B => X_8B, -- i umlaut
547 X_8C => X_8C, -- i circumflex
548 X_8D => X_8D, -- i grave
549 X_8E => X_8E, -- A umlaut
550 X_8F => X_8F, -- A ring
552 X_90 => X_90, -- E acute
553 X_91 => X_92, -- ae
554 X_92 => X_92, -- AE
555 X_93 => X_93, -- o circumflex
556 X_94 => X_99, -- o umlaut
557 X_95 => X_95, -- o grave
558 X_96 => X_96, -- u circumflex
559 X_97 => X_97, -- u grave
560 X_98 => X_98, -- y umlaut
561 X_99 => X_99, -- O umlaut
562 X_9A => X_9A, -- U umlaut
564 X_A0 => X_A0, -- a acute
565 X_A1 => X_A1, -- i acute
566 X_A2 => X_A2, -- o acute
567 X_A3 => X_A3, -- u acute
568 X_A4 => X_A5, -- n tilde
569 X_A5 => X_A5, -- N tilde
570 X_A6 => X_A6, -- a underline
571 X_A7 => X_A7, -- o underline
573 X_E0 => X_E0, -- lower case alpha
574 X_E1 => X_E1, -- lower case beta
575 X_E2 => X_E2, -- upper case gamma
576 X_E3 => X_E3, -- lower case pi
577 X_E4 => X_E4, -- upper case sigma (lower/upper sigma not equivalent)
578 X_E5 => X_E5, -- lower case sigma (lower/upper sigma not equivalent)
579 X_E6 => X_E6, -- lower case mu
580 X_E7 => X_E7, -- lower case tau
581 X_E8 => X_E8, -- upper case phi (lower/upper phi not equivalent)
582 X_E9 => X_E9, -- lower case theta
583 X_EA => X_EA, -- upper case omega
584 X_EB => X_EB, -- lower case delta
585 X_ED => X_ED, -- lower case phi (lower/upper phi not equivalent)
586 X_EE => X_EE, -- lower case epsilon
588 X_FC => X_FC, -- lower case eta
590 '0' => '0',
591 '1' => '1',
592 '2' => '2',
593 '3' => '3',
594 '4' => '4',
595 '5' => '5',
596 '6' => '6',
597 '7' => '7',
598 '8' => '8',
599 '9' => '9',
601 '_' => '_',
603 others => ' ');
605 --------------------------------------------
606 -- Definitions for IBM PC (Code Page 850) --
607 --------------------------------------------
609 -- Note: Code page 850 is the typical default in DOS, Windows and OS/2
610 -- for PC's in Europe, it is an extension of the original PC character
611 -- set to include the additional characters defined in ISO Latin-1.
612 -- See also the definitions for code page 437.
614 Fold_IBM_PC_850 : Translate_Table := Translate_Table'(
616 'a' => 'A',
617 'b' => 'B',
618 'c' => 'C',
619 'd' => 'D',
620 'e' => 'E',
621 'f' => 'F',
622 'g' => 'G',
623 'h' => 'H',
624 'i' => 'I',
625 'j' => 'J',
626 'k' => 'K',
627 'l' => 'L',
628 'm' => 'M',
629 'n' => 'N',
630 'o' => 'O',
631 'p' => 'P',
632 'q' => 'Q',
633 'r' => 'R',
634 's' => 'S',
635 't' => 'T',
636 'u' => 'U',
637 'v' => 'V',
638 'w' => 'W',
639 'x' => 'X',
640 'y' => 'Y',
641 'z' => 'Z',
643 'A' => 'A',
644 'B' => 'B',
645 'C' => 'C',
646 'D' => 'D',
647 'E' => 'E',
648 'F' => 'F',
649 'G' => 'G',
650 'H' => 'H',
651 'I' => 'I',
652 'J' => 'J',
653 'K' => 'K',
654 'L' => 'L',
655 'M' => 'M',
656 'N' => 'N',
657 'O' => 'O',
658 'P' => 'P',
659 'Q' => 'Q',
660 'R' => 'R',
661 'S' => 'S',
662 'T' => 'T',
663 'U' => 'U',
664 'V' => 'V',
665 'W' => 'W',
666 'X' => 'X',
667 'Y' => 'Y',
668 'Z' => 'Z',
670 X_80 => X_80, -- C cedilla
671 X_81 => X_9A, -- u umlaut
672 X_82 => X_90, -- e acute
673 X_83 => X_B6, -- a circumflex
674 X_84 => X_8E, -- a umlaut
675 X_85 => X_B7, -- a grave
676 X_86 => X_8F, -- a ring
677 X_87 => X_80, -- c cedilla
678 X_88 => X_D2, -- e circumflex
679 X_89 => X_D3, -- e umlaut
680 X_8A => X_D4, -- e grave
681 X_8B => X_D8, -- i umlaut
682 X_8C => X_D7, -- i circumflex
683 X_8D => X_DE, -- i grave
684 X_8E => X_8E, -- A umlaut
685 X_8F => X_8F, -- A ring
687 X_90 => X_90, -- E acute
688 X_91 => X_92, -- ae
689 X_92 => X_92, -- AE
690 X_93 => X_E2, -- o circumflex
691 X_94 => X_99, -- o umlaut
692 X_95 => X_E3, -- o grave
693 X_96 => X_EA, -- u circumflex
694 X_97 => X_EB, -- u grave
695 X_98 => X_98, -- y umlaut
696 X_99 => X_99, -- O umlaut
697 X_9A => X_9A, -- U umlaut
699 X_A0 => X_B5, -- a acute
700 X_A1 => X_D6, -- i acute
701 X_A2 => X_E0, -- o acute
702 X_A3 => X_E9, -- u acute
703 X_A4 => X_A5, -- n tilde
704 X_A5 => X_A5, -- N tilde
705 X_A6 => X_A6, -- a underline
706 X_A7 => X_A7, -- o underline
708 X_B5 => X_B5, -- A acute
709 X_B6 => X_B6, -- A circumflex
710 X_B7 => X_B7, -- A grave
712 X_C6 => X_C7, -- a tilde
713 X_C7 => X_C7, -- A tilde
715 X_D0 => X_D1, -- eth
716 X_D1 => X_D1, -- Eth
717 X_D2 => X_D2, -- E circumflex
718 X_D3 => X_D3, -- E umlaut
719 X_D4 => X_D4, -- E grave
720 X_D5 => X_D5, -- dotless i, no uppercase
721 X_D6 => X_D6, -- I acute
722 X_D7 => X_D7, -- I circumflex
723 X_D8 => X_D8, -- I umlaut
724 X_DE => X_DE, -- I grave
726 X_E0 => X_E0, -- O acute
727 X_E1 => X_E1, -- german dbl s, no uppercase
728 X_E2 => X_E2, -- O circumflex
729 X_E3 => X_E3, -- O grave
730 X_E4 => X_E4, -- o tilde
731 X_E5 => X_E5, -- O tilde
732 X_E7 => X_E8, -- thorn
733 X_E8 => X_E8, -- Thorn
734 X_E9 => X_E9, -- U acute
735 X_EA => X_EA, -- U circumflex
736 X_EB => X_EB, -- U grave
737 X_EC => X_ED, -- y acute
738 X_ED => X_ED, -- Y acute
740 '0' => '0',
741 '1' => '1',
742 '2' => '2',
743 '3' => '3',
744 '4' => '4',
745 '5' => '5',
746 '6' => '6',
747 '7' => '7',
748 '8' => '8',
749 '9' => '9',
751 '_' => '_',
753 others => ' ');
755 -----------------------------------------
756 -- Definitions for Full Upper Half Set --
757 -----------------------------------------
759 -- The full upper half set allows all upper half characters as letters,
760 -- and does not recognize any upper/lower case equivalences in this half.
762 Fold_Full_Upper_Half : Translate_Table := Translate_Table'(
764 'a' => 'A',
765 'b' => 'B',
766 'c' => 'C',
767 'd' => 'D',
768 'e' => 'E',
769 'f' => 'F',
770 'g' => 'G',
771 'h' => 'H',
772 'i' => 'I',
773 'j' => 'J',
774 'k' => 'K',
775 'l' => 'L',
776 'm' => 'M',
777 'n' => 'N',
778 'o' => 'O',
779 'p' => 'P',
780 'q' => 'Q',
781 'r' => 'R',
782 's' => 'S',
783 't' => 'T',
784 'u' => 'U',
785 'v' => 'V',
786 'w' => 'W',
787 'x' => 'X',
788 'y' => 'Y',
789 'z' => 'Z',
791 'A' => 'A',
792 'B' => 'B',
793 'C' => 'C',
794 'D' => 'D',
795 'E' => 'E',
796 'F' => 'F',
797 'G' => 'G',
798 'H' => 'H',
799 'I' => 'I',
800 'J' => 'J',
801 'K' => 'K',
802 'L' => 'L',
803 'M' => 'M',
804 'N' => 'N',
805 'O' => 'O',
806 'P' => 'P',
807 'Q' => 'Q',
808 'R' => 'R',
809 'S' => 'S',
810 'T' => 'T',
811 'U' => 'U',
812 'V' => 'V',
813 'W' => 'W',
814 'X' => 'X',
815 'Y' => 'Y',
816 'Z' => 'Z',
818 X_80 => X_80, X_90 => X_90, X_A0 => X_A0, X_B0 => X_B0,
819 X_81 => X_81, X_91 => X_91, X_A1 => X_A1, X_B1 => X_B1,
820 X_82 => X_82, X_92 => X_92, X_A2 => X_A2, X_B2 => X_B2,
821 X_83 => X_83, X_93 => X_93, X_A3 => X_A3, X_B3 => X_B3,
822 X_84 => X_84, X_94 => X_94, X_A4 => X_A4, X_B4 => X_B4,
823 X_85 => X_85, X_95 => X_95, X_A5 => X_A5, X_B5 => X_B5,
824 X_86 => X_86, X_96 => X_96, X_A6 => X_A6, X_B6 => X_B6,
825 X_87 => X_87, X_97 => X_97, X_A7 => X_A7, X_B7 => X_B7,
826 X_88 => X_88, X_98 => X_98, X_A8 => X_A8, X_B8 => X_B8,
827 X_89 => X_89, X_99 => X_99, X_A9 => X_A9, X_B9 => X_B9,
828 X_8A => X_8A, X_9A => X_9A, X_AA => X_AA, X_BA => X_BA,
829 X_8B => X_8B, X_9B => X_9B, X_AB => X_AB, X_BB => X_BB,
830 X_8C => X_8C, X_9C => X_9C, X_AC => X_AC, X_BC => X_BC,
831 X_8D => X_8D, X_9D => X_9D, X_AD => X_AD, X_BD => X_BD,
832 X_8E => X_8E, X_9E => X_9E, X_AE => X_AE, X_BE => X_BE,
833 X_8F => X_8F, X_9F => X_9F, X_AF => X_AF, X_BF => X_BF,
835 X_C0 => X_C0, X_D0 => X_D0, X_E0 => X_E0, X_F0 => X_F0,
836 X_C1 => X_C1, X_D1 => X_D1, X_E1 => X_E1, X_F1 => X_F1,
837 X_C2 => X_C2, X_D2 => X_D2, X_E2 => X_E2, X_F2 => X_F2,
838 X_C3 => X_C3, X_D3 => X_D3, X_E3 => X_E3, X_F3 => X_F3,
839 X_C4 => X_C4, X_D4 => X_D4, X_E4 => X_E4, X_F4 => X_F4,
840 X_C5 => X_C5, X_D5 => X_D5, X_E5 => X_E5, X_F5 => X_F5,
841 X_C6 => X_C6, X_D6 => X_D6, X_E6 => X_E6, X_F6 => X_F6,
842 X_C7 => X_C7, X_D7 => X_D7, X_E7 => X_E7, X_F7 => X_F7,
843 X_C8 => X_C8, X_D8 => X_D8, X_E8 => X_E8, X_F8 => X_F8,
844 X_C9 => X_C9, X_D9 => X_D9, X_E9 => X_E9, X_F9 => X_F9,
845 X_CA => X_CA, X_DA => X_DA, X_EA => X_EA, X_FA => X_FA,
846 X_CB => X_CB, X_DB => X_DB, X_EB => X_EB, X_FB => X_FB,
847 X_CC => X_CC, X_DC => X_DC, X_EC => X_EC, X_FC => X_FC,
848 X_CD => X_CD, X_DD => X_DD, X_ED => X_ED, X_FD => X_FD,
849 X_CE => X_CE, X_DE => X_DE, X_EE => X_EE, X_FE => X_FE,
850 X_CF => X_CF, X_DF => X_DF, X_EF => X_EF, X_FF => X_FF,
852 '0' => '0',
853 '1' => '1',
854 '2' => '2',
855 '3' => '3',
856 '4' => '4',
857 '5' => '5',
858 '6' => '6',
859 '7' => '7',
860 '8' => '8',
861 '9' => '9',
863 '_' => '_',
865 others => ' ');
867 ---------------------------------------
868 -- Definitions for No Upper Half Set --
869 ---------------------------------------
871 -- The no upper half set allows no upper half characters as letters, and
872 -- thus there are no upper/lower case equivalences in this half. This set
873 -- corresponds to the Ada 83 rules.
875 Fold_No_Upper_Half : Translate_Table := Translate_Table'(
877 'a' => 'A',
878 'b' => 'B',
879 'c' => 'C',
880 'd' => 'D',
881 'e' => 'E',
882 'f' => 'F',
883 'g' => 'G',
884 'h' => 'H',
885 'i' => 'I',
886 'j' => 'J',
887 'k' => 'K',
888 'l' => 'L',
889 'm' => 'M',
890 'n' => 'N',
891 'o' => 'O',
892 'p' => 'P',
893 'q' => 'Q',
894 'r' => 'R',
895 's' => 'S',
896 't' => 'T',
897 'u' => 'U',
898 'v' => 'V',
899 'w' => 'W',
900 'x' => 'X',
901 'y' => 'Y',
902 'z' => 'Z',
904 'A' => 'A',
905 'B' => 'B',
906 'C' => 'C',
907 'D' => 'D',
908 'E' => 'E',
909 'F' => 'F',
910 'G' => 'G',
911 'H' => 'H',
912 'I' => 'I',
913 'J' => 'J',
914 'K' => 'K',
915 'L' => 'L',
916 'M' => 'M',
917 'N' => 'N',
918 'O' => 'O',
919 'P' => 'P',
920 'Q' => 'Q',
921 'R' => 'R',
922 'S' => 'S',
923 'T' => 'T',
924 'U' => 'U',
925 'V' => 'V',
926 'W' => 'W',
927 'X' => 'X',
928 'Y' => 'Y',
929 'Z' => 'Z',
931 '0' => '0',
932 '1' => '1',
933 '2' => '2',
934 '3' => '3',
935 '4' => '4',
936 '5' => '5',
937 '6' => '6',
938 '7' => '7',
939 '8' => '8',
940 '9' => '9',
942 '_' => '_',
944 others => ' ');
946 ----------------
947 -- Initialize --
948 ----------------
950 procedure Initialize is
951 begin
953 -- Set Fold_Upper table from source code indication
955 if Identifier_Character_Set = '1'
956 or else Identifier_Character_Set = 'w'
957 then
958 Fold_Upper := Fold_Latin_1;
960 elsif Identifier_Character_Set = '2' then
961 Fold_Upper := Fold_Latin_2;
963 elsif Identifier_Character_Set = '3' then
964 Fold_Upper := Fold_Latin_3;
966 elsif Identifier_Character_Set = '4' then
967 Fold_Upper := Fold_Latin_4;
969 elsif Identifier_Character_Set = 'p' then
970 Fold_Upper := Fold_IBM_PC_437;
972 elsif Identifier_Character_Set = '8' then
973 Fold_Upper := Fold_IBM_PC_850;
975 elsif Identifier_Character_Set = 'f' then
976 Fold_Upper := Fold_Full_Upper_Half;
978 else -- Identifier_Character_Set = 'n'
979 Fold_Upper := Fold_No_Upper_Half;
980 end if;
982 -- Use Fold_Upper table to compute Fold_Lower table
984 Fold_Lower := Fold_Upper;
986 for J in Character loop
987 if J /= Fold_Upper (J) then
988 Fold_Lower (Fold_Upper (J)) := J;
989 Fold_Lower (J) := J;
990 end if;
991 end loop;
993 Fold_Lower (' ') := ' ';
995 -- Build Identifier_Char table from used entries of Fold_Upper
997 for J in Character loop
998 Identifier_Char (J) := (Fold_Upper (J) /= ' ');
999 end loop;
1001 -- Always add [ as an identifier character to deal with the brackets
1002 -- notation for wide characters used in identifiers. Note that if
1003 -- we are not allowing wide characters in identifiers, then any use
1004 -- of this notation will be flagged as an error in Scan_Identifier.
1006 Identifier_Char ('[') := True;
1008 -- Add entry for ESC if wide characters in use with a wide character
1009 -- encoding method active that uses the ESC code for encoding. Also
1010 -- add entry for left bracket to capture use of brackets notation.
1012 if Identifier_Character_Set = 'w'
1013 and then Wide_Character_Encoding_Method in WC_ESC_Encoding_Method
1014 then
1015 Identifier_Char (ASCII.ESC) := True;
1016 end if;
1017 end Initialize;
1019 --------------------------
1020 -- Is_Lower_Case_Letter --
1021 --------------------------
1023 function Is_Lower_Case_Letter (C : Character) return Boolean is
1024 begin
1025 return C /= Fold_Upper (C);
1026 end Is_Lower_Case_Letter;
1028 --------------------------
1029 -- Is_Upper_Case_Letter --
1030 --------------------------
1032 function Is_Upper_Case_Letter (C : Character) return Boolean is
1033 begin
1034 return C /= Fold_Lower (C);
1035 end Is_Upper_Case_Letter;
1037 end Csets;