]>
Commit | Line | Data |
---|---|---|
38cbfe40 RK |
1 | ------------------------------------------------------------------------------ |
2 | -- -- | |
3 | -- GNAT COMPILER COMPONENTS -- | |
4 | -- -- | |
5 | -- I M P U N I T -- | |
6 | -- -- | |
7 | -- B o d y -- | |
8 | -- -- | |
1d005acc | 9 | -- Copyright (C) 2000-2019, Free Software Foundation, Inc. -- |
38cbfe40 RK |
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- -- | |
b5c84c3c | 13 | -- ware Foundation; either version 3, or (at your option) any later ver- -- |
38cbfe40 RK |
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 -- | |
b5c84c3c RD |
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. -- | |
38cbfe40 RK |
20 | -- -- |
21 | -- GNAT was originally developed by the GNAT team at New York University. -- | |
71ff80dc | 22 | -- Extensive contributions were provided by Ada Core Technologies Inc. -- |
38cbfe40 RK |
23 | -- -- |
24 | ------------------------------------------------------------------------------ | |
25 | ||
815f44d0 | 26 | with Atree; use Atree; |
3eb532e6 | 27 | with Errout; use Errout; |
815f44d0 GB |
28 | with Sinfo; use Sinfo; |
29 | with Fname.UF; use Fname.UF; | |
30 | with Lib; use Lib; | |
31 | with Namet; use Namet; | |
0a034606 | 32 | with Opt; use Opt; |
815f44d0 | 33 | with Uname; use Uname; |
38cbfe40 | 34 | |
d408dbfe ALG |
35 | -- Note: this package body is used by GNAT Studio and GNATBench to supply a |
36 | -- list of entries for help on available library routines. | |
d776fae4 | 37 | |
38cbfe40 RK |
38 | package body Impunit is |
39 | ||
40 | subtype File_Name_8 is String (1 .. 8); | |
0a034606 RD |
41 | |
42 | type File_Name_Record is record | |
43 | Fname : File_Name_8; | |
44 | -- 8 character name of unit | |
45 | ||
46 | RMdef : Boolean; | |
47 | -- True if unit is RM defined. False for any unit that is implementation | |
48 | -- defined (and thus not with'able in No_Implementation_Units mode). | |
49 | end record; | |
50 | ||
51 | type File_List is array (Nat range <>) of File_Name_Record; | |
52 | ||
53 | T : constant Boolean := True; | |
54 | F : constant Boolean := False; | |
55 | -- Short hand for RM_Defined values in lists below | |
38cbfe40 | 56 | |
82c80734 RD |
57 | ------------------ |
58 | -- Ada 95 Units -- | |
59 | ------------------ | |
38cbfe40 | 60 | |
f88ecba0 PO |
61 | -- The following is a giant string list containing the names of all non- |
62 | -- implementation internal files, i.e. the complete list of files for | |
82c80734 | 63 | -- internal units which a program may legitimately WITH when operating in |
3e7302c3 | 64 | -- either Ada 95 or Ada 2005 mode. |
38cbfe40 | 65 | |
82c80734 | 66 | -- Note that this list should match the list of units documented in the |
f88ecba0 PO |
67 | -- "GNAT Library" section of the GNAT Reference Manual. A unit listed here |
68 | -- must either be documented in that section or described in the Ada RM. | |
38cbfe40 | 69 | |
82c80734 RD |
70 | Non_Imp_File_Names_95 : constant File_List := ( |
71 | ||
72 | ------------------------------------------------------ | |
5fdc49ec | 73 | -- Ada Hierarchy Units from Ada-95 Reference Manual -- |
82c80734 | 74 | ------------------------------------------------------ |
38cbfe40 | 75 | |
0a034606 RD |
76 | ("a-astaco", T), -- Ada.Asynchronous_Task_Control |
77 | ("a-calend", T), -- Ada.Calendar | |
78 | ("a-chahan", T), -- Ada.Characters.Handling | |
79 | ("a-charac", T), -- Ada.Characters | |
80 | ("a-chlat1", T), -- Ada.Characters.Latin_1 | |
81 | ("a-comlin", T), -- Ada.Command_Line | |
82 | ("a-decima", T), -- Ada.Decimal | |
83 | ("a-direio", T), -- Ada.Direct_IO | |
84 | ("a-dynpri", T), -- Ada.Dynamic_Priorities | |
85 | ("a-except", T), -- Ada.Exceptions | |
86 | ("a-finali", T), -- Ada.Finalization | |
87 | ("a-flteio", T), -- Ada.Float_Text_IO | |
88 | ("a-fwteio", T), -- Ada.Float_Wide_Text_IO | |
89 | ("a-inteio", T), -- Ada.Integer_Text_IO | |
90 | ("a-interr", T), -- Ada.Interrupts | |
91 | ("a-intnam", T), -- Ada.Interrupts.Names | |
92 | ("a-ioexce", T), -- Ada.IO_Exceptions | |
93 | ("a-iwteio", T), -- Ada.Integer_Wide_Text_IO | |
94 | ("a-ncelfu", T), -- Ada.Numerics.Complex_Elementary_Functions | |
95 | ("a-ngcefu", T), -- Ada.Numerics.Generic_Complex_Elementary_Functions | |
96 | ("a-ngcoty", T), -- Ada.Numerics.Generic_Complex_Types | |
97 | ("a-ngelfu", T), -- Ada.Numerics.Generic_Elementary_Functions | |
98 | ("a-nucoty", T), -- Ada.Numerics.Complex_Types | |
99 | ("a-nudira", T), -- Ada.Numerics.Discrete_Random | |
100 | ("a-nuelfu", T), -- Ada.Numerics.Elementary_Functions | |
101 | ("a-nuflra", T), -- Ada.Numerics.Float_Random | |
102 | ("a-numeri", T), -- Ada.Numerics | |
103 | ("a-reatim", T), -- Ada.Real_Time | |
104 | ("a-sequio", T), -- Ada.Sequential_IO | |
105 | ("a-stmaco", T), -- Ada.Strings.Maps.Constants | |
106 | ("a-storio", T), -- Ada.Storage_IO | |
107 | ("a-strbou", T), -- Ada.Strings.Bounded | |
108 | ("a-stream", T), -- Ada.Streams | |
109 | ("a-strfix", T), -- Ada.Strings.Fixed | |
110 | ("a-string", T), -- Ada.Strings | |
111 | ("a-strmap", T), -- Ada.Strings.Maps | |
112 | ("a-strunb", T), -- Ada.Strings.Unbounded | |
113 | ("a-ststio", T), -- Ada.Streams.Stream_IO | |
114 | ("a-stwibo", T), -- Ada.Strings.Wide_Bounded | |
115 | ("a-stwifi", T), -- Ada.Strings.Wide_Fixed | |
116 | ("a-stwima", T), -- Ada.Strings.Wide_Maps | |
117 | ("a-stwiun", T), -- Ada.Strings.Wide_Unbounded | |
118 | ("a-swmwco", T), -- Ada.Strings.Wide_Maps.Wide_Constants | |
119 | ("a-sytaco", T), -- Ada.Synchronous_Task_Control | |
120 | ("a-tags ", T), -- Ada.Tags | |
121 | ("a-tasatt", T), -- Ada.Task_Attributes | |
122 | ("a-taside", T), -- Ada.Task_Identification | |
123 | ("a-teioed", T), -- Ada.Text_IO.Editing | |
124 | ("a-textio", T), -- Ada.Text_IO | |
125 | ("a-ticoio", T), -- Ada.Text_IO.Complex_IO | |
126 | ("a-titest", T), -- Ada.Text_IO.Text_Streams | |
127 | ("a-unccon", T), -- Ada.Unchecked_Conversion | |
128 | ("a-uncdea", T), -- Ada.Unchecked_Deallocation | |
129 | ("a-witeio", T), -- Ada.Wide_Text_IO | |
130 | ("a-wtcoio", T), -- Ada.Wide_Text_IO.Complex_IO | |
131 | ("a-wtedit", T), -- Ada.Wide_Text_IO.Editing | |
132 | ("a-wttest", T), -- Ada.Wide_Text_IO.Text_Streams | |
38cbfe40 RK |
133 | |
134 | ------------------------------------------------- | |
135 | -- RM Required Additions to Ada for GNAT Types -- | |
136 | ------------------------------------------------- | |
137 | ||
0a034606 RD |
138 | -- Note: Long versions are considered RM defined, but not the Long Long, |
139 | -- Short, or Short_Short versions. | |
140 | ||
141 | ("a-lfteio", T), -- Ada.Long_Float_Text_IO | |
142 | ("a-lfwtio", T), -- Ada.Long_Float_Wide_Text_IO | |
143 | ("a-liteio", T), -- Ada.Long_Integer_Text_IO | |
144 | ("a-liwtio", T), -- Ada.Long_Integer_Wide_Text_IO | |
145 | ("a-llftio", T), -- Ada.Long_Long_Float_Text_IO | |
146 | ("a-llfwti", T), -- Ada.Long_Long_Float_Wide_Text_IO | |
147 | ("a-llitio", T), -- Ada.Long_Long_Integer_Text_IO | |
148 | ("a-lliwti", F), -- Ada.Long_Long_Integer_Wide_Text_IO | |
149 | ("a-nlcefu", F), -- Ada.Long_Complex_Elementary_Functions | |
150 | ("a-nlcoty", T), -- Ada.Numerics.Long_Complex_Types | |
151 | ("a-nlelfu", T), -- Ada.Numerics.Long_Elementary_Functions | |
152 | ("a-nllcef", F), -- Ada.Long_Long_Complex_Elementary_Functions | |
153 | ("a-nllefu", F), -- Ada.Numerics.Long_Long_Elementary_Functions | |
154 | ("a-nllcty", F), -- Ada.Numerics.Long_Long_Complex_Types | |
155 | ("a-nscefu", F), -- Ada.Short_Complex_Elementary_Functions | |
156 | ("a-nscoty", F), -- Ada.Numerics.Short_Complex_Types | |
157 | ("a-nselfu", F), -- Ada.Numerics.Short_Elementary_Functions | |
158 | ("a-sfteio", F), -- Ada.Short_Float_Text_IO | |
159 | ("a-sfwtio", F), -- Ada.Short_Float_Wide_Text_IO | |
160 | ("a-siteio", F), -- Ada.Short_Integer_Text_IO | |
161 | ("a-siwtio", F), -- Ada.Short_Integer_Wide_Text_IO | |
162 | ("a-ssitio", F), -- Ada.Short_Short_Integer_Text_IO | |
163 | ("a-ssiwti", F), -- Ada.Short_Short_Integer_Wide_Text_IO | |
38cbfe40 RK |
164 | |
165 | ----------------------------------- | |
166 | -- GNAT Defined Additions to Ada -- | |
167 | ----------------------------------- | |
168 | ||
0a034606 RD |
169 | ("a-calcon", F), -- Ada.Calendar.Conversions |
170 | ("a-chlat9", F), -- Ada.Characters.Latin_9 | |
171 | ("a-clrefi", F), -- Ada.Command_Line.Response_File | |
172 | ("a-colien", F), -- Ada.Command_Line.Environment | |
173 | ("a-colire", F), -- Ada.Command_Line.Remove | |
174 | ("a-cwila1", F), -- Ada.Characters.Wide_Latin_1 | |
175 | ("a-cwila9", F), -- Ada.Characters.Wide_Latin_9 | |
176 | ("a-diocst", F), -- Ada.Direct_IO.C_Streams | |
177 | ("a-einuoc", F), -- Ada.Exceptions.Is_Null_Occurrence | |
178 | ("a-elchha", F), -- Ada.Exceptions.Last_Chance_Handler | |
179 | ("a-exctra", F), -- Ada.Exceptions.Traceback | |
180 | ("a-siocst", F), -- Ada.Sequential_IO.C_Streams | |
181 | ("a-ssicst", F), -- Ada.Streams.Stream_IO.C_Streams | |
182 | ("a-suteio", F), -- Ada.Strings.Unbounded.Text_IO | |
183 | ("a-swuwti", F), -- Ada.Strings.Wide_Unbounded.Wide_Text_IO | |
184 | ("a-tiocst", F), -- Ada.Text_IO.C_Streams | |
185 | ("a-wtcstr", F), -- Ada.Wide_Text_IO.C_Streams | |
38cbfe40 | 186 | |
6d158291 RD |
187 | -- Note: strictly the next two should be Ada 2005 units, but it seems |
188 | -- harmless (and useful) to make then available in Ada 95 mode, since | |
189 | -- they only deal with Wide_Character, not Wide_Wide_Character. | |
190 | ||
0a034606 RD |
191 | ("a-wichun", F), -- Ada.Wide_Characters.Unicode |
192 | ("a-widcha", F), -- Ada.Wide_Characters | |
6d158291 | 193 | |
c97c0163 | 194 | -- Note: strictly the following should be Ada 2012 units, but it seems |
6e1ee5c3 | 195 | -- harmless (and useful) to make then available in Ada 95 mode, since |
c97c0163 | 196 | -- they do not deal with Wide_Wide_Character. |
6e1ee5c3 | 197 | |
0a034606 RD |
198 | ("a-wichha", F), -- Ada.Wide_Characters.Handling |
199 | ("a-stuten", F), -- Ada.Strings.UTF_Encoding | |
200 | ("a-suenco", F), -- Ada.Strings.UTF_Encoding.Conversions | |
201 | ("a-suenst", F), -- Ada.Strings.UTF_Encoding.Strings | |
202 | ("a-suewst", F), -- Ada.Strings.UTF_Encoding.Wide_Strings | |
6e1ee5c3 | 203 | |
38cbfe40 RK |
204 | --------------------------- |
205 | -- GNAT Special IO Units -- | |
206 | --------------------------- | |
207 | ||
f88ecba0 PO |
208 | -- As further explained elsewhere (see Sem_Ch10), the internal packages of |
209 | -- Text_IO and Wide_Text_IO are actually implemented as separate children, | |
210 | -- but this fact is intended to be hidden from the user completely. Any | |
211 | -- attempt to WITH one of these units will be diagnosed as an error later | |
212 | -- on, but for now we do not consider these internal implementation units | |
213 | -- (if we did, then we would get a junk warning which would be confusing | |
dec55d76 | 214 | -- and unnecessary, given that we generate a clear error message). |
38cbfe40 | 215 | |
0a034606 RD |
216 | ("a-tideio", F), -- Ada.Text_IO.Decimal_IO |
217 | ("a-tienio", F), -- Ada.Text_IO.Enumeration_IO | |
218 | ("a-tifiio", F), -- Ada.Text_IO.Fixed_IO | |
219 | ("a-tiflio", F), -- Ada.Text_IO.Float_IO | |
220 | ("a-tiinio", F), -- Ada.Text_IO.Integer_IO | |
221 | ("a-tiinio", F), -- Ada.Text_IO.Integer_IO | |
222 | ("a-timoio", F), -- Ada.Text_IO.Modular_IO | |
223 | ("a-wtdeio", F), -- Ada.Wide_Text_IO.Decimal_IO | |
224 | ("a-wtenio", F), -- Ada.Wide_Text_IO.Enumeration_IO | |
225 | ("a-wtfiio", F), -- Ada.Wide_Text_IO.Fixed_IO | |
226 | ("a-wtflio", F), -- Ada.Wide_Text_IO.Float_IO | |
227 | ("a-wtinio", F), -- Ada.Wide_Text_IO.Integer_IO | |
228 | ("a-wtmoio", F), -- Ada.Wide_Text_IO.Modular_IO | |
38cbfe40 RK |
229 | |
230 | ------------------------ | |
231 | -- GNAT Library Units -- | |
232 | ------------------------ | |
233 | ||
0a034606 RD |
234 | ("g-altive", F), -- GNAT.Altivec |
235 | ("g-altcon", F), -- GNAT.Altivec.Conversions | |
236 | ("g-alveop", F), -- GNAT.Altivec.Vector_Operations | |
237 | ("g-alvety", F), -- GNAT.Altivec.Vector_Types | |
238 | ("g-alvevi", F), -- GNAT.Altivec.Vector_Views | |
239 | ("g-arrspl", F), -- GNAT.Array_Split | |
240 | ("g-awk ", F), -- GNAT.AWK | |
3c777b50 | 241 | ("g-binenv", F), -- GNAT.Bind_Environment |
0a034606 RD |
242 | ("g-boubuf", F), -- GNAT.Bounded_Buffers |
243 | ("g-boumai", F), -- GNAT.Bounded_Mailboxes | |
5b3b4d60 | 244 | ("g-brapre", F), -- GNAT.Branch_Prediction |
0a034606 RD |
245 | ("g-bubsor", F), -- GNAT.Bubble_Sort |
246 | ("g-busora", F), -- GNAT.Bubble_Sort_A | |
247 | ("g-busorg", F), -- GNAT.Bubble_Sort_G | |
248 | ("g-byorma", F), -- GNAT.Byte_Order_Mark | |
249 | ("g-bytswa", F), -- GNAT.Byte_Swapping | |
250 | ("g-calend", F), -- GNAT.Calendar | |
251 | ("g-catiio", F), -- GNAT.Calendar.Time_IO | |
252 | ("g-casuti", F), -- GNAT.Case_Util | |
253 | ("g-cgi ", F), -- GNAT.CGI | |
254 | ("g-cgicoo", F), -- GNAT.CGI.Cookie | |
255 | ("g-cgideb", F), -- GNAT.CGI.Debug | |
256 | ("g-comlin", F), -- GNAT.Command_Line | |
257 | ("g-comver", F), -- GNAT.Compiler_Version | |
7c821eff | 258 | ("g-cppexc", F), -- GNAT.CPP_Exceptions |
0a034606 RD |
259 | ("g-crc32 ", F), -- GNAT.CRC32 |
260 | ("g-ctrl_c", F), -- GNAT.Ctrl_C | |
261 | ("g-curexc", F), -- GNAT.Current_Exception | |
262 | ("g-debpoo", F), -- GNAT.Debug_Pools | |
263 | ("g-debuti", F), -- GNAT.Debug_Utilities | |
264 | ("g-decstr", F), -- GNAT.Decode_String | |
265 | ("g-deutst", F), -- GNAT.Decode_UTF8_String | |
266 | ("g-dirope", F), -- GNAT.Directory_Operations | |
267 | ("g-diopit", F), -- GNAT.Directory_Operations.Iteration | |
268 | ("g-dynhta", F), -- GNAT.Dynamic_HTables | |
269 | ("g-dyntab", F), -- GNAT.Dynamic_Tables | |
270 | ("g-encstr", F), -- GNAT.Encode_String | |
271 | ("g-enutst", F), -- GNAT.Encode_UTF8_String | |
272 | ("g-excact", F), -- GNAT.Exception_Actions | |
273 | ("g-except", F), -- GNAT.Exceptions | |
274 | ("g-exctra", F), -- GNAT.Exception_Traces | |
275 | ("g-expect", F), -- GNAT.Expect | |
3d0c15cf | 276 | ("g-exptty", F), -- GNAT.Expect.TTY |
0a034606 | 277 | ("g-flocon", F), -- GNAT.Float_Control |
2f6f8285 | 278 | ("g-forstr", F), -- GNAT.Formatted_String |
5a428808 | 279 | ("g-graphs", F), -- GNAT.Graphs |
0a034606 RD |
280 | ("g-heasor", F), -- GNAT.Heap_Sort |
281 | ("g-hesora", F), -- GNAT.Heap_Sort_A | |
282 | ("g-hesorg", F), -- GNAT.Heap_Sort_G | |
283 | ("g-htable", F), -- GNAT.Htable | |
284 | ("g-io ", F), -- GNAT.IO | |
285 | ("g-io_aux", F), -- GNAT.IO_Aux | |
2201fa7b | 286 | ("g-lists ", F), -- GNAT.Lists |
0a034606 RD |
287 | ("g-locfil", F), -- GNAT.Lock_Files |
288 | ("g-mbdira", F), -- GNAT.MBBS_Discrete_Random | |
289 | ("g-mbflra", F), -- GNAT.MBBS_Float_Random | |
290 | ("g-md5 ", F), -- GNAT.MD5 | |
291 | ("g-memdum", F), -- GNAT.Memory_Dump | |
292 | ("g-moreex", F), -- GNAT.Most_Recent_Exception | |
293 | ("g-os_lib", F), -- GNAT.Os_Lib | |
294 | ("g-pehage", F), -- GNAT.Perfect_Hash_Generators | |
295 | ("g-rannum", F), -- GNAT.Random_Numbers | |
296 | ("g-regexp", F), -- GNAT.Regexp | |
297 | ("g-regist", F), -- GNAT.Registry | |
298 | ("g-regpat", F), -- GNAT.Regpat | |
36f6df66 | 299 | ("g-rewdat", F), -- GNAT.Rewrite_Data |
0a034606 RD |
300 | ("g-semaph", F), -- GNAT.Semaphores |
301 | ("g-sercom", F), -- GNAT.Serial_Communications | |
302 | ("g-sestin", F), -- GNAT.Secondary_Stack_Info | |
f8bc3bcb | 303 | ("g-sets ", F), -- GNAT.Sets |
0a034606 RD |
304 | ("g-sha1 ", F), -- GNAT.SHA1 |
305 | ("g-sha224", F), -- GNAT.SHA224 | |
306 | ("g-sha256", F), -- GNAT.SHA256 | |
307 | ("g-sha384", F), -- GNAT.SHA384 | |
308 | ("g-sha512", F), -- GNAT.SHA512 | |
309 | ("g-signal", F), -- GNAT.Signals | |
310 | ("g-socket", F), -- GNAT.Sockets | |
311 | ("g-souinf", F), -- GNAT.Source_Info | |
312 | ("g-speche", F), -- GNAT.Spell_Checker | |
313 | ("g-spchge", F), -- GNAT.Spell_Checker_Generic | |
314 | ("g-spitbo", F), -- GNAT.Spitbol | |
315 | ("g-spipat", F), -- GNAT.Spitbol.Patterns | |
316 | ("g-sptabo", F), -- GNAT.Spitbol.Table_Boolean | |
317 | ("g-sptain", F), -- GNAT.Spitbol.Table_Integer | |
318 | ("g-sptavs", F), -- GNAT.Spitbol.Table_Vstring | |
e645cb39 | 319 | ("g-strhas", F), -- GNAT.String_Hash |
0a034606 RD |
320 | ("g-string", F), -- GNAT.Strings |
321 | ("g-strspl", F), -- GNAT.String_Split | |
322 | ("g-sse ", F), -- GNAT.SSE | |
323 | ("g-ssvety", F), -- GNAT.SSE.Vector_Types | |
324 | ("g-table ", F), -- GNAT.Table | |
325 | ("g-tasloc", F), -- GNAT.Task_Lock | |
326 | ("g-tastus", F), -- GNAT.Task_Stack_Usage | |
327 | ("g-thread", F), -- GNAT.Threads | |
328 | ("g-timsta", F), -- GNAT.Time_Stamp | |
329 | ("g-traceb", F), -- GNAT.Traceback | |
330 | ("g-trasym", F), -- GNAT.Traceback.Symbolic | |
3d0c15cf | 331 | ("g-tty ", F), -- GNAT.TTY |
0a034606 RD |
332 | ("g-utf_32", F), -- GNAT.UTF_32 |
333 | ("g-u3spch", F), -- GNAT.UTF_32_Spelling_Checker | |
334 | ("g-wispch", F), -- GNAT.Wide_Spelling_Checker | |
335 | ("g-wistsp", F), -- GNAT.Wide_String_Split | |
38cbfe40 RK |
336 | |
337 | ----------------------------------------------------- | |
338 | -- Interface Hierarchy Units from Reference Manual -- | |
339 | ----------------------------------------------------- | |
340 | ||
0a034606 RD |
341 | ("i-c ", T), -- Interfaces.C |
342 | ("i-cobol ", T), -- Interfaces.Cobol | |
343 | ("i-cpoint", T), -- Interfaces.C.Pointers | |
344 | ("i-cstrin", T), -- Interfaces.C.Strings | |
345 | ("i-fortra", T), -- Interfaces.Fortran | |
38cbfe40 RK |
346 | |
347 | ------------------------------------------ | |
348 | -- GNAT Defined Additions to Interfaces -- | |
349 | ------------------------------------------ | |
350 | ||
0a034606 RD |
351 | ("i-cexten", F), -- Interfaces.C.Extensions |
352 | ("i-cil ", F), -- Interfaces.CIL | |
353 | ("i-cilobj", F), -- Interfaces.CIL.Object | |
0a034606 RD |
354 | ("i-cstrea", F), -- Interfaces.C.Streams |
355 | ("i-java ", F), -- Interfaces.Java | |
356 | ("i-javjni", F), -- Interfaces.Java.JNI | |
357 | ("i-pacdec", F), -- Interfaces.Packed_Decimal | |
5dc203d2 | 358 | ("i-vxinco", F), -- Interfaces.VxWorks.Int_Connection |
0a034606 RD |
359 | ("i-vxwoio", F), -- Interfaces.VxWorks.IO |
360 | ("i-vxwork", F), -- Interfaces.VxWorks | |
38cbfe40 RK |
361 | |
362 | -------------------------------------------------- | |
363 | -- System Hierarchy Units from Reference Manual -- | |
364 | -------------------------------------------------- | |
365 | ||
0a034606 RD |
366 | ("s-atacco", T), -- System.Address_To_Access_Conversions |
367 | ("s-maccod", T), -- System.Machine_Code | |
368 | ("s-rpc ", T), -- System.Rpc | |
369 | ("s-stoele", T), -- System.Storage_Elements | |
370 | ("s-stopoo", T), -- System.Storage_Pools | |
38cbfe40 RK |
371 | |
372 | -------------------------------------- | |
373 | -- GNAT Defined Additions to System -- | |
374 | -------------------------------------- | |
375 | ||
0a034606 | 376 | ("s-addima", F), -- System.Address_Image |
a92230c5 | 377 | ("s-atocou", F), -- System.Atomic_Counters |
0a034606 | 378 | ("s-assert", F), -- System.Assertions |
c4b9b291 YM |
379 | ("s-dfmkio", F), -- System.Dim.Float_Mks_IO |
380 | ("s-dfmopr", F), -- System.Dim.Float_Mks.Other_Prefixes | |
381 | ("s-dgmgop", F), -- System.Dim.Generic_Mks.Generic_Other_Prefixes | |
382 | ("s-dlmopr", F), -- System.Dim.Long_Mks.Other_Prefixes | |
7b50c4a3 | 383 | ("s-diflio", F), -- System.Dim.Float_IO |
c4b9b291 YM |
384 | ("s-diflmk", F), -- System.Dim.Float_Mks |
385 | ("s-digemk", F), -- System.Dim.Generic_Mks | |
7b50c4a3 | 386 | ("s-diinio", F), -- System.Dim.Integer_IO |
c4b9b291 | 387 | ("s-dilomk", F), -- System.Dim.Long_Mks |
7b50c4a3 AC |
388 | ("s-dimkio", F), -- System.Dim.Mks_IO |
389 | ("s-dimmks", F), -- System.Dim.Mks | |
c4b9b291 | 390 | ("s-dlmkio", F), -- System.Dim.Long_Mks_IO |
7b50c4a3 | 391 | ("s-dmotpr", F), -- System.Dim.Mks.Other_Prefixes |
0a034606 RD |
392 | ("s-memory", F), -- System.Memory |
393 | ("s-parint", F), -- System.Partition_Interface | |
394 | ("s-pooglo", F), -- System.Pool_Global | |
395 | ("s-pooloc", F), -- System.Pool_Local | |
396 | ("s-restri", F), -- System.Restrictions | |
397 | ("s-rident", F), -- System.Rident | |
398 | ("s-ststop", F), -- System.Strings.Stream_Ops | |
399 | ("s-tasinf", F), -- System.Task_Info | |
f852ffee | 400 | ("s-unstyp", F), -- System.Unsigned_Types |
c7a7f405 AC |
401 | ("s-wchcnv", F), -- System.WCh_Cnv |
402 | ("s-wchcon", F), -- System.WCh_Con | |
c2658843 AC |
403 | |
404 | -- The following are strictly speaking Ada 2012 units, but we are allowed | |
405 | -- to add children to system, so we consider them to be implementation | |
406 | -- defined additions to System in earlier versions of Ada. | |
407 | ||
408 | ("s-multip", T), -- System.Multiprocessors | |
409 | ("s-mudido", T)); -- System.Multiprocessors.Dispatching_Domains | |
38cbfe40 | 410 | |
82c80734 RD |
411 | -------------------- |
412 | -- Ada 2005 Units -- | |
413 | -------------------- | |
414 | ||
415 | -- The following units should be used only in Ada 05 mode | |
416 | ||
417 | Non_Imp_File_Names_05 : constant File_List := ( | |
418 | ||
419 | -------------------------------------------------------- | |
420 | -- Ada Hierarchy Units from Ada 2005 Reference Manual -- | |
421 | -------------------------------------------------------- | |
422 | ||
0a034606 RD |
423 | ("a-assert", T), -- Ada.Assertions |
424 | ("a-calari", T), -- Ada.Calendar.Arithmetic | |
425 | ("a-calfor", T), -- Ada.Calendar.Formatting | |
426 | ("a-catizo", T), -- Ada.Calendar.Time_Zones | |
427 | ("a-cdlili", T), -- Ada.Containers.Doubly_Linked_Lists | |
428 | ("a-cgarso", T), -- Ada.Containers.Generic_Array_Sort | |
429 | ("a-cgcaso", T), -- Ada.Containers.Generic_Constrained_Array_Sort | |
430 | ("a-chacon", T), -- Ada.Characters.Conversions | |
431 | ("a-cidlli", T), -- Ada.Containers.Indefinite_Doubly_Linked_Lists | |
432 | ("a-cihama", T), -- Ada.Containers.Indefinite_Hashed_Maps | |
433 | ("a-cihase", T), -- Ada.Containers.Indefinite_Hashed_Sets | |
434 | ("a-ciorma", T), -- Ada.Containers.Indefinite_Ordered_Maps | |
435 | ("a-ciorse", T), -- Ada.Containers.Indefinite_Ordered_Sets | |
436 | ("a-cohama", T), -- Ada.Containers.Hashed_Maps | |
437 | ("a-cohase", T), -- Ada.Containers.Hashed_Sets | |
438 | ("a-coinve", T), -- Ada.Containers.Indefinite_Vectors | |
439 | ("a-contai", T), -- Ada.Containers | |
440 | ("a-convec", T), -- Ada.Containers.Vectors | |
441 | ("a-coorma", T), -- Ada.Containers.Ordered_Maps | |
442 | ("a-coorse", T), -- Ada.Containers.Ordered_Sets | |
443 | ("a-coteio", T), -- Ada.Complex_Text_IO | |
444 | ("a-direct", T), -- Ada.Directories | |
5ae7c3cf | 445 | ("a-dinopr", T), -- Ada.Dispatching.Non_Preemptive |
0a034606 RD |
446 | ("a-diroro", T), -- Ada.Dispatching.Round_Robin |
447 | ("a-disedf", T), -- Ada.Dispatching.EDF | |
448 | ("a-dispat", T), -- Ada.Dispatching | |
449 | ("a-envvar", T), -- Ada.Environment_Variables | |
450 | ("a-etgrbu", T), -- Ada.Execution_Time.Group_Budgets | |
451 | ("a-exetim", T), -- Ada.Execution_Time | |
452 | ("a-extiti", T), -- Ada.Execution_Time.Timers | |
453 | ("a-izteio", T), -- Ada.Integer_Wide_Wide_Text_IO | |
454 | ("a-rttiev", T), -- Ada.Real_Time.Timing_Events | |
455 | ("a-ngcoar", T), -- Ada.Numerics.Generic_Complex_Arrays | |
456 | ("a-ngrear", T), -- Ada.Numerics.Generic_Real_Arrays | |
457 | ("a-nucoar", T), -- Ada.Numerics.Complex_Arrays | |
458 | ("a-nurear", T), -- Ada.Numerics.Real_Arrays | |
459 | ("a-stboha", T), -- Ada.Strings.Bounded.Hash | |
460 | ("a-stfiha", T), -- Ada.Strings.Fixed.Hash | |
461 | ("a-strhas", T), -- Ada.Strings.Hash | |
462 | ("a-stunha", T), -- Ada.Strings.Unbounded.Hash | |
463 | ("a-stwiha", T), -- Ada.Strings.Wide_Hash | |
464 | ("a-stzbou", T), -- Ada.Strings.Wide_Wide_Bounded | |
465 | ("a-stzfix", T), -- Ada.Strings.Wide_Wide_Fixed | |
466 | ("a-stzhas", T), -- Ada.Strings.Wide_Wide_Hash | |
467 | ("a-stzmap", T), -- Ada.Strings.Wide_Wide_Maps | |
468 | ("a-stzunb", T), -- Ada.Strings.Wide_Wide_Unbounded | |
469 | ("a-swbwha", T), -- Ada.Strings.Wide_Bounded.Wide_Hash | |
470 | ("a-swfwha", T), -- Ada.Strings.Wide_Fixed.Wide_Hash | |
471 | ("a-swuwha", T), -- Ada.Strings.Wide_Unbounded.Wide_Hash | |
472 | ("a-szbzha", T), -- Ada.Strings.Wide_Wide_Bounded.Wide_Wide_Hash | |
473 | ("a-szfzha", T), -- Ada.Strings.Wide_Wide_Fixed.Wide_Wide_Hash | |
474 | ("a-szmzco", T), -- Ada.Strings.Wide_Wide_Maps.Wide_Wide_Constants | |
475 | ("a-szuzha", T), -- Ada.Strings.Wide_Wide_Unbounded.Wide_Wide_Hash | |
476 | ("a-taster", T), -- Ada.Task_Termination | |
477 | ("a-tgdico", T), -- Ada.Tags.Generic_Dispatching_Constructor | |
478 | ("a-tiboio", T), -- Ada.Text_IO.Bounded_IO | |
479 | ("a-tiunio", T), -- Ada.Text_IO.Unbounded_IO | |
480 | ("a-wichun", T), -- Ada.Wide_Characters.Unicode | |
481 | ("a-wwboio", T), -- Ada.Wide_Text_IO.Wide_Bounded_IO | |
482 | ("a-wwunio", T), -- Ada.Wide_Text_IO.Wide_Unbounded_IO | |
483 | ("a-zchara", T), -- Ada.Wide_Wide_Characters | |
484 | ("a-zchhan", T), -- Ada.Wide_Wide_Characters.Handling | |
485 | ("a-ztcoio", T), -- Ada.Wide_Wide_Text_IO.Complex_IO | |
486 | ("a-ztedit", T), -- Ada.Wide_Wide_Text_IO.Editing | |
487 | ("a-zttest", T), -- Ada.Wide_Wide_Text_IO.Text_Streams | |
488 | ("a-ztexio", T), -- Ada.Wide_Wide_Text_IO | |
489 | ("a-zzboio", T), -- Ada.Wide_Wide_Text_IO.Wide_Wide_Bounded_IO | |
490 | ("a-zzunio", T), -- Ada.Wide_Wide_Text_IO.Wide_Wide_Unbounded_IO | |
82c80734 RD |
491 | |
492 | ------------------------------------------------------ | |
493 | -- RM Required Additions to Ada 2005 for GNAT Types -- | |
494 | ------------------------------------------------------ | |
495 | ||
0a034606 RD |
496 | -- Note: Long versions are considered RM defined, but not the Long Long, |
497 | -- Short, or Short_Short versions. | |
498 | ||
499 | ("a-lcteio", T), -- Ada.Long_Complex_Text_IO | |
500 | ("a-lfztio", T), -- Ada.Long_Float_Wide_Wide_Text_IO | |
501 | ("a-liztio", T), -- Ada.Long_Integer_Wide_Wide_Text_IO | |
502 | ("a-llctio", T), -- Ada.Long_Long_Complex_Text_IO | |
503 | ("a-llfzti", T), -- Ada.Long_Long_Float_Wide_Wide_Text_IO | |
504 | ("a-llizti", T), -- Ada.Long_Long_Integer_Wide_Wide_Text_IO | |
505 | ("a-nlcoar", T), -- Ada.Numerics.Long_Complex_Arrays | |
506 | ("a-nllcar", T), -- Ada.Numerics.Long_Long_Complex_Arrays | |
507 | ("a-nllrar", T), -- Ada.Numerics.Long_Long_Real_Arrays | |
508 | ("a-nlrear", T), -- Ada.Numerics.Long_Real_Arrays | |
509 | ("a-scteio", F), -- Ada.Short_Complex_Text_IO | |
510 | ("a-sfztio", F), -- Ada.Short_Float_Wide_Wide_Text_IO | |
511 | ("a-siztio", F), -- Ada.Short_Integer_Wide_Wide_Text_IO | |
512 | ("a-ssizti", F), -- Ada.Short_Short_Integer_Wide_Wide_Text_IO | |
82c80734 RD |
513 | |
514 | ---------------------------------------- | |
515 | -- GNAT Defined Additions to Ada 2005 -- | |
516 | ---------------------------------------- | |
517 | ||
0a034606 RD |
518 | ("a-cgaaso", F), -- Ada.Containers.Generic_Anonymous_Array_Sort |
519 | ("a-chzla1", F), -- Ada.Characters.Wide_Wide_Latin_1 | |
520 | ("a-chzla9", F), -- Ada.Characters.Wide_Wide_Latin_9 | |
521 | ("a-ciormu", F), -- Ada.Containers.Indefinite_Ordered_Multisets | |
522 | ("a-coormu", F), -- Ada.Containers.Ordered_Multisets | |
523 | ("a-crdlli", F), -- Ada.Containers.Restricted_Doubly_Linked_Lists | |
0a034606 RD |
524 | ("a-szuzti", F), -- Ada.Strings.Wide_Wide_Unbounded.Wide_Wide_Text_IO |
525 | ("a-zchuni", F), -- Ada.Wide_Wide_Characters.Unicode | |
526 | ("a-ztcstr", F), -- Ada.Wide_Wide_Text_IO.C_Streams | |
38cbfe40 | 527 | |
6e1ee5c3 AC |
528 | -- Note: strictly the following should be Ada 2012 units, but it seems |
529 | -- harmless (and useful) to make then available in Ada 2005 mode. | |
0eed45bb | 530 | |
8c18a165 | 531 | ("a-cogeso", T), -- Ada.Containers.Generic_Sort |
65fe0167 | 532 | ("a-dhfina", T), -- Ada.Directories.Hierarchical_File_Names |
a51cd0ec AC |
533 | ("a-secain", T), -- Ada.Strings.Equal_Case_Insensitive |
534 | ("a-shcain", T), -- Ada.Strings.Hash_Case_Insensitive | |
535 | ("a-slcain", T), -- Ada.Strings.Less_Case_Insensitive | |
536 | ("a-sfecin", T), -- Ada.Strings.Fixed.Equal_Case_Insensitive | |
537 | ("a-sfhcin", T), -- Ada.Strings.Fixed.Hash_Case_Insensitive | |
538 | ("a-sflcin", T), -- Ada.Strings.Fixed.Less_Case_Insensitive | |
539 | ("a-sbecin", T), -- Ada.Strings.Bounded.Equal_Case_Insensitive | |
540 | ("a-sbhcin", T), -- Ada.Strings.Bounded.Hash_Case_Insensitive | |
541 | ("a-sblcin", T), -- Ada.Strings.Bounded.Less_Case_Insensitive | |
542 | ("a-suecin", T), -- Ada.Strings.Unbounded.Equal_Case_Insensitive | |
543 | ("a-suhcin", T), -- Ada.Strings.Unbounded.Hash_Case_Insensitive | |
544 | ("a-sulcin", T), -- Ada.Strings.Unbounded.Less_Case_Insensitive | |
0a034606 | 545 | ("a-suezst", T), -- Ada.Strings.UTF_Encoding.Wide_Wide_Strings |
0eed45bb | 546 | |
82c80734 RD |
547 | --------------------------- |
548 | -- GNAT Special IO Units -- | |
549 | --------------------------- | |
38cbfe40 | 550 | |
82c80734 RD |
551 | -- See Ada 95 section for further information. These packages are for the |
552 | -- implementation of the Wide_Wide_Text_IO generic packages. | |
38cbfe40 | 553 | |
0a034606 RD |
554 | ("a-ztdeio", F), -- Ada.Wide_Wide_Text_IO.Decimal_IO |
555 | ("a-ztenio", F), -- Ada.Wide_Wide_Text_IO.Enumeration_IO | |
556 | ("a-ztfiio", F), -- Ada.Wide_Wide_Text_IO.Fixed_IO | |
557 | ("a-ztflio", F), -- Ada.Wide_Wide_Text_IO.Float_IO | |
558 | ("a-ztinio", F), -- Ada.Wide_Wide_Text_IO.Integer_IO | |
559 | ("a-ztmoio", F), -- Ada.Wide_Wide_Text_IO.Modular_IO | |
38cbfe40 | 560 | |
82c80734 RD |
561 | ------------------------ |
562 | -- GNAT Library Units -- | |
563 | ------------------------ | |
564 | ||
0a034606 RD |
565 | ("g-zspche", F), -- GNAT.Wide_Wide_Spelling_Checker |
566 | ("g-zstspl", F)); -- GNAT.Wide_Wide_String_Split | |
82c80734 | 567 | |
7a259f2e VC |
568 | -------------------- |
569 | -- Ada 2012 Units -- | |
570 | -------------------- | |
571 | ||
81eb625c | 572 | -- The following units should be used only in Ada 2012 mode |
7a259f2e VC |
573 | |
574 | Non_Imp_File_Names_12 : constant File_List := ( | |
0a034606 RD |
575 | ("s-stposu", T), -- System.Storage_Pools.Subpools |
576 | ("a-cobove", T), -- Ada.Containers.Bounded_Vectors | |
577 | ("a-cbdlli", T), -- Ada.Containers.Bounded_Doubly_Linked_Lists | |
578 | ("a-cborse", T), -- Ada.Containers.Bounded_Ordered_Sets | |
579 | ("a-cborma", T), -- Ada.Containers.Bounded_Ordered_Maps | |
580 | ("a-cbhase", T), -- Ada.Containers.Bounded_Hashed_Sets | |
581 | ("a-cbhama", T), -- Ada.Containers.Bounded_Hashed_Maps | |
582 | ("a-coinho", T), -- Ada.Containers.Indefinite_Holders | |
583 | ("a-comutr", T), -- Ada.Containers.Multiway_Trees | |
584 | ("a-cimutr", T), -- Ada.Containers.Indefinite_Multiway_Trees | |
585 | ("a-cbmutr", T), -- Ada.Containers.Bounded_Multiway_Trees | |
586 | ("a-csquin", T), -- Ada.Containers.Synchronized_Queue_Interfaces | |
587 | ("a-cusyqu", T), -- Ada.Containers.Unbounded_Synchronized_Queues | |
588 | ("a-cuprqu", T), -- Ada.Containers.Unbounded_Priority_Queues | |
589 | ("a-cbsyqu", T), -- Ada.Containers.Bounded_Synchronized_Queues | |
590 | ("a-cbprqu", T), -- Ada.Containers.Bounded_Priority_Queues | |
591 | ("a-extiin", T), -- Ada.Execution_Time.Interrupts | |
592 | ("a-iteint", T), -- Ada.Iterator_Interfaces | |
e8dde875 | 593 | ("a-locale", T), -- Ada.Locales |
e4dc3327 | 594 | ("a-stcoed", T), -- Ada.Synchronous_Task_Control.EDF |
0a034606 RD |
595 | ("a-synbar", T), -- Ada.Synchronous_Barriers |
596 | ("a-undesu", T), -- Ada.Unchecked_Deallocate_Subpool | |
5f7747af | 597 | |
1df4f514 AC |
598 | ---------------------------------------- |
599 | -- GNAT Defined Additions to Ada 2012 -- | |
600 | ---------------------------------------- | |
5f7747af | 601 | |
4a68b7c4 AC |
602 | ("a-cfinve", F), -- Ada.Containers.Formal_Indefinite_Vectors |
603 | ("a-coboho", F), -- Ada.Containers.Bounded_Holders | |
0a034606 | 604 | ("a-cofove", F), -- Ada.Containers.Formal_Vectors |
11775988 AC |
605 | ("a-cofuma", F), -- Ada.Containers.Functional_Maps |
606 | ("a-cofuse", F), -- Ada.Containers.Functional_Sets | |
607 | ("a-cofuve", F), -- Ada.Containers.Functional_Vectors | |
0a034606 RD |
608 | ("a-cfdlli", F), -- Ada.Containers.Formal_Doubly_Linked_Lists |
609 | ("a-cforse", F), -- Ada.Containers.Formal_Ordered_Sets | |
610 | ("a-cforma", F), -- Ada.Containers.Formal_Ordered_Maps | |
611 | ("a-cfhase", F), -- Ada.Containers.Formal_Hashed_Sets | |
9ea2a24d AC |
612 | ("a-cfhama", F), -- Ada.Containers.Formal_Hashed_Maps |
613 | ("a-cvgpso", F) -- Ada.Containers.Vectors.Generic_Parallel_Sorting from | |
614 | ); -- GNATCOLL.OMP | |
7a259f2e | 615 | |
e841d4d8 BD |
616 | -------------------- |
617 | -- Ada 202X Units -- | |
618 | -------------------- | |
619 | ||
620 | -- The following units should be used only in Ada 202X mode | |
621 | ||
622 | Non_Imp_File_Names_2X : constant File_List := ( | |
f17f5647 AC |
623 | ("a-stteou", T), -- Ada.Strings.Text_Output |
624 | ("a-nubinu", T), -- Ada.Numerics.Big_Numbers | |
625 | ("a-nbnbin", T), -- Ada.Numerics.Big_Numbers.Big_Integers | |
019c74bb AC |
626 | ("a-nbnbre", T), -- Ada.Numerics.Big_Numbers.Big_Reals |
627 | ("s-aotase", T), -- System.Atomic_Operations.Test_And_Set | |
628 | ("s-atoope", T), -- System.Atomic_Operations | |
629 | ("s-atopar", T), -- System.Atomic_Operations.Arithmetic | |
630 | ("s-atopex", T)); -- System.Atomic_Operations.Exchange | |
e841d4d8 | 631 | |
3eb532e6 RD |
632 | ----------------------- |
633 | -- Alternative Units -- | |
634 | ----------------------- | |
635 | ||
636 | -- For some implementation units, there is a unit in the GNAT library | |
637 | -- that has identical functionality that is usable. If we have such a | |
638 | -- case we record the appropriate Unit name in Error_Msg_String. | |
639 | ||
640 | type Aunit_Record is record | |
641 | Fname : String (1 .. 6); | |
aff557c7 | 642 | Aname : String_Ptr_Const; |
3eb532e6 RD |
643 | end record; |
644 | ||
645 | -- Array of alternative unit names | |
646 | ||
aff557c7 AC |
647 | Scasuti : aliased constant String := "GNAT.Case_Util"; |
648 | Scrc32 : aliased constant String := "GNAT.CRC32"; | |
649 | Shtable : aliased constant String := "GNAT.HTable"; | |
650 | Sos_lib : aliased constant String := "GNAT.OS_Lib"; | |
651 | Sregexp : aliased constant String := "GNAT.Regexp"; | |
652 | Sregpat : aliased constant String := "GNAT.Regpat"; | |
653 | Sstring : aliased constant String := "GNAT.Strings"; | |
654 | Sstusta : aliased constant String := "GNAT.Task_Stack_Usage"; | |
655 | Stasloc : aliased constant String := "GNAT.Task_Lock"; | |
656 | Sutf_32 : aliased constant String := "GNAT.UTF_32"; | |
3eb532e6 RD |
657 | |
658 | -- Array giving mapping | |
659 | ||
f6da8aff | 660 | Map_Array : constant array (1 .. 10) of Aunit_Record := ( |
3eb532e6 | 661 | ("casuti", Scasuti'Access), |
f6da8aff RD |
662 | ("crc32 ", Scrc32 'Access), |
663 | ("htable", Shtable'Access), | |
3eb532e6 RD |
664 | ("os_lib", Sos_lib'Access), |
665 | ("regexp", Sregexp'Access), | |
666 | ("regpat", Sregpat'Access), | |
667 | ("string", Sstring'Access), | |
668 | ("stusta", Sstusta'Access), | |
669 | ("tasloc", Stasloc'Access), | |
670 | ("utf_32", Sutf_32'Access)); | |
671 | ||
82c80734 | 672 | ---------------------- |
549cc9c2 | 673 | -- Get_Kind_Of_File -- |
82c80734 RD |
674 | ---------------------- |
675 | ||
549cc9c2 AC |
676 | function Get_Kind_Of_File (File : String) return Kind_Of_Unit is |
677 | pragma Assert (File'First = 1); | |
678 | ||
679 | Buffer : String (1 .. 8); | |
82c80734 RD |
680 | |
681 | begin | |
3eb532e6 RD |
682 | Error_Msg_Strlen := 0; |
683 | ||
0a034606 | 684 | -- Ada/System/Interfaces are all Ada 95 units |
38cbfe40 | 685 | |
549cc9c2 | 686 | if File = "ada.ads" |
549cc9c2 | 687 | or else File = "interfac.ads" |
bc38dbb4 | 688 | or else File = "system.ads" |
0a034606 RD |
689 | then |
690 | return Ada_95_Unit; | |
38cbfe40 RK |
691 | end if; |
692 | ||
0a034606 RD |
693 | -- If length of file name is greater than 12, not predefined. The value |
694 | -- 12 here is an 8 char name with extension .ads. | |
38cbfe40 | 695 | |
549cc9c2 | 696 | if File'Length > 12 then |
0a034606 RD |
697 | return Not_Predefined_Unit; |
698 | end if; | |
38cbfe40 | 699 | |
82c80734 | 700 | -- Not predefined if file name does not start with a- g- s- i- |
38cbfe40 | 701 | |
549cc9c2 AC |
702 | if File'Length < 3 |
703 | or else File (2) /= '-' | |
704 | or else | |
705 | (File (1) /= 'a' | |
706 | and then File (1) /= 'g' | |
707 | and then File (1) /= 'i' | |
708 | and then File (1) /= 's') | |
38cbfe40 | 709 | then |
82c80734 | 710 | return Not_Predefined_Unit; |
38cbfe40 RK |
711 | end if; |
712 | ||
b6ad3c08 PT |
713 | -- Not predefined if file name does not end in .ads. This can happen |
714 | -- when non-standard file names are being used. | |
715 | ||
716 | if Name_Buffer (Name_Len - 3 .. Name_Len) /= ".ads" then | |
82c80734 | 717 | return Not_Predefined_Unit; |
38cbfe40 RK |
718 | end if; |
719 | ||
720 | -- Otherwise normalize file name to 8 characters | |
721 | ||
549cc9c2 AC |
722 | Buffer (1 .. File'Length - 4) := File (1 .. File'Length - 4); |
723 | ||
724 | for J in File'Length - 3 .. 8 loop | |
725 | Buffer (J) := ' '; | |
38cbfe40 RK |
726 | end loop; |
727 | ||
82c80734 | 728 | -- See if name is in 95 list |
38cbfe40 | 729 | |
82c80734 | 730 | for J in Non_Imp_File_Names_95'Range loop |
549cc9c2 | 731 | if Buffer = Non_Imp_File_Names_95 (J).Fname then |
82c80734 | 732 | return Ada_95_Unit; |
38cbfe40 RK |
733 | end if; |
734 | end loop; | |
735 | ||
7a259f2e | 736 | -- See if name is in 2005 list |
82c80734 RD |
737 | |
738 | for J in Non_Imp_File_Names_05'Range loop | |
549cc9c2 | 739 | if Buffer = Non_Imp_File_Names_05 (J).Fname then |
0791fbe9 | 740 | return Ada_2005_Unit; |
82c80734 RD |
741 | end if; |
742 | end loop; | |
743 | ||
7a259f2e VC |
744 | -- See if name is in 2012 list |
745 | ||
746 | for J in Non_Imp_File_Names_12'Range loop | |
549cc9c2 | 747 | if Buffer = Non_Imp_File_Names_12 (J).Fname then |
dbe945f1 | 748 | return Ada_2012_Unit; |
7a259f2e VC |
749 | end if; |
750 | end loop; | |
751 | ||
e841d4d8 BD |
752 | -- See if name is in 202X list |
753 | ||
754 | for J in Non_Imp_File_Names_2X'Range loop | |
755 | if Buffer = Non_Imp_File_Names_2X (J).Fname then | |
756 | return Ada_202X_Unit; | |
757 | end if; | |
758 | end loop; | |
759 | ||
82c80734 RD |
760 | -- Only remaining special possibilities are children of System.RPC and |
761 | -- System.Garlic and special files of the form System.Aux... | |
38cbfe40 | 762 | |
bc38dbb4 | 763 | if File (1 .. 5) = "s-aux" |
549cc9c2 | 764 | or else File (1 .. 5) = "s-gar" |
bc38dbb4 | 765 | or else File (1 .. 5) = "s-rpc" |
38cbfe40 | 766 | then |
82c80734 | 767 | return Ada_95_Unit; |
38cbfe40 RK |
768 | end if; |
769 | ||
3eb532e6 RD |
770 | -- All tests failed, this is definitely an implementation unit. See if |
771 | -- we have an alternative name. | |
772 | ||
549cc9c2 AC |
773 | if File'Length in 11 .. 12 |
774 | and then File (1 .. 2) = "s-" | |
775 | and then File (File'Last - 3 .. File'Last) = ".ads" | |
3eb532e6 RD |
776 | then |
777 | for J in Map_Array'Range loop | |
549cc9c2 AC |
778 | if (File'Length = 12 and then |
779 | File (3 .. 8) = Map_Array (J).Fname) | |
f6da8aff | 780 | or else |
549cc9c2 AC |
781 | (File'Length = 11 and then |
782 | File (3 .. 7) = Map_Array (J).Fname (1 .. 5)) | |
f6da8aff | 783 | then |
3eb532e6 RD |
784 | Error_Msg_Strlen := Map_Array (J).Aname'Length; |
785 | Error_Msg_String (1 .. Error_Msg_Strlen) := | |
786 | Map_Array (J).Aname.all; | |
787 | end if; | |
788 | end loop; | |
789 | end if; | |
38cbfe40 | 790 | |
82c80734 | 791 | return Implementation_Unit; |
549cc9c2 AC |
792 | end Get_Kind_Of_File; |
793 | ||
794 | ---------------------- | |
795 | -- Get_Kind_Of_Unit -- | |
796 | ---------------------- | |
797 | ||
798 | function Get_Kind_Of_Unit (U : Unit_Number_Type) return Kind_Of_Unit is | |
799 | begin | |
800 | Get_Name_String (Unit_File_Name (U)); | |
801 | return Get_Kind_Of_File (Name_Buffer (1 .. Name_Len)); | |
82c80734 | 802 | end Get_Kind_Of_Unit; |
38cbfe40 | 803 | |
815f44d0 GB |
804 | ------------------- |
805 | -- Is_Known_Unit -- | |
806 | ------------------- | |
807 | ||
808 | function Is_Known_Unit (Nam : Node_Id) return Boolean is | |
809 | Unam : Unit_Name_Type; | |
810 | Fnam : File_Name_Type; | |
811 | ||
812 | begin | |
813 | -- If selector is not an identifier (e.g. it is a character literal or | |
814 | -- some junk from a previous error), then definitely not a known unit. | |
815 | ||
816 | if Nkind (Selector_Name (Nam)) /= N_Identifier then | |
817 | return False; | |
818 | end if; | |
819 | ||
820 | -- Otherwise get corresponding file name | |
821 | ||
822 | Unam := Get_Unit_Name (Nam); | |
823 | Fnam := Get_File_Name (Unam, Subunit => False); | |
824 | Get_Name_String (Fnam); | |
825 | ||
0a034606 RD |
826 | Error_Msg_Strlen := 0; |
827 | ||
828 | -- Ada/System/Interfaces are all Ada 95 units | |
829 | ||
830 | if (Name_Len = 7 and then Name_Buffer (1 .. 7) = "ada.ads") | |
831 | or else | |
832 | (Name_Len = 10 and then Name_Buffer (1 .. 10) = "system.ads") | |
833 | or else | |
834 | (Name_Len = 12 and then Name_Buffer (1 .. 12) = "interfac.ads") | |
835 | then | |
836 | return True; | |
837 | end if; | |
838 | ||
815f44d0 GB |
839 | -- Remove extension from file name |
840 | ||
0a034606 RD |
841 | if Name_Buffer (Name_Len - 3 .. Name_Len) = ".adb" |
842 | or else | |
843 | Name_Buffer (Name_Len - 3 .. Name_Len) = ".ads" | |
844 | then | |
815f44d0 GB |
845 | Name_Len := Name_Len - 4; |
846 | else | |
847 | return False; | |
848 | end if; | |
849 | ||
850 | -- Pad name to 8 characters | |
851 | ||
852 | while Name_Len < 8 loop | |
853 | Name_Len := Name_Len + 1; | |
854 | Name_Buffer (Name_Len) := ' '; | |
855 | end loop; | |
856 | ||
857 | -- If length more than 8, definitely not a match | |
858 | ||
859 | if Name_Len /= 8 then | |
860 | return False; | |
861 | end if; | |
862 | ||
863 | -- If length is 8, search our tables | |
864 | ||
865 | for J in Non_Imp_File_Names_95'Range loop | |
0a034606 | 866 | if Name_Buffer (1 .. 8) = Non_Imp_File_Names_95 (J).Fname then |
815f44d0 GB |
867 | return True; |
868 | end if; | |
869 | end loop; | |
870 | ||
871 | for J in Non_Imp_File_Names_05'Range loop | |
0a034606 | 872 | if Name_Buffer (1 .. 8) = Non_Imp_File_Names_05 (J).Fname then |
815f44d0 GB |
873 | return True; |
874 | end if; | |
875 | end loop; | |
876 | ||
ebb6faaa | 877 | for J in Non_Imp_File_Names_12'Range loop |
0a034606 | 878 | if Name_Buffer (1 .. 8) = Non_Imp_File_Names_12 (J).Fname then |
ebb6faaa AC |
879 | return True; |
880 | end if; | |
881 | end loop; | |
882 | ||
815f44d0 GB |
883 | -- If not found, not known |
884 | ||
885 | return False; | |
886 | ||
887 | -- A safety guard, if we get an exception during this processing then it | |
888 | -- is most likely the result of a previous error, or a peculiar case we | |
889 | -- have not thought of. Since this routine is only used for error message | |
890 | -- refinement, we will just return False. | |
891 | ||
892 | exception | |
893 | when others => | |
894 | return False; | |
895 | end Is_Known_Unit; | |
896 | ||
ef417be1 RD |
897 | --------------------------- |
898 | -- Not_Impl_Defined_Unit -- | |
899 | --------------------------- | |
0a034606 | 900 | |
ef417be1 | 901 | function Not_Impl_Defined_Unit (U : Unit_Number_Type) return Boolean is |
0a034606 RD |
902 | Fname : constant File_Name_Type := Unit_File_Name (U); |
903 | ||
904 | begin | |
905 | Error_Msg_Strlen := 0; | |
906 | Get_Name_String (Fname); | |
907 | ||
908 | -- Ada/System/Interfaces are all RM-defined Ada 95 units | |
909 | ||
910 | if (Name_Len = 7 and then Name_Buffer (1 .. 7) = "ada.ads") | |
911 | or else | |
912 | (Name_Len = 10 and then Name_Buffer (1 .. 10) = "system.ads") | |
913 | or else | |
914 | (Name_Len = 12 and then Name_Buffer (1 .. 12) = "interfac.ads") | |
915 | then | |
916 | return True; | |
917 | end if; | |
918 | ||
ef417be1 RD |
919 | -- If length of file name is greater than 12, then it's a user unit |
920 | -- and not a GNAT implementation defined unit. | |
0a034606 RD |
921 | |
922 | if Name_Len > 12 then | |
ef417be1 | 923 | return True; |
0a034606 RD |
924 | end if; |
925 | ||
ef417be1 | 926 | -- Implementation defined if unit in the gnat hierarchy |
0a034606 | 927 | |
ef417be1 RD |
928 | if (Name_Len = 8 and then Name_Buffer (1 .. 8) = "gnat.ads") |
929 | or else (Name_Len > 2 and then Name_Buffer (1 .. 2) = "g-") | |
930 | then | |
0a034606 RD |
931 | return False; |
932 | end if; | |
933 | ||
ef417be1 | 934 | -- Not implementation defined if file name does not start with a- s- i- |
0a034606 RD |
935 | |
936 | if Name_Len < 3 | |
937 | or else Name_Buffer (2) /= '-' | |
938 | or else (Name_Buffer (1) /= 'a' | |
939 | and then | |
940 | Name_Buffer (1) /= 'i' | |
941 | and then | |
942 | Name_Buffer (1) /= 's') | |
943 | then | |
ef417be1 | 944 | return True; |
0a034606 RD |
945 | end if; |
946 | ||
ef417be1 | 947 | -- Not impl-defined if file name does not end in .ads. This can happen |
0a034606 RD |
948 | -- when non-standard file names are being used. |
949 | ||
950 | if Name_Buffer (Name_Len - 3 .. Name_Len) /= ".ads" then | |
ef417be1 | 951 | return True; |
0a034606 RD |
952 | end if; |
953 | ||
954 | -- Otherwise normalize file name to 8 characters | |
955 | ||
956 | Name_Len := Name_Len - 4; | |
957 | while Name_Len < 8 loop | |
958 | Name_Len := Name_Len + 1; | |
959 | Name_Buffer (Name_Len) := ' '; | |
960 | end loop; | |
961 | ||
962 | -- Check our lists of names, if we find a match, return corresponding | |
ef417be1 RD |
963 | -- indication of whether the file is RM defined, respecting the RM |
964 | -- version in which it is defined. | |
0a034606 RD |
965 | |
966 | for J in Non_Imp_File_Names_95'Range loop | |
967 | if Name_Buffer (1 .. 8) = Non_Imp_File_Names_95 (J).Fname then | |
968 | return Non_Imp_File_Names_95 (J).RMdef; | |
969 | end if; | |
970 | end loop; | |
971 | ||
972 | for J in Non_Imp_File_Names_05'Range loop | |
973 | if Name_Buffer (1 .. 8) = Non_Imp_File_Names_05 (J).Fname then | |
974 | return Non_Imp_File_Names_05 (J).RMdef | |
975 | and then Ada_Version >= Ada_2005; | |
976 | end if; | |
977 | end loop; | |
978 | ||
979 | for J in Non_Imp_File_Names_12'Range loop | |
980 | if Name_Buffer (1 .. 8) = Non_Imp_File_Names_12 (J).Fname then | |
981 | return Non_Imp_File_Names_95 (J).RMdef | |
982 | and then Ada_Version >= Ada_2012; | |
983 | end if; | |
984 | end loop; | |
985 | ||
ef417be1 RD |
986 | -- If unit is in System, Ada or Interfaces hierarchies and did not match |
987 | -- any entry in the list, means it is an internal implementation defined | |
988 | -- unit which the restriction should definition forbid. | |
0a034606 | 989 | |
ef417be1 RD |
990 | return True; |
991 | end Not_Impl_Defined_Unit; | |
0a034606 | 992 | |
38cbfe40 | 993 | end Impunit; |