1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
9 -- Copyright (C) 2000-2007, 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. 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. --
21 -- GNAT was originally developed by the GNAT team at New York University. --
22 -- Extensive contributions were provided by Ada Core Technologies Inc. --
24 ------------------------------------------------------------------------------
26 with Atree; use Atree;
27 with Sinfo; use Sinfo;
28 with Fname.UF; use Fname.UF;
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;
45 -- The following is a giant string list containing the names of all non-
46 -- 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. A unit listed here
52 -- must either be documented in that section or described in the Ada RM.
54 Non_Imp_File_Names_95 : constant File_List := (
56 ------------------------------------------------------
57 -- Ada Hierarchy Units from Ada-83 Reference Manual --
58 ------------------------------------------------------
60 "a-astaco", -- Ada.Asynchronous_Task_Control
61 "a-calend", -- Ada.Calendar
62 "a-chahan", -- Ada.Characters.Handling
63 "a-charac", -- Ada.Characters
64 "a-chlat1", -- Ada.Characters.Latin_1
65 "a-comlin", -- Ada.Command_Line
66 "a-decima", -- Ada.Decimal
67 "a-direio", -- Ada.Direct_IO
68 "a-dynpri", -- Ada.Dynamic_Priorities
69 "a-except", -- Ada.Exceptions
70 "a-finali", -- Ada.Finalization
71 "a-flteio", -- Ada.Float_Text_IO
72 "a-fwteio", -- Ada.Float_Wide_Text_IO
73 "a-inteio", -- Ada.Integer_Text_IO
74 "a-interr", -- Ada.Interrupts
75 "a-intnam", -- Ada.Interrupts.Names
76 "a-ioexce", -- Ada.IO_Exceptions
77 "a-iwteio", -- Ada.Integer_Wide_Text_IO
78 "a-ncelfu", -- Ada.Numerics.Complex_Elementary_Functions
79 "a-ngcefu", -- Ada.Numerics.Generic_Complex_Elementary_Functions
80 "a-ngcoty", -- Ada.Numerics.Generic_Complex_Types
81 "a-ngelfu", -- Ada.Numerics.Generic_Elementary_Functions
82 "a-nucoty", -- Ada.Numerics.Complex_Types
83 "a-nudira", -- Ada.Numerics.Discrete_Random
84 "a-nuelfu", -- Ada.Numerics.Elementary_Functions
85 "a-nuflra", -- Ada.Numerics.Float_Random
86 "a-numeri", -- Ada.Numerics
87 "a-reatim", -- Ada.Real_Time
88 "a-sequio", -- Ada.Sequential_IO
89 "a-stmaco", -- Ada.Strings.Maps.Constants
90 "a-storio", -- Ada.Storage_IO
91 "a-strbou", -- Ada.Strings.Bounded
92 "a-stream", -- Ada.Streams
93 "a-strfix", -- Ada.Strings.Fixed
94 "a-string", -- Ada.Strings
95 "a-strmap", -- Ada.Strings.Maps
96 "a-strunb", -- Ada.Strings.Unbounded
97 "a-ststio", -- Ada.Streams.Stream_IO
98 "a-stwibo", -- Ada.Strings.Wide_Bounded
99 "a-stwifi", -- Ada.Strings.Wide_Fixed
100 "a-stwima", -- Ada.Strings.Wide_Maps
101 "a-stwiun", -- Ada.Strings.Wide_Unbounded
102 "a-swmwco", -- Ada.Strings.Wide_Maps.Wide_Constants
103 "a-sytaco", -- Ada.Synchronous_Task_Control
104 "a-tags ", -- Ada.Tags
105 "a-tasatt", -- Ada.Task_Attributes
106 "a-taside", -- Ada.Task_Identification
107 "a-teioed", -- Ada.Text_IO.Editing
108 "a-textio", -- Ada.Text_IO
109 "a-ticoio", -- Ada.Text_IO.Complex_IO
110 "a-titest", -- Ada.Text_IO.Text_Streams
111 "a-unccon", -- Ada.Unchecked_Conversion
112 "a-uncdea", -- Ada.Unchecked_Deallocation
113 "a-witeio", -- Ada.Wide_Text_IO
114 "a-wtcoio", -- Ada.Wide_Text_IO.Complex_IO
115 "a-wtedit", -- Ada.Wide_Text_IO.Editing
116 "a-wttest", -- Ada.Wide_Text_IO.Text_Streams
118 -------------------------------------------------
119 -- RM Required Additions to Ada for GNAT Types --
120 -------------------------------------------------
122 "a-lfteio", -- Ada.Long_Float_Text_IO
123 "a-lfwtio", -- Ada.Long_Float_Wide_Text_IO
124 "a-liteio", -- Ada.Long_Integer_Text_IO
125 "a-liwtio", -- Ada.Long_Integer_Wide_Text_IO
126 "a-llftio", -- Ada.Long_Long_Float_Text_IO
127 "a-llfwti", -- Ada.Long_Long_Float_Wide_Text_IO
128 "a-llitio", -- Ada.Long_Long_Integer_Text_IO
129 "a-lliwti", -- Ada.Long_Long_Integer_Wide_Text_IO
130 "a-nlcefu", -- Ada.Long_Complex_Elementary_Functions
131 "a-nlcoty", -- Ada.Numerics.Long_Complex_Types
132 "a-nlelfu", -- Ada.Numerics.Long_Elementary_Functions
133 "a-nllcef", -- Ada.Long_Long_Complex_Elementary_Functions
134 "a-nllefu", -- Ada.Numerics.Long_Long_Elementary_Functions
135 "a-nllcty", -- Ada.Numerics.Long_Long_Complex_Types
136 "a-nscefu", -- Ada.Short_Complex_Elementary_Functions
137 "a-nscoty", -- Ada.Numerics.Short_Complex_Types
138 "a-nselfu", -- Ada.Numerics.Short_Elementary_Functions
139 "a-sfteio", -- Ada.Short_Float_Text_IO
140 "a-sfwtio", -- Ada.Short_Float_Wide_Text_IO
141 "a-siteio", -- Ada.Short_Integer_Text_IO
142 "a-siwtio", -- Ada.Short_Integer_Wide_Text_IO
143 "a-ssitio", -- Ada.Short_Short_Integer_Text_IO
144 "a-ssiwti", -- Ada.Short_Short_Integer_Wide_Text_IO
146 -----------------------------------
147 -- GNAT Defined Additions to Ada --
148 -----------------------------------
150 "a-chlat9", -- Ada.Characters.Latin_9
151 "a-clrefi", -- Ada.Command_Line.Response_File
152 "a-colien", -- Ada.Command_Line.Environment
153 "a-colire", -- Ada.Command_Line.Remove
154 "a-cwila1", -- Ada.Characters.Wide_Latin_1
155 "a-cwila9", -- Ada.Characters.Wide_Latin_9
156 "a-diocst", -- Ada.Direct_IO.C_Streams
157 "a-einuoc", -- Ada.Exceptions.Is_Null_Occurrence
158 "a-elchha", -- Ada.Exceptions.Last_Chance_Handler
159 "a-exctra", -- Ada.Exceptions.Traceback
160 "a-siocst", -- Ada.Sequential_IO.C_Streams
161 "a-ssicst", -- Ada.Streams.Stream_IO.C_Streams
162 "a-suteio", -- Ada.Strings.Unbounded.Text_IO
163 "a-swuwti", -- Ada.Strings.Wide_Unbounded.Wide_Text_IO
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 packages of
179 -- Text_IO and Wide_Text_IO are actually implemented as separate children,
180 -- but this fact is intended to be hidden from the user completely. Any
181 -- attempt to WITH one of these units will be diagnosed as an error later
182 -- on, but for now we do not consider these internal implementation units
183 -- (if we did, then we would get a junk warning which would be confusing
184 -- and unnecessary, given that we generate a clear error message).
186 "a-tideio", -- Ada.Text_IO.Decimal_IO
187 "a-tienio", -- Ada.Text_IO.Enumeration_IO
188 "a-tifiio", -- Ada.Text_IO.Fixed_IO
189 "a-tiflio", -- Ada.Text_IO.Float_IO
190 "a-tiinio", -- Ada.Text_IO.Integer_IO
191 "a-tiinio", -- Ada.Text_IO.Integer_IO
192 "a-timoio", -- Ada.Text_IO.Modular_IO
193 "a-wtdeio", -- Ada.Wide_Text_IO.Decimal_IO
194 "a-wtenio", -- Ada.Wide_Text_IO.Enumeration_IO
195 "a-wtfiio", -- Ada.Wide_Text_IO.Fixed_IO
196 "a-wtflio", -- Ada.Wide_Text_IO.Float_IO
197 "a-wtinio", -- Ada.Wide_Text_IO.Integer_IO
198 "a-wtmoio", -- Ada.Wide_Text_IO.Modular_IO
200 ------------------------
201 -- GNAT Library Units --
202 ------------------------
204 "g-altive", -- GNAT.Altivec
205 "g-altcon", -- GNAT.Altivec.Conversions
206 "g-alveop", -- GNAT.Altivec.Vector_Operations
207 "g-alvety", -- GNAT.Altivec.Vector_Types
208 "g-alvevi", -- GNAT.Altivec.Vector_Views
209 "g-arrspl", -- GNAT.Array_Split
210 "g-awk ", -- GNAT.AWK
211 "g-boubuf", -- GNAT.Bounded_Buffers
212 "g-boumai", -- GNAT.Bounded_Mailboxes
213 "g-bubsor", -- GNAT.Bubble_Sort
214 "g-busora", -- GNAT.Bubble_Sort_A
215 "g-busorg", -- GNAT.Bubble_Sort_G
216 "g-byorma", -- GNAT.Byte_Order_Mark
217 "g-bytswa", -- GNAT.Byte_Swapping
218 "g-calend", -- GNAT.Calendar
219 "g-catiio", -- GNAT.Calendar.Time_IO
220 "g-casuti", -- GNAT.Case_Util
221 "g-cgi ", -- GNAT.CGI
222 "g-cgicoo", -- GNAT.CGI.Cookie
223 "g-cgideb", -- GNAT.CGI.Debug
224 "g-comlin", -- GNAT.Command_Line
225 "g-comver", -- GNAT.Compiler_Version
226 "g-crc32 ", -- GNAT.CRC32
227 "g-ctrl_c", -- GNAT.Ctrl_C
228 "g-curexc", -- GNAT.Current_Exception
229 "g-debpoo", -- GNAT.Debug_Pools
230 "g-debuti", -- GNAT.Debug_Utilities
231 "g-decstr", -- GNAT.Decode_String
232 "g-deutst", -- GNAT.Decode_UTF8_String
233 "g-dirope", -- GNAT.Directory_Operations
234 "g-diopit", -- GNAT.Directory_Operations.Iteration
235 "g-dynhta", -- GNAT.Dynamic_HTables
236 "g-dyntab", -- GNAT.Dynamic_Tables
237 "g-encstr", -- GNAT.Encode_String
238 "g-enutst", -- GNAT.Encode_UTF8_String
239 "g-excact", -- GNAT.Exception_Actions
240 "g-except", -- GNAT.Exceptions
241 "g-exctra", -- GNAT.Exception_Traces
242 "g-expect", -- GNAT.Expect
243 "g-flocon", -- GNAT.Float_Control
244 "g-heasor", -- GNAT.Heap_Sort
245 "g-hesora", -- GNAT.Heap_Sort_A
246 "g-hesorg", -- GNAT.Heap_Sort_G
247 "g-htable", -- GNAT.Htable
249 "g-io_aux", -- GNAT.IO_Aux
250 "g-locfil", -- GNAT.Lock_Files
251 "g-md5 ", -- GNAT.MD5
252 "g-memdum", -- GNAT.Memory_Dump
253 "g-moreex", -- GNAT.Most_Recent_Exception
254 "g-os_lib", -- GNAT.Os_Lib
255 "g-pehage", -- GNAT.Perfect_Hash_Generators
256 "g-rannum", -- GNAT.Random_Numbers
257 "g-regexp", -- GNAT.Regexp
258 "g-regist", -- GNAT.Registry
259 "g-regpat", -- GNAT.Regpat
260 "g-semaph", -- GNAT.Semaphores
261 "g-sercom", -- GNAT.Serial_Communications
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
286 -----------------------------------------------------
287 -- Interface Hierarchy Units from Reference Manual --
288 -----------------------------------------------------
290 "i-c ", -- Interfaces.C
291 "i-cobol ", -- Interfaces.Cobol
292 "i-cpoint", -- Interfaces.C.Pointers
293 "i-cstrin", -- Interfaces.C.Strings
294 "i-fortra", -- Interfaces.Fortran
296 ------------------------------------------
297 -- GNAT Defined Additions to Interfaces --
298 ------------------------------------------
300 "i-cexten", -- Interfaces.C.Extensions
301 "i-cpp ", -- Interfaces.CPP
302 "i-cstrea", -- Interfaces.C.Streams
303 "i-java ", -- Interfaces.Java
304 "i-pacdec", -- Interfaces.Packed_Decimal
305 "i-vxwoio", -- Interfaces.VxWorks.IO
306 "i-vxwork", -- Interfaces.VxWorks
308 --------------------------------------------------
309 -- System Hierarchy Units from Reference Manual --
310 --------------------------------------------------
312 "s-atacco", -- System.Address_To_Access_Conversions
313 "s-maccod", -- System.Machine_Code
314 "s-rpc ", -- System.Rpc
315 "s-stoele", -- System.Storage_Elements
316 "s-stopoo", -- System.Storage_Pools
318 --------------------------------------
319 -- GNAT Defined Additions to System --
320 --------------------------------------
322 "s-addima", -- System.Address_Image
323 "s-assert", -- System.Assertions
324 "s-memory", -- System.Memory
325 "s-os_lib", -- System.Os_Lib
326 "s-parint", -- System.Partition_Interface
327 "s-pooglo", -- System.Pool_Global
328 "s-pooloc", -- System.Pool_Local
329 "s-restri", -- System.Restrictions
330 "s-rident", -- System.Rident
331 "s-tasinf", -- System.Task_Info
332 "s-wchcnv", -- System.Wch_Cnv
333 "s-wchcon"); -- System.Wch_Con
339 -- The following units should be used only in Ada 05 mode
341 Non_Imp_File_Names_05 : constant File_List := (
343 --------------------------------------------------------
344 -- Ada Hierarchy Units from Ada 2005 Reference Manual --
345 --------------------------------------------------------
347 "a-assert", -- Ada.Assertions
348 "a-calari", -- Ada.Calendar.Arithmetic
349 "a-calfor", -- Ada.Calendar.Formatting
350 "a-catizo", -- Ada.Calendar.Time_Zones
351 "a-cdlili", -- Ada.Containers.Doubly_Linked_Lists
352 "a-cgarso", -- Ada.Containers.Generic_Array_Sort
353 "a-cgcaso", -- Ada.Containers.Generic_Constrained_Array_Sort
354 "a-chacon", -- Ada.Characters.Conversions
355 "a-cidlli", -- Ada.Containers.Indefinite_Doubly_Linked_Lists
356 "a-cihama", -- Ada.Containers.Indefinite_Hashed_Maps
357 "a-cihase", -- Ada.Containers.Indefinite_Hashed_Sets
358 "a-ciorma", -- Ada.Containers.Indefinite_Ordered_Maps
359 "a-ciorse", -- Ada.Containers.Indefinite_Ordered_Sets
360 "a-cohama", -- Ada.Containers.Hashed_Maps
361 "a-cohase", -- Ada.Containers.Hashed_Sets
362 "a-coinve", -- Ada.Containers.Indefinite_Vectors
363 "a-contai", -- Ada.Containers
364 "a-convec", -- Ada.Containers.Vectors
365 "a-coorma", -- Ada.Containers.Ordered_Maps
366 "a-coorse", -- Ada.Containers.Ordered_Sets
367 "a-coteio", -- Ada.Complex_Text_IO
368 "a-direct", -- Ada.Directories
369 "a-diroro", -- Ada.Dispatching.Round_Robin
370 "a-dispat", -- Ada.Dispatching
371 "a-envvar", -- Ada.Environment_Variables
372 "a-exetim", -- Ada.Execution_Time
373 "a-extiti", -- Ada.Execution_Time.Timers
374 "a-rttiev", -- Ada.Real_Time.Timing_Events
375 "a-ngcoar", -- Ada.Numerics.Generic_Complex_Arrays
376 "a-ngrear", -- Ada.Numerics.Generic_Real_Arrays
377 "a-nucoar", -- Ada.Numerics.Complex_Arrays
378 "a-nurear", -- Ada.Numerics.Real_Arrays
379 "a-stboha", -- Ada.Strings.Bounded.Hash
380 "a-stfiha", -- Ada.Strings.Fixed.Hash
381 "a-strhas", -- Ada.Strings.Hash
382 "a-stunha", -- Ada.Strings.Unbounded.Hash
383 "a-stwiha", -- Ada.Strings.Wide_Hash
384 "a-stzbou", -- Ada.Strings.Wide_Wide_Bounded
385 "a-stzfix", -- Ada.Strings.Wide_Wide_Fixed
386 "a-stzhas", -- Ada.Strings.Wide_Wide_Hash
387 "a-stzmap", -- Ada.Strings.Wide_Wide_Maps
388 "a-stzunb", -- Ada.Strings.Wide_Wide_Unbounded
389 "a-swbwha", -- Ada.Strings.Wide_Bounded.Wide_Hash
390 "a-swfwha", -- Ada.Strings.Wide_Fixed.Wide_Hash
391 "a-swuwha", -- Ada.Strings.Wide_Unbounded.Wide_Hash
392 "a-szbzha", -- Ada.Strings.Wide_Wide_Bounded.Wide_Wide_Hash
393 "a-szfzha", -- Ada.Strings.Wide_Wide_Fixed.Wide_Wide_Hash
394 "a-szmzco", -- Ada.Strings.Wide_Wide_Maps.Wide_Wide_Constants
395 "a-szuzha", -- Ada.Strings.Wide_Wide_Unbounded.Wide_Wide_Hash
396 "a-taster", -- Ada.Task_Termination
397 "a-tgdico", -- Ada.Tags.Generic_Dispatching_Constructor
398 "a-tiboio", -- Ada.Text_IO.Bounded_IO
399 "a-tiunio", -- Ada.Text_IO.Unbounded_IO
400 "a-wichun", -- Ada.Wide_Characters.Unicode
401 "a-wwboio", -- Ada.Wide_Text_IO.Wide_Bounded_IO
402 "a-wwunio", -- Ada.Wide_Text_IO.Wide_Unbounded_IO
403 "a-zchara", -- Ada.Wide_Wide_Characters
404 "a-ztcoio", -- Ada.Wide_Wide_Text_IO.Complex_IO
405 "a-ztedit", -- Ada.Wide_Wide_Text_IO.Editing
406 "a-zttest", -- Ada.Wide_Wide_Text_IO.Text_Streams
407 "a-ztexio", -- Ada.Wide_Wide_Text_IO
408 "a-zzboio", -- Ada.Wide_Wide_Text_IO.Wide_Wide_Bounded_IO
409 "a-zzunio", -- Ada.Wide_Wide_Text_IO.Wide_Wide_Unbounded_IO
411 ------------------------------------------------------
412 -- RM Required Additions to Ada 2005 for GNAT Types --
413 ------------------------------------------------------
415 "a-lcteio", -- Ada.Long_Complex_Text_IO
416 "a-lfztio", -- Ada.Long_Float_Wide_Wide_Text_IO
417 "a-liztio", -- Ada.Long_Integer_Wide_Wide_Text_IO
418 "a-llctio", -- Ada.Long_Long_Complex_Text_IO
419 "a-llfzti", -- Ada.Long_Long_Float_Wide_Wide_Text_IO
420 "a-llizti", -- Ada.Long_Long_Integer_Wide_Wide_Text_IO
421 "a-nlcoar", -- Ada.Numerics.Long_Complex_Arrays
422 "a-nllcar", -- Ada.Numerics.Long_Long_Complex_Arrays
423 "a-nllrar", -- Ada.Numerics.Long_Long_Real_Arrays
424 "a-nlrear", -- Ada.Numerics.Long_Real_Arrays
425 "a-scteio", -- Ada.Short_Complex_Text_IO
426 "a-sfztio", -- Ada.Short_Float_Wide_Wide_Text_IO
427 "a-siztio", -- Ada.Short_Integer_Wide_Wide_Text_IO
428 "a-ssizti", -- Ada.Short_Short_Integer_Wide_Wide_Text_IO
429 "a-ztcstr", -- Ada.Wide_Wide_Text_IO.C_Streams
431 ----------------------------------------
432 -- GNAT Defined Additions to Ada 2005 --
433 ----------------------------------------
435 "a-cgaaso", -- Ada.Containers.Generic_Anonymous_Array_Sort
436 "a-chzla1", -- Ada.Characters.Wide_Wide_Latin_1
437 "a-chzla9", -- Ada.Characters.Wide_Wide_Latin_9
438 "a-ciormu", -- Ada.Containers.Indefinite_Ordered_Multisets
439 "a-coormu", -- Ada.Containers.Ordered_Multisets
440 "a-crdlli", -- Ada.Containers.Restricted_Doubly_Linked_Lists
441 "a-secain", -- Ada.Strings.Equal_Case_Insensitive
442 "a-shcain", -- Ada.Strings.Hash_Case_Insensitive
443 "a-slcain", -- Ada.Strings.Less_Case_Insensitive
444 "a-szuzti", -- Ada.Strings.Wide_Wide_Unbounded.Wide_Wide_Text_IO
445 "a-zchuni", -- Ada.Wide_Wide_Characters.Unicode
447 ---------------------------
448 -- GNAT Special IO Units --
449 ---------------------------
451 -- See Ada 95 section for further information. These packages are for the
452 -- implementation of the Wide_Wide_Text_IO generic packages.
454 "a-ztdeio", -- Ada.Wide_Wide_Text_IO.Decimal_IO
455 "a-ztenio", -- Ada.Wide_Wide_Text_IO.Enumeration_IO
456 "a-ztfiio", -- Ada.Wide_Wide_Text_IO.Fixed_IO
457 "a-ztflio", -- Ada.Wide_Wide_Text_IO.Float_IO
458 "a-ztinio", -- Ada.Wide_Wide_Text_IO.Integer_IO
459 "a-ztmoio", -- Ada.Wide_Wide_Text_IO.Modular_IO
461 ------------------------
462 -- GNAT Library Units --
463 ------------------------
465 "g-zspche", -- GNAT.Wide_Wide_Spelling_Checker
466 "g-zstspl"); -- GNAT.Wide_Wide_String_Split
468 ----------------------
469 -- Get_Kind_Of_Unit --
470 ----------------------
472 function Get_Kind_Of_Unit (U : Unit_Number_Type) return Kind_Of_Unit is
473 Fname : constant File_Name_Type := Unit_File_Name (U);
476 -- If length of file name is greater than 12, not predefined.
477 -- The value 12 here is an 8 char name with extension .ads.
479 if Length_Of_Name (Fname) > 12 then
480 return Not_Predefined_Unit;
483 -- Otherwise test file name
485 Get_Name_String (Fname);
487 -- Not predefined if file name does not start with a- g- s- i-
490 or else Name_Buffer (2) /= '-'
491 or else (Name_Buffer (1) /= 'a'
493 Name_Buffer (1) /= 'g'
495 Name_Buffer (1) /= 'i'
497 Name_Buffer (1) /= 's')
499 return Not_Predefined_Unit;
502 -- Not predefined if file name does not end in .ads. This can
503 -- happen when non-standard file names are being used.
505 if Name_Buffer (Name_Len - 3 .. Name_Len) /= ".ads" then
506 return Not_Predefined_Unit;
509 -- Otherwise normalize file name to 8 characters
511 Name_Len := Name_Len - 4;
512 while Name_Len < 8 loop
513 Name_Len := Name_Len + 1;
514 Name_Buffer (Name_Len) := ' ';
517 -- See if name is in 95 list
519 for J in Non_Imp_File_Names_95'Range loop
520 if Name_Buffer (1 .. 8) = Non_Imp_File_Names_95 (J) then
525 -- See if name is in 05 list
527 for J in Non_Imp_File_Names_05'Range loop
528 if Name_Buffer (1 .. 8) = Non_Imp_File_Names_05 (J) then
533 -- Only remaining special possibilities are children of System.RPC and
534 -- System.Garlic and special files of the form System.Aux...
536 Get_Name_String (Unit_Name (U));
539 and then Name_Buffer (1 .. 11) = "system.rpc."
545 and then Name_Buffer (1 .. 14) = "system.garlic."
551 and then Name_Buffer (1 .. 10) = "system.aux"
556 -- All tests failed, this is definitely an implementation unit
558 return Implementation_Unit;
559 end Get_Kind_Of_Unit;
565 function Is_Known_Unit (Nam : Node_Id) return Boolean is
566 Unam : Unit_Name_Type;
567 Fnam : File_Name_Type;
570 -- If selector is not an identifier (e.g. it is a character literal or
571 -- some junk from a previous error), then definitely not a known unit.
573 if Nkind (Selector_Name (Nam)) /= N_Identifier then
577 -- Otherwise get corresponding file name
579 Unam := Get_Unit_Name (Nam);
580 Fnam := Get_File_Name (Unam, Subunit => False);
581 Get_Name_String (Fnam);
583 -- Remove extension from file name
585 if Name_Buffer (Name_Len - 3 .. Name_Len) = ".adb" then
586 Name_Len := Name_Len - 4;
591 -- Pad name to 8 characters
593 while Name_Len < 8 loop
594 Name_Len := Name_Len + 1;
595 Name_Buffer (Name_Len) := ' ';
598 -- If length more than 8, definitely not a match
600 if Name_Len /= 8 then
604 -- If length is 8, search our tables
606 for J in Non_Imp_File_Names_95'Range loop
607 if Name_Buffer (1 .. 8) = Non_Imp_File_Names_95 (J) then
612 for J in Non_Imp_File_Names_05'Range loop
613 if Name_Buffer (1 .. 8) = Non_Imp_File_Names_05 (J) then
618 -- If not found, not known
622 -- A safety guard, if we get an exception during this processing then it
623 -- is most likely the result of a previous error, or a peculiar case we
624 -- have not thought of. Since this routine is only used for error message
625 -- refinement, we will just return False.