OSDN Git Service

PR preprocessor/30805:
[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_switches#" &
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      "runtime_library_dir#" &
780      "unaligned_valid#" &
781      "interface#" &
782      "overriding#" &
783      "synchronized#" &
784      "#";
785
786    ---------------------
787    -- Generated Names --
788    ---------------------
789
790    --  This section lists the various cases of generated names which are
791    --  built from existing names by adding unique leading and/or trailing
792    --  upper case letters. In some cases these names are built recursively,
793    --  in particular names built from types may be built from types which
794    --  themselves have generated names. In this list, xxx represents an
795    --  existing name to which identifying letters are prepended or appended,
796    --  and a trailing n represents a serial number in an external name that
797    --  has some semantic significance (e.g. the n'th index type of an array).
798
799    --    xxxA    access type for formal xxx in entry param record   (Exp_Ch9)
800    --    xxxB    tag table for tagged type xxx                      (Exp_Ch3)
801    --    xxxB    task body procedure for task xxx                   (Exp_Ch9)
802    --    xxxD    dispatch table for tagged type xxx                 (Exp_Ch3)
803    --    xxxD    discriminal for discriminant xxx                   (Sem_Ch3)
804    --    xxxDn   n'th discr check function for rec type xxx         (Exp_Ch3)
805    --    xxxE    elaboration boolean flag for task xxx              (Exp_Ch9)
806    --    xxxE    dispatch table pointer type for tagged type xxx    (Exp_Ch3)
807    --    xxxE    parameters for accept body for entry xxx           (Exp_Ch9)
808    --    xxxFn   n'th primitive of a tagged type (named xxx)        (Exp_Ch3)
809    --    xxxJ    tag table type index for tagged type xxx           (Exp_Ch3)
810    --    xxxM    master Id value for access type xxx                (Exp_Ch3)
811    --    xxxP    tag table pointer type for tagged type xxx         (Exp_Ch3)
812    --    xxxP    parameter record type for entry xxx                (Exp_Ch9)
813    --    xxxPA   access to parameter record type for entry xxx      (Exp_Ch9)
814    --    xxxPn   pointer type for n'th primitive of tagged type xxx (Exp_Ch3)
815    --    xxxR    dispatch table pointer for tagged type xxx         (Exp_Ch3)
816    --    xxxT    tag table type for tagged type xxx                 (Exp_Ch3)
817    --    xxxT    literal table for enumeration type xxx             (Sem_Ch3)
818    --    xxxV    type for task value record for task xxx            (Exp_Ch9)
819    --    xxxX    entry index constant                               (Exp_Ch9)
820    --    xxxY    dispatch table type for tagged type xxx            (Exp_Ch3)
821    --    xxxZ    size variable for task xxx                         (Exp_Ch9)
822
823    --  TSS names
824
825    --    xxxDA   deep adjust routine for type xxx                   (Exp_TSS)
826    --    xxxDF   deep finalize routine for type xxx                 (Exp_TSS)
827    --    xxxDI   deep initialize routine for type xxx               (Exp_TSS)
828    --    xxxEQ   composite equality routine for record type xxx     (Exp_TSS)
829    --    xxxFA   PolyORB/DSA From_Any converter for type xxx        (Exp_TSS)
830    --    xxxIP   initialization procedure for type xxx              (Exp_TSS)
831    --    xxxRA   RAS type access routine for type xxx               (Exp_TSS)
832    --    xxxRD   RAS type dereference routine for type xxx          (Exp_TSS)
833    --    xxxRP   Rep to Pos conversion for enumeration type xxx     (Exp_TSS)
834    --    xxxSA   array/slice assignment for controlled comp. arrays (Exp_TSS)
835    --    xxxSI   stream input attribute subprogram for type xxx     (Exp_TSS)
836    --    xxxSO   stream output attribute subprogram for type xxx    (Exp_TSS)
837    --    xxxSR   stream read attribute subprogram for type xxx      (Exp_TSS)
838    --    xxxSW   stream write attribute subprogram for type xxx     (Exp_TSS)
839    --    xxxTA   PolyORB/DSA To_Any converter for type xxx          (Exp_TSS)
840    --    xxxTC   PolyORB/DSA Typecode for type xxx                  (Exp_TSS)
841
842    --  Implicit type names
843
844    --    TxxxT   type of literal table for enumeration type xxx     (Sem_Ch3)
845
846    --  (Note: this list is not complete or accurate ???)
847
848    ----------------------
849    -- Get_Attribute_Id --
850    ----------------------
851
852    function Get_Attribute_Id (N : Name_Id) return Attribute_Id is
853    begin
854       return Attribute_Id'Val (N - First_Attribute_Name);
855    end Get_Attribute_Id;
856
857    -----------------------
858    -- Get_Convention_Id --
859    -----------------------
860
861    function Get_Convention_Id (N : Name_Id) return Convention_Id is
862    begin
863       case N is
864          when Name_Ada        => return Convention_Ada;
865          when Name_Assembler  => return Convention_Assembler;
866          when Name_C          => return Convention_C;
867          when Name_CIL        => return Convention_CIL;
868          when Name_COBOL      => return Convention_COBOL;
869          when Name_CPP        => return Convention_CPP;
870          when Name_Fortran    => return Convention_Fortran;
871          when Name_Intrinsic  => return Convention_Intrinsic;
872          when Name_Java       => return Convention_Java;
873          when Name_Stdcall    => return Convention_Stdcall;
874          when Name_Stubbed    => return Convention_Stubbed;
875
876          --  If no direct match, then we must have a convention
877          --  identifier pragma that has specified this name.
878
879          when others          =>
880             for J in 1 .. Convention_Identifiers.Last loop
881                if N = Convention_Identifiers.Table (J).Name then
882                   return Convention_Identifiers.Table (J).Convention;
883                end if;
884             end loop;
885
886             raise Program_Error;
887       end case;
888    end Get_Convention_Id;
889
890    -------------------------
891    -- Get_Convention_Name --
892    -------------------------
893
894    function Get_Convention_Name (C : Convention_Id) return Name_Id is
895    begin
896       case C is
897          when Convention_Ada       => return Name_Ada;
898          when Convention_Assembler => return Name_Assembler;
899          when Convention_C         => return Name_C;
900          when Convention_CIL       => return Name_CIL;
901          when Convention_COBOL     => return Name_COBOL;
902          when Convention_CPP       => return Name_CPP;
903          when Convention_Entry     => return Name_Entry;
904          when Convention_Fortran   => return Name_Fortran;
905          when Convention_Intrinsic => return Name_Intrinsic;
906          when Convention_Java      => return Name_Java;
907          when Convention_Protected => return Name_Protected;
908          when Convention_Stdcall   => return Name_Stdcall;
909          when Convention_Stubbed   => return Name_Stubbed;
910       end case;
911    end Get_Convention_Name;
912
913    ---------------------------
914    -- Get_Locking_Policy_Id --
915    ---------------------------
916
917    function Get_Locking_Policy_Id (N : Name_Id) return Locking_Policy_Id is
918    begin
919       return Locking_Policy_Id'Val (N - First_Locking_Policy_Name);
920    end Get_Locking_Policy_Id;
921
922    -------------------
923    -- Get_Pragma_Id --
924    -------------------
925
926    function Get_Pragma_Id (N : Name_Id) return Pragma_Id is
927    begin
928       if N = Name_AST_Entry then
929          return Pragma_AST_Entry;
930       elsif N = Name_Interface then
931          return Pragma_Interface;
932       elsif N = Name_Priority then
933          return Pragma_Priority;
934       elsif N = Name_Storage_Size then
935          return Pragma_Storage_Size;
936       elsif N = Name_Storage_Unit then
937          return Pragma_Storage_Unit;
938       elsif N not in First_Pragma_Name .. Last_Pragma_Name then
939          return Unknown_Pragma;
940       else
941          return Pragma_Id'Val (N - First_Pragma_Name);
942       end if;
943    end Get_Pragma_Id;
944
945    ---------------------------
946    -- Get_Queuing_Policy_Id --
947    ---------------------------
948
949    function Get_Queuing_Policy_Id (N : Name_Id) return Queuing_Policy_Id is
950    begin
951       return Queuing_Policy_Id'Val (N - First_Queuing_Policy_Name);
952    end Get_Queuing_Policy_Id;
953
954    ------------------------------------
955    -- Get_Task_Dispatching_Policy_Id --
956    ------------------------------------
957
958    function Get_Task_Dispatching_Policy_Id (N : Name_Id)
959      return Task_Dispatching_Policy_Id is
960    begin
961       return Task_Dispatching_Policy_Id'Val
962         (N - First_Task_Dispatching_Policy_Name);
963    end Get_Task_Dispatching_Policy_Id;
964
965    ----------------
966    -- Initialize --
967    ----------------
968
969    procedure Initialize is
970       P_Index      : Natural;
971       Discard_Name : Name_Id;
972
973    begin
974       P_Index := Preset_Names'First;
975
976       loop
977          Name_Len := 0;
978
979          while Preset_Names (P_Index) /= '#' loop
980             Name_Len := Name_Len + 1;
981             Name_Buffer (Name_Len) := Preset_Names (P_Index);
982             P_Index := P_Index + 1;
983          end loop;
984
985          --  We do the Name_Find call to enter the name into the table, but
986          --  we don't need to do anything with the result, since we already
987          --  initialized all the preset names to have the right value (we
988          --  are depending on the order of the names and Preset_Names).
989
990          Discard_Name := Name_Find;
991          P_Index := P_Index + 1;
992          exit when Preset_Names (P_Index) = '#';
993       end loop;
994
995       --  Make sure that number of names in standard table is correct. If
996       --  this check fails, run utility program XSNAMES to construct a new
997       --  properly matching version of the body.
998
999       pragma Assert (Discard_Name = Last_Predefined_Name);
1000
1001       --  Initialize the convention identifiers table with the standard
1002       --  set of synonyms that we recognize for conventions.
1003
1004       Convention_Identifiers.Init;
1005
1006       Convention_Identifiers.Append ((Name_Asm,         Convention_Assembler));
1007       Convention_Identifiers.Append ((Name_Assembly,    Convention_Assembler));
1008
1009       Convention_Identifiers.Append ((Name_Default,     Convention_C));
1010       Convention_Identifiers.Append ((Name_External,    Convention_C));
1011
1012       Convention_Identifiers.Append ((Name_C_Plus_Plus, Convention_CPP));
1013
1014       Convention_Identifiers.Append ((Name_DLL,         Convention_Stdcall));
1015       Convention_Identifiers.Append ((Name_Win32,       Convention_Stdcall));
1016    end Initialize;
1017
1018    -----------------------
1019    -- Is_Attribute_Name --
1020    -----------------------
1021
1022    function Is_Attribute_Name (N : Name_Id) return Boolean is
1023    begin
1024       return N in First_Attribute_Name .. Last_Attribute_Name;
1025    end Is_Attribute_Name;
1026
1027    ------------------------
1028    -- Is_Convention_Name --
1029    ------------------------
1030
1031    function Is_Convention_Name (N : Name_Id) return Boolean is
1032    begin
1033       --  Check if this is one of the standard conventions
1034
1035       if N in First_Convention_Name .. Last_Convention_Name
1036         or else N = Name_C
1037       then
1038          return True;
1039
1040       --  Otherwise check if it is in convention identifier table
1041
1042       else
1043          for J in 1 .. Convention_Identifiers.Last loop
1044             if N = Convention_Identifiers.Table (J).Name then
1045                return True;
1046             end if;
1047          end loop;
1048
1049          return False;
1050       end if;
1051    end Is_Convention_Name;
1052
1053    ------------------------------
1054    -- Is_Entity_Attribute_Name --
1055    ------------------------------
1056
1057    function Is_Entity_Attribute_Name (N : Name_Id) return Boolean is
1058    begin
1059       return N in First_Entity_Attribute_Name .. Last_Entity_Attribute_Name;
1060    end Is_Entity_Attribute_Name;
1061
1062    --------------------------------
1063    -- Is_Function_Attribute_Name --
1064    --------------------------------
1065
1066    function Is_Function_Attribute_Name (N : Name_Id) return Boolean is
1067    begin
1068       return N in
1069         First_Renamable_Function_Attribute ..
1070           Last_Renamable_Function_Attribute;
1071    end Is_Function_Attribute_Name;
1072
1073    ---------------------
1074    -- Is_Keyword_Name --
1075    ---------------------
1076
1077    function Is_Keyword_Name (N : Name_Id) return Boolean is
1078    begin
1079       return Get_Name_Table_Byte (N) /= 0
1080         and then (Ada_Version >= Ada_95
1081                   or else N not in Ada_95_Reserved_Words)
1082         and then (Ada_Version >= Ada_05
1083                   or else N not in Ada_2005_Reserved_Words);
1084    end Is_Keyword_Name;
1085
1086    ----------------------------
1087    -- Is_Locking_Policy_Name --
1088    ----------------------------
1089
1090    function Is_Locking_Policy_Name (N : Name_Id) return Boolean is
1091    begin
1092       return N in First_Locking_Policy_Name .. Last_Locking_Policy_Name;
1093    end Is_Locking_Policy_Name;
1094
1095    -----------------------------
1096    -- Is_Operator_Symbol_Name --
1097    -----------------------------
1098
1099    function Is_Operator_Symbol_Name (N : Name_Id) return Boolean is
1100    begin
1101       return N in First_Operator_Name .. Last_Operator_Name;
1102    end Is_Operator_Symbol_Name;
1103
1104    --------------------
1105    -- Is_Pragma_Name --
1106    --------------------
1107
1108    function Is_Pragma_Name (N : Name_Id) return Boolean is
1109    begin
1110       return N in First_Pragma_Name .. Last_Pragma_Name
1111         or else N = Name_AST_Entry
1112         or else N = Name_Interface
1113         or else N = Name_Priority
1114         or else N = Name_Storage_Size
1115         or else N = Name_Storage_Unit;
1116    end Is_Pragma_Name;
1117
1118    ---------------------------------
1119    -- Is_Procedure_Attribute_Name --
1120    ---------------------------------
1121
1122    function Is_Procedure_Attribute_Name (N : Name_Id) return Boolean is
1123    begin
1124       return N in First_Procedure_Attribute .. Last_Procedure_Attribute;
1125    end Is_Procedure_Attribute_Name;
1126
1127    ----------------------------
1128    -- Is_Queuing_Policy_Name --
1129    ----------------------------
1130
1131    function Is_Queuing_Policy_Name (N : Name_Id) return Boolean is
1132    begin
1133       return N in First_Queuing_Policy_Name .. Last_Queuing_Policy_Name;
1134    end Is_Queuing_Policy_Name;
1135
1136    -------------------------------------
1137    -- Is_Task_Dispatching_Policy_Name --
1138    -------------------------------------
1139
1140    function Is_Task_Dispatching_Policy_Name (N : Name_Id) return Boolean is
1141    begin
1142       return N in First_Task_Dispatching_Policy_Name ..
1143                   Last_Task_Dispatching_Policy_Name;
1144    end Is_Task_Dispatching_Policy_Name;
1145
1146    ----------------------------
1147    -- Is_Type_Attribute_Name --
1148    ----------------------------
1149
1150    function Is_Type_Attribute_Name (N : Name_Id) return Boolean is
1151    begin
1152       return N in First_Type_Attribute_Name .. Last_Type_Attribute_Name;
1153    end Is_Type_Attribute_Name;
1154
1155    ----------------------------------
1156    -- Record_Convention_Identifier --
1157    ----------------------------------
1158
1159    procedure Record_Convention_Identifier
1160      (Id         : Name_Id;
1161       Convention : Convention_Id)
1162    is
1163    begin
1164       Convention_Identifiers.Append ((Id, Convention));
1165    end Record_Convention_Identifier;
1166
1167 end Snames;