OSDN Git Service

* Makefile.in (reload1.o-warn): Remove.
[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
37 package body Snames is
38
39    --  Table used to record convention identifiers
40
41    type Convention_Id_Entry is record
42       Name       : Name_Id;
43       Convention : Convention_Id;
44    end record;
45
46    package Convention_Identifiers is new Table.Table (
47      Table_Component_Type => Convention_Id_Entry,
48      Table_Index_Type     => Int,
49      Table_Low_Bound      => 1,
50      Table_Initial        => 50,
51      Table_Increment      => 200,
52      Table_Name           => "Name_Convention_Identifiers");
53
54    --  Table of names to be set by Initialize. Each name is terminated by a
55    --  single #, and the end of the list is marked by a null entry, i.e. by
56    --  two # marks in succession. Note that the table does not include the
57    --  entries for a-z, since these are initialized by Namet itself.
58
59    Preset_Names : constant String :=
60      "_parent#" &
61      "_tag#" &
62      "off#" &
63      "space#" &
64      "time#" &
65      "_abort_signal#" &
66      "_alignment#" &
67      "_assign#" &
68      "_atcb#" &
69      "_chain#" &
70      "_clean#" &
71      "_controller#" &
72      "_entry_bodies#" &
73      "_expunge#" &
74      "_final_list#" &
75      "_idepth#" &
76      "_init#" &
77      "_local_final_list#" &
78      "_master#" &
79      "_object#" &
80      "_priority#" &
81      "_process_atsd#" &
82      "_secondary_stack#" &
83      "_service#" &
84      "_size#" &
85      "_stack#" &
86      "_tags#" &
87      "_task#" &
88      "_task_id#" &
89      "_task_info#" &
90      "_task_name#" &
91      "_trace_sp#" &
92      "_disp_asynchronous_select#" &
93      "_disp_conditional_select#" &
94      "_disp_get_prim_op_kind#" &
95      "_disp_timed_select#" &
96      "_disp_get_task_id#" &
97      "initialize#" &
98      "adjust#" &
99      "finalize#" &
100      "next#" &
101      "prev#" &
102      "_typecode#" &
103      "_from_any#" &
104      "_to_any#" &
105      "allocate#" &
106      "deallocate#" &
107      "dereference#" &
108      "decimal_io#" &
109      "enumeration_io#" &
110      "fixed_io#" &
111      "float_io#" &
112      "integer_io#" &
113      "modular_io#" &
114      "const#" &
115      "<error>#" &
116      "go#" &
117      "put#" &
118      "put_line#" &
119      "to#" &
120      "exception_traces#" &
121      "finalization#" &
122      "finalization_root#" &
123      "interfaces#" &
124      "most_recent_exception#" &
125      "standard#" &
126      "system#" &
127      "text_io#" &
128      "wide_text_io#" &
129      "wide_wide_text_io#" &
130      "no_dsa#" &
131      "garlic_dsa#" &
132      "polyorb_dsa#" &
133      "addr#" &
134      "async#" &
135      "get_active_partition_id#" &
136      "get_rci_package_receiver#" &
137      "get_rci_package_ref#" &
138      "origin#" &
139      "params#" &
140      "partition#" &
141      "partition_interface#" &
142      "ras#" &
143      "_call#" &
144      "rci_name#" &
145      "receiver#" &
146      "result#" &
147      "rpc#" &
148      "subp_id#" &
149      "operation#" &
150      "argument#" &
151      "arg_modes#" &
152      "handler#" &
153      "target#" &
154      "req#" &
155      "obj_typecode#" &
156      "stub#" &
157      "Oabs#" &
158      "Oand#" &
159      "Omod#" &
160      "Onot#" &
161      "Oor#" &
162      "Orem#" &
163      "Oxor#" &
164      "Oeq#" &
165      "One#" &
166      "Olt#" &
167      "Ole#" &
168      "Ogt#" &
169      "Oge#" &
170      "Oadd#" &
171      "Osubtract#" &
172      "Oconcat#" &
173      "Omultiply#" &
174      "Odivide#" &
175      "Oexpon#" &
176      "ada_83#" &
177      "ada_95#" &
178      "ada_05#" &
179      "ada_2005#" &
180      "assertion_policy#" &
181      "c_pass_by_copy#" &
182      "compile_time_error#" &
183      "compile_time_warning#" &
184      "component_alignment#" &
185      "convention_identifier#" &
186      "debug_policy#" &
187      "detect_blocking#" &
188      "discard_names#" &
189      "elaboration_checks#" &
190      "eliminate#" &
191      "extend_system#" &
192      "extensions_allowed#" &
193      "external_name_casing#" &
194      "float_representation#" &
195      "initialize_scalars#" &
196      "interrupt_state#" &
197      "license#" &
198      "locking_policy#" &
199      "long_float#" &
200      "no_run_time#" &
201      "no_strict_aliasing#" &
202      "normalize_scalars#" &
203      "polling#" &
204      "persistent_bss#" &
205      "priority_specific_dispatching#" &
206      "profile#" &
207      "profile_warnings#" &
208      "propagate_exceptions#" &
209      "queuing_policy#" &
210      "ravenscar#" &
211      "restricted_run_time#" &
212      "restrictions#" &
213      "restriction_warnings#" &
214      "reviewable#" &
215      "source_file_name#" &
216      "source_file_name_project#" &
217      "style_checks#" &
218      "suppress#" &
219      "suppress_exception_locations#" &
220      "task_dispatching_policy#" &
221      "universal_data#" &
222      "unsuppress#" &
223      "use_vads_size#" &
224      "validity_checks#" &
225      "warnings#" &
226      "wide_character_encoding#" &
227      "abort_defer#" &
228      "all_calls_remote#" &
229      "annotate#" &
230      "assert#" &
231      "asynchronous#" &
232      "atomic#" &
233      "atomic_components#" &
234      "attach_handler#" &
235      "cil_constructor#" &
236      "comment#" &
237      "common_object#" &
238      "complete_representation#" &
239      "complex_representation#" &
240      "controlled#" &
241      "convention#" &
242      "cpp_class#" &
243      "cpp_constructor#" &
244      "cpp_virtual#" &
245      "cpp_vtable#" &
246      "debug#" &
247      "elaborate#" &
248      "elaborate_all#" &
249      "elaborate_body#" &
250      "export#" &
251      "export_exception#" &
252      "export_function#" &
253      "export_object#" &
254      "export_procedure#" &
255      "export_value#" &
256      "export_valued_procedure#" &
257      "external#" &
258      "finalize_storage_only#" &
259      "ident#" &
260      "import#" &
261      "import_exception#" &
262      "import_function#" &
263      "import_object#" &
264      "import_procedure#" &
265      "import_valued_procedure#" &
266      "inline#" &
267      "inline_always#" &
268      "inline_generic#" &
269      "inspection_point#" &
270      "interface_name#" &
271      "interrupt_handler#" &
272      "interrupt_priority#" &
273      "java_constructor#" &
274      "java_interface#" &
275      "keep_names#" &
276      "link_with#" &
277      "linker_alias#" &
278      "linker_constructor#" &
279      "linker_destructor#" &
280      "linker_options#" &
281      "linker_section#" &
282      "list#" &
283      "machine_attribute#" &
284      "main#" &
285      "main_storage#" &
286      "memory_size#" &
287      "no_body#" &
288      "no_return#" &
289      "obsolescent#" &
290      "optimize#" &
291      "pack#" &
292      "page#" &
293      "passive#" &
294      "preelaborable_initialization#" &
295      "preelaborate#" &
296      "preelaborate_05#" &
297      "psect_object#" &
298      "pure#" &
299      "pure_05#" &
300      "pure_function#" &
301      "remote_call_interface#" &
302      "remote_types#" &
303      "share_generic#" &
304      "shared#" &
305      "shared_passive#" &
306      "source_reference#" &
307      "static_elaboration_desired#" &
308      "stream_convert#" &
309      "subtitle#" &
310      "suppress_all#" &
311      "suppress_debug_info#" &
312      "suppress_initialization#" &
313      "system_name#" &
314      "task_info#" &
315      "task_name#" &
316      "task_storage#" &
317      "time_slice#" &
318      "title#" &
319      "unchecked_union#" &
320      "unimplemented_unit#" &
321      "universal_aliasing#" &
322      "unreferenced#" &
323      "unreferenced_objects#" &
324      "unreserve_all_interrupts#" &
325      "volatile#" &
326      "volatile_components#" &
327      "weak_external#" &
328      "ada#" &
329      "assembler#" &
330      "cil#" &
331      "cobol#" &
332      "cpp#" &
333      "fortran#" &
334      "intrinsic#" &
335      "java#" &
336      "stdcall#" &
337      "stubbed#" &
338      "asm#" &
339      "assembly#" &
340      "default#" &
341      "c_plus_plus#" &
342      "dll#" &
343      "win32#" &
344      "as_is#" &
345      "attribute_name#" &
346      "body_file_name#" &
347      "boolean_entry_barriers#" &
348      "check#" &
349      "casing#" &
350      "code#" &
351      "component#" &
352      "component_size_4#" &
353      "copy#" &
354      "d_float#" &
355      "descriptor#" &
356      "dot_replacement#" &
357      "dynamic#" &
358      "entity#" &
359      "entry_count#" &
360      "external_name#" &
361      "first_optional_parameter#" &
362      "form#" &
363      "g_float#" &
364      "gcc#" &
365      "gnat#" &
366      "gpl#" &
367      "ieee_float#" &
368      "ignore#" &
369      "info#" &
370      "internal#" &
371      "link_name#" &
372      "lowercase#" &
373      "max_entry_queue_depth#" &
374      "max_entry_queue_length#" &
375      "max_size#" &
376      "mechanism#" &
377      "message#" &
378      "mixedcase#" &
379      "modified_gpl#" &
380      "name#" &
381      "nca#" &
382      "no#" &
383      "no_dependence#" &
384      "no_dynamic_attachment#" &
385      "no_dynamic_interrupts#" &
386      "no_requeue#" &
387      "no_requeue_statements#" &
388      "no_task_attributes#" &
389      "no_task_attributes_package#" &
390      "on#" &
391      "parameter_types#" &
392      "reference#" &
393      "restricted#" &
394      "result_mechanism#" &
395      "result_type#" &
396      "runtime#" &
397      "sb#" &
398      "secondary_stack_size#" &
399      "section#" &
400      "semaphore#" &
401      "simple_barriers#" &
402      "spec_file_name#" &
403      "state#" &
404      "static#" &
405      "stack_size#" &
406      "subunit_file_name#" &
407      "task_stack_size_default#" &
408      "task_type#" &
409      "time_slicing_enabled#" &
410      "top_guard#" &
411      "uba#" &
412      "ubs#" &
413      "ubsb#" &
414      "unit_name#" &
415      "unknown#" &
416      "unrestricted#" &
417      "uppercase#" &
418      "user#" &
419      "vax_float#" &
420      "vms#" &
421      "vtable_ptr#" &
422      "working_storage#" &
423      "abort_signal#" &
424      "access#" &
425      "address#" &
426      "address_size#" &
427      "aft#" &
428      "alignment#" &
429      "asm_input#" &
430      "asm_output#" &
431      "ast_entry#" &
432      "bit#" &
433      "bit_order#" &
434      "bit_position#" &
435      "body_version#" &
436      "callable#" &
437      "caller#" &
438      "code_address#" &
439      "component_size#" &
440      "compose#" &
441      "constrained#" &
442      "count#" &
443      "default_bit_order#" &
444      "definite#" &
445      "delta#" &
446      "denorm#" &
447      "digits#" &
448      "elaborated#" &
449      "emax#" &
450      "enum_rep#" &
451      "epsilon#" &
452      "exponent#" &
453      "external_tag#" &
454      "first#" &
455      "first_bit#" &
456      "fixed_value#" &
457      "fore#" &
458      "has_access_values#" &
459      "has_discriminants#" &
460      "identity#" &
461      "img#" &
462      "integer_value#" &
463      "large#" &
464      "last#" &
465      "last_bit#" &
466      "leading_part#" &
467      "length#" &
468      "machine_emax#" &
469      "machine_emin#" &
470      "machine_mantissa#" &
471      "machine_overflows#" &
472      "machine_radix#" &
473      "machine_rounding#" &
474      "machine_rounds#" &
475      "machine_size#" &
476      "mantissa#" &
477      "max_size_in_storage_elements#" &
478      "maximum_alignment#" &
479      "mechanism_code#" &
480      "mod#" &
481      "model_emin#" &
482      "model_epsilon#" &
483      "model_mantissa#" &
484      "model_small#" &
485      "modulus#" &
486      "null_parameter#" &
487      "object_size#" &
488      "partition_id#" &
489      "passed_by_reference#" &
490      "pool_address#" &
491      "pos#" &
492      "position#" &
493      "priority#" &
494      "range#" &
495      "range_length#" &
496      "round#" &
497      "safe_emax#" &
498      "safe_first#" &
499      "safe_large#" &
500      "safe_last#" &
501      "safe_small#" &
502      "scale#" &
503      "scaling#" &
504      "signed_zeros#" &
505      "size#" &
506      "small#" &
507      "storage_size#" &
508      "storage_unit#" &
509      "stream_size#" &
510      "tag#" &
511      "target_name#" &
512      "terminated#" &
513      "to_address#" &
514      "type_class#" &
515      "uet_address#" &
516      "unbiased_rounding#" &
517      "unchecked_access#" &
518      "unconstrained_array#" &
519      "universal_literal_string#" &
520      "unrestricted_access#" &
521      "vads_size#" &
522      "val#" &
523      "valid#" &
524      "value_size#" &
525      "version#" &
526      "wchar_t_size#" &
527      "wide_wide_width#" &
528      "wide_width#" &
529      "width#" &
530      "word_size#" &
531      "adjacent#" &
532      "ceiling#" &
533      "copy_sign#" &
534      "floor#" &
535      "fraction#" &
536      "image#" &
537      "input#" &
538      "machine#" &
539      "max#" &
540      "min#" &
541      "model#" &
542      "pred#" &
543      "remainder#" &
544      "rounding#" &
545      "succ#" &
546      "truncation#" &
547      "value#" &
548      "wide_image#" &
549      "wide_wide_image#" &
550      "wide_value#" &
551      "wide_wide_value#" &
552      "output#" &
553      "read#" &
554      "write#" &
555      "elab_body#" &
556      "elab_spec#" &
557      "storage_pool#" &
558      "base#" &
559      "class#" &
560      "stub_type#" &
561      "ceiling_locking#" &
562      "inheritance_locking#" &
563      "fifo_queuing#" &
564      "priority_queuing#" &
565      "edf_across_priorities#" &
566      "fifo_within_priorities#" &
567      "non_preemptive_within_priorities#" &
568      "round_robin_within_priorities#" &
569      "access_check#" &
570      "accessibility_check#" &
571      "alignment_check#" &
572      "discriminant_check#" &
573      "division_check#" &
574      "elaboration_check#" &
575      "index_check#" &
576      "length_check#" &
577      "overflow_check#" &
578      "range_check#" &
579      "storage_check#" &
580      "tag_check#" &
581      "validity_check#" &
582      "all_checks#" &
583      "abort#" &
584      "abs#" &
585      "accept#" &
586      "and#" &
587      "all#" &
588      "array#" &
589      "at#" &
590      "begin#" &
591      "body#" &
592      "case#" &
593      "constant#" &
594      "declare#" &
595      "delay#" &
596      "do#" &
597      "else#" &
598      "elsif#" &
599      "end#" &
600      "entry#" &
601      "exception#" &
602      "exit#" &
603      "for#" &
604      "function#" &
605      "generic#" &
606      "goto#" &
607      "if#" &
608      "in#" &
609      "is#" &
610      "limited#" &
611      "loop#" &
612      "new#" &
613      "not#" &
614      "null#" &
615      "of#" &
616      "or#" &
617      "others#" &
618      "out#" &
619      "package#" &
620      "pragma#" &
621      "private#" &
622      "procedure#" &
623      "raise#" &
624      "record#" &
625      "rem#" &
626      "renames#" &
627      "return#" &
628      "reverse#" &
629      "select#" &
630      "separate#" &
631      "subtype#" &
632      "task#" &
633      "terminate#" &
634      "then#" &
635      "type#" &
636      "use#" &
637      "when#" &
638      "while#" &
639      "with#" &
640      "xor#" &
641      "divide#" &
642      "enclosing_entity#" &
643      "exception_information#" &
644      "exception_message#" &
645      "exception_name#" &
646      "file#" &
647      "generic_dispatching_constructor#" &
648      "import_address#" &
649      "import_largest_value#" &
650      "import_value#" &
651      "is_negative#" &
652      "line#" &
653      "rotate_left#" &
654      "rotate_right#" &
655      "shift_left#" &
656      "shift_right#" &
657      "shift_right_arithmetic#" &
658      "source_location#" &
659      "unchecked_conversion#" &
660      "unchecked_deallocation#" &
661      "to_pointer#" &
662      "free#" &
663      "abstract#" &
664      "aliased#" &
665      "protected#" &
666      "until#" &
667      "requeue#" &
668      "tagged#" &
669      "raise_exception#" &
670      "ada_roots#" &
671      "archive_builder#" &
672      "archive_indexer#" &
673      "archive_suffix#" &
674      "binder#" &
675      "binder_driver#" &
676      "binder_prefix#" &
677      "body_suffix#" &
678      "builder#" &
679      "builder_switches#" &
680      "compiler#" &
681      "compiler_driver#" &
682      "compiler_kind#" &
683      "compiler_pic_option#" &
684      "compute_dependency#" &
685      "config_body_file_name#" &
686      "config_body_file_name_pattern#" &
687      "config_file_switches#" &
688      "config_file_unique#" &
689      "config_spec_file_name#" &
690      "config_spec_file_name_pattern#" &
691      "cross_reference#" &
692      "default_builder_switches#" &
693      "default_global_compiler_switches#" &
694      "default_language#" &
695      "default_linker#" &
696      "default_minimum_linker_options#" &
697      "default_switches#" &
698      "dependency_file_kind#" &
699      "dependency_option#" &
700      "exec_dir#" &
701      "executable#" &
702      "executable_suffix#" &
703      "extends#" &
704      "externally_built#" &
705      "finder#" &
706      "global_compiler_switches#" &
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_options#" &
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      "minimum_binder_options#" &
751      "minimum_compiler_options#" &
752      "minimum_linker_options#" &
753      "naming#" &
754      "objects_path#" &
755      "objects_path_file#" &
756      "object_dir#" &
757      "pretty_printer#" &
758      "project#" &
759      "roots#" &
760      "run_path_option#" &
761      "runtime_project#" &
762      "shared_library_minimum_options#" &
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_Check_Id --
858    ------------------
859
860    function Get_Check_Id (N : Name_Id) return Check_Id is
861    begin
862       return Check_Id'Val (N - First_Check_Name);
863    end Get_Check_Id;
864
865    -----------------------
866    -- Get_Convention_Id --
867    -----------------------
868
869    function Get_Convention_Id (N : Name_Id) return Convention_Id is
870    begin
871       case N is
872          when Name_Ada        => return Convention_Ada;
873          when Name_Assembler  => return Convention_Assembler;
874          when Name_C          => return Convention_C;
875          when Name_CIL        => return Convention_CIL;
876          when Name_COBOL      => return Convention_COBOL;
877          when Name_CPP        => return Convention_CPP;
878          when Name_Fortran    => return Convention_Fortran;
879          when Name_Intrinsic  => return Convention_Intrinsic;
880          when Name_Java       => return Convention_Java;
881          when Name_Stdcall    => return Convention_Stdcall;
882          when Name_Stubbed    => return Convention_Stubbed;
883
884          --  If no direct match, then we must have a convention
885          --  identifier pragma that has specified this name.
886
887          when others          =>
888             for J in 1 .. Convention_Identifiers.Last loop
889                if N = Convention_Identifiers.Table (J).Name then
890                   return Convention_Identifiers.Table (J).Convention;
891                end if;
892             end loop;
893
894             raise Program_Error;
895       end case;
896    end Get_Convention_Id;
897
898    -------------------------
899    -- Get_Convention_Name --
900    -------------------------
901
902    function Get_Convention_Name (C : Convention_Id) return Name_Id is
903    begin
904       case C is
905          when Convention_Ada       => return Name_Ada;
906          when Convention_Assembler => return Name_Assembler;
907          when Convention_C         => return Name_C;
908          when Convention_CIL       => return Name_CIL;
909          when Convention_COBOL     => return Name_COBOL;
910          when Convention_CPP       => return Name_CPP;
911          when Convention_Entry     => return Name_Entry;
912          when Convention_Fortran   => return Name_Fortran;
913          when Convention_Intrinsic => return Name_Intrinsic;
914          when Convention_Java      => return Name_Java;
915          when Convention_Protected => return Name_Protected;
916          when Convention_Stdcall   => return Name_Stdcall;
917          when Convention_Stubbed   => return Name_Stubbed;
918       end case;
919    end Get_Convention_Name;
920
921    ---------------------------
922    -- Get_Locking_Policy_Id --
923    ---------------------------
924
925    function Get_Locking_Policy_Id (N : Name_Id) return Locking_Policy_Id is
926    begin
927       return Locking_Policy_Id'Val (N - First_Locking_Policy_Name);
928    end Get_Locking_Policy_Id;
929
930    -------------------
931    -- Get_Pragma_Id --
932    -------------------
933
934    function Get_Pragma_Id (N : Name_Id) return Pragma_Id is
935    begin
936       if N = Name_AST_Entry then
937          return Pragma_AST_Entry;
938       elsif N = Name_Interface then
939          return Pragma_Interface;
940       elsif N = Name_Priority then
941          return Pragma_Priority;
942       elsif N = Name_Storage_Size then
943          return Pragma_Storage_Size;
944       elsif N = Name_Storage_Unit then
945          return Pragma_Storage_Unit;
946       elsif N not in First_Pragma_Name .. Last_Pragma_Name then
947          return Unknown_Pragma;
948       else
949          return Pragma_Id'Val (N - First_Pragma_Name);
950       end if;
951    end Get_Pragma_Id;
952
953    ---------------------------
954    -- Get_Queuing_Policy_Id --
955    ---------------------------
956
957    function Get_Queuing_Policy_Id (N : Name_Id) return Queuing_Policy_Id is
958    begin
959       return Queuing_Policy_Id'Val (N - First_Queuing_Policy_Name);
960    end Get_Queuing_Policy_Id;
961
962    ------------------------------------
963    -- Get_Task_Dispatching_Policy_Id --
964    ------------------------------------
965
966    function Get_Task_Dispatching_Policy_Id (N : Name_Id)
967      return Task_Dispatching_Policy_Id is
968    begin
969       return Task_Dispatching_Policy_Id'Val
970         (N - First_Task_Dispatching_Policy_Name);
971    end Get_Task_Dispatching_Policy_Id;
972
973    ----------------
974    -- Initialize --
975    ----------------
976
977    procedure Initialize is
978       P_Index      : Natural;
979       Discard_Name : Name_Id;
980
981    begin
982       P_Index := Preset_Names'First;
983
984       loop
985          Name_Len := 0;
986
987          while Preset_Names (P_Index) /= '#' loop
988             Name_Len := Name_Len + 1;
989             Name_Buffer (Name_Len) := Preset_Names (P_Index);
990             P_Index := P_Index + 1;
991          end loop;
992
993          --  We do the Name_Find call to enter the name into the table, but
994          --  we don't need to do anything with the result, since we already
995          --  initialized all the preset names to have the right value (we
996          --  are depending on the order of the names and Preset_Names).
997
998          Discard_Name := Name_Find;
999          P_Index := P_Index + 1;
1000          exit when Preset_Names (P_Index) = '#';
1001       end loop;
1002
1003       --  Make sure that number of names in standard table is correct. If
1004       --  this check fails, run utility program XSNAMES to construct a new
1005       --  properly matching version of the body.
1006
1007       pragma Assert (Discard_Name = Last_Predefined_Name);
1008
1009       --  Initialize the convention identifiers table with the standard
1010       --  set of synonyms that we recognize for conventions.
1011
1012       Convention_Identifiers.Init;
1013
1014       Convention_Identifiers.Append ((Name_Asm,         Convention_Assembler));
1015       Convention_Identifiers.Append ((Name_Assembly,    Convention_Assembler));
1016
1017       Convention_Identifiers.Append ((Name_Default,     Convention_C));
1018       Convention_Identifiers.Append ((Name_External,    Convention_C));
1019
1020       Convention_Identifiers.Append ((Name_C_Plus_Plus, Convention_CPP));
1021
1022       Convention_Identifiers.Append ((Name_DLL,         Convention_Stdcall));
1023       Convention_Identifiers.Append ((Name_Win32,       Convention_Stdcall));
1024    end Initialize;
1025
1026    -----------------------
1027    -- Is_Attribute_Name --
1028    -----------------------
1029
1030    function Is_Attribute_Name (N : Name_Id) return Boolean is
1031    begin
1032       return N in First_Attribute_Name .. Last_Attribute_Name;
1033    end Is_Attribute_Name;
1034
1035    -------------------
1036    -- Is_Check_Name --
1037    -------------------
1038
1039    function Is_Check_Name (N : Name_Id) return Boolean is
1040    begin
1041       return N in First_Check_Name .. Last_Check_Name;
1042    end Is_Check_Name;
1043
1044    ------------------------
1045    -- Is_Convention_Name --
1046    ------------------------
1047
1048    function Is_Convention_Name (N : Name_Id) return Boolean is
1049    begin
1050       --  Check if this is one of the standard conventions
1051
1052       if N in First_Convention_Name .. Last_Convention_Name
1053         or else N = Name_C
1054       then
1055          return True;
1056
1057       --  Otherwise check if it is in convention identifier table
1058
1059       else
1060          for J in 1 .. Convention_Identifiers.Last loop
1061             if N = Convention_Identifiers.Table (J).Name then
1062                return True;
1063             end if;
1064          end loop;
1065
1066          return False;
1067       end if;
1068    end Is_Convention_Name;
1069
1070    ------------------------------
1071    -- Is_Entity_Attribute_Name --
1072    ------------------------------
1073
1074    function Is_Entity_Attribute_Name (N : Name_Id) return Boolean is
1075    begin
1076       return N in First_Entity_Attribute_Name .. Last_Entity_Attribute_Name;
1077    end Is_Entity_Attribute_Name;
1078
1079    --------------------------------
1080    -- Is_Function_Attribute_Name --
1081    --------------------------------
1082
1083    function Is_Function_Attribute_Name (N : Name_Id) return Boolean is
1084    begin
1085       return N in
1086         First_Renamable_Function_Attribute ..
1087           Last_Renamable_Function_Attribute;
1088    end Is_Function_Attribute_Name;
1089
1090    ---------------------
1091    -- Is_Keyword_Name --
1092    ---------------------
1093
1094    function Is_Keyword_Name (N : Name_Id) return Boolean is
1095    begin
1096       return Get_Name_Table_Byte (N) /= 0
1097         and then (Ada_Version >= Ada_95
1098                   or else N not in Ada_95_Reserved_Words)
1099         and then (Ada_Version >= Ada_05
1100                   or else N not in Ada_2005_Reserved_Words);
1101    end Is_Keyword_Name;
1102
1103    ----------------------------
1104    -- Is_Locking_Policy_Name --
1105    ----------------------------
1106
1107    function Is_Locking_Policy_Name (N : Name_Id) return Boolean is
1108    begin
1109       return N in First_Locking_Policy_Name .. Last_Locking_Policy_Name;
1110    end Is_Locking_Policy_Name;
1111
1112    -----------------------------
1113    -- Is_Operator_Symbol_Name --
1114    -----------------------------
1115
1116    function Is_Operator_Symbol_Name (N : Name_Id) return Boolean is
1117    begin
1118       return N in First_Operator_Name .. Last_Operator_Name;
1119    end Is_Operator_Symbol_Name;
1120
1121    --------------------
1122    -- Is_Pragma_Name --
1123    --------------------
1124
1125    function Is_Pragma_Name (N : Name_Id) return Boolean is
1126    begin
1127       return N in First_Pragma_Name .. Last_Pragma_Name
1128         or else N = Name_AST_Entry
1129         or else N = Name_Interface
1130         or else N = Name_Priority
1131         or else N = Name_Storage_Size
1132         or else N = Name_Storage_Unit;
1133    end Is_Pragma_Name;
1134
1135    ---------------------------------
1136    -- Is_Procedure_Attribute_Name --
1137    ---------------------------------
1138
1139    function Is_Procedure_Attribute_Name (N : Name_Id) return Boolean is
1140    begin
1141       return N in First_Procedure_Attribute .. Last_Procedure_Attribute;
1142    end Is_Procedure_Attribute_Name;
1143
1144    ----------------------------
1145    -- Is_Queuing_Policy_Name --
1146    ----------------------------
1147
1148    function Is_Queuing_Policy_Name (N : Name_Id) return Boolean is
1149    begin
1150       return N in First_Queuing_Policy_Name .. Last_Queuing_Policy_Name;
1151    end Is_Queuing_Policy_Name;
1152
1153    -------------------------------------
1154    -- Is_Task_Dispatching_Policy_Name --
1155    -------------------------------------
1156
1157    function Is_Task_Dispatching_Policy_Name (N : Name_Id) return Boolean is
1158    begin
1159       return N in First_Task_Dispatching_Policy_Name ..
1160                   Last_Task_Dispatching_Policy_Name;
1161    end Is_Task_Dispatching_Policy_Name;
1162
1163    ----------------------------
1164    -- Is_Type_Attribute_Name --
1165    ----------------------------
1166
1167    function Is_Type_Attribute_Name (N : Name_Id) return Boolean is
1168    begin
1169       return N in First_Type_Attribute_Name .. Last_Type_Attribute_Name;
1170    end Is_Type_Attribute_Name;
1171
1172    ----------------------------------
1173    -- Record_Convention_Identifier --
1174    ----------------------------------
1175
1176    procedure Record_Convention_Identifier
1177      (Id         : Name_Id;
1178       Convention : Convention_Id)
1179    is
1180    begin
1181       Convention_Identifiers.Append ((Id, Convention));
1182    end Record_Convention_Identifier;
1183
1184 end Snames;