OSDN Git Service

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