Merge -r 127928:132243 from trunk
[official-gcc.git] / gcc / ada / impunit.adb
blobf9b1b2df9014b3c2cb232b69d80120341fc2dbfc
1 ------------------------------------------------------------------------------
2 -- --
3 -- GNAT COMPILER COMPONENTS --
4 -- --
5 -- I M P U N I T --
6 -- --
7 -- B o d y --
8 -- --
9 -- Copyright (C) 2000-2007, Free Software Foundation, Inc. --
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- --
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. See the GNU General Public License --
17 -- for more details. You should have received a copy of the GNU General --
18 -- Public License distributed with GNAT; see file COPYING3. If not, go to --
19 -- http://www.gnu.org/licenses for a complete copy of the license. --
20 -- --
21 -- GNAT was originally developed by the GNAT team at New York University. --
22 -- Extensive contributions were provided by Ada Core Technologies Inc. --
23 -- --
24 ------------------------------------------------------------------------------
26 with Atree; use Atree;
27 with Sinfo; use Sinfo;
28 with Fname.UF; use Fname.UF;
29 with Lib; use Lib;
30 with Namet; use Namet;
31 with Uname; use Uname;
33 -- Note: this package body is used by GPS and GNATBench to supply a list of
34 -- entries for help on available library routines.
36 package body Impunit is
38 subtype File_Name_8 is String (1 .. 8);
39 type File_List is array (Nat range <>) of File_Name_8;
41 ------------------
42 -- Ada 95 Units --
43 ------------------
45 -- The following is a giant string list containing the names of all
46 -- non-implementation internal files, i.e. the complete list of files for
47 -- internal units which a program may legitimately WITH when operating in
48 -- either Ada 95 or Ada 05 mode.
50 -- Note that this list should match the list of units documented in the
51 -- "GNAT Library" section of the GNAT Reference Manual.
53 Non_Imp_File_Names_95 : constant File_List := (
55 ------------------------------------------------------
56 -- Ada Hierarchy Units from Ada-83 Reference Manual --
57 ------------------------------------------------------
59 "a-astaco", -- Ada.Asynchronous_Task_Control
60 "a-calend", -- Ada.Calendar
61 "a-chahan", -- Ada.Characters.Handling
62 "a-charac", -- Ada.Characters
63 "a-chlat1", -- Ada.Characters.Latin_1
64 "a-comlin", -- Ada.Command_Line
65 "a-decima", -- Ada.Decimal
66 "a-direio", -- Ada.Direct_IO
67 "a-dynpri", -- Ada.Dynamic_Priorities
68 "a-except", -- Ada.Exceptions
69 "a-finali", -- Ada.Finalization
70 "a-flteio", -- Ada.Float_Text_IO
71 "a-fwteio", -- Ada.Float_Wide_Text_IO
72 "a-inteio", -- Ada.Integer_Text_IO
73 "a-interr", -- Ada.Interrupts
74 "a-intnam", -- Ada.Interrupts.Names
75 "a-ioexce", -- Ada.IO_Exceptions
76 "a-iwteio", -- Ada.Integer_Wide_Text_IO
77 "a-ncelfu", -- Ada.Numerics.Complex_Elementary_Functions
78 "a-ngcefu", -- Ada.Numerics.Generic_Complex_Elementary_Functions
79 "a-ngcoty", -- Ada.Numerics.Generic_Complex_Types
80 "a-ngelfu", -- Ada.Numerics.Generic_Elementary_Functions
81 "a-nucoty", -- Ada.Numerics.Complex_Types
82 "a-nudira", -- Ada.Numerics.Discrete_Random
83 "a-nuelfu", -- Ada.Numerics.Elementary_Functions
84 "a-nuflra", -- Ada.Numerics.Float_Random
85 "a-numeri", -- Ada.Numerics
86 "a-reatim", -- Ada.Real_Time
87 "a-sequio", -- Ada.Sequential_IO
88 "a-stmaco", -- Ada.Strings.Maps.Constants
89 "a-storio", -- Ada.Storage_IO
90 "a-strbou", -- Ada.Strings.Bounded
91 "a-stream", -- Ada.Streams
92 "a-strfix", -- Ada.Strings.Fixed
93 "a-string", -- Ada.Strings
94 "a-strmap", -- Ada.Strings.Maps
95 "a-strunb", -- Ada.Strings.Unbounded
96 "a-ststio", -- Ada.Streams.Stream_IO
97 "a-stwibo", -- Ada.Strings.Wide_Bounded
98 "a-stwifi", -- Ada.Strings.Wide_Fixed
99 "a-stwima", -- Ada.Strings.Wide_Maps
100 "a-stwiun", -- Ada.Strings.Wide_Unbounded
101 "a-swmwco", -- Ada.Strings.Wide_Maps.Wide_Constants
102 "a-sytaco", -- Ada.Synchronous_Task_Control
103 "a-tags ", -- Ada.Tags
104 "a-tasatt", -- Ada.Task_Attributes
105 "a-taside", -- Ada.Task_Identification
106 "a-teioed", -- Ada.Text_IO.Editing
107 "a-textio", -- Ada.Text_IO
108 "a-ticoio", -- Ada.Text_IO.Complex_IO
109 "a-titest", -- Ada.Text_IO.Text_Streams
110 "a-unccon", -- Ada.Unchecked_Conversion
111 "a-uncdea", -- Ada.Unchecked_Deallocation
112 "a-witeio", -- Ada.Wide_Text_IO
113 "a-wtcoio", -- Ada.Wide_Text_IO.Complex_IO
114 "a-wtedit", -- Ada.Wide_Text_IO.Editing
115 "a-wttest", -- Ada.Wide_Text_IO.Text_Streams
117 -------------------------------------------------
118 -- RM Required Additions to Ada for GNAT Types --
119 -------------------------------------------------
121 "a-lfteio", -- Ada.Long_Float_Text_IO
122 "a-lfwtio", -- Ada.Long_Float_Wide_Text_IO
123 "a-liteio", -- Ada.Long_Integer_Text_IO
124 "a-liwtio", -- Ada.Long_Integer_Wide_Text_IO
125 "a-llftio", -- Ada.Long_Long_Float_Text_IO
126 "a-llfwti", -- Ada.Long_Long_Float_Wide_Text_IO
127 "a-llitio", -- Ada.Long_Long_Integer_Text_IO
128 "a-lliwti", -- Ada.Long_Long_Integer_Wide_Text_IO
129 "a-nlcefu", -- Ada.Long_Complex_Elementary_Functions
130 "a-nlcoty", -- Ada.Numerics.Long_Complex_Types
131 "a-nlelfu", -- Ada.Numerics.Long_Elementary_Functions
132 "a-nllcef", -- Ada.Long_Long_Complex_Elementary_Functions
133 "a-nllefu", -- Ada.Numerics.Long_Long_Elementary_Functions
134 "a-nllcty", -- Ada.Numerics.Long_Long_Complex_Types
135 "a-nscefu", -- Ada.Short_Complex_Elementary_Functions
136 "a-nscoty", -- Ada.Numerics.Short_Complex_Types
137 "a-nselfu", -- Ada.Numerics.Short_Elementary_Functions
138 "a-sfteio", -- Ada.Short_Float_Text_IO
139 "a-sfwtio", -- Ada.Short_Float_Wide_Text_IO
140 "a-siteio", -- Ada.Short_Integer_Text_IO
141 "a-siwtio", -- Ada.Short_Integer_Wide_Text_IO
142 "a-ssitio", -- Ada.Short_Short_Integer_Text_IO
143 "a-ssiwti", -- Ada.Short_Short_Integer_Wide_Text_IO
145 -----------------------------------
146 -- GNAT Defined Additions to Ada --
147 -----------------------------------
149 "a-chlat9", -- Ada.Characters.Latin_9
150 "a-clrefi", -- Ada.Command_Line.Response_File
151 "a-colien", -- Ada.Command_Line.Environment
152 "a-colire", -- Ada.Command_Line.Remove
153 "a-cwila1", -- Ada.Characters.Wide_Latin_1
154 "a-cwila9", -- Ada.Characters.Wide_Latin_9
155 "a-diocst", -- Ada.Direct_IO.C_Streams
156 "a-einuoc", -- Ada.Exceptions.Is_Null_Occurrence
157 "a-elchha", -- Ada.Exceptions.Last_Chance_Handler
158 "a-exctra", -- Ada.Exceptions.Traceback
159 "a-siocst", -- Ada.Sequential_IO.C_Streams
160 "a-ssicst", -- Ada.Streams.Stream_IO.C_Streams
161 "a-suteio", -- Ada.Strings.Unbounded.Text_IO
162 "a-swuwti", -- Ada.Strings.Wide_Unbounded.Wide_Text_IO
163 "a-taidim", -- Ada.Task_Identification.Image
164 "a-tiocst", -- Ada.Text_IO.C_Streams
165 "a-wtcstr", -- Ada.Wide_Text_IO.C_Streams
167 -- Note: strictly the next two should be Ada 2005 units, but it seems
168 -- harmless (and useful) to make then available in Ada 95 mode, since
169 -- they only deal with Wide_Character, not Wide_Wide_Character.
171 "a-wichun", -- Ada.Wide_Characters.Unicode
172 "a-widcha", -- Ada.Wide_Characters
174 ---------------------------
175 -- GNAT Special IO Units --
176 ---------------------------
178 -- As further explained elsewhere (see Sem_Ch10), the internal
179 -- packages of Text_IO and Wide_Text_IO are actually implemented
180 -- as separate children, but this fact is intended to be hidden
181 -- from the user completely. Any attempt to WITH one of these
182 -- units will be diagnosed as an error later on, but for now we
183 -- do not consider these internal implementation units (if we did,
184 -- then we would get a junk warning which would be confusing and
185 -- unecessary, given that we generate a clear error message).
187 "a-tideio", -- Ada.Text_IO.Decimal_IO
188 "a-tienio", -- Ada.Text_IO.Enumeration_IO
189 "a-tifiio", -- Ada.Text_IO.Fixed_IO
190 "a-tiflio", -- Ada.Text_IO.Float_IO
191 "a-tiinio", -- Ada.Text_IO.Integer_IO
192 "a-tiinio", -- Ada.Text_IO.Integer_IO
193 "a-timoio", -- Ada.Text_IO.Modular_IO
194 "a-wtdeio", -- Ada.Wide_Text_IO.Decimal_IO
195 "a-wtenio", -- Ada.Wide_Text_IO.Enumeration_IO
196 "a-wtfiio", -- Ada.Wide_Text_IO.Fixed_IO
197 "a-wtflio", -- Ada.Wide_Text_IO.Float_IO
198 "a-wtinio", -- Ada.Wide_Text_IO.Integer_IO
199 "a-wtmoio", -- Ada.Wide_Text_IO.Modular_IO
201 ------------------------
202 -- GNAT Library Units --
203 ------------------------
205 "g-altive", -- GNAT.Altivec
206 "g-altcon", -- GNAT.Altivec.Conversions
207 "g-alveop", -- GNAT.Altivec.Vector_Operations
208 "g-alvety", -- GNAT.Altivec.Vector_Types
209 "g-alvevi", -- GNAT.Altivec.Vector_Views
210 "g-arrspl", -- GNAT.Array_Split
211 "g-awk ", -- GNAT.AWK
212 "g-boubuf", -- GNAT.Bounded_Buffers
213 "g-boumai", -- GNAT.Bounded_Mailboxes
214 "g-bubsor", -- GNAT.Bubble_Sort
215 "g-busora", -- GNAT.Bubble_Sort_A
216 "g-busorg", -- GNAT.Bubble_Sort_G
217 "g-byorma", -- GNAT.Byte_Order_Mark
218 "g-bytswa", -- GNAT.Byte_Swapping
219 "g-calend", -- GNAT.Calendar
220 "g-catiio", -- GNAT.Calendar.Time_IO
221 "g-casuti", -- GNAT.Case_Util
222 "g-cgi ", -- GNAT.CGI
223 "g-cgicoo", -- GNAT.CGI.Cookie
224 "g-cgideb", -- GNAT.CGI.Debug
225 "g-comlin", -- GNAT.Command_Line
226 "g-comver", -- GNAT.Compiler_Version
227 "g-crc32 ", -- GNAT.CRC32
228 "g-ctrl_c", -- GNAT.Ctrl_C
229 "g-curexc", -- GNAT.Current_Exception
230 "g-debpoo", -- GNAT.Debug_Pools
231 "g-debuti", -- GNAT.Debug_Utilities
232 "g-decstr", -- GNAT.Decode_String
233 "g-deutst", -- GNAT.Decode_UTF8_String
234 "g-dirope", -- GNAT.Directory_Operations
235 "g-diopit", -- GNAT.Directory_Operations.Iteration
236 "g-dynhta", -- GNAT.Dynamic_HTables
237 "g-dyntab", -- GNAT.Dynamic_Tables
238 "g-encstr", -- GNAT.Encode_String
239 "g-enutst", -- GNAT.Encode_UTF8_String
240 "g-excact", -- GNAT.Exception_Actions
241 "g-except", -- GNAT.Exceptions
242 "g-exctra", -- GNAT.Exception_Traces
243 "g-expect", -- GNAT.Expect
244 "g-flocon", -- GNAT.Float_Control
245 "g-heasor", -- GNAT.Heap_Sort
246 "g-hesora", -- GNAT.Heap_Sort_A
247 "g-hesorg", -- GNAT.Heap_Sort_G
248 "g-htable", -- GNAT.Htable
249 "g-io ", -- GNAT.IO
250 "g-io_aux", -- GNAT.IO_Aux
251 "g-locfil", -- GNAT.Lock_Files
252 "g-md5 ", -- GNAT.MD5
253 "g-memdum", -- GNAT.Memory_Dump
254 "g-moreex", -- GNAT.Most_Recent_Exception
255 "g-os_lib", -- GNAT.Os_Lib
256 "g-pehage", -- GNAT.Perfect_Hash_Generators
257 "g-rannum", -- GNAT.Random_Numbers
258 "g-regexp", -- GNAT.Regexp
259 "g-regist", -- GNAT.Registry
260 "g-regpat", -- GNAT.Regpat
261 "g-semaph", -- GNAT.Semaphores
262 "g-sestin", -- GNAT.Secondary_Stack_Info
263 "g-sha1 ", -- GNAT.SHA1
264 "g-signal", -- GNAT.Signals
265 "g-socket", -- GNAT.Sockets
266 "g-souinf", -- GNAT.Source_Info
267 "g-speche", -- GNAT.Spell_Checker
268 "g-spchge", -- GNAT.Spell_Checker_Generic
269 "g-spitbo", -- GNAT.Spitbol
270 "g-spipat", -- GNAT.Spitbol.Patterns
271 "g-sptabo", -- GNAT.Spitbol.Table_Boolean
272 "g-sptain", -- GNAT.Spitbol.Table_Integer
273 "g-sptavs", -- GNAT.Spitbol.Table_Vstring
274 "g-string", -- GNAT.Strings
275 "g-strspl", -- GNAT.String_Split
276 "g-table ", -- GNAT.Table
277 "g-tasloc", -- GNAT.Task_Lock
278 "g-thread", -- GNAT.Threads
279 "g-traceb", -- GNAT.Traceback
280 "g-trasym", -- GNAT.Traceback.Symbolic
281 "g-utf_32", -- GNAT.UTF_32
282 "g-u3spch", -- GNAT.UTF_32_Spelling_Checker
283 "g-wispch", -- GNAT.Wide_Spelling_Checker
284 "g-wistsp", -- GNAT.Wide_String_Split
285 "g-zspche", -- GNAT.Wide_Wide_Spelling_Checker
286 "g-zstspl", -- GNAT.Wide_Wide_String_Split
288 -----------------------------------------------------
289 -- Interface Hierarchy Units from Reference Manual --
290 -----------------------------------------------------
292 "i-c ", -- Interfaces.C
293 "i-cobol ", -- Interfaces.Cobol
294 "i-cpoint", -- Interfaces.C.Pointers
295 "i-cstrin", -- Interfaces.C.Strings
296 "i-fortra", -- Interfaces.Fortran
298 ------------------------------------------
299 -- GNAT Defined Additions to Interfaces --
300 ------------------------------------------
302 "i-cexten", -- Interfaces.C.Extensions
303 "i-cpp ", -- Interfaces.CPP
304 "i-cstrea", -- Interfaces.C.Streams
305 "i-java ", -- Interfaces.Java
306 "i-pacdec", -- Interfaces.Packed_Decimal
307 "i-vxwoio", -- Interfaces.VxWorks.IO
308 "i-vxwork", -- Interfaces.VxWorks
310 --------------------------------------------------
311 -- System Hierarchy Units from Reference Manual --
312 --------------------------------------------------
314 "s-atacco", -- System.Address_To_Access_Conversions
315 "s-maccod", -- System.Machine_Code
316 "s-rpc ", -- System.Rpc
317 "s-stoele", -- System.Storage_Elements
318 "s-stopoo", -- System.Storage_Pools
320 --------------------------------------
321 -- GNAT Defined Additions to System --
322 --------------------------------------
324 "s-addima", -- System.Address_Image
325 "s-assert", -- System.Assertions
326 "s-memory", -- System.Memory
327 "s-os_lib", -- System.Os_Lib
328 "s-parint", -- System.Partition_Interface
329 "s-pooglo", -- System.Pool_Global
330 "s-pooloc", -- System.Pool_Local
331 "s-restri", -- System.Restrictions
332 "s-rident", -- System.Rident
333 "s-tasinf", -- System.Task_Info
334 "s-wchcnv", -- System.Wch_Cnv
335 "s-wchcon"); -- System.Wch_Con
337 --------------------
338 -- Ada 2005 Units --
339 --------------------
341 -- The following units should be used only in Ada 05 mode
343 Non_Imp_File_Names_05 : constant File_List := (
345 --------------------------------------------------------
346 -- Ada Hierarchy Units from Ada 2005 Reference Manual --
347 --------------------------------------------------------
349 "a-assert", -- Ada.Assertions
350 "a-calari", -- Ada.Calendar.Arithmetic
351 "a-calfor", -- Ada.Calendar.Formatting
352 "a-catizo", -- Ada.Calendar.Time_Zones
353 "a-cdlili", -- Ada.Containers.Doubly_Linked_Lists
354 "a-cgarso", -- Ada.Containers.Generic_Array_Sort
355 "a-cgcaso", -- Ada.Containers.Generic_Constrained_Array_Sort
356 "a-chacon", -- Ada.Characters.Conversions
357 "a-cidlli", -- Ada.Containers.Indefinite_Doubly_Linked_Lists
358 "a-cihama", -- Ada.Containers.Indefinite_Hashed_Maps
359 "a-cihase", -- Ada.Containers.Indefinite_Hashed_Sets
360 "a-ciorma", -- Ada.Containers.Indefinite_Ordered_Maps
361 "a-ciorse", -- Ada.Containers.Indefinite_Ordered_Sets
362 "a-cohama", -- Ada.Containers.Hashed_Maps
363 "a-cohase", -- Ada.Containers.Hashed_Sets
364 "a-coinve", -- Ada.Containers.Indefinite_Vectors
365 "a-contai", -- Ada.Containers
366 "a-convec", -- Ada.Containers.Vectors
367 "a-coorma", -- Ada.Containers.Ordered_Maps
368 "a-coorse", -- Ada.Containers.Ordered_Sets
369 "a-coteio", -- Ada.Complex_Text_IO
370 "a-direct", -- Ada.Directories
371 "a-diroro", -- Ada.Dispatching.Round_Robin
372 "a-dispat", -- Ada.Dispatching
373 "a-envvar", -- Ada.Environment_Variables
374 "a-exetim", -- Ada.Execution_Time
375 "a-extiti", -- Ada.Execution_Time.Timers
376 "a-rttiev", -- Ada.Real_Time.Timing_Events
377 "a-ngcoar", -- Ada.Numerics.Generic_Complex_Arrays
378 "a-ngrear", -- Ada.Numerics.Generic_Real_Arrays
379 "a-nucoar", -- Ada.Numerics.Complex_Arrays
380 "a-nurear", -- Ada.Numerics.Real_Arrays
381 "a-stboha", -- Ada.Strings.Bounded.Hash
382 "a-stfiha", -- Ada.Strings.Fixed.Hash
383 "a-strhas", -- Ada.Strings.Hash
384 "a-stunha", -- Ada.Strings.Unbounded.Hash
385 "a-stwiha", -- Ada.Strings.Wide_Hash
386 "a-stzbou", -- Ada.Strings.Wide_Wide_Bounded
387 "a-stzfix", -- Ada.Strings.Wide_Wide_Fixed
388 "a-stzhas", -- Ada.Strings.Wide_Wide_Hash
389 "a-stzmap", -- Ada.Strings.Wide_Wide_Maps
390 "a-stzunb", -- Ada.Strings.Wide_Wide_Unbounded
391 "a-swbwha", -- Ada.Strings.Wide_Bounded.Wide_Hash
392 "a-swfwha", -- Ada.Strings.Wide_Fixed.Wide_Hash
393 "a-swuwha", -- Ada.Strings.Wide_Unbounded.Wide_Hash
394 "a-szbzha", -- Ada.Strings.Wide_Wide_Bounded.Wide_Wide_Hash
395 "a-szfzha", -- Ada.Strings.Wide_Wide_Fixed.Wide_Wide_Hash
396 "a-szmzco", -- Ada.Strings.Wide_Wide_Maps.Wide_Wide_Constants
397 "a-szuzha", -- Ada.Strings.Wide_Wide_Unbounded.Wide_Wide_Hash
398 "a-taster", -- Ada.Task_Termination
399 "a-tgdico", -- Ada.Tags.Generic_Dispatching_Constructor
400 "a-tiboio", -- Ada.Text_IO.Bounded_IO
401 "a-tiunio", -- Ada.Text_IO.Unbounded_IO
402 "a-wichun", -- Ada.Wide_Characters.Unicode
403 "a-wwboio", -- Ada.Wide_Text_IO.Wide_Bounded_IO
404 "a-wwunio", -- Ada.Wide_Text_IO.Wide_Unbounded_IO
405 "a-zchara", -- Ada.Wide_Wide_Characters
406 "a-ztcoio", -- Ada.Wide_Wide_Text_IO.Complex_IO
407 "a-ztedit", -- Ada.Wide_Wide_Text_IO.Editing
408 "a-zttest", -- Ada.Wide_Wide_Text_IO.Text_Streams
409 "a-ztexio", -- Ada.Wide_Wide_Text_IO
410 "a-zzboio", -- Ada.Wide_Wide_Text_IO.Wide_Wide_Bounded_IO
411 "a-zzunio", -- Ada.Wide_Wide_Text_IO.Wide_Wide_Unbounded_IO
413 ------------------------------------------------------
414 -- RM Required Additions to Ada 2005 for GNAT Types --
415 ------------------------------------------------------
417 "a-lcteio", -- Ada.Long_Complex_Text_IO
418 "a-lfztio", -- Ada.Long_Float_Wide_Wide_Text_IO
419 "a-liztio", -- Ada.Long_Integer_Wide_Wide_Text_IO
420 "a-llctio", -- Ada.Long_Long_Complex_Text_IO
421 "a-llfzti", -- Ada.Long_Long_Float_Wide_Wide_Text_IO
422 "a-llizti", -- Ada.Long_Long_Integer_Wide_Wide_Text_IO
423 "a-nlcoar", -- Ada.Numerics.Long_Complex_Arrays
424 "a-nllcar", -- Ada.Numerics.Long_Long_Complex_Arrays
425 "a-nllrar", -- Ada.Numerics.Long_Long_Real_Arrays
426 "a-nlrear", -- Ada.Numerics.Long_Real_Arrays
427 "a-scteio", -- Ada.Short_Complex_Text_IO
428 "a-sfztio", -- Ada.Short_Float_Wide_Wide_Text_IO
429 "a-siztio", -- Ada.Short_Integer_Wide_Wide_Text_IO
430 "a-ssizti", -- Ada.Short_Short_Integer_Wide_Wide_Text_IO
431 "a-ztcstr", -- Ada.Wide_Wide_Text_IO.C_Streams
433 ----------------------------------------
434 -- GNAT Defined Additions to Ada 2005 --
435 ----------------------------------------
437 "a-cgaaso", -- Ada.Containers.Generic_Anonymous_Array_Sort
438 "a-chzla1", -- Ada.Characters.Wide_Wide_Latin_1
439 "a-chzla9", -- Ada.Characters.Wide_Wide_Latin_9
440 "a-ciormu", -- Ada.Containers.Indefinite_Ordered_Multisets
441 "a-coormu", -- Ada.Containers.Ordered_Multisets
442 "a-crdlli", -- Ada.Containers.Restricted_Doubly_Linked_Lists
443 "a-secain", -- Ada.Strings.Equal_Case_Insensitive
444 "a-shcain", -- Ada.Strings.Hash_Case_Insensitive
445 "a-slcain", -- Ada.Strings.Less_Case_Insensitive
446 "a-szuzti", -- Ada.Strings.Wide_Wide_Unbounded.Wide_Wide_Text_IO
447 "a-zchuni", -- Ada.Wide_Wide_Characters.Unicode
449 ---------------------------
450 -- GNAT Special IO Units --
451 ---------------------------
453 -- See Ada 95 section for further information. These packages are for the
454 -- implementation of the Wide_Wide_Text_IO generic packages.
456 "a-ztdeio", -- Ada.Wide_Wide_Text_IO.Decimal_IO
457 "a-ztenio", -- Ada.Wide_Wide_Text_IO.Enumeration_IO
458 "a-ztfiio", -- Ada.Wide_Wide_Text_IO.Fixed_IO
459 "a-ztflio", -- Ada.Wide_Wide_Text_IO.Float_IO
460 "a-ztinio", -- Ada.Wide_Wide_Text_IO.Integer_IO
461 "a-ztmoio", -- Ada.Wide_Wide_Text_IO.Modular_IO
463 ------------------------
464 -- GNAT Library Units --
465 ------------------------
467 "g-zspche", -- GNAT.Wide_Wide_Spelling_Checker
468 "g-zstspl"); -- GNAT.Wide_Wide_String_Split
470 ----------------------
471 -- Get_Kind_Of_Unit --
472 ----------------------
474 function Get_Kind_Of_Unit (U : Unit_Number_Type) return Kind_Of_Unit is
475 Fname : constant File_Name_Type := Unit_File_Name (U);
477 begin
478 -- If length of file name is greater than 12, not predefined.
479 -- The value 12 here is an 8 char name with extension .ads.
481 if Length_Of_Name (Fname) > 12 then
482 return Not_Predefined_Unit;
483 end if;
485 -- Otherwise test file name
487 Get_Name_String (Fname);
489 -- Not predefined if file name does not start with a- g- s- i-
491 if Name_Len < 3
492 or else Name_Buffer (2) /= '-'
493 or else (Name_Buffer (1) /= 'a'
494 and then
495 Name_Buffer (1) /= 'g'
496 and then
497 Name_Buffer (1) /= 'i'
498 and then
499 Name_Buffer (1) /= 's')
500 then
501 return Not_Predefined_Unit;
502 end if;
504 -- Not predefined if file name does not end in .ads. This can
505 -- happen when non-standard file names are being used.
507 if Name_Buffer (Name_Len - 3 .. Name_Len) /= ".ads" then
508 return Not_Predefined_Unit;
509 end if;
511 -- Otherwise normalize file name to 8 characters
513 Name_Len := Name_Len - 4;
514 while Name_Len < 8 loop
515 Name_Len := Name_Len + 1;
516 Name_Buffer (Name_Len) := ' ';
517 end loop;
519 -- See if name is in 95 list
521 for J in Non_Imp_File_Names_95'Range loop
522 if Name_Buffer (1 .. 8) = Non_Imp_File_Names_95 (J) then
523 return Ada_95_Unit;
524 end if;
525 end loop;
527 -- See if name is in 05 list
529 for J in Non_Imp_File_Names_05'Range loop
530 if Name_Buffer (1 .. 8) = Non_Imp_File_Names_05 (J) then
531 return Ada_05_Unit;
532 end if;
533 end loop;
535 -- Only remaining special possibilities are children of System.RPC and
536 -- System.Garlic and special files of the form System.Aux...
538 Get_Name_String (Unit_Name (U));
540 if Name_Len > 12
541 and then Name_Buffer (1 .. 11) = "system.rpc."
542 then
543 return Ada_95_Unit;
544 end if;
546 if Name_Len > 15
547 and then Name_Buffer (1 .. 14) = "system.garlic."
548 then
549 return Ada_95_Unit;
550 end if;
552 if Name_Len > 11
553 and then Name_Buffer (1 .. 10) = "system.aux"
554 then
555 return Ada_95_Unit;
556 end if;
558 -- All tests failed, this is definitely an implementation unit
560 return Implementation_Unit;
561 end Get_Kind_Of_Unit;
563 -------------------
564 -- Is_Known_Unit --
565 -------------------
567 function Is_Known_Unit (Nam : Node_Id) return Boolean is
568 Unam : Unit_Name_Type;
569 Fnam : File_Name_Type;
571 begin
572 -- If selector is not an identifier (e.g. it is a character literal or
573 -- some junk from a previous error), then definitely not a known unit.
575 if Nkind (Selector_Name (Nam)) /= N_Identifier then
576 return False;
577 end if;
579 -- Otherwise get corresponding file name
581 Unam := Get_Unit_Name (Nam);
582 Fnam := Get_File_Name (Unam, Subunit => False);
583 Get_Name_String (Fnam);
585 -- Remove extension from file name
587 if Name_Buffer (Name_Len - 3 .. Name_Len) = ".adb" then
588 Name_Len := Name_Len - 4;
589 else
590 return False;
591 end if;
593 -- Pad name to 8 characters
595 while Name_Len < 8 loop
596 Name_Len := Name_Len + 1;
597 Name_Buffer (Name_Len) := ' ';
598 end loop;
600 -- If length more than 8, definitely not a match
602 if Name_Len /= 8 then
603 return False;
604 end if;
606 -- If length is 8, search our tables
608 for J in Non_Imp_File_Names_95'Range loop
609 if Name_Buffer (1 .. 8) = Non_Imp_File_Names_95 (J) then
610 return True;
611 end if;
612 end loop;
614 for J in Non_Imp_File_Names_05'Range loop
615 if Name_Buffer (1 .. 8) = Non_Imp_File_Names_05 (J) then
616 return True;
617 end if;
618 end loop;
620 -- If not found, not known
622 return False;
624 -- A safety guard, if we get an exception during this processing then it
625 -- is most likely the result of a previous error, or a peculiar case we
626 -- have not thought of. Since this routine is only used for error message
627 -- refinement, we will just return False.
629 exception
630 when others =>
631 return False;
632 end Is_Known_Unit;
634 end Impunit;