]>
Commit | Line | Data |
---|---|---|
83cce46b | 1 | ------------------------------------------------------------------------------ |
2 | -- -- | |
3 | -- GNAT COMPILER COMPONENTS -- | |
4 | -- -- | |
5 | -- I M P U N I T -- | |
6 | -- -- | |
7 | -- B o d y -- | |
8 | -- -- | |
5f86d0ee | 9 | -- Copyright (C) 2000-2010, Free Software Foundation, Inc. -- |
83cce46b | 10 | -- -- |
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- -- | |
80df182a | 13 | -- ware Foundation; either version 3, or (at your option) any later ver- -- |
83cce46b | 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 -- | |
80df182a | 18 | -- Public License distributed with GNAT; see file COPYING3. If not, go to -- |
19 | -- http://www.gnu.org/licenses for a complete copy of the license. -- | |
83cce46b | 20 | -- -- |
21 | -- GNAT was originally developed by the GNAT team at New York University. -- | |
e78e8c8e | 22 | -- Extensive contributions were provided by Ada Core Technologies Inc. -- |
83cce46b | 23 | -- -- |
24 | ------------------------------------------------------------------------------ | |
25 | ||
0d12640b | 26 | with Atree; use Atree; |
7bc11884 | 27 | with Errout; use Errout; |
0d12640b | 28 | with Sinfo; use Sinfo; |
29 | with Fname.UF; use Fname.UF; | |
30 | with Lib; use Lib; | |
31 | with Namet; use Namet; | |
32 | with Uname; use Uname; | |
83cce46b | 33 | |
e2b6cdc8 | 34 | -- Note: this package body is used by GPS and GNATBench to supply a list of |
35 | -- entries for help on available library routines. | |
36 | ||
83cce46b | 37 | package body Impunit is |
38 | ||
39 | subtype File_Name_8 is String (1 .. 8); | |
40 | type File_List is array (Nat range <>) of File_Name_8; | |
41 | ||
7189d17f | 42 | ------------------ |
43 | -- Ada 95 Units -- | |
44 | ------------------ | |
83cce46b | 45 | |
549bcd91 | 46 | -- The following is a giant string list containing the names of all non- |
47 | -- implementation internal files, i.e. the complete list of files for | |
7189d17f | 48 | -- internal units which a program may legitimately WITH when operating in |
49 | -- either Ada 95 or Ada 05 mode. | |
83cce46b | 50 | |
7189d17f | 51 | -- Note that this list should match the list of units documented in the |
549bcd91 | 52 | -- "GNAT Library" section of the GNAT Reference Manual. A unit listed here |
53 | -- must either be documented in that section or described in the Ada RM. | |
83cce46b | 54 | |
7189d17f | 55 | Non_Imp_File_Names_95 : constant File_List := ( |
56 | ||
57 | ------------------------------------------------------ | |
6fcda3b9 | 58 | -- Ada Hierarchy Units from Ada-95 Reference Manual -- |
7189d17f | 59 | ------------------------------------------------------ |
83cce46b | 60 | |
61 | "a-astaco", -- Ada.Asynchronous_Task_Control | |
62 | "a-calend", -- Ada.Calendar | |
63 | "a-chahan", -- Ada.Characters.Handling | |
64 | "a-charac", -- Ada.Characters | |
65 | "a-chlat1", -- Ada.Characters.Latin_1 | |
66 | "a-comlin", -- Ada.Command_Line | |
67 | "a-decima", -- Ada.Decimal | |
68 | "a-direio", -- Ada.Direct_IO | |
69 | "a-dynpri", -- Ada.Dynamic_Priorities | |
70 | "a-except", -- Ada.Exceptions | |
71 | "a-finali", -- Ada.Finalization | |
72 | "a-flteio", -- Ada.Float_Text_IO | |
73 | "a-fwteio", -- Ada.Float_Wide_Text_IO | |
74 | "a-inteio", -- Ada.Integer_Text_IO | |
75 | "a-interr", -- Ada.Interrupts | |
76 | "a-intnam", -- Ada.Interrupts.Names | |
77 | "a-ioexce", -- Ada.IO_Exceptions | |
78 | "a-iwteio", -- Ada.Integer_Wide_Text_IO | |
79 | "a-ncelfu", -- Ada.Numerics.Complex_Elementary_Functions | |
80 | "a-ngcefu", -- Ada.Numerics.Generic_Complex_Elementary_Functions | |
81 | "a-ngcoty", -- Ada.Numerics.Generic_Complex_Types | |
82 | "a-ngelfu", -- Ada.Numerics.Generic_Elementary_Functions | |
83 | "a-nucoty", -- Ada.Numerics.Complex_Types | |
84 | "a-nudira", -- Ada.Numerics.Discrete_Random | |
85 | "a-nuelfu", -- Ada.Numerics.Elementary_Functions | |
86 | "a-nuflra", -- Ada.Numerics.Float_Random | |
87 | "a-numeri", -- Ada.Numerics | |
88 | "a-reatim", -- Ada.Real_Time | |
89 | "a-sequio", -- Ada.Sequential_IO | |
90 | "a-stmaco", -- Ada.Strings.Maps.Constants | |
91 | "a-storio", -- Ada.Storage_IO | |
92 | "a-strbou", -- Ada.Strings.Bounded | |
93 | "a-stream", -- Ada.Streams | |
94 | "a-strfix", -- Ada.Strings.Fixed | |
95 | "a-string", -- Ada.Strings | |
96 | "a-strmap", -- Ada.Strings.Maps | |
97 | "a-strunb", -- Ada.Strings.Unbounded | |
98 | "a-ststio", -- Ada.Streams.Stream_IO | |
99 | "a-stwibo", -- Ada.Strings.Wide_Bounded | |
100 | "a-stwifi", -- Ada.Strings.Wide_Fixed | |
101 | "a-stwima", -- Ada.Strings.Wide_Maps | |
102 | "a-stwiun", -- Ada.Strings.Wide_Unbounded | |
103 | "a-swmwco", -- Ada.Strings.Wide_Maps.Wide_Constants | |
104 | "a-sytaco", -- Ada.Synchronous_Task_Control | |
105 | "a-tags ", -- Ada.Tags | |
106 | "a-tasatt", -- Ada.Task_Attributes | |
107 | "a-taside", -- Ada.Task_Identification | |
108 | "a-teioed", -- Ada.Text_IO.Editing | |
109 | "a-textio", -- Ada.Text_IO | |
110 | "a-ticoio", -- Ada.Text_IO.Complex_IO | |
111 | "a-titest", -- Ada.Text_IO.Text_Streams | |
112 | "a-unccon", -- Ada.Unchecked_Conversion | |
113 | "a-uncdea", -- Ada.Unchecked_Deallocation | |
114 | "a-witeio", -- Ada.Wide_Text_IO | |
115 | "a-wtcoio", -- Ada.Wide_Text_IO.Complex_IO | |
116 | "a-wtedit", -- Ada.Wide_Text_IO.Editing | |
117 | "a-wttest", -- Ada.Wide_Text_IO.Text_Streams | |
118 | ||
119 | ------------------------------------------------- | |
120 | -- RM Required Additions to Ada for GNAT Types -- | |
121 | ------------------------------------------------- | |
122 | ||
123 | "a-lfteio", -- Ada.Long_Float_Text_IO | |
124 | "a-lfwtio", -- Ada.Long_Float_Wide_Text_IO | |
125 | "a-liteio", -- Ada.Long_Integer_Text_IO | |
126 | "a-liwtio", -- Ada.Long_Integer_Wide_Text_IO | |
127 | "a-llftio", -- Ada.Long_Long_Float_Text_IO | |
128 | "a-llfwti", -- Ada.Long_Long_Float_Wide_Text_IO | |
129 | "a-llitio", -- Ada.Long_Long_Integer_Text_IO | |
130 | "a-lliwti", -- Ada.Long_Long_Integer_Wide_Text_IO | |
131 | "a-nlcefu", -- Ada.Long_Complex_Elementary_Functions | |
132 | "a-nlcoty", -- Ada.Numerics.Long_Complex_Types | |
133 | "a-nlelfu", -- Ada.Numerics.Long_Elementary_Functions | |
134 | "a-nllcef", -- Ada.Long_Long_Complex_Elementary_Functions | |
135 | "a-nllefu", -- Ada.Numerics.Long_Long_Elementary_Functions | |
7859cbd6 | 136 | "a-nllcty", -- Ada.Numerics.Long_Long_Complex_Types |
83cce46b | 137 | "a-nscefu", -- Ada.Short_Complex_Elementary_Functions |
138 | "a-nscoty", -- Ada.Numerics.Short_Complex_Types | |
139 | "a-nselfu", -- Ada.Numerics.Short_Elementary_Functions | |
140 | "a-sfteio", -- Ada.Short_Float_Text_IO | |
141 | "a-sfwtio", -- Ada.Short_Float_Wide_Text_IO | |
142 | "a-siteio", -- Ada.Short_Integer_Text_IO | |
143 | "a-siwtio", -- Ada.Short_Integer_Wide_Text_IO | |
144 | "a-ssitio", -- Ada.Short_Short_Integer_Text_IO | |
145 | "a-ssiwti", -- Ada.Short_Short_Integer_Wide_Text_IO | |
146 | ||
147 | ----------------------------------- | |
148 | -- GNAT Defined Additions to Ada -- | |
149 | ----------------------------------- | |
150 | ||
cbe48986 | 151 | "a-calcon", -- Ada.Calendar.Conversions |
f15731c4 | 152 | "a-chlat9", -- Ada.Characters.Latin_9 |
5bf95828 | 153 | "a-clrefi", -- Ada.Command_Line.Response_File |
9dfe12ae | 154 | "a-colien", -- Ada.Command_Line.Environment |
83cce46b | 155 | "a-colire", -- Ada.Command_Line.Remove |
156 | "a-cwila1", -- Ada.Characters.Wide_Latin_1 | |
f15731c4 | 157 | "a-cwila9", -- Ada.Characters.Wide_Latin_9 |
83cce46b | 158 | "a-diocst", -- Ada.Direct_IO.C_Streams |
159 | "a-einuoc", -- Ada.Exceptions.Is_Null_Occurrence | |
7189d17f | 160 | "a-elchha", -- Ada.Exceptions.Last_Chance_Handler |
9dfe12ae | 161 | "a-exctra", -- Ada.Exceptions.Traceback |
83cce46b | 162 | "a-siocst", -- Ada.Sequential_IO.C_Streams |
163 | "a-ssicst", -- Ada.Streams.Stream_IO.C_Streams | |
164 | "a-suteio", -- Ada.Strings.Unbounded.Text_IO | |
165 | "a-swuwti", -- Ada.Strings.Wide_Unbounded.Wide_Text_IO | |
83cce46b | 166 | "a-tiocst", -- Ada.Text_IO.C_Streams |
167 | "a-wtcstr", -- Ada.Wide_Text_IO.C_Streams | |
168 | ||
26402741 | 169 | -- Note: strictly the next two should be Ada 2005 units, but it seems |
170 | -- harmless (and useful) to make then available in Ada 95 mode, since | |
171 | -- they only deal with Wide_Character, not Wide_Wide_Character. | |
172 | ||
173 | "a-wichun", -- Ada.Wide_Characters.Unicode | |
174 | "a-widcha", -- Ada.Wide_Characters | |
175 | ||
325f3586 | 176 | -- Note: strictly the following should be Ada 2012 units, but it seems |
d73d4db0 | 177 | -- harmless (and useful) to make then available in Ada 95 mode, since |
325f3586 | 178 | -- they do not deal with Wide_Wide_Character. |
d73d4db0 | 179 | |
7800b920 | 180 | "a-wichha", -- Ada.Wide_Characters.Handling |
d73d4db0 | 181 | "a-stuten", -- Ada.Strings.UTF_Encoding |
182 | "a-suenco", -- Ada.Strings.UTF_Encoding.Conversions | |
3b25213b | 183 | "a-suenst", -- Ada.Strings.UTF_Encoding.Strings |
184 | "a-suewst", -- Ada.Strings.UTF_Encoding.Wide_Strings | |
d73d4db0 | 185 | |
83cce46b | 186 | --------------------------- |
187 | -- GNAT Special IO Units -- | |
188 | --------------------------- | |
189 | ||
549bcd91 | 190 | -- As further explained elsewhere (see Sem_Ch10), the internal packages of |
191 | -- Text_IO and Wide_Text_IO are actually implemented as separate children, | |
192 | -- but this fact is intended to be hidden from the user completely. Any | |
193 | -- attempt to WITH one of these units will be diagnosed as an error later | |
194 | -- on, but for now we do not consider these internal implementation units | |
195 | -- (if we did, then we would get a junk warning which would be confusing | |
27f48659 | 196 | -- and unnecessary, given that we generate a clear error message). |
83cce46b | 197 | |
198 | "a-tideio", -- Ada.Text_IO.Decimal_IO | |
199 | "a-tienio", -- Ada.Text_IO.Enumeration_IO | |
200 | "a-tifiio", -- Ada.Text_IO.Fixed_IO | |
201 | "a-tiflio", -- Ada.Text_IO.Float_IO | |
202 | "a-tiinio", -- Ada.Text_IO.Integer_IO | |
203 | "a-tiinio", -- Ada.Text_IO.Integer_IO | |
204 | "a-timoio", -- Ada.Text_IO.Modular_IO | |
205 | "a-wtdeio", -- Ada.Wide_Text_IO.Decimal_IO | |
206 | "a-wtenio", -- Ada.Wide_Text_IO.Enumeration_IO | |
207 | "a-wtfiio", -- Ada.Wide_Text_IO.Fixed_IO | |
208 | "a-wtflio", -- Ada.Wide_Text_IO.Float_IO | |
209 | "a-wtinio", -- Ada.Wide_Text_IO.Integer_IO | |
210 | "a-wtmoio", -- Ada.Wide_Text_IO.Modular_IO | |
211 | ||
212 | ------------------------ | |
213 | -- GNAT Library Units -- | |
214 | ------------------------ | |
215 | ||
0b8fc818 | 216 | "g-altive", -- GNAT.Altivec |
e2b6cdc8 | 217 | "g-altcon", -- GNAT.Altivec.Conversions |
218 | "g-alveop", -- GNAT.Altivec.Vector_Operations | |
0b8fc818 | 219 | "g-alvety", -- GNAT.Altivec.Vector_Types |
220 | "g-alvevi", -- GNAT.Altivec.Vector_Views | |
9dfe12ae | 221 | "g-arrspl", -- GNAT.Array_Split |
83cce46b | 222 | "g-awk ", -- GNAT.AWK |
9dfe12ae | 223 | "g-boubuf", -- GNAT.Bounded_Buffers |
224 | "g-boumai", -- GNAT.Bounded_Mailboxes | |
225 | "g-bubsor", -- GNAT.Bubble_Sort | |
83cce46b | 226 | "g-busora", -- GNAT.Bubble_Sort_A |
227 | "g-busorg", -- GNAT.Bubble_Sort_G | |
e2b6cdc8 | 228 | "g-byorma", -- GNAT.Byte_Order_Mark |
229 | "g-bytswa", -- GNAT.Byte_Swapping | |
83cce46b | 230 | "g-calend", -- GNAT.Calendar |
9dfe12ae | 231 | "g-catiio", -- GNAT.Calendar.Time_IO |
e2b6cdc8 | 232 | "g-casuti", -- GNAT.Case_Util |
83cce46b | 233 | "g-cgi ", -- GNAT.CGI |
234 | "g-cgicoo", -- GNAT.CGI.Cookie | |
235 | "g-cgideb", -- GNAT.CGI.Debug | |
236 | "g-comlin", -- GNAT.Command_Line | |
9dfe12ae | 237 | "g-comver", -- GNAT.Compiler_Version |
59c93cd9 | 238 | "g-crc32 ", -- GNAT.CRC32 |
9dfe12ae | 239 | "g-ctrl_c", -- GNAT.Ctrl_C |
83cce46b | 240 | "g-curexc", -- GNAT.Current_Exception |
241 | "g-debpoo", -- GNAT.Debug_Pools | |
242 | "g-debuti", -- GNAT.Debug_Utilities | |
e2b6cdc8 | 243 | "g-decstr", -- GNAT.Decode_String |
244 | "g-deutst", -- GNAT.Decode_UTF8_String | |
83cce46b | 245 | "g-dirope", -- GNAT.Directory_Operations |
e2b6cdc8 | 246 | "g-diopit", -- GNAT.Directory_Operations.Iteration |
9dfe12ae | 247 | "g-dynhta", -- GNAT.Dynamic_HTables |
83cce46b | 248 | "g-dyntab", -- GNAT.Dynamic_Tables |
e2b6cdc8 | 249 | "g-encstr", -- GNAT.Encode_String |
250 | "g-enutst", -- GNAT.Encode_UTF8_String | |
9dfe12ae | 251 | "g-excact", -- GNAT.Exception_Actions |
252 | "g-except", -- GNAT.Exceptions | |
83cce46b | 253 | "g-exctra", -- GNAT.Exception_Traces |
254 | "g-expect", -- GNAT.Expect | |
255 | "g-flocon", -- GNAT.Float_Control | |
9dfe12ae | 256 | "g-heasor", -- GNAT.Heap_Sort |
83cce46b | 257 | "g-hesora", -- GNAT.Heap_Sort_A |
258 | "g-hesorg", -- GNAT.Heap_Sort_G | |
9dfe12ae | 259 | "g-htable", -- GNAT.Htable |
83cce46b | 260 | "g-io ", -- GNAT.IO |
261 | "g-io_aux", -- GNAT.IO_Aux | |
262 | "g-locfil", -- GNAT.Lock_Files | |
2fb4c5cc | 263 | "g-mbdira", -- GNAT.MBBS_Discrete_Random |
264 | "g-mbflra", -- GNAT.MBBS_Float_Random | |
f15731c4 | 265 | "g-md5 ", -- GNAT.MD5 |
9dfe12ae | 266 | "g-memdum", -- GNAT.Memory_Dump |
83cce46b | 267 | "g-moreex", -- GNAT.Most_Recent_Exception |
268 | "g-os_lib", -- GNAT.Os_Lib | |
44d43e97 | 269 | "g-pehage", -- GNAT.Perfect_Hash_Generators |
3355b3b1 | 270 | "g-rannum", -- GNAT.Random_Numbers |
83cce46b | 271 | "g-regexp", -- GNAT.Regexp |
272 | "g-regist", -- GNAT.Registry | |
273 | "g-regpat", -- GNAT.Regpat | |
9dfe12ae | 274 | "g-semaph", -- GNAT.Semaphores |
549bcd91 | 275 | "g-sercom", -- GNAT.Serial_Communications |
b5ff3ed8 | 276 | "g-sestin", -- GNAT.Secondary_Stack_Info |
0d12640b | 277 | "g-sha1 ", -- GNAT.SHA1 |
760f032a | 278 | "g-sha224", -- GNAT.SHA224 |
279 | "g-sha256", -- GNAT.SHA256 | |
280 | "g-sha384", -- GNAT.SHA384 | |
281 | "g-sha512", -- GNAT.SHA512 | |
ec621b58 | 282 | "g-signal", -- GNAT.Signals |
83cce46b | 283 | "g-socket", -- GNAT.Sockets |
83cce46b | 284 | "g-souinf", -- GNAT.Source_Info |
285 | "g-speche", -- GNAT.Spell_Checker | |
e2b6cdc8 | 286 | "g-spchge", -- GNAT.Spell_Checker_Generic |
9dfe12ae | 287 | "g-spitbo", -- GNAT.Spitbol |
e2b6cdc8 | 288 | "g-spipat", -- GNAT.Spitbol.Patterns |
9dfe12ae | 289 | "g-sptabo", -- GNAT.Spitbol.Table_Boolean |
290 | "g-sptain", -- GNAT.Spitbol.Table_Integer | |
291 | "g-sptavs", -- GNAT.Spitbol.Table_Vstring | |
292 | "g-string", -- GNAT.Strings | |
293 | "g-strspl", -- GNAT.String_Split | |
3dbca0d5 | 294 | "g-sse ", -- GNAT.SSE |
295 | "g-ssvety", -- GNAT.SSE.Vector_Types | |
83cce46b | 296 | "g-table ", -- GNAT.Table |
297 | "g-tasloc", -- GNAT.Task_Lock | |
298 | "g-thread", -- GNAT.Threads | |
cbe48986 | 299 | "g-timsta", -- GNAT.Time_Stamp |
83cce46b | 300 | "g-traceb", -- GNAT.Traceback |
301 | "g-trasym", -- GNAT.Traceback.Symbolic | |
aacdaf74 | 302 | "g-utf_32", -- GNAT.UTF_32 |
e2b6cdc8 | 303 | "g-u3spch", -- GNAT.UTF_32_Spelling_Checker |
304 | "g-wispch", -- GNAT.Wide_Spelling_Checker | |
9dfe12ae | 305 | "g-wistsp", -- GNAT.Wide_String_Split |
83cce46b | 306 | |
307 | ----------------------------------------------------- | |
308 | -- Interface Hierarchy Units from Reference Manual -- | |
309 | ----------------------------------------------------- | |
310 | ||
311 | "i-c ", -- Interfaces.C | |
312 | "i-cobol ", -- Interfaces.Cobol | |
313 | "i-cpoint", -- Interfaces.C.Pointers | |
314 | "i-cstrin", -- Interfaces.C.Strings | |
315 | "i-fortra", -- Interfaces.Fortran | |
316 | ||
317 | ------------------------------------------ | |
318 | -- GNAT Defined Additions to Interfaces -- | |
319 | ------------------------------------------ | |
320 | ||
321 | "i-cexten", -- Interfaces.C.Extensions | |
f8384751 | 322 | "i-cil ", -- Interfaces.CIL |
323 | "i-cilobj", -- Interfaces.CIL.Object | |
83cce46b | 324 | "i-cpp ", -- Interfaces.CPP |
9dfe12ae | 325 | "i-cstrea", -- Interfaces.C.Streams |
9dfe12ae | 326 | "i-java ", -- Interfaces.Java |
cbe48986 | 327 | "i-javjni", -- Interfaces.Java.JNI |
83cce46b | 328 | "i-pacdec", -- Interfaces.Packed_Decimal |
f15731c4 | 329 | "i-vxwoio", -- Interfaces.VxWorks.IO |
9dfe12ae | 330 | "i-vxwork", -- Interfaces.VxWorks |
83cce46b | 331 | |
332 | -------------------------------------------------- | |
333 | -- System Hierarchy Units from Reference Manual -- | |
334 | -------------------------------------------------- | |
335 | ||
336 | "s-atacco", -- System.Address_To_Access_Conversions | |
337 | "s-maccod", -- System.Machine_Code | |
338 | "s-rpc ", -- System.Rpc | |
339 | "s-stoele", -- System.Storage_Elements | |
340 | "s-stopoo", -- System.Storage_Pools | |
341 | ||
342 | -------------------------------------- | |
343 | -- GNAT Defined Additions to System -- | |
344 | -------------------------------------- | |
345 | ||
346 | "s-addima", -- System.Address_Image | |
347 | "s-assert", -- System.Assertions | |
9dfe12ae | 348 | "s-memory", -- System.Memory |
83cce46b | 349 | "s-parint", -- System.Partition_Interface |
6b567c71 | 350 | "s-pooglo", -- System.Pool_Global |
351 | "s-pooloc", -- System.Pool_Local | |
1147840a | 352 | "s-restri", -- System.Restrictions |
353 | "s-rident", -- System.Rident | |
cbe48986 | 354 | "s-ststop", -- System.Strings.Stream_Ops |
83cce46b | 355 | "s-tasinf", -- System.Task_Info |
356 | "s-wchcnv", -- System.Wch_Cnv | |
357 | "s-wchcon"); -- System.Wch_Con | |
358 | ||
7189d17f | 359 | -------------------- |
360 | -- Ada 2005 Units -- | |
361 | -------------------- | |
362 | ||
363 | -- The following units should be used only in Ada 05 mode | |
364 | ||
365 | Non_Imp_File_Names_05 : constant File_List := ( | |
366 | ||
367 | -------------------------------------------------------- | |
368 | -- Ada Hierarchy Units from Ada 2005 Reference Manual -- | |
369 | -------------------------------------------------------- | |
370 | ||
3355b3b1 | 371 | "a-assert", -- Ada.Assertions |
d68c9dad | 372 | "a-calari", -- Ada.Calendar.Arithmetic |
373 | "a-calfor", -- Ada.Calendar.Formatting | |
374 | "a-catizo", -- Ada.Calendar.Time_Zones | |
7189d17f | 375 | "a-cdlili", -- Ada.Containers.Doubly_Linked_Lists |
7189d17f | 376 | "a-cgarso", -- Ada.Containers.Generic_Array_Sort |
377 | "a-cgcaso", -- Ada.Containers.Generic_Constrained_Array_Sort | |
26402741 | 378 | "a-chacon", -- Ada.Characters.Conversions |
7189d17f | 379 | "a-cidlli", -- Ada.Containers.Indefinite_Doubly_Linked_Lists |
380 | "a-cihama", -- Ada.Containers.Indefinite_Hashed_Maps | |
381 | "a-cihase", -- Ada.Containers.Indefinite_Hashed_Sets | |
382 | "a-ciorma", -- Ada.Containers.Indefinite_Ordered_Maps | |
7189d17f | 383 | "a-ciorse", -- Ada.Containers.Indefinite_Ordered_Sets |
384 | "a-cohama", -- Ada.Containers.Hashed_Maps | |
385 | "a-cohase", -- Ada.Containers.Hashed_Sets | |
7189d17f | 386 | "a-coinve", -- Ada.Containers.Indefinite_Vectors |
387 | "a-contai", -- Ada.Containers | |
388 | "a-convec", -- Ada.Containers.Vectors | |
389 | "a-coorma", -- Ada.Containers.Ordered_Maps | |
7189d17f | 390 | "a-coorse", -- Ada.Containers.Ordered_Sets |
a58fd097 | 391 | "a-coteio", -- Ada.Complex_Text_IO |
7189d17f | 392 | "a-direct", -- Ada.Directories |
d68c9dad | 393 | "a-diroro", -- Ada.Dispatching.Round_Robin |
cbe48986 | 394 | "a-disedf", -- Ada.Dispatching.EDF |
d68c9dad | 395 | "a-dispat", -- Ada.Dispatching |
a58fd097 | 396 | "a-envvar", -- Ada.Environment_Variables |
5bf95828 | 397 | "a-exetim", -- Ada.Execution_Time |
398 | "a-extiti", -- Ada.Execution_Time.Timers | |
6fcda3b9 | 399 | "a-izteio", -- Ada.Integer_Wide_Wide_Text_IO |
a58fd097 | 400 | "a-rttiev", -- Ada.Real_Time.Timing_Events |
0d12640b | 401 | "a-ngcoar", -- Ada.Numerics.Generic_Complex_Arrays |
402 | "a-ngrear", -- Ada.Numerics.Generic_Real_Arrays | |
403 | "a-nucoar", -- Ada.Numerics.Complex_Arrays | |
404 | "a-nurear", -- Ada.Numerics.Real_Arrays | |
a58fd097 | 405 | "a-stboha", -- Ada.Strings.Bounded.Hash |
406 | "a-stfiha", -- Ada.Strings.Fixed.Hash | |
7189d17f | 407 | "a-strhas", -- Ada.Strings.Hash |
408 | "a-stunha", -- Ada.Strings.Unbounded.Hash | |
409 | "a-stwiha", -- Ada.Strings.Wide_Hash | |
410 | "a-stzbou", -- Ada.Strings.Wide_Wide_Bounded | |
411 | "a-stzfix", -- Ada.Strings.Wide_Wide_Fixed | |
412 | "a-stzhas", -- Ada.Strings.Wide_Wide_Hash | |
413 | "a-stzmap", -- Ada.Strings.Wide_Wide_Maps | |
414 | "a-stzunb", -- Ada.Strings.Wide_Wide_Unbounded | |
a58fd097 | 415 | "a-swbwha", -- Ada.Strings.Wide_Bounded.Wide_Hash |
416 | "a-swfwha", -- Ada.Strings.Wide_Fixed.Wide_Hash | |
26402741 | 417 | "a-swuwha", -- Ada.Strings.Wide_Unbounded.Wide_Hash |
a58fd097 | 418 | "a-szbzha", -- Ada.Strings.Wide_Wide_Bounded.Wide_Wide_Hash |
419 | "a-szfzha", -- Ada.Strings.Wide_Wide_Fixed.Wide_Wide_Hash | |
0b8fc818 | 420 | "a-szmzco", -- Ada.Strings.Wide_Wide_Maps.Wide_Wide_Constants |
26402741 | 421 | "a-szuzha", -- Ada.Strings.Wide_Wide_Unbounded.Wide_Wide_Hash |
0b8fc818 | 422 | "a-taster", -- Ada.Task_Termination |
423 | "a-tgdico", -- Ada.Tags.Generic_Dispatching_Constructor | |
a58fd097 | 424 | "a-tiboio", -- Ada.Text_IO.Bounded_IO |
0b8fc818 | 425 | "a-tiunio", -- Ada.Text_IO.Unbounded_IO |
26402741 | 426 | "a-wichun", -- Ada.Wide_Characters.Unicode |
a58fd097 | 427 | "a-wwboio", -- Ada.Wide_Text_IO.Wide_Bounded_IO |
0b8fc818 | 428 | "a-wwunio", -- Ada.Wide_Text_IO.Wide_Unbounded_IO |
26402741 | 429 | "a-zchara", -- Ada.Wide_Wide_Characters |
7800b920 | 430 | "a-zchhan", -- Ada.Wide_Wide_Characters.Handling |
d68c9dad | 431 | "a-ztcoio", -- Ada.Wide_Wide_Text_IO.Complex_IO |
432 | "a-ztedit", -- Ada.Wide_Wide_Text_IO.Editing | |
7189d17f | 433 | "a-zttest", -- Ada.Wide_Wide_Text_IO.Text_Streams |
434 | "a-ztexio", -- Ada.Wide_Wide_Text_IO | |
a58fd097 | 435 | "a-zzboio", -- Ada.Wide_Wide_Text_IO.Wide_Wide_Bounded_IO |
7189d17f | 436 | "a-zzunio", -- Ada.Wide_Wide_Text_IO.Wide_Wide_Unbounded_IO |
437 | ||
438 | ------------------------------------------------------ | |
439 | -- RM Required Additions to Ada 2005 for GNAT Types -- | |
440 | ------------------------------------------------------ | |
441 | ||
a58fd097 | 442 | "a-lcteio", -- Ada.Long_Complex_Text_IO |
7189d17f | 443 | "a-lfztio", -- Ada.Long_Float_Wide_Wide_Text_IO |
444 | "a-liztio", -- Ada.Long_Integer_Wide_Wide_Text_IO | |
a58fd097 | 445 | "a-llctio", -- Ada.Long_Long_Complex_Text_IO |
7189d17f | 446 | "a-llfzti", -- Ada.Long_Long_Float_Wide_Wide_Text_IO |
447 | "a-llizti", -- Ada.Long_Long_Integer_Wide_Wide_Text_IO | |
0d12640b | 448 | "a-nlcoar", -- Ada.Numerics.Long_Complex_Arrays |
449 | "a-nllcar", -- Ada.Numerics.Long_Long_Complex_Arrays | |
450 | "a-nllrar", -- Ada.Numerics.Long_Long_Real_Arrays | |
451 | "a-nlrear", -- Ada.Numerics.Long_Real_Arrays | |
a58fd097 | 452 | "a-scteio", -- Ada.Short_Complex_Text_IO |
7189d17f | 453 | "a-sfztio", -- Ada.Short_Float_Wide_Wide_Text_IO |
454 | "a-siztio", -- Ada.Short_Integer_Wide_Wide_Text_IO | |
455 | "a-ssizti", -- Ada.Short_Short_Integer_Wide_Wide_Text_IO | |
456 | "a-ztcstr", -- Ada.Wide_Wide_Text_IO.C_Streams | |
457 | ||
458 | ---------------------------------------- | |
459 | -- GNAT Defined Additions to Ada 2005 -- | |
460 | ---------------------------------------- | |
461 | ||
d68c9dad | 462 | "a-cgaaso", -- Ada.Containers.Generic_Anonymous_Array_Sort |
7189d17f | 463 | "a-chzla1", -- Ada.Characters.Wide_Wide_Latin_1 |
464 | "a-chzla9", -- Ada.Characters.Wide_Wide_Latin_9 | |
89362889 | 465 | "a-ciormu", -- Ada.Containers.Indefinite_Ordered_Multisets |
466 | "a-coormu", -- Ada.Containers.Ordered_Multisets | |
d68c9dad | 467 | "a-crdlli", -- Ada.Containers.Restricted_Doubly_Linked_Lists |
468 | "a-secain", -- Ada.Strings.Equal_Case_Insensitive | |
469 | "a-shcain", -- Ada.Strings.Hash_Case_Insensitive | |
470 | "a-slcain", -- Ada.Strings.Less_Case_Insensitive | |
7189d17f | 471 | "a-szuzti", -- Ada.Strings.Wide_Wide_Unbounded.Wide_Wide_Text_IO |
26402741 | 472 | "a-zchuni", -- Ada.Wide_Wide_Characters.Unicode |
83cce46b | 473 | |
d73d4db0 | 474 | -- Note: strictly the following should be Ada 2012 units, but it seems |
475 | -- harmless (and useful) to make then available in Ada 2005 mode. | |
5779992c | 476 | |
3b25213b | 477 | "a-suezst", -- Ada.Strings.UTF_Encoding.Wide_Wide_Strings |
5779992c | 478 | |
7189d17f | 479 | --------------------------- |
480 | -- GNAT Special IO Units -- | |
481 | --------------------------- | |
83cce46b | 482 | |
7189d17f | 483 | -- See Ada 95 section for further information. These packages are for the |
484 | -- implementation of the Wide_Wide_Text_IO generic packages. | |
83cce46b | 485 | |
7189d17f | 486 | "a-ztdeio", -- Ada.Wide_Wide_Text_IO.Decimal_IO |
487 | "a-ztenio", -- Ada.Wide_Wide_Text_IO.Enumeration_IO | |
488 | "a-ztfiio", -- Ada.Wide_Wide_Text_IO.Fixed_IO | |
489 | "a-ztflio", -- Ada.Wide_Wide_Text_IO.Float_IO | |
490 | "a-ztinio", -- Ada.Wide_Wide_Text_IO.Integer_IO | |
491 | "a-ztmoio", -- Ada.Wide_Wide_Text_IO.Modular_IO | |
83cce46b | 492 | |
7189d17f | 493 | ------------------------ |
494 | -- GNAT Library Units -- | |
495 | ------------------------ | |
496 | ||
e2b6cdc8 | 497 | "g-zspche", -- GNAT.Wide_Wide_Spelling_Checker |
7189d17f | 498 | "g-zstspl"); -- GNAT.Wide_Wide_String_Split |
499 | ||
ed8e5b83 | 500 | -------------------- |
501 | -- Ada 2012 Units -- | |
502 | -------------------- | |
503 | ||
504 | -- The following units should be used only in Ada 05 mode | |
505 | ||
506 | Non_Imp_File_Names_12 : constant File_List := ( | |
507 | 0 => "s-multip"); -- System.Mutiprocessors | |
508 | ||
7bc11884 | 509 | ----------------------- |
510 | -- Alternative Units -- | |
511 | ----------------------- | |
512 | ||
513 | -- For some implementation units, there is a unit in the GNAT library | |
514 | -- that has identical functionality that is usable. If we have such a | |
515 | -- case we record the appropriate Unit name in Error_Msg_String. | |
516 | ||
517 | type Aunit_Record is record | |
518 | Fname : String (1 .. 6); | |
519 | Aname : String_Ptr; | |
520 | end record; | |
521 | ||
522 | -- Array of alternative unit names | |
523 | ||
524 | Scasuti : aliased String := "GNAT.Case_Util"; | |
5f86d0ee | 525 | Scrc32 : aliased String := "GNAT.CRC32"; |
526 | Shtable : aliased String := "GNAT.HTable"; | |
7bc11884 | 527 | Sos_lib : aliased String := "GNAT.OS_Lib"; |
528 | Sregexp : aliased String := "GNAT.Regexp"; | |
529 | Sregpat : aliased String := "GNAT.Regpat"; | |
530 | Sstring : aliased String := "GNAT.Strings"; | |
531 | Sstusta : aliased String := "GNAT.Task_Stack_Usage"; | |
532 | Stasloc : aliased String := "GNAT.Task_Lock"; | |
533 | Sutf_32 : aliased String := "GNAT.UTF_32"; | |
534 | ||
535 | -- Array giving mapping | |
536 | ||
5f86d0ee | 537 | Map_Array : constant array (1 .. 10) of Aunit_Record := ( |
7bc11884 | 538 | ("casuti", Scasuti'Access), |
5f86d0ee | 539 | ("crc32 ", Scrc32 'Access), |
540 | ("htable", Shtable'Access), | |
7bc11884 | 541 | ("os_lib", Sos_lib'Access), |
542 | ("regexp", Sregexp'Access), | |
543 | ("regpat", Sregpat'Access), | |
544 | ("string", Sstring'Access), | |
545 | ("stusta", Sstusta'Access), | |
546 | ("tasloc", Stasloc'Access), | |
547 | ("utf_32", Sutf_32'Access)); | |
548 | ||
7189d17f | 549 | ---------------------- |
550 | -- Get_Kind_Of_Unit -- | |
551 | ---------------------- | |
552 | ||
553 | function Get_Kind_Of_Unit (U : Unit_Number_Type) return Kind_Of_Unit is | |
554 | Fname : constant File_Name_Type := Unit_File_Name (U); | |
555 | ||
556 | begin | |
7bc11884 | 557 | Error_Msg_Strlen := 0; |
558 | ||
7189d17f | 559 | -- If length of file name is greater than 12, not predefined. |
83cce46b | 560 | -- The value 12 here is an 8 char name with extension .ads. |
561 | ||
562 | if Length_Of_Name (Fname) > 12 then | |
7189d17f | 563 | return Not_Predefined_Unit; |
83cce46b | 564 | end if; |
565 | ||
566 | -- Otherwise test file name | |
567 | ||
568 | Get_Name_String (Fname); | |
569 | ||
7189d17f | 570 | -- Not predefined if file name does not start with a- g- s- i- |
83cce46b | 571 | |
572 | if Name_Len < 3 | |
573 | or else Name_Buffer (2) /= '-' | |
574 | or else (Name_Buffer (1) /= 'a' | |
575 | and then | |
576 | Name_Buffer (1) /= 'g' | |
577 | and then | |
578 | Name_Buffer (1) /= 'i' | |
579 | and then | |
580 | Name_Buffer (1) /= 's') | |
581 | then | |
7189d17f | 582 | return Not_Predefined_Unit; |
83cce46b | 583 | end if; |
584 | ||
7189d17f | 585 | -- Not predefined if file name does not end in .ads. This can |
83cce46b | 586 | -- happen when non-standard file names are being used. |
587 | ||
588 | if Name_Buffer (Name_Len - 3 .. Name_Len) /= ".ads" then | |
7189d17f | 589 | return Not_Predefined_Unit; |
83cce46b | 590 | end if; |
591 | ||
592 | -- Otherwise normalize file name to 8 characters | |
593 | ||
594 | Name_Len := Name_Len - 4; | |
595 | while Name_Len < 8 loop | |
596 | Name_Len := Name_Len + 1; | |
597 | Name_Buffer (Name_Len) := ' '; | |
598 | end loop; | |
599 | ||
7189d17f | 600 | -- See if name is in 95 list |
83cce46b | 601 | |
7189d17f | 602 | for J in Non_Imp_File_Names_95'Range loop |
603 | if Name_Buffer (1 .. 8) = Non_Imp_File_Names_95 (J) then | |
604 | return Ada_95_Unit; | |
83cce46b | 605 | end if; |
606 | end loop; | |
607 | ||
ed8e5b83 | 608 | -- See if name is in 2005 list |
7189d17f | 609 | |
610 | for J in Non_Imp_File_Names_05'Range loop | |
611 | if Name_Buffer (1 .. 8) = Non_Imp_File_Names_05 (J) then | |
de54c5ab | 612 | return Ada_2005_Unit; |
7189d17f | 613 | end if; |
614 | end loop; | |
615 | ||
ed8e5b83 | 616 | -- See if name is in 2012 list |
617 | ||
618 | for J in Non_Imp_File_Names_12'Range loop | |
619 | if Name_Buffer (1 .. 8) = Non_Imp_File_Names_12 (J) then | |
ad8b87c8 | 620 | return Ada_2012_Unit; |
ed8e5b83 | 621 | end if; |
622 | end loop; | |
623 | ||
7189d17f | 624 | -- Only remaining special possibilities are children of System.RPC and |
625 | -- System.Garlic and special files of the form System.Aux... | |
83cce46b | 626 | |
627 | Get_Name_String (Unit_Name (U)); | |
628 | ||
629 | if Name_Len > 12 | |
630 | and then Name_Buffer (1 .. 11) = "system.rpc." | |
631 | then | |
7189d17f | 632 | return Ada_95_Unit; |
83cce46b | 633 | end if; |
634 | ||
635 | if Name_Len > 15 | |
636 | and then Name_Buffer (1 .. 14) = "system.garlic." | |
637 | then | |
7189d17f | 638 | return Ada_95_Unit; |
83cce46b | 639 | end if; |
640 | ||
641 | if Name_Len > 11 | |
642 | and then Name_Buffer (1 .. 10) = "system.aux" | |
643 | then | |
7189d17f | 644 | return Ada_95_Unit; |
83cce46b | 645 | end if; |
646 | ||
7bc11884 | 647 | -- All tests failed, this is definitely an implementation unit. See if |
648 | -- we have an alternative name. | |
649 | ||
650 | Get_Name_String (Fname); | |
651 | ||
5f86d0ee | 652 | if Name_Len in 11 .. 12 |
7bc11884 | 653 | and then Name_Buffer (1 .. 2) = "s-" |
5f86d0ee | 654 | and then Name_Buffer (Name_Len - 3 .. Name_Len) = ".ads" |
7bc11884 | 655 | then |
656 | for J in Map_Array'Range loop | |
5f86d0ee | 657 | if (Name_Len = 12 and then |
658 | Name_Buffer (3 .. 8) = Map_Array (J).Fname) | |
659 | or else | |
660 | (Name_Len = 11 and then | |
661 | Name_Buffer (3 .. 7) = Map_Array (J).Fname (1 .. 5)) | |
662 | then | |
7bc11884 | 663 | Error_Msg_Strlen := Map_Array (J).Aname'Length; |
664 | Error_Msg_String (1 .. Error_Msg_Strlen) := | |
665 | Map_Array (J).Aname.all; | |
666 | end if; | |
667 | end loop; | |
668 | end if; | |
83cce46b | 669 | |
7189d17f | 670 | return Implementation_Unit; |
671 | end Get_Kind_Of_Unit; | |
83cce46b | 672 | |
0d12640b | 673 | ------------------- |
674 | -- Is_Known_Unit -- | |
675 | ------------------- | |
676 | ||
677 | function Is_Known_Unit (Nam : Node_Id) return Boolean is | |
678 | Unam : Unit_Name_Type; | |
679 | Fnam : File_Name_Type; | |
680 | ||
681 | begin | |
682 | -- If selector is not an identifier (e.g. it is a character literal or | |
683 | -- some junk from a previous error), then definitely not a known unit. | |
684 | ||
685 | if Nkind (Selector_Name (Nam)) /= N_Identifier then | |
686 | return False; | |
687 | end if; | |
688 | ||
689 | -- Otherwise get corresponding file name | |
690 | ||
691 | Unam := Get_Unit_Name (Nam); | |
692 | Fnam := Get_File_Name (Unam, Subunit => False); | |
693 | Get_Name_String (Fnam); | |
694 | ||
695 | -- Remove extension from file name | |
696 | ||
697 | if Name_Buffer (Name_Len - 3 .. Name_Len) = ".adb" then | |
698 | Name_Len := Name_Len - 4; | |
699 | else | |
700 | return False; | |
701 | end if; | |
702 | ||
703 | -- Pad name to 8 characters | |
704 | ||
705 | while Name_Len < 8 loop | |
706 | Name_Len := Name_Len + 1; | |
707 | Name_Buffer (Name_Len) := ' '; | |
708 | end loop; | |
709 | ||
710 | -- If length more than 8, definitely not a match | |
711 | ||
712 | if Name_Len /= 8 then | |
713 | return False; | |
714 | end if; | |
715 | ||
716 | -- If length is 8, search our tables | |
717 | ||
718 | for J in Non_Imp_File_Names_95'Range loop | |
719 | if Name_Buffer (1 .. 8) = Non_Imp_File_Names_95 (J) then | |
720 | return True; | |
721 | end if; | |
722 | end loop; | |
723 | ||
724 | for J in Non_Imp_File_Names_05'Range loop | |
725 | if Name_Buffer (1 .. 8) = Non_Imp_File_Names_05 (J) then | |
726 | return True; | |
727 | end if; | |
728 | end loop; | |
729 | ||
730 | -- If not found, not known | |
731 | ||
732 | return False; | |
733 | ||
734 | -- A safety guard, if we get an exception during this processing then it | |
735 | -- is most likely the result of a previous error, or a peculiar case we | |
736 | -- have not thought of. Since this routine is only used for error message | |
737 | -- refinement, we will just return False. | |
738 | ||
739 | exception | |
740 | when others => | |
741 | return False; | |
742 | end Is_Known_Unit; | |
743 | ||
83cce46b | 744 | end Impunit; |