1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
11 -- Copyright (C) 1992-2001, Free Software Foundation, Inc. --
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. --
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. --
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). --
34 ------------------------------------------------------------------------------
38 with System
.WCh_Con
; use System
.WCh_Con
;
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,
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,
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
,
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
,
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,
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,
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
,
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
,
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
'(
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
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
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'(
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
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
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
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
'(
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,
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'(
950 procedure Initialize
is
953 -- Set Fold_Upper table from source code indication
955 if Identifier_Character_Set
= '1'
956 or else Identifier_Character_Set
= 'w'
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
;
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
;
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
) /= ' ');
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
1015 Identifier_Char
(ASCII
.ESC
) := True;
1019 --------------------------
1020 -- Is_Lower_Case_Letter --
1021 --------------------------
1023 function Is_Lower_Case_Letter
(C
: Character) return Boolean is
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
1034 return C
/= Fold_Lower
(C
);
1035 end Is_Upper_Case_Letter
;