OSDN Git Service

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