OSDN Git Service

2008-08-01 Vincent Celier <celier@adacore.com>
[pf3gnuchains/gcc-fork.git] / gcc / ada / snames.adb
1 ------------------------------------------------------------------------------
2 --                                                                          --
3 --                         GNAT COMPILER COMPONENTS                         --
4 --                                                                          --
5 --                               S N A M E S                                --
6 --                                                                          --
7 --                                 B o d y                                  --
8 --                                                                          --
9 --          Copyright (C) 1992-2008, Free Software Foundation, Inc.         --
10 --                                                                          --
11 -- GNAT is free software;  you can  redistribute it  and/or modify it under --
12 -- terms of the  GNU General Public License as published  by the Free Soft- --
13 -- ware  Foundation;  either version 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,  51  Franklin  Street,  Fifth  Floor, --
20 -- Boston, MA 02110-1301, 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. --
30 -- Extensive contributions were provided by Ada Core Technologies Inc.      --
31 --                                                                          --
32 ------------------------------------------------------------------------------
33
34 with Opt;   use Opt;
35 with Table;
36 with Types; use Types;
37
38 package body Snames is
39
40    --  Table used to record convention identifiers
41
42    type Convention_Id_Entry is record
43       Name       : Name_Id;
44       Convention : Convention_Id;
45    end record;
46
47    package Convention_Identifiers is new Table.Table (
48      Table_Component_Type => Convention_Id_Entry,
49      Table_Index_Type     => Int,
50      Table_Low_Bound      => 1,
51      Table_Initial        => 50,
52      Table_Increment      => 200,
53      Table_Name           => "Name_Convention_Identifiers");
54
55    --  Table of names to be set by Initialize. Each name is terminated by a
56    --  single #, and the end of the list is marked by a null entry, i.e. by
57    --  two # marks in succession. Note that the table does not include the
58    --  entries for a-z, since these are initialized by Namet itself.
59
60    Preset_Names : constant String :=
61      "_parent#" &
62      "_tag#" &
63      "off#" &
64      "space#" &
65      "time#" &
66      "_abort_signal#" &
67      "_alignment#" &
68      "_assign#" &
69      "_atcb#" &
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      "_postconditions#" &
82      "_priority#" &
83      "_process_atsd#" &
84      "_relative_deadline#" &
85      "_result#" &
86      "_secondary_stack#" &
87      "_service#" &
88      "_size#" &
89      "_stack#" &
90      "_tags#" &
91      "_task#" &
92      "_task_id#" &
93      "_task_info#" &
94      "_task_name#" &
95      "_trace_sp#" &
96      "_disp_asynchronous_select#" &
97      "_disp_conditional_select#" &
98      "_disp_get_prim_op_kind#" &
99      "_disp_get_task_id#" &
100      "_disp_requeue#" &
101      "_disp_timed_select#" &
102      "initialize#" &
103      "adjust#" &
104      "finalize#" &
105      "next#" &
106      "prev#" &
107      "_typecode#" &
108      "_from_any#" &
109      "_to_any#" &
110      "allocate#" &
111      "deallocate#" &
112      "dereference#" &
113      "decimal_io#" &
114      "enumeration_io#" &
115      "fixed_io#" &
116      "float_io#" &
117      "integer_io#" &
118      "modular_io#" &
119      "const#" &
120      "<error>#" &
121      "go#" &
122      "put#" &
123      "put_line#" &
124      "to#" &
125      "exception_traces#" &
126      "finalization#" &
127      "finalization_root#" &
128      "interfaces#" &
129      "most_recent_exception#" &
130      "standard#" &
131      "system#" &
132      "text_io#" &
133      "wide_text_io#" &
134      "wide_wide_text_io#" &
135      "no_dsa#" &
136      "garlic_dsa#" &
137      "polyorb_dsa#" &
138      "addr#" &
139      "async#" &
140      "get_active_partition_id#" &
141      "get_rci_package_receiver#" &
142      "get_rci_package_ref#" &
143      "origin#" &
144      "params#" &
145      "partition#" &
146      "partition_interface#" &
147      "ras#" &
148      "_call#" &
149      "rci_name#" &
150      "receiver#" &
151      "rpc#" &
152      "subp_id#" &
153      "operation#" &
154      "argument#" &
155      "arg_modes#" &
156      "handler#" &
157      "target#" &
158      "req#" &
159      "obj_typecode#" &
160      "stub#" &
161      "Oabs#" &
162      "Oand#" &
163      "Omod#" &
164      "Onot#" &
165      "Oor#" &
166      "Orem#" &
167      "Oxor#" &
168      "Oeq#" &
169      "One#" &
170      "Olt#" &
171      "Ole#" &
172      "Ogt#" &
173      "Oge#" &
174      "Oadd#" &
175      "Osubtract#" &
176      "Oconcat#" &
177      "Omultiply#" &
178      "Odivide#" &
179      "Oexpon#" &
180      "ada_83#" &
181      "ada_95#" &
182      "ada_05#" &
183      "ada_2005#" &
184      "assertion_policy#" &
185      "c_pass_by_copy#" &
186      "canonical_streams#" &
187      "check_name#" &
188      "check_policy#" &
189      "compile_time_error#" &
190      "compile_time_warning#" &
191      "compiler_unit#" &
192      "component_alignment#" &
193      "convention_identifier#" &
194      "debug_policy#" &
195      "detect_blocking#" &
196      "discard_names#" &
197      "elaboration_checks#" &
198      "eliminate#" &
199      "extend_system#" &
200      "extensions_allowed#" &
201      "external_name_casing#" &
202      "favor_top_level#" &
203      "float_representation#" &
204      "implicit_packing#" &
205      "initialize_scalars#" &
206      "interrupt_state#" &
207      "license#" &
208      "locking_policy#" &
209      "long_float#" &
210      "no_run_time#" &
211      "no_strict_aliasing#" &
212      "normalize_scalars#" &
213      "optimize_alignment#" &
214      "persistent_bss#" &
215      "polling#" &
216      "priority_specific_dispatching#" &
217      "profile#" &
218      "profile_warnings#" &
219      "propagate_exceptions#" &
220      "queuing_policy#" &
221      "ravenscar#" &
222      "restricted_run_time#" &
223      "restrictions#" &
224      "restriction_warnings#" &
225      "reviewable#" &
226      "source_file_name#" &
227      "source_file_name_project#" &
228      "style_checks#" &
229      "suppress#" &
230      "suppress_exception_locations#" &
231      "task_dispatching_policy#" &
232      "universal_data#" &
233      "unsuppress#" &
234      "use_vads_size#" &
235      "validity_checks#" &
236      "warnings#" &
237      "wide_character_encoding#" &
238      "abort_defer#" &
239      "all_calls_remote#" &
240      "annotate#" &
241      "assert#" &
242      "asynchronous#" &
243      "atomic#" &
244      "atomic_components#" &
245      "attach_handler#" &
246      "check#" &
247      "cil_constructor#" &
248      "comment#" &
249      "common_object#" &
250      "complete_representation#" &
251      "complex_representation#" &
252      "controlled#" &
253      "convention#" &
254      "cpp_class#" &
255      "cpp_constructor#" &
256      "cpp_virtual#" &
257      "cpp_vtable#" &
258      "debug#" &
259      "elaborate#" &
260      "elaborate_all#" &
261      "elaborate_body#" &
262      "export#" &
263      "export_exception#" &
264      "export_function#" &
265      "export_object#" &
266      "export_procedure#" &
267      "export_value#" &
268      "export_valued_procedure#" &
269      "external#" &
270      "finalize_storage_only#" &
271      "ident#" &
272      "implemented_by_entry#" &
273      "import#" &
274      "import_exception#" &
275      "import_function#" &
276      "import_object#" &
277      "import_procedure#" &
278      "import_valued_procedure#" &
279      "inline#" &
280      "inline_always#" &
281      "inline_generic#" &
282      "inspection_point#" &
283      "interface_name#" &
284      "interrupt_handler#" &
285      "interrupt_priority#" &
286      "java_constructor#" &
287      "java_interface#" &
288      "keep_names#" &
289      "link_with#" &
290      "linker_alias#" &
291      "linker_constructor#" &
292      "linker_destructor#" &
293      "linker_options#" &
294      "linker_section#" &
295      "list#" &
296      "machine_attribute#" &
297      "main#" &
298      "main_storage#" &
299      "memory_size#" &
300      "no_body#" &
301      "no_return#" &
302      "obsolescent#" &
303      "optimize#" &
304      "pack#" &
305      "page#" &
306      "passive#" &
307      "postcondition#" &
308      "precondition#" &
309      "preelaborable_initialization#" &
310      "preelaborate#" &
311      "preelaborate_05#" &
312      "psect_object#" &
313      "pure#" &
314      "pure_05#" &
315      "pure_function#" &
316      "relative_deadline#" &
317      "remote_call_interface#" &
318      "remote_types#" &
319      "share_generic#" &
320      "shared#" &
321      "shared_passive#" &
322      "source_reference#" &
323      "static_elaboration_desired#" &
324      "stream_convert#" &
325      "subtitle#" &
326      "suppress_all#" &
327      "suppress_debug_info#" &
328      "suppress_initialization#" &
329      "system_name#" &
330      "task_info#" &
331      "task_name#" &
332      "task_storage#" &
333      "time_slice#" &
334      "title#" &
335      "unchecked_union#" &
336      "unimplemented_unit#" &
337      "universal_aliasing#" &
338      "unmodified#" &
339      "unreferenced#" &
340      "unreferenced_objects#" &
341      "unreserve_all_interrupts#" &
342      "volatile#" &
343      "volatile_components#" &
344      "weak_external#" &
345      "ada#" &
346      "assembler#" &
347      "cil#" &
348      "cobol#" &
349      "cpp#" &
350      "fortran#" &
351      "intrinsic#" &
352      "java#" &
353      "stdcall#" &
354      "stubbed#" &
355      "asm#" &
356      "assembly#" &
357      "default#" &
358      "c_plus_plus#" &
359      "dll#" &
360      "win32#" &
361      "as_is#" &
362      "assertion#" &
363      "attribute_name#" &
364      "body_file_name#" &
365      "boolean_entry_barriers#" &
366      "casing#" &
367      "code#" &
368      "component#" &
369      "component_size_4#" &
370      "copy#" &
371      "d_float#" &
372      "descriptor#" &
373      "dot_replacement#" &
374      "dynamic#" &
375      "entity#" &
376      "entry_count#" &
377      "external_name#" &
378      "first_optional_parameter#" &
379      "form#" &
380      "g_float#" &
381      "gcc#" &
382      "gnat#" &
383      "gpl#" &
384      "ieee_float#" &
385      "ignore#" &
386      "info#" &
387      "internal#" &
388      "link_name#" &
389      "lowercase#" &
390      "max_entry_queue_depth#" &
391      "max_entry_queue_length#" &
392      "max_size#" &
393      "mechanism#" &
394      "message#" &
395      "mixedcase#" &
396      "modified_gpl#" &
397      "name#" &
398      "nca#" &
399      "no#" &
400      "no_dependence#" &
401      "no_dynamic_attachment#" &
402      "no_dynamic_interrupts#" &
403      "no_requeue#" &
404      "no_requeue_statements#" &
405      "no_task_attributes#" &
406      "no_task_attributes_package#" &
407      "on#" &
408      "parameter_types#" &
409      "reference#" &
410      "restricted#" &
411      "result_mechanism#" &
412      "result_type#" &
413      "runtime#" &
414      "sb#" &
415      "secondary_stack_size#" &
416      "section#" &
417      "semaphore#" &
418      "short_descriptor#" &
419      "simple_barriers#" &
420      "spec_file_name#" &
421      "state#" &
422      "static#" &
423      "stack_size#" &
424      "subunit_file_name#" &
425      "task_stack_size_default#" &
426      "task_type#" &
427      "time_slicing_enabled#" &
428      "top_guard#" &
429      "uba#" &
430      "ubs#" &
431      "ubsb#" &
432      "unit_name#" &
433      "unknown#" &
434      "unrestricted#" &
435      "uppercase#" &
436      "user#" &
437      "vax_float#" &
438      "vms#" &
439      "vtable_ptr#" &
440      "working_storage#" &
441      "abort_signal#" &
442      "access#" &
443      "address#" &
444      "address_size#" &
445      "aft#" &
446      "alignment#" &
447      "asm_input#" &
448      "asm_output#" &
449      "ast_entry#" &
450      "bit#" &
451      "bit_order#" &
452      "bit_position#" &
453      "body_version#" &
454      "callable#" &
455      "caller#" &
456      "code_address#" &
457      "component_size#" &
458      "compose#" &
459      "constrained#" &
460      "count#" &
461      "default_bit_order#" &
462      "definite#" &
463      "delta#" &
464      "denorm#" &
465      "digits#" &
466      "elaborated#" &
467      "emax#" &
468      "enabled#" &
469      "enum_rep#" &
470      "enum_val#" &
471      "epsilon#" &
472      "exponent#" &
473      "external_tag#" &
474      "fast_math#" &
475      "first#" &
476      "first_bit#" &
477      "fixed_value#" &
478      "fore#" &
479      "has_access_values#" &
480      "has_discriminants#" &
481      "has_tagged_values#" &
482      "identity#" &
483      "img#" &
484      "integer_value#" &
485      "invalid_value#" &
486      "large#" &
487      "last#" &
488      "last_bit#" &
489      "leading_part#" &
490      "length#" &
491      "machine_emax#" &
492      "machine_emin#" &
493      "machine_mantissa#" &
494      "machine_overflows#" &
495      "machine_radix#" &
496      "machine_rounding#" &
497      "machine_rounds#" &
498      "machine_size#" &
499      "mantissa#" &
500      "max_size_in_storage_elements#" &
501      "maximum_alignment#" &
502      "mechanism_code#" &
503      "mod#" &
504      "model_emin#" &
505      "model_epsilon#" &
506      "model_mantissa#" &
507      "model_small#" &
508      "modulus#" &
509      "null_parameter#" &
510      "object_size#" &
511      "old#" &
512      "partition_id#" &
513      "passed_by_reference#" &
514      "pool_address#" &
515      "pos#" &
516      "position#" &
517      "priority#" &
518      "range#" &
519      "range_length#" &
520      "result#" &
521      "round#" &
522      "safe_emax#" &
523      "safe_first#" &
524      "safe_large#" &
525      "safe_last#" &
526      "safe_small#" &
527      "scale#" &
528      "scaling#" &
529      "signed_zeros#" &
530      "size#" &
531      "small#" &
532      "storage_size#" &
533      "storage_unit#" &
534      "stream_size#" &
535      "tag#" &
536      "target_name#" &
537      "terminated#" &
538      "to_address#" &
539      "type_class#" &
540      "uet_address#" &
541      "unbiased_rounding#" &
542      "unchecked_access#" &
543      "unconstrained_array#" &
544      "universal_literal_string#" &
545      "unrestricted_access#" &
546      "vads_size#" &
547      "val#" &
548      "valid#" &
549      "value_size#" &
550      "version#" &
551      "wchar_t_size#" &
552      "wide_wide_width#" &
553      "wide_width#" &
554      "width#" &
555      "word_size#" &
556      "adjacent#" &
557      "ceiling#" &
558      "copy_sign#" &
559      "floor#" &
560      "fraction#" &
561      "image#" &
562      "input#" &
563      "machine#" &
564      "max#" &
565      "min#" &
566      "model#" &
567      "pred#" &
568      "remainder#" &
569      "rounding#" &
570      "succ#" &
571      "truncation#" &
572      "value#" &
573      "wide_image#" &
574      "wide_wide_image#" &
575      "wide_value#" &
576      "wide_wide_value#" &
577      "output#" &
578      "read#" &
579      "write#" &
580      "elab_body#" &
581      "elab_spec#" &
582      "storage_pool#" &
583      "base#" &
584      "class#" &
585      "stub_type#" &
586      "ceiling_locking#" &
587      "inheritance_locking#" &
588      "fifo_queuing#" &
589      "priority_queuing#" &
590      "edf_across_priorities#" &
591      "fifo_within_priorities#" &
592      "non_preemptive_within_priorities#" &
593      "round_robin_within_priorities#" &
594      "access_check#" &
595      "accessibility_check#" &
596      "alignment_check#" &
597      "discriminant_check#" &
598      "division_check#" &
599      "elaboration_check#" &
600      "index_check#" &
601      "length_check#" &
602      "overflow_check#" &
603      "range_check#" &
604      "storage_check#" &
605      "tag_check#" &
606      "validity_check#" &
607      "all_checks#" &
608      "abort#" &
609      "abs#" &
610      "accept#" &
611      "and#" &
612      "all#" &
613      "array#" &
614      "at#" &
615      "begin#" &
616      "body#" &
617      "case#" &
618      "constant#" &
619      "declare#" &
620      "delay#" &
621      "do#" &
622      "else#" &
623      "elsif#" &
624      "end#" &
625      "entry#" &
626      "exception#" &
627      "exit#" &
628      "for#" &
629      "function#" &
630      "generic#" &
631      "goto#" &
632      "if#" &
633      "in#" &
634      "is#" &
635      "limited#" &
636      "loop#" &
637      "new#" &
638      "not#" &
639      "null#" &
640      "of#" &
641      "or#" &
642      "others#" &
643      "out#" &
644      "package#" &
645      "pragma#" &
646      "private#" &
647      "procedure#" &
648      "raise#" &
649      "record#" &
650      "rem#" &
651      "renames#" &
652      "return#" &
653      "reverse#" &
654      "select#" &
655      "separate#" &
656      "subtype#" &
657      "task#" &
658      "terminate#" &
659      "then#" &
660      "type#" &
661      "use#" &
662      "when#" &
663      "while#" &
664      "with#" &
665      "xor#" &
666      "divide#" &
667      "enclosing_entity#" &
668      "exception_information#" &
669      "exception_message#" &
670      "exception_name#" &
671      "file#" &
672      "generic_dispatching_constructor#" &
673      "import_address#" &
674      "import_largest_value#" &
675      "import_value#" &
676      "is_negative#" &
677      "line#" &
678      "rotate_left#" &
679      "rotate_right#" &
680      "shift_left#" &
681      "shift_right#" &
682      "shift_right_arithmetic#" &
683      "source_location#" &
684      "unchecked_conversion#" &
685      "unchecked_deallocation#" &
686      "to_pointer#" &
687      "free#" &
688      "abstract#" &
689      "aliased#" &
690      "protected#" &
691      "until#" &
692      "requeue#" &
693      "tagged#" &
694      "raise_exception#" &
695      "ada_roots#" &
696      "aggregate#" &
697      "archive_builder#" &
698      "archive_builder_append_option#" &
699      "archive_indexer#" &
700      "archive_suffix#" &
701      "binder#" &
702      "binder_prefix#" &
703      "body_suffix#" &
704      "builder#" &
705      "builder_switches#" &
706      "compiler#" &
707      "compiler_kind#" &
708      "config_body_file_name#" &
709      "config_body_file_name_pattern#" &
710      "config_file_switches#" &
711      "config_file_unique#" &
712      "config_spec_file_name#" &
713      "config_spec_file_name_pattern#" &
714      "configuration#" &
715      "cross_reference#" &
716      "default_language#" &
717      "default_switches#" &
718      "dependency_driver#" &
719      "dependency_file_kind#" &
720      "dependency_switches#" &
721      "driver#" &
722      "excluded_source_dirs#" &
723      "excluded_source_files#" &
724      "excluded_source_list_file#" &
725      "exec_dir#" &
726      "executable#" &
727      "executable_suffix#" &
728      "extends#" &
729      "externally_built#" &
730      "finder#" &
731      "global_configuration_pragmas#" &
732      "global_config_file#" &
733      "gnatls#" &
734      "gnatstub#" &
735      "implementation#" &
736      "implementation_exceptions#" &
737      "implementation_suffix#" &
738      "include_switches#" &
739      "include_path#" &
740      "include_path_file#" &
741      "inherit_source_path#" &
742      "language_kind#" &
743      "language_processing#" &
744      "languages#" &
745      "library#" &
746      "library_ali_dir#" &
747      "library_auto_init#" &
748      "library_auto_init_supported#" &
749      "library_builder#" &
750      "library_dir#" &
751      "library_gcc#" &
752      "library_interface#" &
753      "library_kind#" &
754      "library_name#" &
755      "library_major_minor_id_supported#" &
756      "library_options#" &
757      "library_partial_linker#" &
758      "library_reference_symbol_file#" &
759      "library_src_dir#" &
760      "library_support#" &
761      "library_symbol_file#" &
762      "library_symbol_policy#" &
763      "library_version#" &
764      "library_version_switches#" &
765      "linker#" &
766      "linker_executable_option#" &
767      "linker_lib_dir_option#" &
768      "linker_lib_name_option#" &
769      "local_config_file#" &
770      "local_configuration_pragmas#" &
771      "locally_removed_files#" &
772      "map_file_option#" &
773      "mapping_file_switches#" &
774      "mapping_spec_suffix#" &
775      "mapping_body_suffix#" &
776      "metrics#" &
777      "naming#" &
778      "object_generated#" &
779      "objects_linked#" &
780      "objects_path#" &
781      "objects_path_file#" &
782      "object_dir#" &
783      "path_syntax#" &
784      "pic_option#" &
785      "pretty_printer#" &
786      "prefix#" &
787      "project#" &
788      "roots#" &
789      "required_switches#" &
790      "run_path_option#" &
791      "runtime_project#" &
792      "shared_library_minimum_switches#" &
793      "shared_library_prefix#" &
794      "shared_library_suffix#" &
795      "separate_suffix#" &
796      "source_dirs#" &
797      "source_files#" &
798      "source_list_file#" &
799      "spec#" &
800      "spec_suffix#" &
801      "specification#" &
802      "specification_exceptions#" &
803      "specification_suffix#" &
804      "stack#" &
805      "switches#" &
806      "symbolic_link_supported#" &
807      "sync#" &
808      "synchronize#" &
809      "toolchain_description#" &
810      "toolchain_version#" &
811      "runtime_library_dir#" &
812      "unaligned_valid#" &
813      "interface#" &
814      "overriding#" &
815      "synchronized#" &
816      "#";
817
818    ---------------------
819    -- Generated Names --
820    ---------------------
821
822    --  This section lists the various cases of generated names which are
823    --  built from existing names by adding unique leading and/or trailing
824    --  upper case letters. In some cases these names are built recursively,
825    --  in particular names built from types may be built from types which
826    --  themselves have generated names. In this list, xxx represents an
827    --  existing name to which identifying letters are prepended or appended,
828    --  and a trailing n represents a serial number in an external name that
829    --  has some semantic significance (e.g. the n'th index type of an array).
830
831    --    xxxA    access type for formal xxx in entry param record   (Exp_Ch9)
832    --    xxxB    tag table for tagged type xxx                      (Exp_Ch3)
833    --    xxxB    task body procedure for task xxx                   (Exp_Ch9)
834    --    xxxD    dispatch table for tagged type xxx                 (Exp_Ch3)
835    --    xxxD    discriminal for discriminant xxx                   (Sem_Ch3)
836    --    xxxDn   n'th discr check function for rec type xxx         (Exp_Ch3)
837    --    xxxE    elaboration boolean flag for task xxx              (Exp_Ch9)
838    --    xxxE    dispatch table pointer type for tagged type xxx    (Exp_Ch3)
839    --    xxxE    parameters for accept body for entry xxx           (Exp_Ch9)
840    --    xxxFn   n'th primitive of a tagged type (named xxx)        (Exp_Ch3)
841    --    xxxJ    tag table type index for tagged type xxx           (Exp_Ch3)
842    --    xxxM    master Id value for access type xxx                (Exp_Ch3)
843    --    xxxP    tag table pointer type for tagged type xxx         (Exp_Ch3)
844    --    xxxP    parameter record type for entry xxx                (Exp_Ch9)
845    --    xxxPA   access to parameter record type for entry xxx      (Exp_Ch9)
846    --    xxxPn   pointer type for n'th primitive of tagged type xxx (Exp_Ch3)
847    --    xxxR    dispatch table pointer for tagged type xxx         (Exp_Ch3)
848    --    xxxT    tag table type for tagged type xxx                 (Exp_Ch3)
849    --    xxxT    literal table for enumeration type xxx             (Sem_Ch3)
850    --    xxxV    type for task value record for task xxx            (Exp_Ch9)
851    --    xxxX    entry index constant                               (Exp_Ch9)
852    --    xxxY    dispatch table type for tagged type xxx            (Exp_Ch3)
853    --    xxxZ    size variable for task xxx                         (Exp_Ch9)
854
855    --  TSS names
856
857    --    xxxDA   deep adjust routine for type xxx                   (Exp_TSS)
858    --    xxxDF   deep finalize routine for type xxx                 (Exp_TSS)
859    --    xxxDI   deep initialize routine for type xxx               (Exp_TSS)
860    --    xxxEQ   composite equality routine for record type xxx     (Exp_TSS)
861    --    xxxFA   PolyORB/DSA From_Any converter for type xxx        (Exp_TSS)
862    --    xxxIP   initialization procedure for type xxx              (Exp_TSS)
863    --    xxxRA   RAS type access routine for type xxx               (Exp_TSS)
864    --    xxxRD   RAS type dereference routine for type xxx          (Exp_TSS)
865    --    xxxRP   Rep to Pos conversion for enumeration type xxx     (Exp_TSS)
866    --    xxxSA   array/slice assignment for controlled comp. arrays (Exp_TSS)
867    --    xxxSI   stream input attribute subprogram for type xxx     (Exp_TSS)
868    --    xxxSO   stream output attribute subprogram for type xxx    (Exp_TSS)
869    --    xxxSR   stream read attribute subprogram for type xxx      (Exp_TSS)
870    --    xxxSW   stream write attribute subprogram for type xxx     (Exp_TSS)
871    --    xxxTA   PolyORB/DSA To_Any converter for type xxx          (Exp_TSS)
872    --    xxxTC   PolyORB/DSA Typecode for type xxx                  (Exp_TSS)
873
874    --  Implicit type names
875
876    --    TxxxT   type of literal table for enumeration type xxx     (Sem_Ch3)
877
878    --  (Note: this list is not complete or accurate ???)
879
880    ----------------------
881    -- Get_Attribute_Id --
882    ----------------------
883
884    function Get_Attribute_Id (N : Name_Id) return Attribute_Id is
885    begin
886       return Attribute_Id'Val (N - First_Attribute_Name);
887    end Get_Attribute_Id;
888
889    -----------------------
890    -- Get_Convention_Id --
891    -----------------------
892
893    function Get_Convention_Id (N : Name_Id) return Convention_Id is
894    begin
895       case N is
896          when Name_Ada        => return Convention_Ada;
897          when Name_Assembler  => return Convention_Assembler;
898          when Name_C          => return Convention_C;
899          when Name_CIL        => return Convention_CIL;
900          when Name_COBOL      => return Convention_COBOL;
901          when Name_CPP        => return Convention_CPP;
902          when Name_Fortran    => return Convention_Fortran;
903          when Name_Intrinsic  => return Convention_Intrinsic;
904          when Name_Java       => return Convention_Java;
905          when Name_Stdcall    => return Convention_Stdcall;
906          when Name_Stubbed    => return Convention_Stubbed;
907
908          --  If no direct match, then we must have a convention
909          --  identifier pragma that has specified this name.
910
911          when others          =>
912             for J in 1 .. Convention_Identifiers.Last loop
913                if N = Convention_Identifiers.Table (J).Name then
914                   return Convention_Identifiers.Table (J).Convention;
915                end if;
916             end loop;
917
918             raise Program_Error;
919       end case;
920    end Get_Convention_Id;
921
922    -------------------------
923    -- Get_Convention_Name --
924    -------------------------
925
926    function Get_Convention_Name (C : Convention_Id) return Name_Id is
927    begin
928       case C is
929          when Convention_Ada       => return Name_Ada;
930          when Convention_Assembler => return Name_Assembler;
931          when Convention_C         => return Name_C;
932          when Convention_CIL       => return Name_CIL;
933          when Convention_COBOL     => return Name_COBOL;
934          when Convention_CPP       => return Name_CPP;
935          when Convention_Entry     => return Name_Entry;
936          when Convention_Fortran   => return Name_Fortran;
937          when Convention_Intrinsic => return Name_Intrinsic;
938          when Convention_Java      => return Name_Java;
939          when Convention_Protected => return Name_Protected;
940          when Convention_Stdcall   => return Name_Stdcall;
941          when Convention_Stubbed   => return Name_Stubbed;
942       end case;
943    end Get_Convention_Name;
944
945    ---------------------------
946    -- Get_Locking_Policy_Id --
947    ---------------------------
948
949    function Get_Locking_Policy_Id (N : Name_Id) return Locking_Policy_Id is
950    begin
951       return Locking_Policy_Id'Val (N - First_Locking_Policy_Name);
952    end Get_Locking_Policy_Id;
953
954    -------------------
955    -- Get_Pragma_Id --
956    -------------------
957
958    function Get_Pragma_Id (N : Name_Id) return Pragma_Id is
959    begin
960       if N = Name_AST_Entry then
961          return Pragma_AST_Entry;
962       elsif N = Name_Fast_Math then
963          return Pragma_Fast_Math;
964       elsif N = Name_Interface then
965          return Pragma_Interface;
966       elsif N = Name_Priority then
967          return Pragma_Priority;
968       elsif N = Name_Relative_Deadline then
969          return Pragma_Relative_Deadline;
970       elsif N = Name_Storage_Size then
971          return Pragma_Storage_Size;
972       elsif N = Name_Storage_Unit then
973          return Pragma_Storage_Unit;
974       elsif N not in First_Pragma_Name .. Last_Pragma_Name then
975          return Unknown_Pragma;
976       else
977          return Pragma_Id'Val (N - First_Pragma_Name);
978       end if;
979    end Get_Pragma_Id;
980
981    ---------------------------
982    -- Get_Queuing_Policy_Id --
983    ---------------------------
984
985    function Get_Queuing_Policy_Id (N : Name_Id) return Queuing_Policy_Id is
986    begin
987       return Queuing_Policy_Id'Val (N - First_Queuing_Policy_Name);
988    end Get_Queuing_Policy_Id;
989
990    ------------------------------------
991    -- Get_Task_Dispatching_Policy_Id --
992    ------------------------------------
993
994    function Get_Task_Dispatching_Policy_Id
995      (N : Name_Id) return Task_Dispatching_Policy_Id
996    is
997    begin
998       return Task_Dispatching_Policy_Id'Val
999         (N - First_Task_Dispatching_Policy_Name);
1000    end Get_Task_Dispatching_Policy_Id;
1001
1002    ----------------
1003    -- Initialize --
1004    ----------------
1005
1006    procedure Initialize is
1007       P_Index      : Natural;
1008       Discard_Name : Name_Id;
1009
1010    begin
1011       P_Index := Preset_Names'First;
1012       loop
1013          Name_Len := 0;
1014          while Preset_Names (P_Index) /= '#' loop
1015             Name_Len := Name_Len + 1;
1016             Name_Buffer (Name_Len) := Preset_Names (P_Index);
1017             P_Index := P_Index + 1;
1018          end loop;
1019
1020          --  We do the Name_Find call to enter the name into the table, but
1021          --  we don't need to do anything with the result, since we already
1022          --  initialized all the preset names to have the right value (we
1023          --  are depending on the order of the names and Preset_Names).
1024
1025          Discard_Name := Name_Find;
1026          P_Index := P_Index + 1;
1027          exit when Preset_Names (P_Index) = '#';
1028       end loop;
1029
1030       --  Make sure that number of names in standard table is correct. If
1031       --  this check fails, run utility program XSNAMES to construct a new
1032       --  properly matching version of the body.
1033
1034       pragma Assert (Discard_Name = Last_Predefined_Name);
1035
1036       --  Initialize the convention identifiers table with the standard
1037       --  set of synonyms that we recognize for conventions.
1038
1039       Convention_Identifiers.Init;
1040
1041       Convention_Identifiers.Append ((Name_Asm,         Convention_Assembler));
1042       Convention_Identifiers.Append ((Name_Assembly,    Convention_Assembler));
1043
1044       Convention_Identifiers.Append ((Name_Default,     Convention_C));
1045       Convention_Identifiers.Append ((Name_External,    Convention_C));
1046
1047       Convention_Identifiers.Append ((Name_C_Plus_Plus, Convention_CPP));
1048
1049       Convention_Identifiers.Append ((Name_DLL,         Convention_Stdcall));
1050       Convention_Identifiers.Append ((Name_Win32,       Convention_Stdcall));
1051    end Initialize;
1052
1053    -----------------------
1054    -- Is_Attribute_Name --
1055    -----------------------
1056
1057    function Is_Attribute_Name (N : Name_Id) return Boolean is
1058    begin
1059       return N in First_Attribute_Name .. Last_Attribute_Name;
1060    end Is_Attribute_Name;
1061
1062    ----------------------------------
1063    -- Is_Configuration_Pragma_Name --
1064    ----------------------------------
1065
1066    function Is_Configuration_Pragma_Name (N : Name_Id) return Boolean is
1067    begin
1068       return N in First_Pragma_Name .. Last_Configuration_Pragma_Name
1069         or else N = Name_Fast_Math;
1070    end Is_Configuration_Pragma_Name;
1071
1072    ------------------------
1073    -- Is_Convention_Name --
1074    ------------------------
1075
1076    function Is_Convention_Name (N : Name_Id) return Boolean is
1077    begin
1078       --  Check if this is one of the standard conventions
1079
1080       if N in First_Convention_Name .. Last_Convention_Name
1081         or else N = Name_C
1082       then
1083          return True;
1084
1085       --  Otherwise check if it is in convention identifier table
1086
1087       else
1088          for J in 1 .. Convention_Identifiers.Last loop
1089             if N = Convention_Identifiers.Table (J).Name then
1090                return True;
1091             end if;
1092          end loop;
1093
1094          return False;
1095       end if;
1096    end Is_Convention_Name;
1097
1098    ------------------------------
1099    -- Is_Entity_Attribute_Name --
1100    ------------------------------
1101
1102    function Is_Entity_Attribute_Name (N : Name_Id) return Boolean is
1103    begin
1104       return N in First_Entity_Attribute_Name .. Last_Entity_Attribute_Name;
1105    end Is_Entity_Attribute_Name;
1106
1107    --------------------------------
1108    -- Is_Function_Attribute_Name --
1109    --------------------------------
1110
1111    function Is_Function_Attribute_Name (N : Name_Id) return Boolean is
1112    begin
1113       return N in
1114         First_Renamable_Function_Attribute ..
1115           Last_Renamable_Function_Attribute;
1116    end Is_Function_Attribute_Name;
1117
1118    ---------------------
1119    -- Is_Keyword_Name --
1120    ---------------------
1121
1122    function Is_Keyword_Name (N : Name_Id) return Boolean is
1123    begin
1124       return Get_Name_Table_Byte (N) /= 0
1125         and then (Ada_Version >= Ada_95
1126                   or else N not in Ada_95_Reserved_Words)
1127         and then (Ada_Version >= Ada_05
1128                   or else N not in Ada_2005_Reserved_Words);
1129    end Is_Keyword_Name;
1130
1131    ----------------------------
1132    -- Is_Locking_Policy_Name --
1133    ----------------------------
1134
1135    function Is_Locking_Policy_Name (N : Name_Id) return Boolean is
1136    begin
1137       return N in First_Locking_Policy_Name .. Last_Locking_Policy_Name;
1138    end Is_Locking_Policy_Name;
1139
1140    -----------------------------
1141    -- Is_Operator_Symbol_Name --
1142    -----------------------------
1143
1144    function Is_Operator_Symbol_Name (N : Name_Id) return Boolean is
1145    begin
1146       return N in First_Operator_Name .. Last_Operator_Name;
1147    end Is_Operator_Symbol_Name;
1148
1149    --------------------
1150    -- Is_Pragma_Name --
1151    --------------------
1152
1153    function Is_Pragma_Name (N : Name_Id) return Boolean is
1154    begin
1155       return N in First_Pragma_Name .. Last_Pragma_Name
1156         or else N = Name_AST_Entry
1157         or else N = Name_Fast_Math
1158         or else N = Name_Interface
1159         or else N = Name_Relative_Deadline
1160         or else N = Name_Priority
1161         or else N = Name_Storage_Size
1162         or else N = Name_Storage_Unit;
1163    end Is_Pragma_Name;
1164
1165    ---------------------------------
1166    -- Is_Procedure_Attribute_Name --
1167    ---------------------------------
1168
1169    function Is_Procedure_Attribute_Name (N : Name_Id) return Boolean is
1170    begin
1171       return N in First_Procedure_Attribute .. Last_Procedure_Attribute;
1172    end Is_Procedure_Attribute_Name;
1173
1174    ----------------------------
1175    -- Is_Queuing_Policy_Name --
1176    ----------------------------
1177
1178    function Is_Queuing_Policy_Name (N : Name_Id) return Boolean is
1179    begin
1180       return N in First_Queuing_Policy_Name .. Last_Queuing_Policy_Name;
1181    end Is_Queuing_Policy_Name;
1182
1183    -------------------------------------
1184    -- Is_Task_Dispatching_Policy_Name --
1185    -------------------------------------
1186
1187    function Is_Task_Dispatching_Policy_Name (N : Name_Id) return Boolean is
1188    begin
1189       return N in First_Task_Dispatching_Policy_Name ..
1190                   Last_Task_Dispatching_Policy_Name;
1191    end Is_Task_Dispatching_Policy_Name;
1192
1193    ----------------------------
1194    -- Is_Type_Attribute_Name --
1195    ----------------------------
1196
1197    function Is_Type_Attribute_Name (N : Name_Id) return Boolean is
1198    begin
1199       return N in First_Type_Attribute_Name .. Last_Type_Attribute_Name;
1200    end Is_Type_Attribute_Name;
1201
1202    ----------------------------------
1203    -- Record_Convention_Identifier --
1204    ----------------------------------
1205
1206    procedure Record_Convention_Identifier
1207      (Id         : Name_Id;
1208       Convention : Convention_Id)
1209    is
1210    begin
1211       Convention_Identifiers.Append ((Id, Convention));
1212    end Record_Convention_Identifier;
1213
1214 end Snames;