OSDN Git Service

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