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