OSDN Git Service

2005-02-09 Robert Dewar <dewar@adacore.com>
[pf3gnuchains/gcc-fork.git] / gcc / ada / snames.adb
1 ------------------------------------------------------------------------------\r
2 --                                                                          --\r
3 --                         GNAT COMPILER COMPONENTS                         --\r
4 --                                                                          --\r
5 --                               S N A M E S                                --\r
6 --                                                                          --\r
7 --                                 B o d y                                  --\r
8 --                                                                          --\r
9 --          Copyright (C) 1992-2005, Free Software Foundation, Inc.         --\r
10 --                                                                          --\r
11 -- GNAT is free software;  you can  redistribute it  and/or modify it under --\r
12 -- terms of the  GNU General Public License as published  by the Free Soft- --\r
13 -- ware  Foundation;  either version 2,  or (at your option) any later ver- --\r
14 -- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --\r
15 -- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --\r
16 -- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License --\r
17 -- for  more details.  You should have  received  a copy of the GNU General --\r
18 -- Public License  distributed with GNAT;  see file COPYING.  If not, write --\r
19 -- to  the Free Software Foundation,  59 Temple Place - Suite 330,  Boston, --\r
20 -- MA 02111-1307, USA.                                                      --\r
21 --                                                                          --\r
22 -- As a special exception,  if other files  instantiate  generics from this --\r
23 -- unit, or you link  this unit with other files  to produce an executable, --\r
24 -- this  unit  does not  by itself cause  the resulting  executable  to  be --\r
25 -- covered  by the  GNU  General  Public  License.  This exception does not --\r
26 -- however invalidate  any other reasons why  the executable file  might be --\r
27 -- covered by the  GNU Public License.                                      --\r
28 --                                                                          --\r
29 -- GNAT was originally developed  by the GNAT team at  New York University. --\r
30 -- Extensive contributions were provided by Ada Core Technologies Inc.      --\r
31 --                                                                          --\r
32 ------------------------------------------------------------------------------\r
33 \r
34 with Namet; use Namet;\r
35 with Table;\r
36 \r
37 package body Snames is\r
38 \r
39    --  Table used to record convention identifiers\r
40 \r
41    type Convention_Id_Entry is record\r
42       Name       : Name_Id;\r
43       Convention : Convention_Id;\r
44    end record;\r
45 \r
46    package Convention_Identifiers is new Table.Table (\r
47      Table_Component_Type => Convention_Id_Entry,\r
48      Table_Index_Type     => Int,\r
49      Table_Low_Bound      => 1,\r
50      Table_Initial        => 50,\r
51      Table_Increment      => 200,\r
52      Table_Name           => "Name_Convention_Identifiers");\r
53 \r
54    --  Table of names to be set by Initialize. Each name is terminated by a\r
55    --  single #, and the end of the list is marked by a null entry, i.e. by\r
56    --  two # marks in succession. Note that the table does not include the\r
57    --  entries for a-z, since these are initialized by Namet itself.\r
58 \r
59    Preset_Names : constant String :=\r
60      "_parent#" &\r
61      "_tag#" &\r
62      "off#" &\r
63      "space#" &\r
64      "time#" &\r
65      "_abort_signal#" &\r
66      "_alignment#" &\r
67      "_assign#" &\r
68      "_atcb#" &\r
69      "_chain#" &\r
70      "_clean#" &\r
71      "_controller#" &\r
72      "_entry_bodies#" &\r
73      "_expunge#" &\r
74      "_final_list#" &\r
75      "_idepth#" &\r
76      "_init#" &\r
77      "_local_final_list#" &\r
78      "_master#" &\r
79      "_object#" &\r
80      "_priority#" &\r
81      "_process_atsd#" &\r
82      "_secondary_stack#" &\r
83      "_service#" &\r
84      "_size#" &\r
85      "_stack#" &\r
86      "_tags#" &\r
87      "_task#" &\r
88      "_task_id#" &\r
89      "_task_info#" &\r
90      "_task_name#" &\r
91      "_trace_sp#" &\r
92      "initialize#" &\r
93      "adjust#" &\r
94      "finalize#" &\r
95      "next#" &\r
96      "prev#" &\r
97      "_typecode#" &\r
98      "_from_any#" &\r
99      "_to_any#" &\r
100      "allocate#" &\r
101      "deallocate#" &\r
102      "dereference#" &\r
103      "decimal_io#" &\r
104      "enumeration_io#" &\r
105      "fixed_io#" &\r
106      "float_io#" &\r
107      "integer_io#" &\r
108      "modular_io#" &\r
109      "const#" &\r
110      "<error>#" &\r
111      "go#" &\r
112      "put#" &\r
113      "put_line#" &\r
114      "to#" &\r
115      "finalization#" &\r
116      "finalization_root#" &\r
117      "interfaces#" &\r
118      "standard#" &\r
119      "system#" &\r
120      "text_io#" &\r
121      "wide_text_io#" &\r
122      "wide_wide_text_io#" &\r
123      "no_dsa#" &\r
124      "garlic_dsa#" &\r
125      "polyorb_dsa#" &\r
126      "addr#" &\r
127      "async#" &\r
128      "get_active_partition_id#" &\r
129      "get_rci_package_receiver#" &\r
130      "get_rci_package_ref#" &\r
131      "origin#" &\r
132      "params#" &\r
133      "partition#" &\r
134      "partition_interface#" &\r
135      "ras#" &\r
136      "call#" &\r
137      "rci_name#" &\r
138      "receiver#" &\r
139      "result#" &\r
140      "rpc#" &\r
141      "subp_id#" &\r
142      "operation#" &\r
143      "argument#" &\r
144      "arg_modes#" &\r
145      "handler#" &\r
146      "target#" &\r
147      "req#" &\r
148      "obj_typecode#" &\r
149      "stub#" &\r
150      "Oabs#" &\r
151      "Oand#" &\r
152      "Omod#" &\r
153      "Onot#" &\r
154      "Oor#" &\r
155      "Orem#" &\r
156      "Oxor#" &\r
157      "Oeq#" &\r
158      "One#" &\r
159      "Olt#" &\r
160      "Ole#" &\r
161      "Ogt#" &\r
162      "Oge#" &\r
163      "Oadd#" &\r
164      "Osubtract#" &\r
165      "Oconcat#" &\r
166      "Omultiply#" &\r
167      "Odivide#" &\r
168      "Oexpon#" &\r
169      "ada_83#" &\r
170      "ada_95#" &\r
171      "ada_05#" &\r
172      "c_pass_by_copy#" &\r
173      "compile_time_warning#" &\r
174      "component_alignment#" &\r
175      "convention_identifier#" &\r
176      "detect_blocking#" &\r
177      "discard_names#" &\r
178      "elaboration_checks#" &\r
179      "eliminate#" &\r
180      "explicit_overriding#" &\r
181      "extend_system#" &\r
182      "extensions_allowed#" &\r
183      "external_name_casing#" &\r
184      "float_representation#" &\r
185      "initialize_scalars#" &\r
186      "interrupt_state#" &\r
187      "license#" &\r
188      "locking_policy#" &\r
189      "long_float#" &\r
190      "no_run_time#" &\r
191      "no_strict_aliasing#" &\r
192      "normalize_scalars#" &\r
193      "polling#" &\r
194      "persistent_data#" &\r
195      "persistent_object#" &\r
196      "profile#" &\r
197      "profile_warnings#" &\r
198      "propagate_exceptions#" &\r
199      "queuing_policy#" &\r
200      "ravenscar#" &\r
201      "restricted_run_time#" &\r
202      "restrictions#" &\r
203      "restriction_warnings#" &\r
204      "reviewable#" &\r
205      "source_file_name#" &\r
206      "source_file_name_project#" &\r
207      "style_checks#" &\r
208      "suppress#" &\r
209      "suppress_exception_locations#" &\r
210      "task_dispatching_policy#" &\r
211      "universal_data#" &\r
212      "unsuppress#" &\r
213      "use_vads_size#" &\r
214      "validity_checks#" &\r
215      "warnings#" &\r
216      "abort_defer#" &\r
217      "all_calls_remote#" &\r
218      "annotate#" &\r
219      "assert#" &\r
220      "asynchronous#" &\r
221      "atomic#" &\r
222      "atomic_components#" &\r
223      "attach_handler#" &\r
224      "comment#" &\r
225      "common_object#" &\r
226      "complex_representation#" &\r
227      "controlled#" &\r
228      "convention#" &\r
229      "cpp_class#" &\r
230      "cpp_constructor#" &\r
231      "cpp_virtual#" &\r
232      "cpp_vtable#" &\r
233      "debug#" &\r
234      "elaborate#" &\r
235      "elaborate_all#" &\r
236      "elaborate_body#" &\r
237      "export#" &\r
238      "export_exception#" &\r
239      "export_function#" &\r
240      "export_object#" &\r
241      "export_procedure#" &\r
242      "export_value#" &\r
243      "export_valued_procedure#" &\r
244      "external#" &\r
245      "finalize_storage_only#" &\r
246      "ident#" &\r
247      "import#" &\r
248      "import_exception#" &\r
249      "import_function#" &\r
250      "import_object#" &\r
251      "import_procedure#" &\r
252      "import_valued_procedure#" &\r
253      "inline#" &\r
254      "inline_always#" &\r
255      "inline_generic#" &\r
256      "inspection_point#" &\r
257      "interface_name#" &\r
258      "interrupt_handler#" &\r
259      "interrupt_priority#" &\r
260      "java_constructor#" &\r
261      "java_interface#" &\r
262      "keep_names#" &\r
263      "link_with#" &\r
264      "linker_alias#" &\r
265      "linker_options#" &\r
266      "linker_section#" &\r
267      "list#" &\r
268      "machine_attribute#" &\r
269      "main#" &\r
270      "main_storage#" &\r
271      "memory_size#" &\r
272      "no_return#" &\r
273      "obsolescent#" &\r
274      "optimize#" &\r
275      "optional_overriding#" &\r
276      "pack#" &\r
277      "page#" &\r
278      "passive#" &\r
279      "preelaborate#" &\r
280      "priority#" &\r
281      "psect_object#" &\r
282      "pure#" &\r
283      "pure_function#" &\r
284      "remote_call_interface#" &\r
285      "remote_types#" &\r
286      "share_generic#" &\r
287      "shared#" &\r
288      "shared_passive#" &\r
289      "source_reference#" &\r
290      "stream_convert#" &\r
291      "subtitle#" &\r
292      "suppress_all#" &\r
293      "suppress_debug_info#" &\r
294      "suppress_initialization#" &\r
295      "system_name#" &\r
296      "task_info#" &\r
297      "task_name#" &\r
298      "task_storage#" &\r
299      "thread_body#" &\r
300      "time_slice#" &\r
301      "title#" &\r
302      "unchecked_union#" &\r
303      "unimplemented_unit#" &\r
304      "unreferenced#" &\r
305      "unreserve_all_interrupts#" &\r
306      "volatile#" &\r
307      "volatile_components#" &\r
308      "weak_external#" &\r
309      "ada#" &\r
310      "assembler#" &\r
311      "cobol#" &\r
312      "cpp#" &\r
313      "fortran#" &\r
314      "intrinsic#" &\r
315      "java#" &\r
316      "stdcall#" &\r
317      "stubbed#" &\r
318      "asm#" &\r
319      "assembly#" &\r
320      "default#" &\r
321      "dll#" &\r
322      "win32#" &\r
323      "as_is#" &\r
324      "body_file_name#" &\r
325      "boolean_entry_barriers#" &\r
326      "casing#" &\r
327      "code#" &\r
328      "component#" &\r
329      "component_size_4#" &\r
330      "copy#" &\r
331      "d_float#" &\r
332      "descriptor#" &\r
333      "dot_replacement#" &\r
334      "dynamic#" &\r
335      "entity#" &\r
336      "external_name#" &\r
337      "first_optional_parameter#" &\r
338      "form#" &\r
339      "g_float#" &\r
340      "gcc#" &\r
341      "gnat#" &\r
342      "gpl#" &\r
343      "ieee_float#" &\r
344      "internal#" &\r
345      "link_name#" &\r
346      "lowercase#" &\r
347      "max_entry_queue_depth#" &\r
348      "max_entry_queue_length#" &\r
349      "max_size#" &\r
350      "mechanism#" &\r
351      "mixedcase#" &\r
352      "modified_gpl#" &\r
353      "name#" &\r
354      "nca#" &\r
355      "no#" &\r
356      "no_dependence#" &\r
357      "no_dynamic_attachment#" &\r
358      "no_dynamic_interrupts#" &\r
359      "no_requeue#" &\r
360      "no_requeue_statements#" &\r
361      "no_task_attributes#" &\r
362      "no_task_attributes_package#" &\r
363      "on#" &\r
364      "parameter_types#" &\r
365      "reference#" &\r
366      "restricted#" &\r
367      "result_mechanism#" &\r
368      "result_type#" &\r
369      "runtime#" &\r
370      "sb#" &\r
371      "secondary_stack_size#" &\r
372      "section#" &\r
373      "semaphore#" &\r
374      "simple_barriers#" &\r
375      "spec_file_name#" &\r
376      "static#" &\r
377      "stack_size#" &\r
378      "subunit_file_name#" &\r
379      "task_stack_size_default#" &\r
380      "task_type#" &\r
381      "time_slicing_enabled#" &\r
382      "top_guard#" &\r
383      "uba#" &\r
384      "ubs#" &\r
385      "ubsb#" &\r
386      "unit_name#" &\r
387      "unknown#" &\r
388      "unrestricted#" &\r
389      "uppercase#" &\r
390      "user#" &\r
391      "vax_float#" &\r
392      "vms#" &\r
393      "working_storage#" &\r
394      "abort_signal#" &\r
395      "access#" &\r
396      "address#" &\r
397      "address_size#" &\r
398      "aft#" &\r
399      "alignment#" &\r
400      "asm_input#" &\r
401      "asm_output#" &\r
402      "ast_entry#" &\r
403      "bit#" &\r
404      "bit_order#" &\r
405      "bit_position#" &\r
406      "body_version#" &\r
407      "callable#" &\r
408      "caller#" &\r
409      "code_address#" &\r
410      "component_size#" &\r
411      "compose#" &\r
412      "constrained#" &\r
413      "count#" &\r
414      "default_bit_order#" &\r
415      "definite#" &\r
416      "delta#" &\r
417      "denorm#" &\r
418      "digits#" &\r
419      "elaborated#" &\r
420      "emax#" &\r
421      "enum_rep#" &\r
422      "epsilon#" &\r
423      "exponent#" &\r
424      "external_tag#" &\r
425      "first#" &\r
426      "first_bit#" &\r
427      "fixed_value#" &\r
428      "fore#" &\r
429      "has_access_values#" &\r
430      "has_discriminants#" &\r
431      "identity#" &\r
432      "img#" &\r
433      "integer_value#" &\r
434      "large#" &\r
435      "last#" &\r
436      "last_bit#" &\r
437      "leading_part#" &\r
438      "length#" &\r
439      "machine_emax#" &\r
440      "machine_emin#" &\r
441      "machine_mantissa#" &\r
442      "machine_overflows#" &\r
443      "machine_radix#" &\r
444      "machine_rounds#" &\r
445      "machine_size#" &\r
446      "mantissa#" &\r
447      "max_size_in_storage_elements#" &\r
448      "maximum_alignment#" &\r
449      "mechanism_code#" &\r
450      "mod#" &\r
451      "model_emin#" &\r
452      "model_epsilon#" &\r
453      "model_mantissa#" &\r
454      "model_small#" &\r
455      "modulus#" &\r
456      "null_parameter#" &\r
457      "object_size#" &\r
458      "partition_id#" &\r
459      "passed_by_reference#" &\r
460      "pool_address#" &\r
461      "pos#" &\r
462      "position#" &\r
463      "range#" &\r
464      "range_length#" &\r
465      "round#" &\r
466      "safe_emax#" &\r
467      "safe_first#" &\r
468      "safe_large#" &\r
469      "safe_last#" &\r
470      "safe_small#" &\r
471      "scale#" &\r
472      "scaling#" &\r
473      "signed_zeros#" &\r
474      "size#" &\r
475      "small#" &\r
476      "storage_size#" &\r
477      "storage_unit#" &\r
478      "stream_size#" &\r
479      "tag#" &\r
480      "target_name#" &\r
481      "terminated#" &\r
482      "to_address#" &\r
483      "type_class#" &\r
484      "uet_address#" &\r
485      "unbiased_rounding#" &\r
486      "unchecked_access#" &\r
487      "unconstrained_array#" &\r
488      "universal_literal_string#" &\r
489      "unrestricted_access#" &\r
490      "vads_size#" &\r
491      "val#" &\r
492      "valid#" &\r
493      "value_size#" &\r
494      "version#" &\r
495      "wchar_t_size#" &\r
496      "wide_wide_width#" &\r
497      "wide_width#" &\r
498      "width#" &\r
499      "word_size#" &\r
500      "adjacent#" &\r
501      "ceiling#" &\r
502      "copy_sign#" &\r
503      "floor#" &\r
504      "fraction#" &\r
505      "image#" &\r
506      "input#" &\r
507      "machine#" &\r
508      "max#" &\r
509      "min#" &\r
510      "model#" &\r
511      "pred#" &\r
512      "remainder#" &\r
513      "rounding#" &\r
514      "succ#" &\r
515      "truncation#" &\r
516      "value#" &\r
517      "wide_image#" &\r
518      "wide_wide_image#" &\r
519      "wide_value#" &\r
520      "wide_wide_value#" &\r
521      "output#" &\r
522      "read#" &\r
523      "write#" &\r
524      "elab_body#" &\r
525      "elab_spec#" &\r
526      "storage_pool#" &\r
527      "base#" &\r
528      "class#" &\r
529      "ceiling_locking#" &\r
530      "inheritance_locking#" &\r
531      "fifo_queuing#" &\r
532      "priority_queuing#" &\r
533      "fifo_within_priorities#" &\r
534      "access_check#" &\r
535      "accessibility_check#" &\r
536      "discriminant_check#" &\r
537      "division_check#" &\r
538      "elaboration_check#" &\r
539      "index_check#" &\r
540      "length_check#" &\r
541      "overflow_check#" &\r
542      "range_check#" &\r
543      "storage_check#" &\r
544      "tag_check#" &\r
545      "all_checks#" &\r
546      "abort#" &\r
547      "abs#" &\r
548      "accept#" &\r
549      "and#" &\r
550      "all#" &\r
551      "array#" &\r
552      "at#" &\r
553      "begin#" &\r
554      "body#" &\r
555      "case#" &\r
556      "constant#" &\r
557      "declare#" &\r
558      "delay#" &\r
559      "do#" &\r
560      "else#" &\r
561      "elsif#" &\r
562      "end#" &\r
563      "entry#" &\r
564      "exception#" &\r
565      "exit#" &\r
566      "for#" &\r
567      "function#" &\r
568      "generic#" &\r
569      "goto#" &\r
570      "if#" &\r
571      "in#" &\r
572      "is#" &\r
573      "limited#" &\r
574      "loop#" &\r
575      "new#" &\r
576      "not#" &\r
577      "null#" &\r
578      "of#" &\r
579      "or#" &\r
580      "others#" &\r
581      "out#" &\r
582      "package#" &\r
583      "pragma#" &\r
584      "private#" &\r
585      "procedure#" &\r
586      "raise#" &\r
587      "record#" &\r
588      "rem#" &\r
589      "renames#" &\r
590      "return#" &\r
591      "reverse#" &\r
592      "select#" &\r
593      "separate#" &\r
594      "subtype#" &\r
595      "task#" &\r
596      "terminate#" &\r
597      "then#" &\r
598      "type#" &\r
599      "use#" &\r
600      "when#" &\r
601      "while#" &\r
602      "with#" &\r
603      "xor#" &\r
604      "divide#" &\r
605      "enclosing_entity#" &\r
606      "exception_information#" &\r
607      "exception_message#" &\r
608      "exception_name#" &\r
609      "file#" &\r
610      "import_address#" &\r
611      "import_largest_value#" &\r
612      "import_value#" &\r
613      "is_negative#" &\r
614      "line#" &\r
615      "rotate_left#" &\r
616      "rotate_right#" &\r
617      "shift_left#" &\r
618      "shift_right#" &\r
619      "shift_right_arithmetic#" &\r
620      "source_location#" &\r
621      "unchecked_conversion#" &\r
622      "unchecked_deallocation#" &\r
623      "to_pointer#" &\r
624      "abstract#" &\r
625      "aliased#" &\r
626      "protected#" &\r
627      "until#" &\r
628      "requeue#" &\r
629      "tagged#" &\r
630      "raise_exception#" &\r
631      "ada_roots#" &\r
632      "binder#" &\r
633      "binder_driver#" &\r
634      "body_suffix#" &\r
635      "builder#" &\r
636      "compiler#" &\r
637      "compiler_driver#" &\r
638      "compiler_kind#" &\r
639      "compute_dependency#" &\r
640      "cross_reference#" &\r
641      "default_linker#" &\r
642      "default_switches#" &\r
643      "dependency_option#" &\r
644      "exec_dir#" &\r
645      "executable#" &\r
646      "executable_suffix#" &\r
647      "extends#" &\r
648      "externally_built#" &\r
649      "finder#" &\r
650      "global_configuration_pragmas#" &\r
651      "gnatls#" &\r
652      "gnatstub#" &\r
653      "implementation#" &\r
654      "implementation_exceptions#" &\r
655      "implementation_suffix#" &\r
656      "include_option#" &\r
657      "language_processing#" &\r
658      "languages#" &\r
659      "library_dir#" &\r
660      "library_auto_init#" &\r
661      "library_gcc#" &\r
662      "library_interface#" &\r
663      "library_kind#" &\r
664      "library_name#" &\r
665      "library_options#" &\r
666      "library_reference_symbol_file#" &\r
667      "library_src_dir#" &\r
668      "library_symbol_file#" &\r
669      "library_symbol_policy#" &\r
670      "library_version#" &\r
671      "linker#" &\r
672      "local_configuration_pragmas#" &\r
673      "locally_removed_files#" &\r
674      "metrics#" &\r
675      "naming#" &\r
676      "object_dir#" &\r
677      "pretty_printer#" &\r
678      "project#" &\r
679      "separate_suffix#" &\r
680      "source_dirs#" &\r
681      "source_files#" &\r
682      "source_list_file#" &\r
683      "spec#" &\r
684      "spec_suffix#" &\r
685      "specification#" &\r
686      "specification_exceptions#" &\r
687      "specification_suffix#" &\r
688      "switches#" &\r
689      "unaligned_valid#" &\r
690      "interface#" &\r
691      "overriding#" &\r
692      "synchronized#" &\r
693      "#";\r
694 \r
695    ---------------------\r
696    -- Generated Names --\r
697    ---------------------\r
698 \r
699    --  This section lists the various cases of generated names which are\r
700    --  built from existing names by adding unique leading and/or trailing\r
701    --  upper case letters. In some cases these names are built recursively,\r
702    --  in particular names built from types may be built from types which\r
703    --  themselves have generated names. In this list, xxx represents an\r
704    --  existing name to which identifying letters are prepended or appended,\r
705    --  and a trailing n represents a serial number in an external name that\r
706    --  has some semantic significance (e.g. the n'th index type of an array).\r
707 \r
708    --    xxxA    access type for formal xxx in entry param record   (Exp_Ch9)\r
709    --    xxxB    tag table for tagged type xxx                      (Exp_Ch3)\r
710    --    xxxB    task body procedure for task xxx                   (Exp_Ch9)\r
711    --    xxxD    dispatch table for tagged type xxx                 (Exp_Ch3)\r
712    --    xxxD    discriminal for discriminant xxx                   (Sem_Ch3)\r
713    --    xxxDn   n'th discr check function for rec type xxx         (Exp_Ch3)\r
714    --    xxxE    elaboration boolean flag for task xxx              (Exp_Ch9)\r
715    --    xxxE    dispatch table pointer type for tagged type xxx    (Exp_Ch3)\r
716    --    xxxE    parameters for accept body for entry xxx           (Exp_Ch9)\r
717    --    xxxFn   n'th primitive of a tagged type (named xxx)        (Exp_Ch3)\r
718    --    xxxJ    tag table type index for tagged type xxx           (Exp_Ch3)\r
719    --    xxxM    master Id value for access type xxx                (Exp_Ch3)\r
720    --    xxxP    tag table pointer type for tagged type xxx         (Exp_Ch3)\r
721    --    xxxP    parameter record type for entry xxx                (Exp_Ch9)\r
722    --    xxxPA   access to parameter record type for entry xxx      (Exp_Ch9)\r
723    --    xxxPn   pointer type for n'th primitive of tagged type xxx (Exp_Ch3)\r
724    --    xxxR    dispatch table pointer for tagged type xxx         (Exp_Ch3)\r
725    --    xxxT    tag table type for tagged type xxx                 (Exp_Ch3)\r
726    --    xxxT    literal table for enumeration type xxx             (Sem_Ch3)\r
727    --    xxxV    type for task value record for task xxx            (Exp_Ch9)\r
728    --    xxxX    entry index constant                               (Exp_Ch9)\r
729    --    xxxY    dispatch table type for tagged type xxx            (Exp_Ch3)\r
730    --    xxxZ    size variable for task xxx                         (Exp_Ch9)\r
731 \r
732    --  TSS names\r
733 \r
734    --    xxxDA   deep adjust routine for type xxx                   (Exp_TSS)\r
735    --    xxxDF   deep finalize routine for type xxx                 (Exp_TSS)\r
736    --    xxxDI   deep initialize routine for type xxx               (Exp_TSS)\r
737    --    xxxEQ   composite equality routine for record type xxx     (Exp_TSS)\r
738    --    xxxIP   initialization procedure for type xxx              (Exp_TSS)\r
739    --    xxxRA   RAs type access routine for type xxx               (Exp_TSS)\r
740    --    xxxRD   RAs type dereference routine for type xxx          (Exp_TSS)\r
741    --    xxxRP   Rep to Pos conversion for enumeration type xxx     (Exp_TSS)\r
742    --    xxxSA   array/slice assignment for controlled comp. arrays (Exp_TSS)\r
743    --    xxxSI   stream input attribute subprogram for type xxx     (Exp_TSS)\r
744    --    xxxSO   stream output attribute subprogram for type xxx    (Exp_TSS)\r
745    --    xxxSR   stream read attribute subprogram for type xxx      (Exp_TSS)\r
746    --    xxxSW   stream write attribute subprogram for type xxx     (Exp_TSS)\r
747 \r
748    --  Implicit type names\r
749 \r
750    --    TxxxT   type of literal table for enumeration type xxx     (Sem_Ch3)\r
751 \r
752    --  (Note: this list is not complete or accurate ???)\r
753 \r
754    ----------------------\r
755    -- Get_Attribute_Id --\r
756    ----------------------\r
757 \r
758    function Get_Attribute_Id (N : Name_Id) return Attribute_Id is\r
759    begin\r
760       return Attribute_Id'Val (N - First_Attribute_Name);\r
761    end Get_Attribute_Id;\r
762 \r
763    ------------------\r
764    -- Get_Check_Id --\r
765    ------------------\r
766 \r
767    function Get_Check_Id (N : Name_Id) return Check_Id is\r
768    begin\r
769       return Check_Id'Val (N - First_Check_Name);\r
770    end Get_Check_Id;\r
771 \r
772    -----------------------\r
773    -- Get_Convention_Id --\r
774    -----------------------\r
775 \r
776    function Get_Convention_Id (N : Name_Id) return Convention_Id is\r
777    begin\r
778       case N is\r
779          when Name_Ada        => return Convention_Ada;\r
780          when Name_Assembler  => return Convention_Assembler;\r
781          when Name_C          => return Convention_C;\r
782          when Name_COBOL      => return Convention_COBOL;\r
783          when Name_CPP        => return Convention_CPP;\r
784          when Name_Fortran    => return Convention_Fortran;\r
785          when Name_Intrinsic  => return Convention_Intrinsic;\r
786          when Name_Java       => return Convention_Java;\r
787          when Name_Stdcall    => return Convention_Stdcall;\r
788          when Name_Stubbed    => return Convention_Stubbed;\r
789 \r
790          --  If no direct match, then we must have a convention\r
791          --  identifier pragma that has specified this name.\r
792 \r
793          when others          =>\r
794             for J in 1 .. Convention_Identifiers.Last loop\r
795                if N = Convention_Identifiers.Table (J).Name then\r
796                   return Convention_Identifiers.Table (J).Convention;\r
797                end if;\r
798             end loop;\r
799 \r
800             raise Program_Error;\r
801       end case;\r
802    end Get_Convention_Id;\r
803 \r
804    ---------------------------\r
805    -- Get_Locking_Policy_Id --\r
806    ---------------------------\r
807 \r
808    function Get_Locking_Policy_Id (N : Name_Id) return Locking_Policy_Id is\r
809    begin\r
810       return Locking_Policy_Id'Val (N - First_Locking_Policy_Name);\r
811    end Get_Locking_Policy_Id;\r
812 \r
813    -------------------\r
814    -- Get_Pragma_Id --\r
815    -------------------\r
816 \r
817    function Get_Pragma_Id (N : Name_Id) return Pragma_Id is\r
818    begin\r
819       if N = Name_AST_Entry then\r
820          return Pragma_AST_Entry;\r
821       elsif N = Name_Interface then\r
822          return Pragma_Interface;\r
823       elsif N = Name_Storage_Size then\r
824          return Pragma_Storage_Size;\r
825       elsif N = Name_Storage_Unit then\r
826          return Pragma_Storage_Unit;\r
827       elsif N not in First_Pragma_Name .. Last_Pragma_Name then\r
828          return Unknown_Pragma;\r
829       else\r
830          return Pragma_Id'Val (N - First_Pragma_Name);\r
831       end if;\r
832    end Get_Pragma_Id;\r
833 \r
834    ---------------------------\r
835    -- Get_Queuing_Policy_Id --\r
836    ---------------------------\r
837 \r
838    function Get_Queuing_Policy_Id (N : Name_Id) return Queuing_Policy_Id is\r
839    begin\r
840       return Queuing_Policy_Id'Val (N - First_Queuing_Policy_Name);\r
841    end Get_Queuing_Policy_Id;\r
842 \r
843    ------------------------------------\r
844    -- Get_Task_Dispatching_Policy_Id --\r
845    ------------------------------------\r
846 \r
847    function Get_Task_Dispatching_Policy_Id (N : Name_Id)\r
848      return Task_Dispatching_Policy_Id is\r
849    begin\r
850       return Task_Dispatching_Policy_Id'Val\r
851         (N - First_Task_Dispatching_Policy_Name);\r
852    end Get_Task_Dispatching_Policy_Id;\r
853 \r
854    ----------------\r
855    -- Initialize --\r
856    ----------------\r
857 \r
858    procedure Initialize is\r
859       P_Index      : Natural;\r
860       Discard_Name : Name_Id;\r
861 \r
862    begin\r
863       P_Index := Preset_Names'First;\r
864 \r
865       loop\r
866          Name_Len := 0;\r
867 \r
868          while Preset_Names (P_Index) /= '#' loop\r
869             Name_Len := Name_Len + 1;\r
870             Name_Buffer (Name_Len) := Preset_Names (P_Index);\r
871             P_Index := P_Index + 1;\r
872          end loop;\r
873 \r
874          --  We do the Name_Find call to enter the name into the table, but\r
875          --  we don't need to do anything with the result, since we already\r
876          --  initialized all the preset names to have the right value (we\r
877          --  are depending on the order of the names and Preset_Names).\r
878 \r
879          Discard_Name := Name_Find;\r
880          P_Index := P_Index + 1;\r
881          exit when Preset_Names (P_Index) = '#';\r
882       end loop;\r
883 \r
884       --  Make sure that number of names in standard table is correct. If\r
885       --  this check fails, run utility program XSNAMES to construct a new\r
886       --  properly matching version of the body.\r
887 \r
888       pragma Assert (Discard_Name = Last_Predefined_Name);\r
889 \r
890       --  Initialize the convention identifiers table with the standard\r
891       --  set of synonyms that we recognize for conventions.\r
892 \r
893       Convention_Identifiers.Init;\r
894 \r
895       Convention_Identifiers.Append ((Name_Asm,      Convention_Assembler));\r
896       Convention_Identifiers.Append ((Name_Assembly, Convention_Assembler));\r
897 \r
898       Convention_Identifiers.Append ((Name_Default,  Convention_C));\r
899       Convention_Identifiers.Append ((Name_External, Convention_C));\r
900 \r
901       Convention_Identifiers.Append ((Name_DLL,      Convention_Stdcall));\r
902       Convention_Identifiers.Append ((Name_Win32,    Convention_Stdcall));\r
903    end Initialize;\r
904 \r
905    -----------------------\r
906    -- Is_Attribute_Name --\r
907    -----------------------\r
908 \r
909    function Is_Attribute_Name (N : Name_Id) return Boolean is\r
910    begin\r
911       return N in First_Attribute_Name .. Last_Attribute_Name;\r
912    end Is_Attribute_Name;\r
913 \r
914    -------------------\r
915    -- Is_Check_Name --\r
916    -------------------\r
917 \r
918    function Is_Check_Name (N : Name_Id) return Boolean is\r
919    begin\r
920       return N in First_Check_Name .. Last_Check_Name;\r
921    end Is_Check_Name;\r
922 \r
923    ------------------------\r
924    -- Is_Convention_Name --\r
925    ------------------------\r
926 \r
927    function Is_Convention_Name (N : Name_Id) return Boolean is\r
928    begin\r
929       --  Check if this is one of the standard conventions\r
930 \r
931       if N in First_Convention_Name .. Last_Convention_Name\r
932         or else N = Name_C\r
933       then\r
934          return True;\r
935 \r
936       --  Otherwise check if it is in convention identifier table\r
937 \r
938       else\r
939          for J in 1 .. Convention_Identifiers.Last loop\r
940             if N = Convention_Identifiers.Table (J).Name then\r
941                return True;\r
942             end if;\r
943          end loop;\r
944 \r
945          return False;\r
946       end if;\r
947    end Is_Convention_Name;\r
948 \r
949    ------------------------------\r
950    -- Is_Entity_Attribute_Name --\r
951    ------------------------------\r
952 \r
953    function Is_Entity_Attribute_Name (N : Name_Id) return Boolean is\r
954    begin\r
955       return N in First_Entity_Attribute_Name .. Last_Entity_Attribute_Name;\r
956    end Is_Entity_Attribute_Name;\r
957 \r
958    --------------------------------\r
959    -- Is_Function_Attribute_Name --\r
960    --------------------------------\r
961 \r
962    function Is_Function_Attribute_Name (N : Name_Id) return Boolean is\r
963    begin\r
964       return N in\r
965         First_Renamable_Function_Attribute ..\r
966           Last_Renamable_Function_Attribute;\r
967    end Is_Function_Attribute_Name;\r
968 \r
969    ----------------------------\r
970    -- Is_Locking_Policy_Name --\r
971    ----------------------------\r
972 \r
973    function Is_Locking_Policy_Name (N : Name_Id) return Boolean is\r
974    begin\r
975       return N in First_Locking_Policy_Name .. Last_Locking_Policy_Name;\r
976    end Is_Locking_Policy_Name;\r
977 \r
978    -----------------------------\r
979    -- Is_Operator_Symbol_Name --\r
980    -----------------------------\r
981 \r
982    function Is_Operator_Symbol_Name (N : Name_Id) return Boolean is\r
983    begin\r
984       return N in First_Operator_Name .. Last_Operator_Name;\r
985    end Is_Operator_Symbol_Name;\r
986 \r
987    --------------------\r
988    -- Is_Pragma_Name --\r
989    --------------------\r
990 \r
991    function Is_Pragma_Name (N : Name_Id) return Boolean is\r
992    begin\r
993       return N in First_Pragma_Name .. Last_Pragma_Name\r
994         or else N = Name_AST_Entry\r
995         or else N = Name_Interface\r
996         or else N = Name_Storage_Size\r
997         or else N = Name_Storage_Unit;\r
998    end Is_Pragma_Name;\r
999 \r
1000    ---------------------------------\r
1001    -- Is_Procedure_Attribute_Name --\r
1002    ---------------------------------\r
1003 \r
1004    function Is_Procedure_Attribute_Name (N : Name_Id) return Boolean is\r
1005    begin\r
1006       return N in First_Procedure_Attribute .. Last_Procedure_Attribute;\r
1007    end Is_Procedure_Attribute_Name;\r
1008 \r
1009    ----------------------------\r
1010    -- Is_Queuing_Policy_Name --\r
1011    ----------------------------\r
1012 \r
1013    function Is_Queuing_Policy_Name (N : Name_Id) return Boolean is\r
1014    begin\r
1015       return N in First_Queuing_Policy_Name .. Last_Queuing_Policy_Name;\r
1016    end Is_Queuing_Policy_Name;\r
1017 \r
1018    -------------------------------------\r
1019    -- Is_Task_Dispatching_Policy_Name --\r
1020    -------------------------------------\r
1021 \r
1022    function Is_Task_Dispatching_Policy_Name (N : Name_Id) return Boolean is\r
1023    begin\r
1024       return N in First_Task_Dispatching_Policy_Name ..\r
1025                   Last_Task_Dispatching_Policy_Name;\r
1026    end Is_Task_Dispatching_Policy_Name;\r
1027 \r
1028    ----------------------------\r
1029    -- Is_Type_Attribute_Name --\r
1030    ----------------------------\r
1031 \r
1032    function Is_Type_Attribute_Name (N : Name_Id) return Boolean is\r
1033    begin\r
1034       return N in First_Type_Attribute_Name .. Last_Type_Attribute_Name;\r
1035    end Is_Type_Attribute_Name;\r
1036 \r
1037    ----------------------------------\r
1038    -- Record_Convention_Identifier --\r
1039    ----------------------------------\r
1040 \r
1041    procedure Record_Convention_Identifier\r
1042      (Id         : Name_Id;\r
1043       Convention : Convention_Id)\r
1044    is\r
1045    begin\r
1046       Convention_Identifiers.Append ((Id, Convention));\r
1047    end Record_Convention_Identifier;\r
1048 \r
1049 end Snames;\r