1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
9 -- Copyright (C) 1992-2002, Free Software Foundation, Inc. --
11 -- GNAT is free software; you can redistribute it and/or modify it under --
12 -- terms of the GNU General Public License as published by the Free Soft- --
13 -- ware Foundation; either version 2, or (at your option) any later ver- --
14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
15 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
16 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
17 -- for more details. You should have received a copy of the GNU General --
18 -- Public License distributed with GNAT; see file COPYING. If not, write --
19 -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
20 -- MA 02111-1307, USA. --
22 -- As a special exception, if other files instantiate generics from this --
23 -- unit, or you link this unit with other files to produce an executable, --
24 -- this unit does not by itself cause the resulting executable to be --
25 -- covered by the GNU General Public License. This exception does not --
26 -- however invalidate any other reasons why the executable file might be --
27 -- covered by the GNU Public License. --
29 -- GNAT was originally developed by the GNAT team at New York University. --
30 -- Extensive contributions were provided by Ada Core Technologies Inc. --
32 ------------------------------------------------------------------------------
36 with System
.WCh_Con
; use System
.WCh_Con
;
40 X_80
: constant Character := Character'Val (16#
80#
);
41 X_81
: constant Character := Character'Val (16#
81#
);
42 X_82
: constant Character := Character'Val (16#
82#
);
43 X_83
: constant Character := Character'Val (16#
83#
);
44 X_84
: constant Character := Character'Val (16#
84#
);
45 X_85
: constant Character := Character'Val (16#
85#
);
46 X_86
: constant Character := Character'Val (16#
86#
);
47 X_87
: constant Character := Character'Val (16#
87#
);
48 X_88
: constant Character := Character'Val (16#
88#
);
49 X_89
: constant Character := Character'Val (16#
89#
);
50 X_8A
: constant Character := Character'Val (16#
8A#
);
51 X_8B
: constant Character := Character'Val (16#
8B#
);
52 X_8C
: constant Character := Character'Val (16#
8C#
);
53 X_8D
: constant Character := Character'Val (16#
8D#
);
54 X_8E
: constant Character := Character'Val (16#
8E#
);
55 X_8F
: constant Character := Character'Val (16#
8F#
);
56 X_90
: constant Character := Character'Val (16#
90#
);
57 X_91
: constant Character := Character'Val (16#
91#
);
58 X_92
: constant Character := Character'Val (16#
92#
);
59 X_93
: constant Character := Character'Val (16#
93#
);
60 X_94
: constant Character := Character'Val (16#
94#
);
61 X_95
: constant Character := Character'Val (16#
95#
);
62 X_96
: constant Character := Character'Val (16#
96#
);
63 X_97
: constant Character := Character'Val (16#
97#
);
64 X_98
: constant Character := Character'Val (16#
98#
);
65 X_99
: constant Character := Character'Val (16#
99#
);
66 X_9A
: constant Character := Character'Val (16#
9A#
);
67 X_9B
: constant Character := Character'Val (16#
9B#
);
68 X_9C
: constant Character := Character'Val (16#
9C#
);
69 X_9D
: constant Character := Character'Val (16#
9D#
);
70 X_9E
: constant Character := Character'Val (16#
9E#
);
71 X_9F
: constant Character := Character'Val (16#
9F#
);
72 X_A0
: constant Character := Character'Val (16#A0#
);
73 X_A1
: constant Character := Character'Val (16#A1#
);
74 X_A2
: constant Character := Character'Val (16#A2#
);
75 X_A3
: constant Character := Character'Val (16#A3#
);
76 X_A4
: constant Character := Character'Val (16#A4#
);
77 X_A5
: constant Character := Character'Val (16#A5#
);
78 X_A6
: constant Character := Character'Val (16#A6#
);
79 X_A7
: constant Character := Character'Val (16#A7#
);
80 X_A8
: constant Character := Character'Val (16#A8#
);
81 X_A9
: constant Character := Character'Val (16#A9#
);
82 X_AA
: constant Character := Character'Val (16#AA#
);
83 X_AB
: constant Character := Character'Val (16#AB#
);
84 X_AC
: constant Character := Character'Val (16#AC#
);
85 X_AD
: constant Character := Character'Val (16#AD#
);
86 X_AE
: constant Character := Character'Val (16#AE#
);
87 X_AF
: constant Character := Character'Val (16#AF#
);
88 X_B0
: constant Character := Character'Val (16#B0#
);
89 X_B1
: constant Character := Character'Val (16#B1#
);
90 X_B2
: constant Character := Character'Val (16#B2#
);
91 X_B3
: constant Character := Character'Val (16#B3#
);
92 X_B4
: constant Character := Character'Val (16#B4#
);
93 X_B5
: constant Character := Character'Val (16#B5#
);
94 X_B6
: constant Character := Character'Val (16#B6#
);
95 X_B7
: constant Character := Character'Val (16#B7#
);
96 X_B8
: constant Character := Character'Val (16#B8#
);
97 X_B9
: constant Character := Character'Val (16#B9#
);
98 X_BA
: constant Character := Character'Val (16#BA#
);
99 X_BB
: constant Character := Character'Val (16#BB#
);
100 X_BC
: constant Character := Character'Val (16#BC#
);
101 X_BD
: constant Character := Character'Val (16#BD#
);
102 X_BE
: constant Character := Character'Val (16#BE#
);
103 X_BF
: constant Character := Character'Val (16#BF#
);
104 X_C0
: constant Character := Character'Val (16#C0#
);
105 X_C1
: constant Character := Character'Val (16#C1#
);
106 X_C2
: constant Character := Character'Val (16#C2#
);
107 X_C3
: constant Character := Character'Val (16#C3#
);
108 X_C4
: constant Character := Character'Val (16#C4#
);
109 X_C5
: constant Character := Character'Val (16#C5#
);
110 X_C6
: constant Character := Character'Val (16#C6#
);
111 X_C7
: constant Character := Character'Val (16#C7#
);
112 X_C8
: constant Character := Character'Val (16#C8#
);
113 X_C9
: constant Character := Character'Val (16#C9#
);
114 X_CA
: constant Character := Character'Val (16#CA#
);
115 X_CB
: constant Character := Character'Val (16#CB#
);
116 X_CC
: constant Character := Character'Val (16#CC#
);
117 X_CD
: constant Character := Character'Val (16#CD#
);
118 X_CE
: constant Character := Character'Val (16#CE#
);
119 X_CF
: constant Character := Character'Val (16#CF#
);
120 X_D0
: constant Character := Character'Val (16#D0#
);
121 X_D1
: constant Character := Character'Val (16#D1#
);
122 X_D2
: constant Character := Character'Val (16#D2#
);
123 X_D3
: constant Character := Character'Val (16#D3#
);
124 X_D4
: constant Character := Character'Val (16#D4#
);
125 X_D5
: constant Character := Character'Val (16#D5#
);
126 X_D6
: constant Character := Character'Val (16#D6#
);
127 X_D7
: constant Character := Character'Val (16#D7#
);
128 X_D8
: constant Character := Character'Val (16#D8#
);
129 X_D9
: constant Character := Character'Val (16#D9#
);
130 X_DA
: constant Character := Character'Val (16#DA#
);
131 X_DB
: constant Character := Character'Val (16#DB#
);
132 X_DC
: constant Character := Character'Val (16#DC#
);
133 X_DD
: constant Character := Character'Val (16#DD#
);
134 X_DE
: constant Character := Character'Val (16#DE#
);
135 X_DF
: constant Character := Character'Val (16#DF#
);
136 X_E0
: constant Character := Character'Val (16#E0#
);
137 X_E1
: constant Character := Character'Val (16#E1#
);
138 X_E2
: constant Character := Character'Val (16#E2#
);
139 X_E3
: constant Character := Character'Val (16#E3#
);
140 X_E4
: constant Character := Character'Val (16#E4#
);
141 X_E5
: constant Character := Character'Val (16#E5#
);
142 X_E6
: constant Character := Character'Val (16#E6#
);
143 X_E7
: constant Character := Character'Val (16#E7#
);
144 X_E8
: constant Character := Character'Val (16#E8#
);
145 X_E9
: constant Character := Character'Val (16#E9#
);
146 X_EA
: constant Character := Character'Val (16#EA#
);
147 X_EB
: constant Character := Character'Val (16#EB#
);
148 X_EC
: constant Character := Character'Val (16#EC#
);
149 X_ED
: constant Character := Character'Val (16#ED#
);
150 X_EE
: constant Character := Character'Val (16#EE#
);
151 X_EF
: constant Character := Character'Val (16#EF#
);
152 X_F0
: constant Character := Character'Val (16#F0#
);
153 X_F1
: constant Character := Character'Val (16#F1#
);
154 X_F2
: constant Character := Character'Val (16#F2#
);
155 X_F3
: constant Character := Character'Val (16#F3#
);
156 X_F4
: constant Character := Character'Val (16#F4#
);
157 X_F5
: constant Character := Character'Val (16#F5#
);
158 X_F6
: constant Character := Character'Val (16#F6#
);
159 X_F7
: constant Character := Character'Val (16#F7#
);
160 X_F8
: constant Character := Character'Val (16#F8#
);
161 X_F9
: constant Character := Character'Val (16#F9#
);
162 X_FA
: constant Character := Character'Val (16#FA#
);
163 X_FB
: constant Character := Character'Val (16#FB#
);
164 X_FC
: constant Character := Character'Val (16#FC#
);
165 X_FD
: constant Character := Character'Val (16#FD#
);
166 X_FE
: constant Character := Character'Val (16#FE#
);
167 X_FF
: constant Character := Character'Val (16#FF#
);
169 ------------------------------------------
170 -- Definitions for Latin-1 (ISO 8859-1) --
171 ------------------------------------------
173 Fold_Latin_1
: Translate_Table
:= Translate_Table
'(
175 'a
' => 'A
', X_E0 => X_C0, X_F0 => X_D0,
176 'b
' => 'B
', X_E1 => X_C1, X_F1 => X_D1,
177 'c
' => 'C
', X_E2 => X_C2, X_F2 => X_D2,
178 'd
' => 'D
', X_E3 => X_C3, X_F3 => X_D3,
179 'e
' => 'E
', X_E4 => X_C4, X_F4 => X_D4,
180 'f
' => 'F
', X_E5 => X_C5, X_F5 => X_D5,
181 'g
' => 'G
', X_E6 => X_C6, X_F6 => X_D6,
182 'h
' => 'H
', X_E7 => X_C7,
183 'i
' => 'I
', X_E8 => X_C8, X_F8 => X_D8,
184 'j
' => 'J
', X_E9 => X_C9, X_F9 => X_D9,
185 'k
' => 'K
', X_EA => X_CA, X_FA => X_DA,
186 'l
' => 'L
', X_EB => X_CB, X_FB => X_DB,
187 'm
' => 'M
', X_EC => X_CC, X_FC => X_DC,
188 'n
' => 'N
', X_ED => X_CD, X_FD => X_DD,
189 'o
' => 'O
', X_EE => X_CE, X_FE => X_DE,
190 'p
' => 'P
', X_EF => X_CF,
202 'A
' => 'A
', X_C0 => X_C0, X_D0 => X_D0,
203 'B
' => 'B
', X_C1 => X_C1, X_D1 => X_D1,
204 'C
' => 'C
', X_C2 => X_C2, X_D2 => X_D2,
205 'D
' => 'D
', X_C3 => X_C3, X_D3 => X_D3,
206 'E
' => 'E
', X_C4 => X_C4, X_D4 => X_D4,
207 'F
' => 'F
', X_C5 => X_C5, X_D5 => X_D5,
208 'G
' => 'G
', X_C6 => X_C6, X_D6 => X_D6,
209 'H
' => 'H
', X_C7 => X_C7,
210 'I
' => 'I
', X_C8 => X_C8, X_D8 => X_D8,
211 'J
' => 'J
', X_C9 => X_C9, X_D9 => X_D9,
212 'K
' => 'K
', X_CA => X_CA, X_DA => X_DA,
213 'L
' => 'L
', X_CB => X_CB, X_DB => X_DB,
214 'M
' => 'M
', X_CC => X_CC, X_DC => X_DC,
215 'N
' => 'N
', X_CD => X_CD, X_DD => X_DD,
216 'O
' => 'O
', X_CE => X_CE, X_DE => X_DE,
217 'P
' => 'P
', X_CF => X_CF, X_DF => X_DF, X_FF => X_FF,
244 ------------------------------------------
245 -- Definitions for Latin-2 (ISO 8859-2) --
246 ------------------------------------------
248 Fold_Latin_2 : Translate_Table := Translate_Table'(
250 'a' => 'A', X_E0
=> X_C0
, X_F0
=> X_D0
,
251 'b' => 'B', X_E1
=> X_C1
, X_F1
=> X_D1
, X_B1
=> X_A1
,
252 'c' => 'C', X_E2
=> X_C2
, X_F2
=> X_D2
,
253 'd' => 'D', X_E3
=> X_C3
, X_F3
=> X_D3
, X_B3
=> X_A3
,
254 'e' => 'E', X_E4
=> X_C4
, X_F4
=> X_D4
,
255 'f' => 'F', X_E5
=> X_C5
, X_F5
=> X_D5
, X_B5
=> X_A5
,
256 'g' => 'G', X_E6
=> X_C6
, X_F6
=> X_D6
, X_B6
=> X_A6
,
257 'h' => 'H', X_E7
=> X_C7
,
258 'i' => 'I', X_E8
=> X_C8
, X_F8
=> X_D8
,
259 'j' => 'J', X_E9
=> X_C9
, X_F9
=> X_D9
, X_B9
=> X_A9
,
260 'k' => 'K', X_EA
=> X_CA
, X_FA
=> X_DA
, X_BA
=> X_AA
,
261 'l' => 'L', X_EB
=> X_CB
, X_FB
=> X_DB
, X_BB
=> X_AB
,
262 'm' => 'M', X_EC
=> X_CC
, X_FC
=> X_DC
, X_BC
=> X_AC
,
263 'n' => 'N', X_ED
=> X_CD
, X_FD
=> X_DD
,
264 'o' => 'O', X_EE
=> X_CE
, X_FE
=> X_DE
, X_BE
=> X_AE
,
265 'p' => 'P', X_EF
=> X_CF
, X_FF
=> X_DF
, X_BF
=> X_AF
,
277 'A' => 'A', X_C0
=> X_C0
, X_D0
=> X_D0
,
278 'B' => 'B', X_C1
=> X_C1
, X_D1
=> X_D1
, X_A1
=> X_A1
,
279 'C' => 'C', X_C2
=> X_C2
, X_D2
=> X_D2
,
280 'D' => 'D', X_C3
=> X_C3
, X_D3
=> X_D3
, X_A3
=> X_A3
,
281 'E' => 'E', X_C4
=> X_C4
, X_D4
=> X_D4
,
282 'F' => 'F', X_C5
=> X_C5
, X_D5
=> X_D5
, X_A5
=> X_A5
,
283 'G' => 'G', X_C6
=> X_C6
, X_D6
=> X_D6
, X_A6
=> X_A6
,
284 'H' => 'H', X_C7
=> X_C7
,
285 'I' => 'I', X_C8
=> X_C8
, X_D8
=> X_D8
,
286 'J' => 'J', X_C9
=> X_C9
, X_D9
=> X_D9
, X_A9
=> X_A9
,
287 'K' => 'K', X_CA
=> X_CA
, X_DA
=> X_DA
, X_AA
=> X_AA
,
288 'L' => 'L', X_CB
=> X_CB
, X_DB
=> X_DB
, X_AB
=> X_AB
,
289 'M' => 'M', X_CC
=> X_CC
, X_DC
=> X_DC
, X_AC
=> X_AC
,
290 'N' => 'N', X_CD
=> X_CD
, X_DD
=> X_DD
,
291 'O' => 'O', X_CE
=> X_CE
, X_DE
=> X_DE
, X_AE
=> X_AE
,
292 'P' => 'P', X_CF
=> X_CF
, X_DF
=> X_DF
, X_AF
=> X_AF
,
319 ------------------------------------------
320 -- Definitions for Latin-3 (ISO 8859-3) --
321 ------------------------------------------
323 Fold_Latin_3
: Translate_Table
:= Translate_Table
'(
325 'a
' => 'A
', X_E0 => X_C0,
326 'b
' => 'B
', X_E1 => X_C1, X_F1 => X_D1, X_B1 => X_A1,
327 'c
' => 'C
', X_E2 => X_C2, X_F2 => X_D2,
328 'd
' => 'D
', X_F3 => X_D3,
329 'e
' => 'E
', X_E4 => X_C4, X_F4 => X_D4,
330 'f
' => 'F
', X_E5 => X_C5, X_F5 => X_D5, X_B5 => X_A5,
331 'g
' => 'G
', X_E6 => X_C6, X_F6 => X_D6, X_B6 => X_A6,
332 'h
' => 'H
', X_E7 => X_C7,
333 'i
' => 'I
', X_E8 => X_C8, X_F8 => X_D8,
334 'j
' => 'J
', X_E9 => X_C9, X_F9 => X_D9, X_B9 => X_A9,
335 'k
' => 'K
', X_EA => X_CA, X_FA => X_DA, X_BA => X_AA,
336 'l
' => 'L
', X_EB => X_CB, X_FB => X_DB, X_BB => X_AB,
337 'm
' => 'M
', X_EC => X_CC, X_FC => X_DC, X_BC => X_AC,
338 'n
' => 'N
', X_ED => X_CD, X_FD => X_DD,
339 'o
' => 'O
', X_EE => X_CE, X_FE => X_DE,
340 'p
' => 'P
', X_EF => X_CF, X_BF => X_AF,
352 'A
' => 'A
', X_C0 => X_C0,
353 'B
' => 'B
', X_C1 => X_C1, X_D1 => X_D1, X_A1 => X_A1,
354 'C
' => 'C
', X_C2 => X_C2, X_D2 => X_D2,
355 'D
' => 'D
', X_D3 => X_D3,
356 'E
' => 'E
', X_C4 => X_C4, X_D4 => X_D4,
357 'F
' => 'F
', X_C5 => X_C5, X_D5 => X_D5, X_A5 => X_A5,
358 'G
' => 'G
', X_C6 => X_C6, X_D6 => X_D6, X_A6 => X_A6,
359 'H
' => 'H
', X_C7 => X_C7,
360 'I
' => 'I
', X_C8 => X_C8, X_D8 => X_D8,
361 'J
' => 'J
', X_C9 => X_C9, X_D9 => X_D9, X_A9 => X_A9,
362 'K
' => 'K
', X_CA => X_CA, X_DA => X_DA, X_AA => X_AA,
363 'L
' => 'L
', X_CB => X_CB, X_DB => X_DB, X_AB => X_AB,
364 'M
' => 'M
', X_CC => X_CC, X_DC => X_DC, X_AC => X_AC,
365 'N
' => 'N
', X_CD => X_CD, X_DD => X_DD,
366 'O
' => 'O
', X_CE => X_CE, X_DE => X_DE,
367 'P
' => 'P
', X_CF => X_CF, X_AF => X_AF,
394 ------------------------------------------
395 -- Definitions for Latin-4 (ISO 8859-4) --
396 ------------------------------------------
398 Fold_Latin_4 : Translate_Table := Translate_Table'(
400 'a' => 'A', X_E0
=> X_C0
, X_F0
=> X_D0
,
401 'b' => 'B', X_E1
=> X_C1
, X_F1
=> X_D1
, X_B1
=> X_A1
,
402 'c' => 'C', X_E2
=> X_C2
, X_F2
=> X_D2
,
403 'd' => 'D', X_E3
=> X_C3
, X_F3
=> X_D3
, X_B3
=> X_A3
,
404 'e' => 'E', X_E4
=> X_C4
, X_F4
=> X_D4
,
405 'f' => 'F', X_E5
=> X_C5
, X_F5
=> X_D5
, X_B5
=> X_A5
,
406 'g' => 'G', X_E6
=> X_C6
, X_F6
=> X_D6
, X_B6
=> X_A6
,
407 'h' => 'H', X_E7
=> X_C7
,
408 'i' => 'I', X_E8
=> X_C8
, X_F8
=> X_D8
,
409 'j' => 'J', X_E9
=> X_C9
, X_F9
=> X_D9
, X_B9
=> X_A9
,
410 'k' => 'K', X_EA
=> X_CA
, X_FA
=> X_DA
, X_BA
=> X_AA
,
411 'l' => 'L', X_EB
=> X_CB
, X_FB
=> X_DB
, X_BB
=> X_AB
,
412 'm' => 'M', X_EC
=> X_CC
, X_FC
=> X_DC
, X_BC
=> X_AC
,
413 'n' => 'N', X_ED
=> X_CD
, X_FD
=> X_DD
,
414 'o' => 'O', X_EE
=> X_CE
, X_FE
=> X_DE
, X_BE
=> X_AE
,
415 'p' => 'P', X_EF
=> X_CF
,
427 'A' => 'A', X_C0
=> X_C0
, X_D0
=> X_D0
,
428 'B' => 'B', X_C1
=> X_C1
, X_D1
=> X_D1
, X_A1
=> X_A1
,
429 'C' => 'C', X_C2
=> X_C2
, X_D2
=> X_D2
,
430 'D' => 'D', X_C3
=> X_C3
, X_D3
=> X_D3
, X_A3
=> X_A3
,
431 'E' => 'E', X_C4
=> X_C4
, X_D4
=> X_D4
,
432 'F' => 'F', X_C5
=> X_C5
, X_D5
=> X_D5
, X_A5
=> X_A5
,
433 'G' => 'G', X_C6
=> X_C6
, X_D6
=> X_D6
, X_A6
=> X_A6
,
434 'H' => 'H', X_C7
=> X_C7
,
435 'I' => 'I', X_C8
=> X_C8
, X_D8
=> X_D8
,
436 'J' => 'J', X_C9
=> X_C9
, X_D9
=> X_D9
, X_A9
=> X_A9
,
437 'K' => 'K', X_CA
=> X_CA
, X_DA
=> X_DA
, X_AA
=> X_AA
,
438 'L' => 'L', X_CB
=> X_CB
, X_DB
=> X_DB
, X_AB
=> X_AB
,
439 'M' => 'M', X_CC
=> X_CC
, X_DC
=> X_DC
, X_AC
=> X_AC
,
440 'N' => 'N', X_CD
=> X_CD
, X_DD
=> X_DD
,
441 'O' => 'O', X_CE
=> X_CE
, X_DE
=> X_DE
, X_AE
=> X_AE
,
442 'P' => 'P', X_CF
=> X_CF
,
469 ---------------------------------------------------
470 -- Definitions for Latin-5 (Cyrillic ISO-8859-5) --
471 ---------------------------------------------------
473 Fold_Latin_5
: Translate_Table
:= Translate_Table
'(
475 'a
' => 'A
', X_D0 => X_B0, X_E0 => X_C0,
476 'b
' => 'B
', X_D1 => X_B1, X_E1 => X_C1, X_F1 => X_A1,
477 'c
' => 'C
', X_D2 => X_B2, X_E2 => X_C2, X_F2 => X_A2,
478 'd
' => 'D
', X_D3 => X_B3, X_E3 => X_C3, X_F3 => X_A3,
479 'e
' => 'E
', X_D4 => X_B4, X_E4 => X_C4, X_F4 => X_A4,
480 'f
' => 'F
', X_D5 => X_B5, X_E5 => X_C5, X_F5 => X_A5,
481 'g
' => 'G
', X_D6 => X_B6, X_E6 => X_C6, X_F6 => X_A6,
482 'h
' => 'H
', X_D7 => X_B7, X_E7 => X_C7, X_F7 => X_A7,
483 'i
' => 'I
', X_D8 => X_B8, X_E8 => X_C8, X_F8 => X_A8,
484 'j
' => 'J
', X_D9 => X_B9, X_E9 => X_C9, X_F9 => X_A9,
485 'k
' => 'K
', X_DA => X_BA, X_EA => X_CA, X_FA => X_AA,
486 'l
' => 'L
', X_DB => X_BB, X_EB => X_CB, X_FB => X_AB,
487 'm
' => 'M
', X_DC => X_BC, X_EC => X_CC, X_FC => X_AC,
488 'n
' => 'N
', X_DD => X_BD, X_ED => X_CD,
489 'o
' => 'O
', X_DE => X_BE, X_EE => X_CE, X_FE => X_AE,
490 'p
' => 'P
', X_DF => X_BF, X_EF => X_CF, X_FF => X_AF,
502 'A
' => 'A
', X_B0 => X_B0, X_C0 => X_C0,
503 'B
' => 'B
', X_B1 => X_B1, X_C1 => X_C1, X_A1 => X_A1,
504 'C
' => 'C
', X_B2 => X_B2, X_C2 => X_C2, X_A2 => X_A2,
505 'D
' => 'D
', X_B3 => X_B3, X_C3 => X_C3, X_A3 => X_A3,
506 'E
' => 'E
', X_B4 => X_B4, X_C4 => X_C4, X_A4 => X_A4,
507 'F
' => 'F
', X_B5 => X_B5, X_C5 => X_C5, X_A5 => X_A5,
508 'G
' => 'G
', X_B6 => X_B6, X_C6 => X_C6, X_A6 => X_A6,
509 'H
' => 'H
', X_B7 => X_B7, X_C7 => X_C7, X_A7 => X_A7,
510 'I
' => 'I
', X_B8 => X_B8, X_C8 => X_C8, X_A8 => X_A8,
511 'J
' => 'J
', X_B9 => X_B9, X_C9 => X_C9, X_A9 => X_A9,
512 'K
' => 'K
', X_BA => X_BA, X_CA => X_CA, X_AA => X_AA,
513 'L
' => 'L
', X_BB => X_BB, X_CB => X_CB, X_AB => X_AB,
514 'M
' => 'M
', X_BC => X_BC, X_CC => X_CC, X_AC => X_AC,
515 'N
' => 'N
', X_BD => X_BD, X_CD => X_CD,
516 'O
' => 'O
', X_BE => X_BE, X_CE => X_CE, X_AE => X_AE,
517 'P
' => 'P
', X_BF => X_BF, X_CF => X_CF, X_AF => X_AF,
544 ------------------------------------------
545 -- Definitions for Latin-9 (ISO 8859-9) --
546 ------------------------------------------
548 Fold_Latin_9 : Translate_Table := Translate_Table'(
550 'a' => 'A', X_E0
=> X_C0
, X_F0
=> X_D0
,
551 'b' => 'B', X_E1
=> X_C1
, X_F1
=> X_D1
,
552 'c' => 'C', X_E2
=> X_C2
, X_F2
=> X_D2
,
553 'd' => 'D', X_E3
=> X_C3
, X_F3
=> X_D3
,
554 'e' => 'E', X_E4
=> X_C4
, X_F4
=> X_D4
,
555 'f' => 'F', X_E5
=> X_C5
, X_F5
=> X_D5
,
556 'g' => 'G', X_E6
=> X_C6
, X_F6
=> X_D6
,
557 'h' => 'H', X_E7
=> X_C7
,
558 'i' => 'I', X_E8
=> X_C8
, X_F8
=> X_D8
,
559 'j' => 'J', X_E9
=> X_C9
, X_F9
=> X_D9
,
560 'k' => 'K', X_EA
=> X_CA
, X_FA
=> X_DA
,
561 'l' => 'L', X_EB
=> X_CB
, X_FB
=> X_DB
,
562 'm' => 'M', X_EC
=> X_CC
, X_FC
=> X_DC
,
563 'n' => 'N', X_ED
=> X_CD
, X_FD
=> X_DD
,
564 'o' => 'O', X_EE
=> X_CE
, X_FE
=> X_DE
,
565 'p' => 'P', X_EF
=> X_CF
,
566 'q' => 'Q', X_A8
=> X_A6
,
567 'r' => 'R', X_B8
=> X_B4
,
568 's' => 'S', X_BD
=> X_BC
,
569 't' => 'T', X_BE
=> X_FF
,
577 'A' => 'A', X_C0
=> X_C0
, X_D0
=> X_D0
,
578 'B' => 'B', X_C1
=> X_C1
, X_D1
=> X_D1
,
579 'C' => 'C', X_C2
=> X_C2
, X_D2
=> X_D2
,
580 'D' => 'D', X_C3
=> X_C3
, X_D3
=> X_D3
,
581 'E' => 'E', X_C4
=> X_C4
, X_D4
=> X_D4
,
582 'F' => 'F', X_C5
=> X_C5
, X_D5
=> X_D5
,
583 'G' => 'G', X_C6
=> X_C6
, X_D6
=> X_D6
,
584 'H' => 'H', X_C7
=> X_C7
,
585 'I' => 'I', X_C8
=> X_C8
, X_D8
=> X_D8
,
586 'J' => 'J', X_C9
=> X_C9
, X_D9
=> X_D9
,
587 'K' => 'K', X_CA
=> X_CA
, X_DA
=> X_DA
,
588 'L' => 'L', X_CB
=> X_CB
, X_DB
=> X_DB
,
589 'M' => 'M', X_CC
=> X_CC
, X_DC
=> X_DC
,
590 'N' => 'N', X_CD
=> X_CD
, X_DD
=> X_DD
,
591 'O' => 'O', X_CE
=> X_CE
, X_DE
=> X_DE
,
592 'P' => 'P', X_CF
=> X_CF
, X_DF
=> X_DF
, X_FF
=> X_FF
,
593 'Q' => 'Q', X_A6
=> X_A6
,
594 'R' => 'R', X_B4
=> X_B4
,
595 'S' => 'S', X_BC
=> X_BC
,
619 --------------------------------------------
620 -- Definitions for IBM PC (Code Page 437) --
621 --------------------------------------------
623 -- Note: Code page 437 is the typical default in DOS, Windows and OS/2
624 -- for PC's in the US, it corresponds to the original PC character set.
625 -- See also the definitions for code page 850.
627 Fold_IBM_PC_437
: Translate_Table
:= Translate_Table
'(
683 X_80 => X_80, -- C cedilla
684 X_81 => X_9A, -- u umlaut
685 X_82 => X_90, -- e acute
686 X_83 => X_83, -- a circumflex
687 X_84 => X_8E, -- a umlaut
688 X_85 => X_85, -- a grave
689 X_86 => X_8F, -- a ring
690 X_87 => X_80, -- c cedilla
691 X_88 => X_88, -- e circumflex
692 X_89 => X_89, -- e umlaut
693 X_8A => X_8A, -- e grave
694 X_8B => X_8B, -- i umlaut
695 X_8C => X_8C, -- i circumflex
696 X_8D => X_8D, -- i grave
697 X_8E => X_8E, -- A umlaut
698 X_8F => X_8F, -- A ring
700 X_90 => X_90, -- E acute
703 X_93 => X_93, -- o circumflex
704 X_94 => X_99, -- o umlaut
705 X_95 => X_95, -- o grave
706 X_96 => X_96, -- u circumflex
707 X_97 => X_97, -- u grave
708 X_98 => X_98, -- y umlaut
709 X_99 => X_99, -- O umlaut
710 X_9A => X_9A, -- U umlaut
712 X_A0 => X_A0, -- a acute
713 X_A1 => X_A1, -- i acute
714 X_A2 => X_A2, -- o acute
715 X_A3 => X_A3, -- u acute
716 X_A4 => X_A5, -- n tilde
717 X_A5 => X_A5, -- N tilde
718 X_A6 => X_A6, -- a underline
719 X_A7 => X_A7, -- o underline
721 X_E0 => X_E0, -- lower case alpha
722 X_E1 => X_E1, -- lower case beta
723 X_E2 => X_E2, -- upper case gamma
724 X_E3 => X_E3, -- lower case pi
725 X_E4 => X_E4, -- upper case sigma (lower/upper sigma not equivalent)
726 X_E5 => X_E5, -- lower case sigma (lower/upper sigma not equivalent)
727 X_E6 => X_E6, -- lower case mu
728 X_E7 => X_E7, -- lower case tau
729 X_E8 => X_E8, -- upper case phi (lower/upper phi not equivalent)
730 X_E9 => X_E9, -- lower case theta
731 X_EA => X_EA, -- upper case omega
732 X_EB => X_EB, -- lower case delta
733 X_ED => X_ED, -- lower case phi (lower/upper phi not equivalent)
734 X_EE => X_EE, -- lower case epsilon
736 X_FC => X_FC, -- lower case eta
753 --------------------------------------------
754 -- Definitions for IBM PC (Code Page 850) --
755 --------------------------------------------
757 -- Note: Code page 850 is the typical default in DOS, Windows and OS/2
758 -- for PC's in Europe, it is an extension of the original PC character
759 -- set to include the additional characters defined in ISO Latin-1.
760 -- See also the definitions for code page 437.
762 Fold_IBM_PC_850 : Translate_Table := Translate_Table'(
818 X_80
=> X_80
, -- C cedilla
819 X_81
=> X_9A
, -- u umlaut
820 X_82
=> X_90
, -- e acute
821 X_83
=> X_B6
, -- a circumflex
822 X_84
=> X_8E
, -- a umlaut
823 X_85
=> X_B7
, -- a grave
824 X_86
=> X_8F
, -- a ring
825 X_87
=> X_80
, -- c cedilla
826 X_88
=> X_D2
, -- e circumflex
827 X_89
=> X_D3
, -- e umlaut
828 X_8A
=> X_D4
, -- e grave
829 X_8B
=> X_D8
, -- i umlaut
830 X_8C
=> X_D7
, -- i circumflex
831 X_8D
=> X_DE
, -- i grave
832 X_8E
=> X_8E
, -- A umlaut
833 X_8F
=> X_8F
, -- A ring
835 X_90
=> X_90
, -- E acute
838 X_93
=> X_E2
, -- o circumflex
839 X_94
=> X_99
, -- o umlaut
840 X_95
=> X_E3
, -- o grave
841 X_96
=> X_EA
, -- u circumflex
842 X_97
=> X_EB
, -- u grave
843 X_98
=> X_98
, -- y umlaut
844 X_99
=> X_99
, -- O umlaut
845 X_9A
=> X_9A
, -- U umlaut
847 X_A0
=> X_B5
, -- a acute
848 X_A1
=> X_D6
, -- i acute
849 X_A2
=> X_E0
, -- o acute
850 X_A3
=> X_E9
, -- u acute
851 X_A4
=> X_A5
, -- n tilde
852 X_A5
=> X_A5
, -- N tilde
853 X_A6
=> X_A6
, -- a underline
854 X_A7
=> X_A7
, -- o underline
856 X_B5
=> X_B5
, -- A acute
857 X_B6
=> X_B6
, -- A circumflex
858 X_B7
=> X_B7
, -- A grave
860 X_C6
=> X_C7
, -- a tilde
861 X_C7
=> X_C7
, -- A tilde
865 X_D2
=> X_D2
, -- E circumflex
866 X_D3
=> X_D3
, -- E umlaut
867 X_D4
=> X_D4
, -- E grave
868 X_D5
=> X_D5
, -- dotless i, no uppercase
869 X_D6
=> X_D6
, -- I acute
870 X_D7
=> X_D7
, -- I circumflex
871 X_D8
=> X_D8
, -- I umlaut
872 X_DE
=> X_DE
, -- I grave
874 X_E0
=> X_E0
, -- O acute
875 X_E1
=> X_E1
, -- german dbl s, no uppercase
876 X_E2
=> X_E2
, -- O circumflex
877 X_E3
=> X_E3
, -- O grave
878 X_E4
=> X_E4
, -- o tilde
879 X_E5
=> X_E5
, -- O tilde
880 X_E7
=> X_E8
, -- thorn
881 X_E8
=> X_E8
, -- Thorn
882 X_E9
=> X_E9
, -- U acute
883 X_EA
=> X_EA
, -- U circumflex
884 X_EB
=> X_EB
, -- U grave
885 X_EC
=> X_ED
, -- y acute
886 X_ED
=> X_ED
, -- Y acute
903 -----------------------------------------
904 -- Definitions for Full Upper Half Set --
905 -----------------------------------------
907 -- The full upper half set allows all upper half characters as letters,
908 -- and does not recognize any upper/lower case equivalences in this half.
910 Fold_Full_Upper_Half
: Translate_Table
:= Translate_Table
'(
966 X_80 => X_80, X_90 => X_90, X_A0 => X_A0, X_B0 => X_B0,
967 X_81 => X_81, X_91 => X_91, X_A1 => X_A1, X_B1 => X_B1,
968 X_82 => X_82, X_92 => X_92, X_A2 => X_A2, X_B2 => X_B2,
969 X_83 => X_83, X_93 => X_93, X_A3 => X_A3, X_B3 => X_B3,
970 X_84 => X_84, X_94 => X_94, X_A4 => X_A4, X_B4 => X_B4,
971 X_85 => X_85, X_95 => X_95, X_A5 => X_A5, X_B5 => X_B5,
972 X_86 => X_86, X_96 => X_96, X_A6 => X_A6, X_B6 => X_B6,
973 X_87 => X_87, X_97 => X_97, X_A7 => X_A7, X_B7 => X_B7,
974 X_88 => X_88, X_98 => X_98, X_A8 => X_A8, X_B8 => X_B8,
975 X_89 => X_89, X_99 => X_99, X_A9 => X_A9, X_B9 => X_B9,
976 X_8A => X_8A, X_9A => X_9A, X_AA => X_AA, X_BA => X_BA,
977 X_8B => X_8B, X_9B => X_9B, X_AB => X_AB, X_BB => X_BB,
978 X_8C => X_8C, X_9C => X_9C, X_AC => X_AC, X_BC => X_BC,
979 X_8D => X_8D, X_9D => X_9D, X_AD => X_AD, X_BD => X_BD,
980 X_8E => X_8E, X_9E => X_9E, X_AE => X_AE, X_BE => X_BE,
981 X_8F => X_8F, X_9F => X_9F, X_AF => X_AF, X_BF => X_BF,
983 X_C0 => X_C0, X_D0 => X_D0, X_E0 => X_E0, X_F0 => X_F0,
984 X_C1 => X_C1, X_D1 => X_D1, X_E1 => X_E1, X_F1 => X_F1,
985 X_C2 => X_C2, X_D2 => X_D2, X_E2 => X_E2, X_F2 => X_F2,
986 X_C3 => X_C3, X_D3 => X_D3, X_E3 => X_E3, X_F3 => X_F3,
987 X_C4 => X_C4, X_D4 => X_D4, X_E4 => X_E4, X_F4 => X_F4,
988 X_C5 => X_C5, X_D5 => X_D5, X_E5 => X_E5, X_F5 => X_F5,
989 X_C6 => X_C6, X_D6 => X_D6, X_E6 => X_E6, X_F6 => X_F6,
990 X_C7 => X_C7, X_D7 => X_D7, X_E7 => X_E7, X_F7 => X_F7,
991 X_C8 => X_C8, X_D8 => X_D8, X_E8 => X_E8, X_F8 => X_F8,
992 X_C9 => X_C9, X_D9 => X_D9, X_E9 => X_E9, X_F9 => X_F9,
993 X_CA => X_CA, X_DA => X_DA, X_EA => X_EA, X_FA => X_FA,
994 X_CB => X_CB, X_DB => X_DB, X_EB => X_EB, X_FB => X_FB,
995 X_CC => X_CC, X_DC => X_DC, X_EC => X_EC, X_FC => X_FC,
996 X_CD => X_CD, X_DD => X_DD, X_ED => X_ED, X_FD => X_FD,
997 X_CE => X_CE, X_DE => X_DE, X_EE => X_EE, X_FE => X_FE,
998 X_CF => X_CF, X_DF => X_DF, X_EF => X_EF, X_FF => X_FF,
1015 ---------------------------------------
1016 -- Definitions for No Upper Half Set --
1017 ---------------------------------------
1019 -- The no upper half set allows no upper half characters as letters, and
1020 -- thus there are no upper/lower case equivalences in this half. This set
1021 -- corresponds to the Ada 83 rules.
1023 Fold_No_Upper_Half : Translate_Table := Translate_Table'(
1098 procedure Initialize
is
1100 -- Set Fold_Upper table from source code indication
1102 if Identifier_Character_Set
= '1'
1103 or else Identifier_Character_Set
= 'w'
1105 Fold_Upper
:= Fold_Latin_1
;
1107 elsif Identifier_Character_Set
= '2' then
1108 Fold_Upper
:= Fold_Latin_2
;
1110 elsif Identifier_Character_Set
= '3' then
1111 Fold_Upper
:= Fold_Latin_3
;
1113 elsif Identifier_Character_Set
= '4' then
1114 Fold_Upper
:= Fold_Latin_4
;
1116 elsif Identifier_Character_Set
= '5' then
1117 Fold_Upper
:= Fold_Latin_5
;
1119 elsif Identifier_Character_Set
= 'p' then
1120 Fold_Upper
:= Fold_IBM_PC_437
;
1122 elsif Identifier_Character_Set
= '8' then
1123 Fold_Upper
:= Fold_IBM_PC_850
;
1125 elsif Identifier_Character_Set
= '9' then
1126 Fold_Upper
:= Fold_Latin_9
;
1128 elsif Identifier_Character_Set
= 'f' then
1129 Fold_Upper
:= Fold_Full_Upper_Half
;
1131 else -- Identifier_Character_Set = 'n'
1132 Fold_Upper
:= Fold_No_Upper_Half
;
1135 -- Use Fold_Upper table to compute Fold_Lower table
1137 Fold_Lower
:= Fold_Upper
;
1139 for J
in Character loop
1140 if J
/= Fold_Upper
(J
) then
1141 Fold_Lower
(Fold_Upper
(J
)) := J
;
1142 Fold_Lower
(J
) := J
;
1146 Fold_Lower
(' ') := ' ';
1148 -- Build Identifier_Char table from used entries of Fold_Upper
1150 for J
in Character loop
1151 Identifier_Char
(J
) := (Fold_Upper
(J
) /= ' ');
1154 -- Always add [ as an identifier character to deal with the brackets
1155 -- notation for wide characters used in identifiers. Note that if
1156 -- we are not allowing wide characters in identifiers, then any use
1157 -- of this notation will be flagged as an error in Scan_Identifier.
1159 Identifier_Char
('[') := True;
1161 -- Add entry for ESC if wide characters in use with a wide character
1162 -- encoding method active that uses the ESC code for encoding. Also
1163 -- add entry for left bracket to capture use of brackets notation.
1165 if Identifier_Character_Set
= 'w'
1166 and then Wide_Character_Encoding_Method
in WC_ESC_Encoding_Method
1168 Identifier_Char
(ASCII
.ESC
) := True;
1172 --------------------------
1173 -- Is_Lower_Case_Letter --
1174 --------------------------
1176 function Is_Lower_Case_Letter
(C
: Character) return Boolean is
1178 return C
/= Fold_Upper
(C
);
1179 end Is_Lower_Case_Letter
;
1181 --------------------------
1182 -- Is_Upper_Case_Letter --
1183 --------------------------
1185 function Is_Upper_Case_Letter
(C
: Character) return Boolean is
1187 return C
/= Fold_Lower
(C
);
1188 end Is_Upper_Case_Letter
;