]>
Commit | Line | Data |
---|---|---|
996ae0b0 RK |
1 | ------------------------------------------------------------------------------ |
2 | -- -- | |
3 | -- GNAT COMPILER COMPONENTS -- | |
4 | -- -- | |
5 | -- S N A M E S -- | |
6 | -- -- | |
7 | -- B o d y -- | |
8 | -- -- | |
07fc65c4 | 9 | -- Copyright (C) 1992-2002, Free Software Foundation, Inc. -- |
996ae0b0 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- -- | |
13 | -- ware Foundation; either version 2, 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 COPYING. If not, write -- | |
19 | -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- | |
20 | -- MA 02111-1307, USA. -- | |
21 | -- -- | |
22 | -- As a special exception, if other files instantiate generics from this -- | |
23 | -- unit, or you link this unit with other files to produce an executable, -- | |
24 | -- this unit does not by itself cause the resulting executable to be -- | |
25 | -- covered by the GNU General Public License. This exception does not -- | |
26 | -- however invalidate any other reasons why the executable file might be -- | |
27 | -- covered by the GNU Public License. -- | |
28 | -- -- | |
29 | -- GNAT was originally developed by the GNAT team at New York University. -- | |
71ff80dc | 30 | -- Extensive contributions were provided by Ada Core Technologies Inc. -- |
996ae0b0 RK |
31 | -- -- |
32 | ------------------------------------------------------------------------------ | |
33 | ||
34 | with Namet; use Namet; | |
07fc65c4 | 35 | with Table; |
996ae0b0 RK |
36 | |
37 | package body Snames is | |
38 | ||
07fc65c4 GB |
39 | -- Table used to record convention identifiers |
40 | ||
41 | type Convention_Id_Entry is record | |
42 | Name : Name_Id; | |
43 | Convention : Convention_Id; | |
44 | end record; | |
45 | ||
46 | package Convention_Identifiers is new Table.Table ( | |
47 | Table_Component_Type => Convention_Id_Entry, | |
48 | Table_Index_Type => Int, | |
49 | Table_Low_Bound => 1, | |
50 | Table_Initial => 50, | |
51 | Table_Increment => 200, | |
52 | Table_Name => "Name_Convention_Identifiers"); | |
53 | ||
996ae0b0 RK |
54 | -- Table of names to be set by Initialize. Each name is terminated by a |
55 | -- single #, and the end of the list is marked by a null entry, i.e. by | |
56 | -- two # marks in succession. Note that the table does not include the | |
57 | -- entries for a-z, since these are initialized by Namet itself. | |
58 | ||
59 | Preset_Names : constant String := | |
60 | "_parent#" & | |
61 | "_tag#" & | |
62 | "off#" & | |
63 | "space#" & | |
64 | "time#" & | |
65 | "_init_proc#" & | |
66 | "_size#" & | |
67 | "_abort_signal#" & | |
68 | "_address_resolver#" & | |
69 | "_assign#" & | |
70 | "_chain#" & | |
71 | "_clean#" & | |
72 | "_controller#" & | |
73 | "_entry_bodies#" & | |
74 | "_expunge#" & | |
75 | "_final_list#" & | |
76 | "_idepth#" & | |
77 | "_init#" & | |
78 | "_local_final_list#" & | |
79 | "_master#" & | |
80 | "_object#" & | |
81 | "_priority#" & | |
82 | "_service#" & | |
83 | "_tags#" & | |
84 | "_task#" & | |
85 | "_task_id#" & | |
86 | "_task_info#" & | |
87 | "_task_name#" & | |
88 | "_trace_sp#" & | |
89 | "initialize#" & | |
90 | "adjust#" & | |
91 | "finalize#" & | |
92 | "next#" & | |
93 | "prev#" & | |
94 | "_deep_adjust#" & | |
95 | "_equality#" & | |
96 | "_deep_finalize#" & | |
97 | "_deep_initialize#" & | |
98 | "_input#" & | |
99 | "_output#" & | |
100 | "_ras_access#" & | |
101 | "_ras_dereference#" & | |
102 | "_read#" & | |
103 | "_rep_to_pos#" & | |
104 | "_write#" & | |
105 | "allocate#" & | |
106 | "deallocate#" & | |
107 | "dereference#" & | |
108 | "decimal_io#" & | |
109 | "enumeration_io#" & | |
110 | "fixed_io#" & | |
111 | "float_io#" & | |
112 | "integer_io#" & | |
113 | "modular_io#" & | |
114 | "a_textio#" & | |
115 | "a_witeio#" & | |
116 | "const#" & | |
117 | "<error>#" & | |
118 | "go#" & | |
119 | "put#" & | |
120 | "put_line#" & | |
121 | "to#" & | |
122 | "finalization#" & | |
123 | "finalization_root#" & | |
124 | "interfaces#" & | |
125 | "standard#" & | |
126 | "system#" & | |
127 | "text_io#" & | |
128 | "wide_text_io#" & | |
129 | "addr#" & | |
130 | "async#" & | |
131 | "get_active_partition_id#" & | |
132 | "get_rci_package_receiver#" & | |
133 | "origin#" & | |
134 | "params#" & | |
135 | "partition#" & | |
136 | "partition_interface#" & | |
137 | "ras#" & | |
138 | "rci_name#" & | |
139 | "receiver#" & | |
140 | "result#" & | |
141 | "rpc#" & | |
142 | "subp_id#" & | |
143 | "Oabs#" & | |
144 | "Oand#" & | |
145 | "Omod#" & | |
146 | "Onot#" & | |
147 | "Oor#" & | |
148 | "Orem#" & | |
149 | "Oxor#" & | |
150 | "Oeq#" & | |
151 | "One#" & | |
152 | "Olt#" & | |
153 | "Ole#" & | |
154 | "Ogt#" & | |
155 | "Oge#" & | |
156 | "Oadd#" & | |
157 | "Osubtract#" & | |
158 | "Oconcat#" & | |
159 | "Omultiply#" & | |
160 | "Odivide#" & | |
161 | "Oexpon#" & | |
162 | "ada_83#" & | |
163 | "ada_95#" & | |
164 | "c_pass_by_copy#" & | |
165 | "component_alignment#" & | |
07fc65c4 | 166 | "convention_identifier#" & |
996ae0b0 RK |
167 | "discard_names#" & |
168 | "elaboration_checks#" & | |
169 | "eliminate#" & | |
170 | "extend_system#" & | |
171 | "extensions_allowed#" & | |
172 | "external_name_casing#" & | |
173 | "float_representation#" & | |
174 | "initialize_scalars#" & | |
175 | "license#" & | |
176 | "locking_policy#" & | |
177 | "long_float#" & | |
178 | "no_run_time#" & | |
179 | "normalize_scalars#" & | |
180 | "polling#" & | |
181 | "propagate_exceptions#" & | |
182 | "queuing_policy#" & | |
183 | "ravenscar#" & | |
184 | "restricted_run_time#" & | |
185 | "restrictions#" & | |
186 | "reviewable#" & | |
187 | "source_file_name#" & | |
188 | "style_checks#" & | |
189 | "suppress#" & | |
190 | "task_dispatching_policy#" & | |
191 | "unsuppress#" & | |
192 | "use_vads_size#" & | |
193 | "warnings#" & | |
194 | "validity_checks#" & | |
195 | "abort_defer#" & | |
196 | "all_calls_remote#" & | |
197 | "annotate#" & | |
198 | "assert#" & | |
199 | "asynchronous#" & | |
200 | "atomic#" & | |
201 | "atomic_components#" & | |
202 | "attach_handler#" & | |
203 | "comment#" & | |
204 | "common_object#" & | |
205 | "complex_representation#" & | |
206 | "controlled#" & | |
207 | "convention#" & | |
208 | "cpp_class#" & | |
209 | "cpp_constructor#" & | |
210 | "cpp_virtual#" & | |
211 | "cpp_vtable#" & | |
212 | "debug#" & | |
213 | "elaborate#" & | |
214 | "elaborate_all#" & | |
215 | "elaborate_body#" & | |
216 | "export#" & | |
217 | "export_exception#" & | |
218 | "export_function#" & | |
219 | "export_object#" & | |
220 | "export_procedure#" & | |
221 | "export_valued_procedure#" & | |
72e4357f | 222 | "external#" & |
996ae0b0 RK |
223 | "finalize_storage_only#" & |
224 | "ident#" & | |
225 | "import#" & | |
226 | "import_exception#" & | |
227 | "import_function#" & | |
228 | "import_object#" & | |
229 | "import_procedure#" & | |
230 | "import_valued_procedure#" & | |
231 | "inline#" & | |
232 | "inline_always#" & | |
233 | "inline_generic#" & | |
234 | "inspection_point#" & | |
235 | "interface#" & | |
236 | "interface_name#" & | |
237 | "interrupt_handler#" & | |
238 | "interrupt_priority#" & | |
239 | "java_constructor#" & | |
240 | "java_interface#" & | |
241 | "link_with#" & | |
242 | "linker_alias#" & | |
243 | "linker_options#" & | |
244 | "linker_section#" & | |
245 | "list#" & | |
246 | "machine_attribute#" & | |
247 | "main#" & | |
248 | "main_storage#" & | |
249 | "memory_size#" & | |
250 | "no_return#" & | |
251 | "optimize#" & | |
252 | "pack#" & | |
253 | "page#" & | |
254 | "passive#" & | |
255 | "preelaborate#" & | |
256 | "priority#" & | |
257 | "psect_object#" & | |
258 | "pure#" & | |
259 | "pure_function#" & | |
260 | "remote_call_interface#" & | |
261 | "remote_types#" & | |
262 | "share_generic#" & | |
263 | "shared#" & | |
264 | "shared_passive#" & | |
265 | "source_reference#" & | |
266 | "stream_convert#" & | |
267 | "subtitle#" & | |
268 | "suppress_all#" & | |
269 | "suppress_debug_info#" & | |
270 | "suppress_initialization#" & | |
271 | "system_name#" & | |
272 | "task_info#" & | |
273 | "task_name#" & | |
274 | "task_storage#" & | |
275 | "time_slice#" & | |
276 | "title#" & | |
277 | "unchecked_union#" & | |
278 | "unimplemented_unit#" & | |
07fc65c4 GB |
279 | "universal_data#" & |
280 | "unreferenced#" & | |
996ae0b0 RK |
281 | "unreserve_all_interrupts#" & |
282 | "volatile#" & | |
283 | "volatile_components#" & | |
284 | "weak_external#" & | |
285 | "ada#" & | |
996ae0b0 RK |
286 | "assembler#" & |
287 | "cobol#" & | |
288 | "cpp#" & | |
996ae0b0 RK |
289 | "fortran#" & |
290 | "intrinsic#" & | |
291 | "java#" & | |
292 | "stdcall#" & | |
293 | "stubbed#" & | |
07fc65c4 GB |
294 | "asm#" & |
295 | "assembly#" & | |
296 | "default#" & | |
297 | "dll#" & | |
996ae0b0 RK |
298 | "win32#" & |
299 | "as_is#" & | |
300 | "body_file_name#" & | |
301 | "casing#" & | |
302 | "code#" & | |
303 | "component#" & | |
304 | "component_size_4#" & | |
305 | "copy#" & | |
306 | "d_float#" & | |
307 | "descriptor#" & | |
996ae0b0 RK |
308 | "dot_replacement#" & |
309 | "dynamic#" & | |
310 | "entity#" & | |
996ae0b0 RK |
311 | "external_name#" & |
312 | "first_optional_parameter#" & | |
313 | "form#" & | |
314 | "g_float#" & | |
315 | "gcc#" & | |
316 | "gnat#" & | |
317 | "gpl#" & | |
318 | "ieee_float#" & | |
07fc65c4 | 319 | "homonym_number#" & |
996ae0b0 RK |
320 | "internal#" & |
321 | "link_name#" & | |
322 | "lowercase#" & | |
323 | "max_size#" & | |
324 | "mechanism#" & | |
325 | "mixedcase#" & | |
326 | "modified_gpl#" & | |
327 | "name#" & | |
328 | "nca#" & | |
329 | "no#" & | |
330 | "on#" & | |
331 | "parameter_types#" & | |
332 | "reference#" & | |
333 | "restricted#" & | |
334 | "result_mechanism#" & | |
335 | "result_type#" & | |
336 | "sb#" & | |
337 | "section#" & | |
338 | "semaphore#" & | |
339 | "spec_file_name#" & | |
340 | "static#" & | |
341 | "stack_size#" & | |
342 | "subunit_file_name#" & | |
343 | "task_stack_size_default#" & | |
344 | "task_type#" & | |
345 | "time_slicing_enabled#" & | |
346 | "top_guard#" & | |
347 | "uba#" & | |
348 | "ubs#" & | |
349 | "ubsb#" & | |
350 | "unit_name#" & | |
351 | "unknown#" & | |
352 | "unrestricted#" & | |
353 | "uppercase#" & | |
354 | "vax_float#" & | |
355 | "vms#" & | |
356 | "working_storage#" & | |
357 | "abort_signal#" & | |
358 | "access#" & | |
359 | "address#" & | |
360 | "address_size#" & | |
361 | "aft#" & | |
362 | "alignment#" & | |
363 | "asm_input#" & | |
364 | "asm_output#" & | |
365 | "ast_entry#" & | |
366 | "bit#" & | |
367 | "bit_order#" & | |
368 | "bit_position#" & | |
369 | "body_version#" & | |
370 | "callable#" & | |
371 | "caller#" & | |
372 | "code_address#" & | |
373 | "component_size#" & | |
374 | "compose#" & | |
375 | "constrained#" & | |
376 | "count#" & | |
377 | "default_bit_order#" & | |
378 | "definite#" & | |
379 | "delta#" & | |
380 | "denorm#" & | |
381 | "digits#" & | |
382 | "elaborated#" & | |
383 | "emax#" & | |
384 | "enum_rep#" & | |
385 | "epsilon#" & | |
386 | "exponent#" & | |
387 | "external_tag#" & | |
388 | "first#" & | |
389 | "first_bit#" & | |
390 | "fixed_value#" & | |
391 | "fore#" & | |
392 | "has_discriminants#" & | |
393 | "identity#" & | |
394 | "img#" & | |
395 | "integer_value#" & | |
396 | "large#" & | |
397 | "last#" & | |
398 | "last_bit#" & | |
399 | "leading_part#" & | |
400 | "length#" & | |
401 | "machine_emax#" & | |
402 | "machine_emin#" & | |
403 | "machine_mantissa#" & | |
404 | "machine_overflows#" & | |
405 | "machine_radix#" & | |
406 | "machine_rounds#" & | |
407 | "machine_size#" & | |
408 | "mantissa#" & | |
996ae0b0 RK |
409 | "max_size_in_storage_elements#" & |
410 | "maximum_alignment#" & | |
411 | "mechanism_code#" & | |
412 | "model_emin#" & | |
413 | "model_epsilon#" & | |
414 | "model_mantissa#" & | |
415 | "model_small#" & | |
416 | "modulus#" & | |
417 | "null_parameter#" & | |
418 | "object_size#" & | |
419 | "partition_id#" & | |
420 | "passed_by_reference#" & | |
421 | "pos#" & | |
422 | "position#" & | |
423 | "range#" & | |
424 | "range_length#" & | |
425 | "round#" & | |
426 | "safe_emax#" & | |
427 | "safe_first#" & | |
428 | "safe_large#" & | |
429 | "safe_last#" & | |
430 | "safe_small#" & | |
431 | "scale#" & | |
432 | "scaling#" & | |
433 | "signed_zeros#" & | |
434 | "size#" & | |
435 | "small#" & | |
436 | "storage_size#" & | |
437 | "storage_unit#" & | |
438 | "tag#" & | |
439 | "terminated#" & | |
996ae0b0 RK |
440 | "to_address#" & |
441 | "type_class#" & | |
442 | "uet_address#" & | |
443 | "unbiased_rounding#" & | |
444 | "unchecked_access#" & | |
445 | "universal_literal_string#" & | |
446 | "unrestricted_access#" & | |
447 | "vads_size#" & | |
448 | "val#" & | |
449 | "valid#" & | |
450 | "value_size#" & | |
451 | "version#" & | |
452 | "wchar_t_size#" & | |
453 | "wide_width#" & | |
454 | "width#" & | |
455 | "word_size#" & | |
456 | "adjacent#" & | |
457 | "ceiling#" & | |
458 | "copy_sign#" & | |
459 | "floor#" & | |
460 | "fraction#" & | |
461 | "image#" & | |
462 | "input#" & | |
463 | "machine#" & | |
464 | "max#" & | |
465 | "min#" & | |
466 | "model#" & | |
467 | "pred#" & | |
468 | "remainder#" & | |
469 | "rounding#" & | |
470 | "succ#" & | |
471 | "truncation#" & | |
472 | "value#" & | |
473 | "wide_image#" & | |
474 | "wide_value#" & | |
475 | "output#" & | |
476 | "read#" & | |
477 | "write#" & | |
478 | "elab_body#" & | |
479 | "elab_spec#" & | |
480 | "storage_pool#" & | |
481 | "base#" & | |
482 | "class#" & | |
483 | "ceiling_locking#" & | |
484 | "inheritance_locking#" & | |
485 | "fifo_queuing#" & | |
486 | "priority_queuing#" & | |
487 | "fifo_within_priorities#" & | |
488 | "access_check#" & | |
489 | "accessibility_check#" & | |
490 | "discriminant_check#" & | |
491 | "division_check#" & | |
492 | "elaboration_check#" & | |
493 | "index_check#" & | |
494 | "length_check#" & | |
495 | "overflow_check#" & | |
496 | "range_check#" & | |
497 | "storage_check#" & | |
498 | "tag_check#" & | |
499 | "all_checks#" & | |
500 | "abort#" & | |
501 | "abs#" & | |
502 | "accept#" & | |
503 | "and#" & | |
504 | "all#" & | |
505 | "array#" & | |
506 | "at#" & | |
507 | "begin#" & | |
508 | "body#" & | |
509 | "case#" & | |
510 | "constant#" & | |
511 | "declare#" & | |
512 | "delay#" & | |
513 | "do#" & | |
514 | "else#" & | |
515 | "elsif#" & | |
516 | "end#" & | |
517 | "entry#" & | |
518 | "exception#" & | |
519 | "exit#" & | |
520 | "for#" & | |
521 | "function#" & | |
522 | "generic#" & | |
523 | "goto#" & | |
524 | "if#" & | |
525 | "in#" & | |
526 | "is#" & | |
527 | "limited#" & | |
528 | "loop#" & | |
529 | "mod#" & | |
530 | "new#" & | |
531 | "not#" & | |
532 | "null#" & | |
533 | "of#" & | |
534 | "or#" & | |
535 | "others#" & | |
536 | "out#" & | |
537 | "package#" & | |
538 | "pragma#" & | |
539 | "private#" & | |
540 | "procedure#" & | |
541 | "raise#" & | |
542 | "record#" & | |
543 | "rem#" & | |
544 | "renames#" & | |
545 | "return#" & | |
546 | "reverse#" & | |
547 | "select#" & | |
548 | "separate#" & | |
549 | "subtype#" & | |
550 | "task#" & | |
551 | "terminate#" & | |
552 | "then#" & | |
553 | "type#" & | |
554 | "use#" & | |
555 | "when#" & | |
556 | "while#" & | |
557 | "with#" & | |
558 | "xor#" & | |
559 | "divide#" & | |
560 | "enclosing_entity#" & | |
561 | "exception_information#" & | |
562 | "exception_message#" & | |
563 | "exception_name#" & | |
564 | "file#" & | |
565 | "import_address#" & | |
566 | "import_largest_value#" & | |
567 | "import_value#" & | |
568 | "is_negative#" & | |
569 | "line#" & | |
570 | "rotate_left#" & | |
571 | "rotate_right#" & | |
572 | "shift_left#" & | |
573 | "shift_right#" & | |
574 | "shift_right_arithmetic#" & | |
575 | "source_location#" & | |
576 | "unchecked_conversion#" & | |
577 | "unchecked_deallocation#" & | |
578 | "abstract#" & | |
579 | "aliased#" & | |
580 | "protected#" & | |
581 | "until#" & | |
582 | "requeue#" & | |
583 | "tagged#" & | |
584 | "raise_exception#" & | |
79503fdd GB |
585 | "binder#" & |
586 | "builder#" & | |
587 | "compiler#" & | |
588 | "cross_reference#" & | |
589 | "default_switches#" & | |
590 | "exec_dir#" & | |
d7b2a6af | 591 | "extends#" & |
79503fdd GB |
592 | "finder#" & |
593 | "gnatls#" & | |
594 | "gnatstub#" & | |
e834fe1f | 595 | "implementation#" & |
e834fe1f | 596 | "implementation_exceptions#" & |
e834fe1f | 597 | "implementation_suffix#" & |
79503fdd | 598 | "languages#" & |
996ae0b0 | 599 | "library_dir#" & |
79503fdd | 600 | "library_elaboration#" & |
996ae0b0 | 601 | "library_kind#" & |
79503fdd | 602 | "library_name#" & |
996ae0b0 | 603 | "library_version#" & |
996ae0b0 | 604 | "linker#" & |
79503fdd GB |
605 | "naming#" & |
606 | "object_dir#" & | |
607 | "project#" & | |
608 | "separate_suffix#" & | |
609 | "source_dirs#" & | |
610 | "source_files#" & | |
611 | "source_list_file#" & | |
612 | "specification#" & | |
613 | "specification_exceptions#" & | |
614 | "specification_suffix#" & | |
615 | "switches#" & | |
996ae0b0 RK |
616 | "#"; |
617 | ||
618 | --------------------- | |
619 | -- Generated Names -- | |
620 | --------------------- | |
621 | ||
622 | -- This section lists the various cases of generated names which are | |
623 | -- built from existing names by adding unique leading and/or trailing | |
624 | -- upper case letters. In some cases these names are built recursively, | |
625 | -- in particular names built from types may be built from types which | |
626 | -- themselves have generated names. In this list, xxx represents an | |
627 | -- existing name to which identifying letters are prepended or appended, | |
628 | -- and a trailing n represents a serial number in an external name that | |
629 | -- has some semantic significance (e.g. the n'th index type of an array). | |
630 | ||
631 | -- xxxA access type for formal xxx in entry param record (Exp_Ch9) | |
632 | -- xxxB tag table for tagged type xxx (Exp_Ch3) | |
633 | -- xxxB task body procedure for task xxx (Exp_Ch9) | |
634 | -- xxxD dispatch table for tagged type xxx (Exp_Ch3) | |
635 | -- xxxD discriminal for discriminant xxx (Sem_Ch3) | |
636 | -- xxxDn n'th discr check function for rec type xxx (Exp_Ch3) | |
637 | -- xxxE elaboration boolean flag for task xxx (Exp_Ch9) | |
638 | -- xxxE dispatch table pointer type for tagged type xxx (Exp_Ch3) | |
639 | -- xxxE parameters for accept body for entry xxx (Exp_Ch9) | |
640 | -- xxxFn n'th primitive of a tagged type (named xxx) (Exp_Ch3) | |
641 | -- xxxI initialization procedure for type xxx (Exp_Ch3) | |
642 | -- xxxJ tag table type index for tagged type xxx (Exp_Ch3) | |
643 | -- xxxM master Id value for access type xxx (Exp_Ch3) | |
644 | -- xxxP tag table pointer type for tagged type xxx (Exp_Ch3) | |
645 | -- xxxP parameter record type for entry xxx (Exp_Ch9) | |
646 | -- xxxPA access to parameter record type for entry xxx (Exp_Ch9) | |
647 | -- xxxPn pointer type for n'th primitive of tagged type xxx (Exp_Ch3) | |
648 | -- xxxR dispatch table pointer for tagged type xxx (Exp_Ch3) | |
649 | -- xxxT tag table type for tagged type xxx (Exp_Ch3) | |
650 | -- xxxT literal table for enumeration type xxx (Sem_Ch3) | |
651 | -- xxxV type for task value record for task xxx (Exp_Ch9) | |
652 | -- xxxX entry index constant (Exp_Ch9) | |
653 | -- xxxY dispatch table type for tagged type xxx (Exp_Ch3) | |
654 | -- xxxZ size variable for task xxx (Exp_Ch9) | |
655 | ||
656 | -- Implicit type names | |
657 | ||
658 | -- TxxxT type of literal table for enumeration type xxx (Sem_Ch3) | |
659 | ||
07fc65c4 | 660 | -- (Note: this list is not complete or accurate ???) |
996ae0b0 RK |
661 | |
662 | ---------------------- | |
663 | -- Get_Attribute_Id -- | |
664 | ---------------------- | |
665 | ||
666 | function Get_Attribute_Id (N : Name_Id) return Attribute_Id is | |
667 | begin | |
668 | return Attribute_Id'Val (N - First_Attribute_Name); | |
669 | end Get_Attribute_Id; | |
670 | ||
671 | ------------------ | |
672 | -- Get_Check_Id -- | |
673 | ------------------ | |
674 | ||
675 | function Get_Check_Id (N : Name_Id) return Check_Id is | |
676 | begin | |
677 | return Check_Id'Val (N - First_Check_Name); | |
678 | end Get_Check_Id; | |
679 | ||
680 | ----------------------- | |
681 | -- Get_Convention_Id -- | |
682 | ----------------------- | |
683 | ||
684 | function Get_Convention_Id (N : Name_Id) return Convention_Id is | |
685 | begin | |
686 | case N is | |
687 | when Name_Ada => return Convention_Ada; | |
996ae0b0 RK |
688 | when Name_Assembler => return Convention_Assembler; |
689 | when Name_C => return Convention_C; | |
690 | when Name_COBOL => return Convention_COBOL; | |
691 | when Name_CPP => return Convention_CPP; | |
996ae0b0 RK |
692 | when Name_Fortran => return Convention_Fortran; |
693 | when Name_Intrinsic => return Convention_Intrinsic; | |
694 | when Name_Java => return Convention_Java; | |
695 | when Name_Stdcall => return Convention_Stdcall; | |
696 | when Name_Stubbed => return Convention_Stubbed; | |
07fc65c4 | 697 | |
996ae0b0 | 698 | when others => |
07fc65c4 GB |
699 | for J in 1 .. Convention_Identifiers.Last loop |
700 | if N = Convention_Identifiers.Table (J).Name then | |
701 | return Convention_Identifiers.Table (J).Convention; | |
702 | end if; | |
703 | end loop; | |
704 | ||
996ae0b0 RK |
705 | raise Program_Error; |
706 | end case; | |
707 | end Get_Convention_Id; | |
708 | ||
709 | --------------------------- | |
710 | -- Get_Locking_Policy_Id -- | |
711 | --------------------------- | |
712 | ||
713 | function Get_Locking_Policy_Id (N : Name_Id) return Locking_Policy_Id is | |
714 | begin | |
715 | return Locking_Policy_Id'Val (N - First_Locking_Policy_Name); | |
716 | end Get_Locking_Policy_Id; | |
717 | ||
718 | ------------------- | |
719 | -- Get_Pragma_Id -- | |
720 | ------------------- | |
721 | ||
722 | function Get_Pragma_Id (N : Name_Id) return Pragma_Id is | |
723 | begin | |
724 | if N = Name_AST_Entry then | |
725 | return Pragma_AST_Entry; | |
726 | elsif N = Name_Storage_Size then | |
727 | return Pragma_Storage_Size; | |
728 | elsif N = Name_Storage_Unit then | |
729 | return Pragma_Storage_Unit; | |
730 | else | |
731 | return Pragma_Id'Val (N - First_Pragma_Name); | |
732 | end if; | |
733 | end Get_Pragma_Id; | |
734 | ||
735 | --------------------------- | |
736 | -- Get_Queuing_Policy_Id -- | |
737 | --------------------------- | |
738 | ||
739 | function Get_Queuing_Policy_Id (N : Name_Id) return Queuing_Policy_Id is | |
740 | begin | |
741 | return Queuing_Policy_Id'Val (N - First_Queuing_Policy_Name); | |
742 | end Get_Queuing_Policy_Id; | |
743 | ||
744 | ------------------------------------ | |
745 | -- Get_Task_Dispatching_Policy_Id -- | |
746 | ------------------------------------ | |
747 | ||
748 | function Get_Task_Dispatching_Policy_Id (N : Name_Id) | |
749 | return Task_Dispatching_Policy_Id is | |
750 | begin | |
751 | return Task_Dispatching_Policy_Id'Val | |
752 | (N - First_Task_Dispatching_Policy_Name); | |
753 | end Get_Task_Dispatching_Policy_Id; | |
754 | ||
755 | ---------------- | |
756 | -- Initialize -- | |
757 | ---------------- | |
758 | ||
759 | procedure Initialize is | |
760 | P_Index : Natural; | |
761 | Discard_Name : Name_Id; | |
762 | ||
763 | begin | |
764 | P_Index := Preset_Names'First; | |
765 | ||
766 | loop | |
767 | Name_Len := 0; | |
768 | ||
769 | while Preset_Names (P_Index) /= '#' loop | |
770 | Name_Len := Name_Len + 1; | |
771 | Name_Buffer (Name_Len) := Preset_Names (P_Index); | |
772 | P_Index := P_Index + 1; | |
773 | end loop; | |
774 | ||
775 | -- We do the Name_Find call to enter the name into the table, but | |
776 | -- we don't need to do anything with the result, since we already | |
777 | -- initialized all the preset names to have the right value (we | |
778 | -- are depending on the order of the names and Preset_Names). | |
779 | ||
780 | Discard_Name := Name_Find; | |
781 | P_Index := P_Index + 1; | |
782 | exit when Preset_Names (P_Index) = '#'; | |
783 | end loop; | |
784 | ||
785 | -- Make sure that number of names in standard table is correct. If | |
786 | -- this check fails, run utility program XSNAMES to construct a new | |
787 | -- properly matching version of the body. | |
788 | ||
789 | pragma Assert (Discard_Name = Last_Predefined_Name); | |
07fc65c4 GB |
790 | |
791 | -- Initialize the convention identifiers table with the standard | |
792 | -- set of synonyms that we recognize for conventions. | |
793 | ||
794 | Convention_Identifiers.Init; | |
795 | ||
796 | Convention_Identifiers.Append ((Name_Asm, Convention_Assembler)); | |
797 | Convention_Identifiers.Append ((Name_Assembly, Convention_Assembler)); | |
798 | ||
799 | Convention_Identifiers.Append ((Name_Default, Convention_C)); | |
800 | Convention_Identifiers.Append ((Name_External, Convention_C)); | |
801 | ||
802 | Convention_Identifiers.Append ((Name_DLL, Convention_Stdcall)); | |
803 | Convention_Identifiers.Append ((Name_Win32, Convention_Stdcall)); | |
996ae0b0 RK |
804 | end Initialize; |
805 | ||
806 | ----------------------- | |
807 | -- Is_Attribute_Name -- | |
808 | ----------------------- | |
809 | ||
810 | function Is_Attribute_Name (N : Name_Id) return Boolean is | |
811 | begin | |
812 | return N in First_Attribute_Name .. Last_Attribute_Name; | |
813 | end Is_Attribute_Name; | |
814 | ||
815 | ------------------- | |
816 | -- Is_Check_Name -- | |
817 | ------------------- | |
818 | ||
819 | function Is_Check_Name (N : Name_Id) return Boolean is | |
820 | begin | |
821 | return N in First_Check_Name .. Last_Check_Name; | |
822 | end Is_Check_Name; | |
823 | ||
824 | ------------------------ | |
825 | -- Is_Convention_Name -- | |
826 | ------------------------ | |
827 | ||
828 | function Is_Convention_Name (N : Name_Id) return Boolean is | |
829 | begin | |
07fc65c4 GB |
830 | if N in First_Convention_Name .. Last_Convention_Name |
831 | or else N = Name_C | |
832 | then | |
833 | return True; | |
834 | ||
835 | else | |
836 | for J in 1 .. Convention_Identifiers.Last loop | |
837 | if N = Convention_Identifiers.Table (J).Name then | |
838 | return True; | |
839 | end if; | |
840 | end loop; | |
841 | ||
842 | return False; | |
843 | end if; | |
996ae0b0 RK |
844 | end Is_Convention_Name; |
845 | ||
846 | ------------------------------ | |
847 | -- Is_Entity_Attribute_Name -- | |
848 | ------------------------------ | |
849 | ||
850 | function Is_Entity_Attribute_Name (N : Name_Id) return Boolean is | |
851 | begin | |
852 | return N in First_Entity_Attribute_Name .. Last_Entity_Attribute_Name; | |
853 | end Is_Entity_Attribute_Name; | |
854 | ||
855 | -------------------------------- | |
856 | -- Is_Function_Attribute_Name -- | |
857 | -------------------------------- | |
858 | ||
859 | function Is_Function_Attribute_Name (N : Name_Id) return Boolean is | |
860 | begin | |
861 | return N in | |
862 | First_Renamable_Function_Attribute .. | |
863 | Last_Renamable_Function_Attribute; | |
864 | end Is_Function_Attribute_Name; | |
865 | ||
866 | ---------------------------- | |
867 | -- Is_Locking_Policy_Name -- | |
868 | ---------------------------- | |
869 | ||
870 | function Is_Locking_Policy_Name (N : Name_Id) return Boolean is | |
871 | begin | |
872 | return N in First_Locking_Policy_Name .. Last_Locking_Policy_Name; | |
873 | end Is_Locking_Policy_Name; | |
874 | ||
875 | ----------------------------- | |
876 | -- Is_Operator_Symbol_Name -- | |
877 | ----------------------------- | |
878 | ||
879 | function Is_Operator_Symbol_Name (N : Name_Id) return Boolean is | |
880 | begin | |
881 | return N in First_Operator_Name .. Last_Operator_Name; | |
882 | end Is_Operator_Symbol_Name; | |
883 | ||
884 | -------------------- | |
885 | -- Is_Pragma_Name -- | |
886 | -------------------- | |
887 | ||
888 | function Is_Pragma_Name (N : Name_Id) return Boolean is | |
889 | begin | |
890 | return N in First_Pragma_Name .. Last_Pragma_Name | |
891 | or else N = Name_AST_Entry | |
892 | or else N = Name_Storage_Size | |
893 | or else N = Name_Storage_Unit; | |
894 | end Is_Pragma_Name; | |
895 | ||
896 | --------------------------------- | |
897 | -- Is_Procedure_Attribute_Name -- | |
898 | --------------------------------- | |
899 | ||
900 | function Is_Procedure_Attribute_Name (N : Name_Id) return Boolean is | |
901 | begin | |
902 | return N in First_Procedure_Attribute .. Last_Procedure_Attribute; | |
903 | end Is_Procedure_Attribute_Name; | |
904 | ||
905 | ---------------------------- | |
906 | -- Is_Queuing_Policy_Name -- | |
907 | ---------------------------- | |
908 | ||
909 | function Is_Queuing_Policy_Name (N : Name_Id) return Boolean is | |
910 | begin | |
911 | return N in First_Queuing_Policy_Name .. Last_Queuing_Policy_Name; | |
912 | end Is_Queuing_Policy_Name; | |
913 | ||
914 | ------------------------------------- | |
915 | -- Is_Task_Dispatching_Policy_Name -- | |
916 | ------------------------------------- | |
917 | ||
918 | function Is_Task_Dispatching_Policy_Name (N : Name_Id) return Boolean is | |
919 | begin | |
920 | return N in First_Task_Dispatching_Policy_Name .. | |
921 | Last_Task_Dispatching_Policy_Name; | |
922 | end Is_Task_Dispatching_Policy_Name; | |
923 | ||
924 | ---------------------------- | |
925 | -- Is_Type_Attribute_Name -- | |
926 | ---------------------------- | |
927 | ||
928 | function Is_Type_Attribute_Name (N : Name_Id) return Boolean is | |
929 | begin | |
930 | return N in First_Type_Attribute_Name .. Last_Type_Attribute_Name; | |
931 | end Is_Type_Attribute_Name; | |
932 | ||
07fc65c4 GB |
933 | ---------------------------------- |
934 | -- Record_Convention_Identifier -- | |
935 | ---------------------------------- | |
936 | ||
937 | procedure Record_Convention_Identifier | |
938 | (Id : Name_Id; | |
939 | Convention : Convention_Id) | |
940 | is | |
941 | begin | |
942 | Convention_Identifiers.Append ((Id, Convention)); | |
943 | end Record_Convention_Identifier; | |
944 | ||
996ae0b0 | 945 | end Snames; |