1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
9 -- Copyright (C) 1992-2009, 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 3, 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. --
18 -- As a special exception under Section 7 of GPL version 3, you are granted --
19 -- additional permissions described in the GCC Runtime Library Exception, --
20 -- version 3.1, as published by the Free Software Foundation. --
22 -- You should have received a copy of the GNU General Public License and --
23 -- a copy of the GCC Runtime Library Exception along with this program; --
24 -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
25 -- <http://www.gnu.org/licenses/>. --
27 -- GNAT was originally developed by the GNAT team at New York University. --
28 -- Extensive contributions were provided by Ada Core Technologies Inc. --
30 ------------------------------------------------------------------------------
34 with System
.WCh_Con
; use System
.WCh_Con
;
38 X_80
: constant Character := Character'Val (16#
80#
);
39 X_81
: constant Character := Character'Val (16#
81#
);
40 X_82
: constant Character := Character'Val (16#
82#
);
41 X_83
: constant Character := Character'Val (16#
83#
);
42 X_84
: constant Character := Character'Val (16#
84#
);
43 X_85
: constant Character := Character'Val (16#
85#
);
44 X_86
: constant Character := Character'Val (16#
86#
);
45 X_87
: constant Character := Character'Val (16#
87#
);
46 X_88
: constant Character := Character'Val (16#
88#
);
47 X_89
: constant Character := Character'Val (16#
89#
);
48 X_8A
: constant Character := Character'Val (16#
8A#
);
49 X_8B
: constant Character := Character'Val (16#
8B#
);
50 X_8C
: constant Character := Character'Val (16#
8C#
);
51 X_8D
: constant Character := Character'Val (16#
8D#
);
52 X_8E
: constant Character := Character'Val (16#
8E#
);
53 X_8F
: constant Character := Character'Val (16#
8F#
);
54 X_90
: constant Character := Character'Val (16#
90#
);
55 X_91
: constant Character := Character'Val (16#
91#
);
56 X_92
: constant Character := Character'Val (16#
92#
);
57 X_93
: constant Character := Character'Val (16#
93#
);
58 X_94
: constant Character := Character'Val (16#
94#
);
59 X_95
: constant Character := Character'Val (16#
95#
);
60 X_96
: constant Character := Character'Val (16#
96#
);
61 X_97
: constant Character := Character'Val (16#
97#
);
62 X_98
: constant Character := Character'Val (16#
98#
);
63 X_99
: constant Character := Character'Val (16#
99#
);
64 X_9A
: constant Character := Character'Val (16#
9A#
);
65 X_9B
: constant Character := Character'Val (16#
9B#
);
66 X_9C
: constant Character := Character'Val (16#
9C#
);
67 X_9D
: constant Character := Character'Val (16#
9D#
);
68 X_9E
: constant Character := Character'Val (16#
9E#
);
69 X_9F
: constant Character := Character'Val (16#
9F#
);
70 X_A0
: constant Character := Character'Val (16#A0#
);
71 X_A1
: constant Character := Character'Val (16#A1#
);
72 X_A2
: constant Character := Character'Val (16#A2#
);
73 X_A3
: constant Character := Character'Val (16#A3#
);
74 X_A4
: constant Character := Character'Val (16#A4#
);
75 X_A5
: constant Character := Character'Val (16#A5#
);
76 X_A6
: constant Character := Character'Val (16#A6#
);
77 X_A7
: constant Character := Character'Val (16#A7#
);
78 X_A8
: constant Character := Character'Val (16#A8#
);
79 X_A9
: constant Character := Character'Val (16#A9#
);
80 X_AA
: constant Character := Character'Val (16#AA#
);
81 X_AB
: constant Character := Character'Val (16#AB#
);
82 X_AC
: constant Character := Character'Val (16#AC#
);
83 X_AD
: constant Character := Character'Val (16#AD#
);
84 X_AE
: constant Character := Character'Val (16#AE#
);
85 X_AF
: constant Character := Character'Val (16#AF#
);
86 X_B0
: constant Character := Character'Val (16#B0#
);
87 X_B1
: constant Character := Character'Val (16#B1#
);
88 X_B2
: constant Character := Character'Val (16#B2#
);
89 X_B3
: constant Character := Character'Val (16#B3#
);
90 X_B4
: constant Character := Character'Val (16#B4#
);
91 X_B5
: constant Character := Character'Val (16#B5#
);
92 X_B6
: constant Character := Character'Val (16#B6#
);
93 X_B7
: constant Character := Character'Val (16#B7#
);
94 X_B8
: constant Character := Character'Val (16#B8#
);
95 X_B9
: constant Character := Character'Val (16#B9#
);
96 X_BA
: constant Character := Character'Val (16#BA#
);
97 X_BB
: constant Character := Character'Val (16#BB#
);
98 X_BC
: constant Character := Character'Val (16#BC#
);
99 X_BD
: constant Character := Character'Val (16#BD#
);
100 X_BE
: constant Character := Character'Val (16#BE#
);
101 X_BF
: constant Character := Character'Val (16#BF#
);
102 X_C0
: constant Character := Character'Val (16#C0#
);
103 X_C1
: constant Character := Character'Val (16#C1#
);
104 X_C2
: constant Character := Character'Val (16#C2#
);
105 X_C3
: constant Character := Character'Val (16#C3#
);
106 X_C4
: constant Character := Character'Val (16#C4#
);
107 X_C5
: constant Character := Character'Val (16#C5#
);
108 X_C6
: constant Character := Character'Val (16#C6#
);
109 X_C7
: constant Character := Character'Val (16#C7#
);
110 X_C8
: constant Character := Character'Val (16#C8#
);
111 X_C9
: constant Character := Character'Val (16#C9#
);
112 X_CA
: constant Character := Character'Val (16#CA#
);
113 X_CB
: constant Character := Character'Val (16#CB#
);
114 X_CC
: constant Character := Character'Val (16#CC#
);
115 X_CD
: constant Character := Character'Val (16#CD#
);
116 X_CE
: constant Character := Character'Val (16#CE#
);
117 X_CF
: constant Character := Character'Val (16#CF#
);
118 X_D0
: constant Character := Character'Val (16#D0#
);
119 X_D1
: constant Character := Character'Val (16#D1#
);
120 X_D2
: constant Character := Character'Val (16#D2#
);
121 X_D3
: constant Character := Character'Val (16#D3#
);
122 X_D4
: constant Character := Character'Val (16#D4#
);
123 X_D5
: constant Character := Character'Val (16#D5#
);
124 X_D6
: constant Character := Character'Val (16#D6#
);
125 X_D7
: constant Character := Character'Val (16#D7#
);
126 X_D8
: constant Character := Character'Val (16#D8#
);
127 X_D9
: constant Character := Character'Val (16#D9#
);
128 X_DA
: constant Character := Character'Val (16#DA#
);
129 X_DB
: constant Character := Character'Val (16#DB#
);
130 X_DC
: constant Character := Character'Val (16#DC#
);
131 X_DD
: constant Character := Character'Val (16#DD#
);
132 X_DE
: constant Character := Character'Val (16#DE#
);
133 X_DF
: constant Character := Character'Val (16#DF#
);
134 X_E0
: constant Character := Character'Val (16#E0#
);
135 X_E1
: constant Character := Character'Val (16#E1#
);
136 X_E2
: constant Character := Character'Val (16#E2#
);
137 X_E3
: constant Character := Character'Val (16#E3#
);
138 X_E4
: constant Character := Character'Val (16#E4#
);
139 X_E5
: constant Character := Character'Val (16#E5#
);
140 X_E6
: constant Character := Character'Val (16#E6#
);
141 X_E7
: constant Character := Character'Val (16#E7#
);
142 X_E8
: constant Character := Character'Val (16#E8#
);
143 X_E9
: constant Character := Character'Val (16#E9#
);
144 X_EA
: constant Character := Character'Val (16#EA#
);
145 X_EB
: constant Character := Character'Val (16#EB#
);
146 X_EC
: constant Character := Character'Val (16#EC#
);
147 X_ED
: constant Character := Character'Val (16#ED#
);
148 X_EE
: constant Character := Character'Val (16#EE#
);
149 X_EF
: constant Character := Character'Val (16#EF#
);
150 X_F0
: constant Character := Character'Val (16#F0#
);
151 X_F1
: constant Character := Character'Val (16#F1#
);
152 X_F2
: constant Character := Character'Val (16#F2#
);
153 X_F3
: constant Character := Character'Val (16#F3#
);
154 X_F4
: constant Character := Character'Val (16#F4#
);
155 X_F5
: constant Character := Character'Val (16#F5#
);
156 X_F6
: constant Character := Character'Val (16#F6#
);
157 X_F7
: constant Character := Character'Val (16#F7#
);
158 X_F8
: constant Character := Character'Val (16#F8#
);
159 X_F9
: constant Character := Character'Val (16#F9#
);
160 X_FA
: constant Character := Character'Val (16#FA#
);
161 X_FB
: constant Character := Character'Val (16#FB#
);
162 X_FC
: constant Character := Character'Val (16#FC#
);
163 X_FD
: constant Character := Character'Val (16#FD#
);
164 X_FE
: constant Character := Character'Val (16#FE#
);
165 X_FF
: constant Character := Character'Val (16#FF#
);
167 ------------------------------------------
168 -- Definitions for Latin-1 (ISO 8859-1) --
169 ------------------------------------------
171 Fold_Latin_1
: constant Translate_Table
:= Translate_Table
'(
173 'a
' => 'A
', X_E0 => X_C0, X_F0 => X_D0,
174 'b
' => 'B
', X_E1 => X_C1, X_F1 => X_D1,
175 'c
' => 'C
', X_E2 => X_C2, X_F2 => X_D2,
176 'd
' => 'D
', X_E3 => X_C3, X_F3 => X_D3,
177 'e
' => 'E
', X_E4 => X_C4, X_F4 => X_D4,
178 'f
' => 'F
', X_E5 => X_C5, X_F5 => X_D5,
179 'g
' => 'G
', X_E6 => X_C6, X_F6 => X_D6,
180 'h
' => 'H
', X_E7 => X_C7,
181 'i
' => 'I
', X_E8 => X_C8, X_F8 => X_D8,
182 'j
' => 'J
', X_E9 => X_C9, X_F9 => X_D9,
183 'k
' => 'K
', X_EA => X_CA, X_FA => X_DA,
184 'l
' => 'L
', X_EB => X_CB, X_FB => X_DB,
185 'm
' => 'M
', X_EC => X_CC, X_FC => X_DC,
186 'n
' => 'N
', X_ED => X_CD, X_FD => X_DD,
187 'o
' => 'O
', X_EE => X_CE, X_FE => X_DE,
188 'p
' => 'P
', X_EF => X_CF,
200 'A
' => 'A
', X_C0 => X_C0, X_D0 => X_D0,
201 'B
' => 'B
', X_C1 => X_C1, X_D1 => X_D1,
202 'C
' => 'C
', X_C2 => X_C2, X_D2 => X_D2,
203 'D
' => 'D
', X_C3 => X_C3, X_D3 => X_D3,
204 'E
' => 'E
', X_C4 => X_C4, X_D4 => X_D4,
205 'F
' => 'F
', X_C5 => X_C5, X_D5 => X_D5,
206 'G
' => 'G
', X_C6 => X_C6, X_D6 => X_D6,
207 'H
' => 'H
', X_C7 => X_C7,
208 'I
' => 'I
', X_C8 => X_C8, X_D8 => X_D8,
209 'J
' => 'J
', X_C9 => X_C9, X_D9 => X_D9,
210 'K
' => 'K
', X_CA => X_CA, X_DA => X_DA,
211 'L
' => 'L
', X_CB => X_CB, X_DB => X_DB,
212 'M
' => 'M
', X_CC => X_CC, X_DC => X_DC,
213 'N
' => 'N
', X_CD => X_CD, X_DD => X_DD,
214 'O
' => 'O
', X_CE => X_CE, X_DE => X_DE,
215 'P
' => 'P
', X_CF => X_CF, X_DF => X_DF, X_FF => X_FF,
242 ------------------------------------------
243 -- Definitions for Latin-2 (ISO 8859-2) --
244 ------------------------------------------
246 Fold_Latin_2 : constant Translate_Table := Translate_Table'(
248 'a' => 'A', X_E0
=> X_C0
, X_F0
=> X_D0
,
249 'b' => 'B', X_E1
=> X_C1
, X_F1
=> X_D1
, X_B1
=> X_A1
,
250 'c' => 'C', X_E2
=> X_C2
, X_F2
=> X_D2
,
251 'd' => 'D', X_E3
=> X_C3
, X_F3
=> X_D3
, X_B3
=> X_A3
,
252 'e' => 'E', X_E4
=> X_C4
, X_F4
=> X_D4
,
253 'f' => 'F', X_E5
=> X_C5
, X_F5
=> X_D5
, X_B5
=> X_A5
,
254 'g' => 'G', X_E6
=> X_C6
, X_F6
=> X_D6
, X_B6
=> X_A6
,
255 'h' => 'H', X_E7
=> X_C7
,
256 'i' => 'I', X_E8
=> X_C8
, X_F8
=> X_D8
,
257 'j' => 'J', X_E9
=> X_C9
, X_F9
=> X_D9
, X_B9
=> X_A9
,
258 'k' => 'K', X_EA
=> X_CA
, X_FA
=> X_DA
, X_BA
=> X_AA
,
259 'l' => 'L', X_EB
=> X_CB
, X_FB
=> X_DB
, X_BB
=> X_AB
,
260 'm' => 'M', X_EC
=> X_CC
, X_FC
=> X_DC
, X_BC
=> X_AC
,
261 'n' => 'N', X_ED
=> X_CD
, X_FD
=> X_DD
,
262 'o' => 'O', X_EE
=> X_CE
, X_FE
=> X_DE
, X_BE
=> X_AE
,
263 'p' => 'P', X_EF
=> X_CF
, X_FF
=> X_DF
, X_BF
=> X_AF
,
275 'A' => 'A', X_C0
=> X_C0
, X_D0
=> X_D0
,
276 'B' => 'B', X_C1
=> X_C1
, X_D1
=> X_D1
, X_A1
=> X_A1
,
277 'C' => 'C', X_C2
=> X_C2
, X_D2
=> X_D2
,
278 'D' => 'D', X_C3
=> X_C3
, X_D3
=> X_D3
, X_A3
=> X_A3
,
279 'E' => 'E', X_C4
=> X_C4
, X_D4
=> X_D4
,
280 'F' => 'F', X_C5
=> X_C5
, X_D5
=> X_D5
, X_A5
=> X_A5
,
281 'G' => 'G', X_C6
=> X_C6
, X_D6
=> X_D6
, X_A6
=> X_A6
,
282 'H' => 'H', X_C7
=> X_C7
,
283 'I' => 'I', X_C8
=> X_C8
, X_D8
=> X_D8
,
284 'J' => 'J', X_C9
=> X_C9
, X_D9
=> X_D9
, X_A9
=> X_A9
,
285 'K' => 'K', X_CA
=> X_CA
, X_DA
=> X_DA
, X_AA
=> X_AA
,
286 'L' => 'L', X_CB
=> X_CB
, X_DB
=> X_DB
, X_AB
=> X_AB
,
287 'M' => 'M', X_CC
=> X_CC
, X_DC
=> X_DC
, X_AC
=> X_AC
,
288 'N' => 'N', X_CD
=> X_CD
, X_DD
=> X_DD
,
289 'O' => 'O', X_CE
=> X_CE
, X_DE
=> X_DE
, X_AE
=> X_AE
,
290 'P' => 'P', X_CF
=> X_CF
, X_DF
=> X_DF
, X_AF
=> X_AF
,
317 ------------------------------------------
318 -- Definitions for Latin-3 (ISO 8859-3) --
319 ------------------------------------------
321 Fold_Latin_3
: constant Translate_Table
:= Translate_Table
'(
323 'a
' => 'A
', X_E0 => X_C0,
324 'b
' => 'B
', X_E1 => X_C1, X_F1 => X_D1, X_B1 => X_A1,
325 'c
' => 'C
', X_E2 => X_C2, X_F2 => X_D2,
326 'd
' => 'D
', X_F3 => X_D3,
327 'e
' => 'E
', X_E4 => X_C4, X_F4 => X_D4,
328 'f
' => 'F
', X_E5 => X_C5, X_F5 => X_D5, X_B5 => X_A5,
329 'g
' => 'G
', X_E6 => X_C6, X_F6 => X_D6, X_B6 => X_A6,
330 'h
' => 'H
', X_E7 => X_C7,
331 'i
' => 'I
', X_E8 => X_C8, X_F8 => X_D8,
332 'j
' => 'J
', X_E9 => X_C9, X_F9 => X_D9, X_B9 => X_A9,
333 'k
' => 'K
', X_EA => X_CA, X_FA => X_DA, X_BA => X_AA,
334 'l
' => 'L
', X_EB => X_CB, X_FB => X_DB, X_BB => X_AB,
335 'm
' => 'M
', X_EC => X_CC, X_FC => X_DC, X_BC => X_AC,
336 'n
' => 'N
', X_ED => X_CD, X_FD => X_DD,
337 'o
' => 'O
', X_EE => X_CE, X_FE => X_DE,
338 'p
' => 'P
', X_EF => X_CF, X_BF => X_AF,
350 'A
' => 'A
', X_C0 => X_C0,
351 'B
' => 'B
', X_C1 => X_C1, X_D1 => X_D1, X_A1 => X_A1,
352 'C
' => 'C
', X_C2 => X_C2, X_D2 => X_D2,
353 'D
' => 'D
', X_D3 => X_D3,
354 'E
' => 'E
', X_C4 => X_C4, X_D4 => X_D4,
355 'F
' => 'F
', X_C5 => X_C5, X_D5 => X_D5, X_A5 => X_A5,
356 'G
' => 'G
', X_C6 => X_C6, X_D6 => X_D6, X_A6 => X_A6,
357 'H
' => 'H
', X_C7 => X_C7,
358 'I
' => 'I
', X_C8 => X_C8, X_D8 => X_D8,
359 'J
' => 'J
', X_C9 => X_C9, X_D9 => X_D9, X_A9 => X_A9,
360 'K
' => 'K
', X_CA => X_CA, X_DA => X_DA, X_AA => X_AA,
361 'L
' => 'L
', X_CB => X_CB, X_DB => X_DB, X_AB => X_AB,
362 'M
' => 'M
', X_CC => X_CC, X_DC => X_DC, X_AC => X_AC,
363 'N
' => 'N
', X_CD => X_CD, X_DD => X_DD,
364 'O
' => 'O
', X_CE => X_CE, X_DE => X_DE,
365 'P
' => 'P
', X_CF => X_CF, X_AF => X_AF,
392 ------------------------------------------
393 -- Definitions for Latin-4 (ISO 8859-4) --
394 ------------------------------------------
396 Fold_Latin_4 : constant Translate_Table := Translate_Table'(
398 'a' => 'A', X_E0
=> X_C0
, X_F0
=> X_D0
,
399 'b' => 'B', X_E1
=> X_C1
, X_F1
=> X_D1
, X_B1
=> X_A1
,
400 'c' => 'C', X_E2
=> X_C2
, X_F2
=> X_D2
,
401 'd' => 'D', X_E3
=> X_C3
, X_F3
=> X_D3
, X_B3
=> X_A3
,
402 'e' => 'E', X_E4
=> X_C4
, X_F4
=> X_D4
,
403 'f' => 'F', X_E5
=> X_C5
, X_F5
=> X_D5
, X_B5
=> X_A5
,
404 'g' => 'G', X_E6
=> X_C6
, X_F6
=> X_D6
, X_B6
=> X_A6
,
405 'h' => 'H', X_E7
=> X_C7
,
406 'i' => 'I', X_E8
=> X_C8
, X_F8
=> X_D8
,
407 'j' => 'J', X_E9
=> X_C9
, X_F9
=> X_D9
, X_B9
=> X_A9
,
408 'k' => 'K', X_EA
=> X_CA
, X_FA
=> X_DA
, X_BA
=> X_AA
,
409 'l' => 'L', X_EB
=> X_CB
, X_FB
=> X_DB
, X_BB
=> X_AB
,
410 'm' => 'M', X_EC
=> X_CC
, X_FC
=> X_DC
, X_BC
=> X_AC
,
411 'n' => 'N', X_ED
=> X_CD
, X_FD
=> X_DD
,
412 'o' => 'O', X_EE
=> X_CE
, X_FE
=> X_DE
, X_BE
=> X_AE
,
413 'p' => 'P', X_EF
=> X_CF
,
425 'A' => 'A', X_C0
=> X_C0
, X_D0
=> X_D0
,
426 'B' => 'B', X_C1
=> X_C1
, X_D1
=> X_D1
, X_A1
=> X_A1
,
427 'C' => 'C', X_C2
=> X_C2
, X_D2
=> X_D2
,
428 'D' => 'D', X_C3
=> X_C3
, X_D3
=> X_D3
, X_A3
=> X_A3
,
429 'E' => 'E', X_C4
=> X_C4
, X_D4
=> X_D4
,
430 'F' => 'F', X_C5
=> X_C5
, X_D5
=> X_D5
, X_A5
=> X_A5
,
431 'G' => 'G', X_C6
=> X_C6
, X_D6
=> X_D6
, X_A6
=> X_A6
,
432 'H' => 'H', X_C7
=> X_C7
,
433 'I' => 'I', X_C8
=> X_C8
, X_D8
=> X_D8
,
434 'J' => 'J', X_C9
=> X_C9
, X_D9
=> X_D9
, X_A9
=> X_A9
,
435 'K' => 'K', X_CA
=> X_CA
, X_DA
=> X_DA
, X_AA
=> X_AA
,
436 'L' => 'L', X_CB
=> X_CB
, X_DB
=> X_DB
, X_AB
=> X_AB
,
437 'M' => 'M', X_CC
=> X_CC
, X_DC
=> X_DC
, X_AC
=> X_AC
,
438 'N' => 'N', X_CD
=> X_CD
, X_DD
=> X_DD
,
439 'O' => 'O', X_CE
=> X_CE
, X_DE
=> X_DE
, X_AE
=> X_AE
,
440 'P' => 'P', X_CF
=> X_CF
,
467 ---------------------------------------------------
468 -- Definitions for Latin-5 (Cyrillic ISO-8859-5) --
469 ---------------------------------------------------
471 Fold_Latin_5
: constant Translate_Table
:= Translate_Table
'(
473 'a
' => 'A
', X_D0 => X_B0, X_E0 => X_C0,
474 'b
' => 'B
', X_D1 => X_B1, X_E1 => X_C1, X_F1 => X_A1,
475 'c
' => 'C
', X_D2 => X_B2, X_E2 => X_C2, X_F2 => X_A2,
476 'd
' => 'D
', X_D3 => X_B3, X_E3 => X_C3, X_F3 => X_A3,
477 'e
' => 'E
', X_D4 => X_B4, X_E4 => X_C4, X_F4 => X_A4,
478 'f
' => 'F
', X_D5 => X_B5, X_E5 => X_C5, X_F5 => X_A5,
479 'g
' => 'G
', X_D6 => X_B6, X_E6 => X_C6, X_F6 => X_A6,
480 'h
' => 'H
', X_D7 => X_B7, X_E7 => X_C7, X_F7 => X_A7,
481 'i
' => 'I
', X_D8 => X_B8, X_E8 => X_C8, X_F8 => X_A8,
482 'j
' => 'J
', X_D9 => X_B9, X_E9 => X_C9, X_F9 => X_A9,
483 'k
' => 'K
', X_DA => X_BA, X_EA => X_CA, X_FA => X_AA,
484 'l
' => 'L
', X_DB => X_BB, X_EB => X_CB, X_FB => X_AB,
485 'm
' => 'M
', X_DC => X_BC, X_EC => X_CC, X_FC => X_AC,
486 'n
' => 'N
', X_DD => X_BD, X_ED => X_CD,
487 'o
' => 'O
', X_DE => X_BE, X_EE => X_CE, X_FE => X_AE,
488 'p
' => 'P
', X_DF => X_BF, X_EF => X_CF, X_FF => X_AF,
500 'A
' => 'A
', X_B0 => X_B0, X_C0 => X_C0,
501 'B
' => 'B
', X_B1 => X_B1, X_C1 => X_C1, X_A1 => X_A1,
502 'C
' => 'C
', X_B2 => X_B2, X_C2 => X_C2, X_A2 => X_A2,
503 'D
' => 'D
', X_B3 => X_B3, X_C3 => X_C3, X_A3 => X_A3,
504 'E
' => 'E
', X_B4 => X_B4, X_C4 => X_C4, X_A4 => X_A4,
505 'F
' => 'F
', X_B5 => X_B5, X_C5 => X_C5, X_A5 => X_A5,
506 'G
' => 'G
', X_B6 => X_B6, X_C6 => X_C6, X_A6 => X_A6,
507 'H
' => 'H
', X_B7 => X_B7, X_C7 => X_C7, X_A7 => X_A7,
508 'I
' => 'I
', X_B8 => X_B8, X_C8 => X_C8, X_A8 => X_A8,
509 'J
' => 'J
', X_B9 => X_B9, X_C9 => X_C9, X_A9 => X_A9,
510 'K
' => 'K
', X_BA => X_BA, X_CA => X_CA, X_AA => X_AA,
511 'L
' => 'L
', X_BB => X_BB, X_CB => X_CB, X_AB => X_AB,
512 'M
' => 'M
', X_BC => X_BC, X_CC => X_CC, X_AC => X_AC,
513 'N
' => 'N
', X_BD => X_BD, X_CD => X_CD,
514 'O
' => 'O
', X_BE => X_BE, X_CE => X_CE, X_AE => X_AE,
515 'P
' => 'P
', X_BF => X_BF, X_CF => X_CF, X_AF => X_AF,
542 ------------------------------------------
543 -- Definitions for Latin-9 (ISO 8859-9) --
544 ------------------------------------------
546 Fold_Latin_9 : constant Translate_Table := Translate_Table'(
548 'a' => 'A', X_E0
=> X_C0
, X_F0
=> X_D0
,
549 'b' => 'B', X_E1
=> X_C1
, X_F1
=> X_D1
,
550 'c' => 'C', X_E2
=> X_C2
, X_F2
=> X_D2
,
551 'd' => 'D', X_E3
=> X_C3
, X_F3
=> X_D3
,
552 'e' => 'E', X_E4
=> X_C4
, X_F4
=> X_D4
,
553 'f' => 'F', X_E5
=> X_C5
, X_F5
=> X_D5
,
554 'g' => 'G', X_E6
=> X_C6
, X_F6
=> X_D6
,
555 'h' => 'H', X_E7
=> X_C7
,
556 'i' => 'I', X_E8
=> X_C8
, X_F8
=> X_D8
,
557 'j' => 'J', X_E9
=> X_C9
, X_F9
=> X_D9
,
558 'k' => 'K', X_EA
=> X_CA
, X_FA
=> X_DA
,
559 'l' => 'L', X_EB
=> X_CB
, X_FB
=> X_DB
,
560 'm' => 'M', X_EC
=> X_CC
, X_FC
=> X_DC
,
561 'n' => 'N', X_ED
=> X_CD
, X_FD
=> X_DD
,
562 'o' => 'O', X_EE
=> X_CE
, X_FE
=> X_DE
,
563 'p' => 'P', X_EF
=> X_CF
,
564 'q' => 'Q', X_A8
=> X_A6
,
565 'r' => 'R', X_B8
=> X_B4
,
566 's' => 'S', X_BD
=> X_BC
,
567 't' => 'T', X_BE
=> X_FF
,
575 'A' => 'A', X_C0
=> X_C0
, X_D0
=> X_D0
,
576 'B' => 'B', X_C1
=> X_C1
, X_D1
=> X_D1
,
577 'C' => 'C', X_C2
=> X_C2
, X_D2
=> X_D2
,
578 'D' => 'D', X_C3
=> X_C3
, X_D3
=> X_D3
,
579 'E' => 'E', X_C4
=> X_C4
, X_D4
=> X_D4
,
580 'F' => 'F', X_C5
=> X_C5
, X_D5
=> X_D5
,
581 'G' => 'G', X_C6
=> X_C6
, X_D6
=> X_D6
,
582 'H' => 'H', X_C7
=> X_C7
,
583 'I' => 'I', X_C8
=> X_C8
, X_D8
=> X_D8
,
584 'J' => 'J', X_C9
=> X_C9
, X_D9
=> X_D9
,
585 'K' => 'K', X_CA
=> X_CA
, X_DA
=> X_DA
,
586 'L' => 'L', X_CB
=> X_CB
, X_DB
=> X_DB
,
587 'M' => 'M', X_CC
=> X_CC
, X_DC
=> X_DC
,
588 'N' => 'N', X_CD
=> X_CD
, X_DD
=> X_DD
,
589 'O' => 'O', X_CE
=> X_CE
, X_DE
=> X_DE
,
590 'P' => 'P', X_CF
=> X_CF
, X_DF
=> X_DF
, X_FF
=> X_FF
,
591 'Q' => 'Q', X_A6
=> X_A6
,
592 'R' => 'R', X_B4
=> X_B4
,
593 'S' => 'S', X_BC
=> X_BC
,
617 --------------------------------------------
618 -- Definitions for IBM PC (Code Page 437) --
619 --------------------------------------------
621 -- Note: Code page 437 is the typical default in DOS, Windows and OS/2
622 -- for PC's in the US, it corresponds to the original PC character set.
623 -- See also the definitions for code page 850.
625 Fold_IBM_PC_437
: constant Translate_Table
:= Translate_Table
'(
681 X_80 => X_80, -- C cedilla
682 X_81 => X_9A, -- u umlaut
683 X_82 => X_90, -- e acute
684 X_83 => X_83, -- a circumflex
685 X_84 => X_8E, -- a umlaut
686 X_85 => X_85, -- a grave
687 X_86 => X_8F, -- a ring
688 X_87 => X_80, -- c cedilla
689 X_88 => X_88, -- e circumflex
690 X_89 => X_89, -- e umlaut
691 X_8A => X_8A, -- e grave
692 X_8B => X_8B, -- i umlaut
693 X_8C => X_8C, -- i circumflex
694 X_8D => X_8D, -- i grave
695 X_8E => X_8E, -- A umlaut
696 X_8F => X_8F, -- A ring
698 X_90 => X_90, -- E acute
701 X_93 => X_93, -- o circumflex
702 X_94 => X_99, -- o umlaut
703 X_95 => X_95, -- o grave
704 X_96 => X_96, -- u circumflex
705 X_97 => X_97, -- u grave
706 X_98 => X_98, -- y umlaut
707 X_99 => X_99, -- O umlaut
708 X_9A => X_9A, -- U umlaut
710 X_A0 => X_A0, -- a acute
711 X_A1 => X_A1, -- i acute
712 X_A2 => X_A2, -- o acute
713 X_A3 => X_A3, -- u acute
714 X_A4 => X_A5, -- n tilde
715 X_A5 => X_A5, -- N tilde
716 X_A6 => X_A6, -- a underline
717 X_A7 => X_A7, -- o underline
719 X_E0 => X_E0, -- lower case alpha
720 X_E1 => X_E1, -- lower case beta
721 X_E2 => X_E2, -- upper case gamma
722 X_E3 => X_E3, -- lower case pi
723 X_E4 => X_E4, -- upper case sigma (lower/upper sigma not equivalent)
724 X_E5 => X_E5, -- lower case sigma (lower/upper sigma not equivalent)
725 X_E6 => X_E6, -- lower case mu
726 X_E7 => X_E7, -- lower case tau
727 X_E8 => X_E8, -- upper case phi (lower/upper phi not equivalent)
728 X_E9 => X_E9, -- lower case theta
729 X_EA => X_EA, -- upper case omega
730 X_EB => X_EB, -- lower case delta
731 X_ED => X_ED, -- lower case phi (lower/upper phi not equivalent)
732 X_EE => X_EE, -- lower case epsilon
734 X_FC => X_FC, -- lower case eta
751 --------------------------------------------
752 -- Definitions for IBM PC (Code Page 850) --
753 --------------------------------------------
755 -- Note: Code page 850 is the typical default in DOS, Windows and OS/2
756 -- for PC's in Europe, it is an extension of the original PC character
757 -- set to include the additional characters defined in ISO Latin-1.
758 -- See also the definitions for code page 437.
760 Fold_IBM_PC_850 : constant Translate_Table := Translate_Table'(
816 X_80
=> X_80
, -- C cedilla
817 X_81
=> X_9A
, -- u umlaut
818 X_82
=> X_90
, -- e acute
819 X_83
=> X_B6
, -- a circumflex
820 X_84
=> X_8E
, -- a umlaut
821 X_85
=> X_B7
, -- a grave
822 X_86
=> X_8F
, -- a ring
823 X_87
=> X_80
, -- c cedilla
824 X_88
=> X_D2
, -- e circumflex
825 X_89
=> X_D3
, -- e umlaut
826 X_8A
=> X_D4
, -- e grave
827 X_8B
=> X_D8
, -- i umlaut
828 X_8C
=> X_D7
, -- i circumflex
829 X_8D
=> X_DE
, -- i grave
830 X_8E
=> X_8E
, -- A umlaut
831 X_8F
=> X_8F
, -- A ring
833 X_90
=> X_90
, -- E acute
836 X_93
=> X_E2
, -- o circumflex
837 X_94
=> X_99
, -- o umlaut
838 X_95
=> X_E3
, -- o grave
839 X_96
=> X_EA
, -- u circumflex
840 X_97
=> X_EB
, -- u grave
841 X_98
=> X_98
, -- y umlaut
842 X_99
=> X_99
, -- O umlaut
843 X_9A
=> X_9A
, -- U umlaut
845 X_A0
=> X_B5
, -- a acute
846 X_A1
=> X_D6
, -- i acute
847 X_A2
=> X_E0
, -- o acute
848 X_A3
=> X_E9
, -- u acute
849 X_A4
=> X_A5
, -- n tilde
850 X_A5
=> X_A5
, -- N tilde
851 X_A6
=> X_A6
, -- a underline
852 X_A7
=> X_A7
, -- o underline
854 X_B5
=> X_B5
, -- A acute
855 X_B6
=> X_B6
, -- A circumflex
856 X_B7
=> X_B7
, -- A grave
858 X_C6
=> X_C7
, -- a tilde
859 X_C7
=> X_C7
, -- A tilde
863 X_D2
=> X_D2
, -- E circumflex
864 X_D3
=> X_D3
, -- E umlaut
865 X_D4
=> X_D4
, -- E grave
866 X_D5
=> X_D5
, -- dotless i, no uppercase
867 X_D6
=> X_D6
, -- I acute
868 X_D7
=> X_D7
, -- I circumflex
869 X_D8
=> X_D8
, -- I umlaut
870 X_DE
=> X_DE
, -- I grave
872 X_E0
=> X_E0
, -- O acute
873 X_E1
=> X_E1
, -- german dbl s, no uppercase
874 X_E2
=> X_E2
, -- O circumflex
875 X_E3
=> X_E3
, -- O grave
876 X_E4
=> X_E4
, -- o tilde
877 X_E5
=> X_E5
, -- O tilde
878 X_E7
=> X_E8
, -- thorn
879 X_E8
=> X_E8
, -- Thorn
880 X_E9
=> X_E9
, -- U acute
881 X_EA
=> X_EA
, -- U circumflex
882 X_EB
=> X_EB
, -- U grave
883 X_EC
=> X_ED
, -- y acute
884 X_ED
=> X_ED
, -- Y acute
901 -----------------------------------------
902 -- Definitions for Full Upper Half Set --
903 -----------------------------------------
905 -- The full upper half set allows all upper half characters as letters,
906 -- and does not recognize any upper/lower case equivalences in this half.
908 Fold_Full_Upper_Half
: constant Translate_Table
:= Translate_Table
'(
964 X_80 => X_80, X_90 => X_90, X_A0 => X_A0, X_B0 => X_B0,
965 X_81 => X_81, X_91 => X_91, X_A1 => X_A1, X_B1 => X_B1,
966 X_82 => X_82, X_92 => X_92, X_A2 => X_A2, X_B2 => X_B2,
967 X_83 => X_83, X_93 => X_93, X_A3 => X_A3, X_B3 => X_B3,
968 X_84 => X_84, X_94 => X_94, X_A4 => X_A4, X_B4 => X_B4,
969 X_85 => X_85, X_95 => X_95, X_A5 => X_A5, X_B5 => X_B5,
970 X_86 => X_86, X_96 => X_96, X_A6 => X_A6, X_B6 => X_B6,
971 X_87 => X_87, X_97 => X_97, X_A7 => X_A7, X_B7 => X_B7,
972 X_88 => X_88, X_98 => X_98, X_A8 => X_A8, X_B8 => X_B8,
973 X_89 => X_89, X_99 => X_99, X_A9 => X_A9, X_B9 => X_B9,
974 X_8A => X_8A, X_9A => X_9A, X_AA => X_AA, X_BA => X_BA,
975 X_8B => X_8B, X_9B => X_9B, X_AB => X_AB, X_BB => X_BB,
976 X_8C => X_8C, X_9C => X_9C, X_AC => X_AC, X_BC => X_BC,
977 X_8D => X_8D, X_9D => X_9D, X_AD => X_AD, X_BD => X_BD,
978 X_8E => X_8E, X_9E => X_9E, X_AE => X_AE, X_BE => X_BE,
979 X_8F => X_8F, X_9F => X_9F, X_AF => X_AF, X_BF => X_BF,
981 X_C0 => X_C0, X_D0 => X_D0, X_E0 => X_E0, X_F0 => X_F0,
982 X_C1 => X_C1, X_D1 => X_D1, X_E1 => X_E1, X_F1 => X_F1,
983 X_C2 => X_C2, X_D2 => X_D2, X_E2 => X_E2, X_F2 => X_F2,
984 X_C3 => X_C3, X_D3 => X_D3, X_E3 => X_E3, X_F3 => X_F3,
985 X_C4 => X_C4, X_D4 => X_D4, X_E4 => X_E4, X_F4 => X_F4,
986 X_C5 => X_C5, X_D5 => X_D5, X_E5 => X_E5, X_F5 => X_F5,
987 X_C6 => X_C6, X_D6 => X_D6, X_E6 => X_E6, X_F6 => X_F6,
988 X_C7 => X_C7, X_D7 => X_D7, X_E7 => X_E7, X_F7 => X_F7,
989 X_C8 => X_C8, X_D8 => X_D8, X_E8 => X_E8, X_F8 => X_F8,
990 X_C9 => X_C9, X_D9 => X_D9, X_E9 => X_E9, X_F9 => X_F9,
991 X_CA => X_CA, X_DA => X_DA, X_EA => X_EA, X_FA => X_FA,
992 X_CB => X_CB, X_DB => X_DB, X_EB => X_EB, X_FB => X_FB,
993 X_CC => X_CC, X_DC => X_DC, X_EC => X_EC, X_FC => X_FC,
994 X_CD => X_CD, X_DD => X_DD, X_ED => X_ED, X_FD => X_FD,
995 X_CE => X_CE, X_DE => X_DE, X_EE => X_EE, X_FE => X_FE,
996 X_CF => X_CF, X_DF => X_DF, X_EF => X_EF, X_FF => X_FF,
1013 ---------------------------------------
1014 -- Definitions for No Upper Half Set --
1015 ---------------------------------------
1017 -- The no upper half set allows no upper half characters as letters, and
1018 -- thus there are no upper/lower case equivalences in this half. This set
1019 -- corresponds to the Ada 83 rules.
1021 Fold_No_Upper_Half : constant Translate_Table := Translate_Table'(
1096 procedure Initialize
is
1098 -- Set Fold_Upper table from source code indication
1100 if Identifier_Character_Set
= '1'
1101 or else Identifier_Character_Set
= 'w'
1103 Fold_Upper
:= Fold_Latin_1
;
1105 elsif Identifier_Character_Set
= '2' then
1106 Fold_Upper
:= Fold_Latin_2
;
1108 elsif Identifier_Character_Set
= '3' then
1109 Fold_Upper
:= Fold_Latin_3
;
1111 elsif Identifier_Character_Set
= '4' then
1112 Fold_Upper
:= Fold_Latin_4
;
1114 elsif Identifier_Character_Set
= '5' then
1115 Fold_Upper
:= Fold_Latin_5
;
1117 elsif Identifier_Character_Set
= 'p' then
1118 Fold_Upper
:= Fold_IBM_PC_437
;
1120 elsif Identifier_Character_Set
= '8' then
1121 Fold_Upper
:= Fold_IBM_PC_850
;
1123 elsif Identifier_Character_Set
= '9' then
1124 Fold_Upper
:= Fold_Latin_9
;
1126 elsif Identifier_Character_Set
= 'f' then
1127 Fold_Upper
:= Fold_Full_Upper_Half
;
1129 else -- Identifier_Character_Set = 'n'
1130 Fold_Upper
:= Fold_No_Upper_Half
;
1133 -- Use Fold_Upper table to compute Fold_Lower table
1135 Fold_Lower
:= Fold_Upper
;
1137 for J
in Character loop
1138 if J
/= Fold_Upper
(J
) then
1139 Fold_Lower
(Fold_Upper
(J
)) := J
;
1140 Fold_Lower
(J
) := J
;
1144 Fold_Lower
(' ') := ' ';
1146 -- Build Identifier_Char table from used entries of Fold_Upper
1148 for J
in Character loop
1149 Identifier_Char
(J
) := (Fold_Upper
(J
) /= ' ');
1152 -- Always add [ as an identifier character to deal with the brackets
1153 -- notation for wide characters used in identifiers. Note that if
1154 -- we are not allowing wide characters in identifiers, then any use
1155 -- of this notation will be flagged as an error in Scan_Identifier.
1157 Identifier_Char
('[') := True;
1159 -- Add entry for ESC if wide characters in use with a wide character
1160 -- encoding method active that uses the ESC code for encoding.
1162 if Identifier_Character_Set
= 'w'
1163 and then Wide_Character_Encoding_Method
in WC_ESC_Encoding_Method
1165 Identifier_Char
(ASCII
.ESC
) := True;
1169 --------------------------
1170 -- Is_Lower_Case_Letter --
1171 --------------------------
1173 function Is_Lower_Case_Letter
(C
: Character) return Boolean is
1175 return C
/= Fold_Upper
(C
);
1176 end Is_Lower_Case_Letter
;
1178 --------------------------
1179 -- Is_Upper_Case_Letter --
1180 --------------------------
1182 function Is_Upper_Case_Letter
(C
: Character) return Boolean is
1184 return C
/= Fold_Lower
(C
);
1185 end Is_Upper_Case_Letter
;