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