OSDN Git Service

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