ocarina-backends-asn1_tree-nodes.adb 31.2 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053
pragma Style_Checks ("NM32766");

--  This file has been generated automatically by `mknodes'. Do not
--  hand modify this file since your changes will be overridden.

with Ocarina.Backends.ASN1_Tree.Debug; use Ocarina.Backends.ASN1_Tree.Debug;

package body Ocarina.Backends.ASN1_Tree.Nodes is

   pragma Warnings (Off);
   use Entries;

   function Kind (N : Node_Id) return Node_Kind is
   begin
      return Table (Types.Node_Id (N)).Kind;
   end Kind;

   procedure Set_Kind (N : Node_Id; V : Node_Kind) is
   begin
      Table (Types.Node_Id (N)).Kind := V;
   end Set_Kind;

   function Loc (N : Node_Id) return Location is
   begin
      return Table (Types.Node_Id (N)).Loc;
   end Loc;

   procedure Set_Loc (N : Node_Id; V : Location) is
   begin
      Table (Types.Node_Id (N)).Loc := V;
   end Set_Loc;

   function Image (N : Base_Type) return Name_Id is
   begin
      pragma Assert (False
        or else Table (Types.Node_Id (N)).Kind = K_Base_Type
        or else Table (Types.Node_Id (N)).Kind = K_Float
        or else Table (Types.Node_Id (N)).Kind = K_Int
        or else Table (Types.Node_Id (N)).Kind = K_Char
        or else Table (Types.Node_Id (N)).Kind = K_String);

      return Name_Id (Table (Types.Node_Id (N)).L (1));
   end Image;

   procedure Set_Image (N : Base_Type; V : Name_Id) is
   begin
      pragma Assert (False
        or else Table (Types.Node_Id (N)).Kind = K_Base_Type
        or else Table (Types.Node_Id (N)).Kind = K_Float
        or else Table (Types.Node_Id (N)).Kind = K_Int
        or else Table (Types.Node_Id (N)).Kind = K_Char
        or else Table (Types.Node_Id (N)).Kind = K_String);

      Table (Types.Node_Id (N)).L (1) := Int (V);
   end Set_Image;

   function Next_Node (N : Node_Id) return Node_Id is
   begin
      pragma Assert (False
        or else Table (Types.Node_Id (N)).Kind = K_Node_Id
        or else Table (Types.Node_Id (N)).Kind = K_Definition
        or else Table (Types.Node_Id (N)).Kind = K_Defining_Identifier
        or else Table (Types.Node_Id (N)).Kind = K_ASN1_File
        or else Table (Types.Node_Id (N)).Kind = K_ASN1_Module
        or else Table (Types.Node_Id (N)).Kind = K_Import_Export_Clause
        or else Table (Types.Node_Id (N)).Kind = K_Type_Definition
        or else Table (Types.Node_Id (N)).Kind = K_Enumerated
        or else Table (Types.Node_Id (N)).Kind = K_Enumerated_Value
        or else Table (Types.Node_Id (N)).Kind = K_Sequence
        or else Table (Types.Node_Id (N)).Kind = K_Sequence_Member
        or else Table (Types.Node_Id (N)).Kind = K_Choice
        or else Table (Types.Node_Id (N)).Kind = K_Choice_Member
        or else Table (Types.Node_Id (N)).Kind = K_Literal
        or else Table (Types.Node_Id (N)).Kind = K_Type_Designator
        or else Table (Types.Node_Id (N)).Kind = K_Type_Constraints);

      return Node_Id (Table (Types.Node_Id (N)).L (2));
   end Next_Node;

   procedure Set_Next_Node (N : Node_Id; V : Node_Id) is
   begin
      pragma Assert (False
        or else Table (Types.Node_Id (N)).Kind = K_Node_Id
        or else Table (Types.Node_Id (N)).Kind = K_Definition
        or else Table (Types.Node_Id (N)).Kind = K_Defining_Identifier
        or else Table (Types.Node_Id (N)).Kind = K_ASN1_File
        or else Table (Types.Node_Id (N)).Kind = K_ASN1_Module
        or else Table (Types.Node_Id (N)).Kind = K_Import_Export_Clause
        or else Table (Types.Node_Id (N)).Kind = K_Type_Definition
        or else Table (Types.Node_Id (N)).Kind = K_Enumerated
        or else Table (Types.Node_Id (N)).Kind = K_Enumerated_Value
        or else Table (Types.Node_Id (N)).Kind = K_Sequence
        or else Table (Types.Node_Id (N)).Kind = K_Sequence_Member
        or else Table (Types.Node_Id (N)).Kind = K_Choice
        or else Table (Types.Node_Id (N)).Kind = K_Choice_Member
        or else Table (Types.Node_Id (N)).Kind = K_Literal
        or else Table (Types.Node_Id (N)).Kind = K_Type_Designator
        or else Table (Types.Node_Id (N)).Kind = K_Type_Constraints);

      Table (Types.Node_Id (N)).L (2) := Int (V);
   end Set_Next_Node;

   function Frontend_Node (N : Node_Id) return Node_Id is
   begin
      pragma Assert (False
        or else Table (Types.Node_Id (N)).Kind = K_Node_Id
        or else Table (Types.Node_Id (N)).Kind = K_Definition
        or else Table (Types.Node_Id (N)).Kind = K_Defining_Identifier
        or else Table (Types.Node_Id (N)).Kind = K_ASN1_File
        or else Table (Types.Node_Id (N)).Kind = K_ASN1_Module
        or else Table (Types.Node_Id (N)).Kind = K_Import_Export_Clause
        or else Table (Types.Node_Id (N)).Kind = K_Type_Definition
        or else Table (Types.Node_Id (N)).Kind = K_Enumerated
        or else Table (Types.Node_Id (N)).Kind = K_Enumerated_Value
        or else Table (Types.Node_Id (N)).Kind = K_Sequence
        or else Table (Types.Node_Id (N)).Kind = K_Sequence_Member
        or else Table (Types.Node_Id (N)).Kind = K_Choice
        or else Table (Types.Node_Id (N)).Kind = K_Choice_Member
        or else Table (Types.Node_Id (N)).Kind = K_Literal
        or else Table (Types.Node_Id (N)).Kind = K_Type_Designator
        or else Table (Types.Node_Id (N)).Kind = K_Type_Constraints);

      return Node_Id (Table (Types.Node_Id (N)).L (3));
   end Frontend_Node;

   procedure Set_Frontend_Node (N : Node_Id; V : Node_Id) is
   begin
      pragma Assert (False
        or else Table (Types.Node_Id (N)).Kind = K_Node_Id
        or else Table (Types.Node_Id (N)).Kind = K_Definition
        or else Table (Types.Node_Id (N)).Kind = K_Defining_Identifier
        or else Table (Types.Node_Id (N)).Kind = K_ASN1_File
        or else Table (Types.Node_Id (N)).Kind = K_ASN1_Module
        or else Table (Types.Node_Id (N)).Kind = K_Import_Export_Clause
        or else Table (Types.Node_Id (N)).Kind = K_Type_Definition
        or else Table (Types.Node_Id (N)).Kind = K_Enumerated
        or else Table (Types.Node_Id (N)).Kind = K_Enumerated_Value
        or else Table (Types.Node_Id (N)).Kind = K_Sequence
        or else Table (Types.Node_Id (N)).Kind = K_Sequence_Member
        or else Table (Types.Node_Id (N)).Kind = K_Choice
        or else Table (Types.Node_Id (N)).Kind = K_Choice_Member
        or else Table (Types.Node_Id (N)).Kind = K_Literal
        or else Table (Types.Node_Id (N)).Kind = K_Type_Designator
        or else Table (Types.Node_Id (N)).Kind = K_Type_Constraints);

      Table (Types.Node_Id (N)).L (3) := Int (V);
   end Set_Frontend_Node;

   function Defining_Identifier (N : Node_Id) return Node_Id is
   begin
      pragma Assert (False
        or else Table (Types.Node_Id (N)).Kind = K_Definition
        or else Table (Types.Node_Id (N)).Kind = K_ASN1_File
        or else Table (Types.Node_Id (N)).Kind = K_Type_Definition);

      return Node_Id (Table (Types.Node_Id (N)).L (1));
   end Defining_Identifier;

   procedure Set_Defining_Identifier (N : Node_Id; V : Node_Id) is
   begin
      pragma Assert (False
        or else Table (Types.Node_Id (N)).Kind = K_Definition
        or else Table (Types.Node_Id (N)).Kind = K_ASN1_File
        or else Table (Types.Node_Id (N)).Kind = K_Type_Definition);

      Table (Types.Node_Id (N)).L (1) := Int (V);
   end Set_Defining_Identifier;

   function First_Node (N : List_Id) return Node_Id is
   begin
      pragma Assert (False
        or else Table (Types.Node_Id (N)).Kind = K_List_Id
        or else Table (Types.Node_Id (N)).Kind = K_Enumerated_Value_List);

      return Node_Id (Table (Types.Node_Id (N)).L (1));
   end First_Node;

   procedure Set_First_Node (N : List_Id; V : Node_Id) is
   begin
      pragma Assert (False
        or else Table (Types.Node_Id (N)).Kind = K_List_Id
        or else Table (Types.Node_Id (N)).Kind = K_Enumerated_Value_List);

      Table (Types.Node_Id (N)).L (1) := Int (V);
   end Set_First_Node;

   function Last_Node (N : List_Id) return Node_Id is
   begin
      pragma Assert (False
        or else Table (Types.Node_Id (N)).Kind = K_List_Id
        or else Table (Types.Node_Id (N)).Kind = K_Enumerated_Value_List);

      return Node_Id (Table (Types.Node_Id (N)).L (2));
   end Last_Node;

   procedure Set_Last_Node (N : List_Id; V : Node_Id) is
   begin
      pragma Assert (False
        or else Table (Types.Node_Id (N)).Kind = K_List_Id
        or else Table (Types.Node_Id (N)).Kind = K_Enumerated_Value_List);

      Table (Types.Node_Id (N)).L (2) := Int (V);
   end Set_Last_Node;

   function Name (N : Node_Id) return Name_Id is
   begin
      pragma Assert (False
        or else Table (Types.Node_Id (N)).Kind = K_Defining_Identifier
        or else Table (Types.Node_Id (N)).Kind = K_ASN1_Module
        or else Table (Types.Node_Id (N)).Kind = K_Import_Export_Clause
        or else Table (Types.Node_Id (N)).Kind = K_Type_Definition
        or else Table (Types.Node_Id (N)).Kind = K_Enumerated_Value);

      return Name_Id (Table (Types.Node_Id (N)).L (4));
   end Name;

   procedure Set_Name (N : Node_Id; V : Name_Id) is
   begin
      pragma Assert (False
        or else Table (Types.Node_Id (N)).Kind = K_Defining_Identifier
        or else Table (Types.Node_Id (N)).Kind = K_ASN1_Module
        or else Table (Types.Node_Id (N)).Kind = K_Import_Export_Clause
        or else Table (Types.Node_Id (N)).Kind = K_Type_Definition
        or else Table (Types.Node_Id (N)).Kind = K_Enumerated_Value);

      Table (Types.Node_Id (N)).L (4) := Int (V);
   end Set_Name;

   function Corresponding_Node (N : Node_Id) return Node_Id is
   begin
      pragma Assert (False
        or else Table (Types.Node_Id (N)).Kind = K_Defining_Identifier);

      return Node_Id (Table (Types.Node_Id (N)).L (5));
   end Corresponding_Node;

   procedure Set_Corresponding_Node (N : Node_Id; V : Node_Id) is
   begin
      pragma Assert (False
        or else Table (Types.Node_Id (N)).Kind = K_Defining_Identifier);

      Table (Types.Node_Id (N)).L (5) := Int (V);
   end Set_Corresponding_Node;

   function Compile_Unit (N : Node_Id) return Node_Id is
   begin
      pragma Assert (False
        or else Table (Types.Node_Id (N)).Kind = K_Defining_Identifier);

      return Node_Id (Table (Types.Node_Id (N)).L (6));
   end Compile_Unit;

   procedure Set_Compile_Unit (N : Node_Id; V : Node_Id) is
   begin
      pragma Assert (False
        or else Table (Types.Node_Id (N)).Kind = K_Defining_Identifier);

      Table (Types.Node_Id (N)).L (6) := Int (V);
   end Set_Compile_Unit;

   function Is_Pointer (N : Node_Id) return Boolean is
   begin
      pragma Assert (False
        or else Table (Types.Node_Id (N)).Kind = K_Defining_Identifier);

      return Boolean (Table (Types.Node_Id (N)).B (1));
   end Is_Pointer;

   procedure Set_Is_Pointer (N : Node_Id; V : Boolean) is
   begin
      pragma Assert (False
        or else Table (Types.Node_Id (N)).Kind = K_Defining_Identifier);

      Table (Types.Node_Id (N)).B (1) := Boolean (V);
   end Set_Is_Pointer;

   function Module_Node (N : Node_Id) return Node_Id is
   begin
      pragma Assert (False
        or else Table (Types.Node_Id (N)).Kind = K_ASN1_File);

      return Node_Id (Table (Types.Node_Id (N)).L (4));
   end Module_Node;

   procedure Set_Module_Node (N : Node_Id; V : Node_Id) is
   begin
      pragma Assert (False
        or else Table (Types.Node_Id (N)).Kind = K_ASN1_File);

      Table (Types.Node_Id (N)).L (4) := Int (V);
   end Set_Module_Node;

   function Oid (N : Node_Id) return Node_Id is
   begin
      pragma Assert (False
        or else Table (Types.Node_Id (N)).Kind = K_ASN1_Module);

      return Node_Id (Table (Types.Node_Id (N)).L (5));
   end Oid;

   procedure Set_Oid (N : Node_Id; V : Node_Id) is
   begin
      pragma Assert (False
        or else Table (Types.Node_Id (N)).Kind = K_ASN1_Module);

      Table (Types.Node_Id (N)).L (5) := Int (V);
   end Set_Oid;

   function Automatic_Tags (N : Node_Id) return Boolean is
   begin
      pragma Assert (False
        or else Table (Types.Node_Id (N)).Kind = K_ASN1_Module);

      return Boolean (Table (Types.Node_Id (N)).B (1));
   end Automatic_Tags;

   procedure Set_Automatic_Tags (N : Node_Id; V : Boolean) is
   begin
      pragma Assert (False
        or else Table (Types.Node_Id (N)).Kind = K_ASN1_Module);

      Table (Types.Node_Id (N)).B (1) := Boolean (V);
   end Set_Automatic_Tags;

   function Imported_Clauses (N : Node_Id) return List_Id is
   begin
      pragma Assert (False
        or else Table (Types.Node_Id (N)).Kind = K_ASN1_Module);

      return List_Id (Table (Types.Node_Id (N)).L (6));
   end Imported_Clauses;

   procedure Set_Imported_Clauses (N : Node_Id; V : List_Id) is
   begin
      pragma Assert (False
        or else Table (Types.Node_Id (N)).Kind = K_ASN1_Module);

      Table (Types.Node_Id (N)).L (6) := Int (V);
   end Set_Imported_Clauses;

   function Exported_Clauses (N : Node_Id) return List_Id is
   begin
      pragma Assert (False
        or else Table (Types.Node_Id (N)).Kind = K_ASN1_Module);

      return List_Id (Table (Types.Node_Id (N)).L (7));
   end Exported_Clauses;

   procedure Set_Exported_Clauses (N : Node_Id; V : List_Id) is
   begin
      pragma Assert (False
        or else Table (Types.Node_Id (N)).Kind = K_ASN1_Module);

      Table (Types.Node_Id (N)).L (7) := Int (V);
   end Set_Exported_Clauses;

   function Definitions (N : Node_Id) return List_Id is
   begin
      pragma Assert (False
        or else Table (Types.Node_Id (N)).Kind = K_ASN1_Module);

      return List_Id (Table (Types.Node_Id (N)).L (8));
   end Definitions;

   procedure Set_Definitions (N : Node_Id; V : List_Id) is
   begin
      pragma Assert (False
        or else Table (Types.Node_Id (N)).Kind = K_ASN1_Module);

      Table (Types.Node_Id (N)).L (8) := Int (V);
   end Set_Definitions;

   function Associated_Module (N : Node_Id) return Name_Id is
   begin
      pragma Assert (False
        or else Table (Types.Node_Id (N)).Kind = K_Import_Export_Clause);

      return Name_Id (Table (Types.Node_Id (N)).L (1));
   end Associated_Module;

   procedure Set_Associated_Module (N : Node_Id; V : Name_Id) is
   begin
      pragma Assert (False
        or else Table (Types.Node_Id (N)).Kind = K_Import_Export_Clause);

      Table (Types.Node_Id (N)).L (1) := Int (V);
   end Set_Associated_Module;

   function Declaration (N : Node_Id) return Node_Id is
   begin
      pragma Assert (False
        or else Table (Types.Node_Id (N)).Kind = K_Type_Definition);

      return Node_Id (Table (Types.Node_Id (N)).L (5));
   end Declaration;

   procedure Set_Declaration (N : Node_Id; V : Node_Id) is
   begin
      pragma Assert (False
        or else Table (Types.Node_Id (N)).Kind = K_Type_Definition);

      Table (Types.Node_Id (N)).L (5) := Int (V);
   end Set_Declaration;

   function Values (N : Node_Id) return List_Id is
   begin
      pragma Assert (False
        or else Table (Types.Node_Id (N)).Kind = K_Enumerated
        or else Table (Types.Node_Id (N)).Kind = K_Sequence
        or else Table (Types.Node_Id (N)).Kind = K_Choice);

      return List_Id (Table (Types.Node_Id (N)).L (1));
   end Values;

   procedure Set_Values (N : Node_Id; V : List_Id) is
   begin
      pragma Assert (False
        or else Table (Types.Node_Id (N)).Kind = K_Enumerated
        or else Table (Types.Node_Id (N)).Kind = K_Sequence
        or else Table (Types.Node_Id (N)).Kind = K_Choice);

      Table (Types.Node_Id (N)).L (1) := Int (V);
   end Set_Values;

   function Value (N : Node_Id) return Value_Id is
   begin
      pragma Assert (False
        or else Table (Types.Node_Id (N)).Kind = K_Enumerated_Value
        or else Table (Types.Node_Id (N)).Kind = K_Literal);

      return Value_Id (Table (Types.Node_Id (N)).L (1));
   end Value;

   procedure Set_Value (N : Node_Id; V : Value_Id) is
   begin
      pragma Assert (False
        or else Table (Types.Node_Id (N)).Kind = K_Enumerated_Value
        or else Table (Types.Node_Id (N)).Kind = K_Literal);

      Table (Types.Node_Id (N)).L (1) := Int (V);
   end Set_Value;

   function Member_Name (N : Node_Id) return Name_Id is
   begin
      pragma Assert (False
        or else Table (Types.Node_Id (N)).Kind = K_Sequence_Member
        or else Table (Types.Node_Id (N)).Kind = K_Choice_Member);

      return Name_Id (Table (Types.Node_Id (N)).L (1));
   end Member_Name;

   procedure Set_Member_Name (N : Node_Id; V : Name_Id) is
   begin
      pragma Assert (False
        or else Table (Types.Node_Id (N)).Kind = K_Sequence_Member
        or else Table (Types.Node_Id (N)).Kind = K_Choice_Member);

      Table (Types.Node_Id (N)).L (1) := Int (V);
   end Set_Member_Name;

   function Member_Type (N : Node_Id) return Node_Id is
   begin
      pragma Assert (False
        or else Table (Types.Node_Id (N)).Kind = K_Sequence_Member
        or else Table (Types.Node_Id (N)).Kind = K_Choice_Member);

      return Node_Id (Table (Types.Node_Id (N)).L (4));
   end Member_Type;

   procedure Set_Member_Type (N : Node_Id; V : Node_Id) is
   begin
      pragma Assert (False
        or else Table (Types.Node_Id (N)).Kind = K_Sequence_Member
        or else Table (Types.Node_Id (N)).Kind = K_Choice_Member);

      Table (Types.Node_Id (N)).L (4) := Int (V);
   end Set_Member_Type;

   function Type_Name (N : Node_Id) return Node_Id is
   begin
      pragma Assert (False
        or else Table (Types.Node_Id (N)).Kind = K_Type_Designator);

      return Node_Id (Table (Types.Node_Id (N)).L (1));
   end Type_Name;

   procedure Set_Type_Name (N : Node_Id; V : Node_Id) is
   begin
      pragma Assert (False
        or else Table (Types.Node_Id (N)).Kind = K_Type_Designator);

      Table (Types.Node_Id (N)).L (1) := Int (V);
   end Set_Type_Name;

   function Constraints (N : Node_Id) return Node_Id is
   begin
      pragma Assert (False
        or else Table (Types.Node_Id (N)).Kind = K_Type_Designator);

      return Node_Id (Table (Types.Node_Id (N)).L (4));
   end Constraints;

   procedure Set_Constraints (N : Node_Id; V : Node_Id) is
   begin
      pragma Assert (False
        or else Table (Types.Node_Id (N)).Kind = K_Type_Designator);

      Table (Types.Node_Id (N)).L (4) := Int (V);
   end Set_Constraints;

   function Size_Down (N : Node_Id) return Value_Id is
   begin
      pragma Assert (False
        or else Table (Types.Node_Id (N)).Kind = K_Type_Constraints);

      return Value_Id (Table (Types.Node_Id (N)).L (1));
   end Size_Down;

   procedure Set_Size_Down (N : Node_Id; V : Value_Id) is
   begin
      pragma Assert (False
        or else Table (Types.Node_Id (N)).Kind = K_Type_Constraints);

      Table (Types.Node_Id (N)).L (1) := Int (V);
   end Set_Size_Down;

   function Size_Up (N : Node_Id) return Value_Id is
   begin
      pragma Assert (False
        or else Table (Types.Node_Id (N)).Kind = K_Type_Constraints);

      return Value_Id (Table (Types.Node_Id (N)).L (4));
   end Size_Up;

   procedure Set_Size_Up (N : Node_Id; V : Value_Id) is
   begin
      pragma Assert (False
        or else Table (Types.Node_Id (N)).Kind = K_Type_Constraints);

      Table (Types.Node_Id (N)).L (4) := Int (V);
   end Set_Size_Up;

   procedure W_Node (N : Node_Id) is
   begin
      case Kind (N) is
         when K_Definition =>
            W_Definition
              (Node_Id (N));
         when K_Defining_Identifier =>
            W_Defining_Identifier
              (Node_Id (N));
         when K_ASN1_File =>
            W_ASN1_File
              (Node_Id (N));
         when K_ASN1_Module =>
            W_ASN1_Module
              (Node_Id (N));
         when K_Import_Export_Clause =>
            W_Import_Export_Clause
              (Node_Id (N));
         when K_Type_Definition =>
            W_Type_Definition
              (Node_Id (N));
         when K_Enumerated =>
            W_Enumerated
              (Node_Id (N));
         when K_Enumerated_Value_List =>
            W_Enumerated_Value_List
              (List_Id (N));
         when K_Enumerated_Value =>
            W_Enumerated_Value
              (Node_Id (N));
         when K_Sequence =>
            W_Sequence
              (Node_Id (N));
         when K_Sequence_Member =>
            W_Sequence_Member
              (Node_Id (N));
         when K_Choice =>
            W_Choice
              (Node_Id (N));
         when K_Choice_Member =>
            W_Choice_Member
              (Node_Id (N));
         when K_Literal =>
            W_Literal
              (Node_Id (N));
         when K_Type_Designator =>
            W_Type_Designator
              (Node_Id (N));
         when K_Type_Constraints =>
            W_Type_Constraints
              (Node_Id (N));
         when K_Float =>
            W_Float
              (Base_Type (N));
         when K_Int =>
            W_Int
              (Base_Type (N));
         when K_Char =>
            W_Char
              (Base_Type (N));
         when K_String =>
            W_String
              (Base_Type (N));
         when others =>
            null;
      end case;
   end W_Node;

   procedure W_Definition (N : Node_Id) is
   begin
      W_Node_Header
        (Node_Id (N));
      W_Node_Attribute
        ("Next_Node",
         "Node_Id",
         Image (Next_Node (N)),
         Int (Next_Node (N)));
      W_Node_Attribute
        ("Frontend_Node",
         "Node_Id",
         Image (Frontend_Node (N)),
         Int (Frontend_Node (N)));
      W_Node_Attribute
        ("Defining_Identifier",
         "Node_Id",
         Image (Defining_Identifier (N)),
         Int (Defining_Identifier (N)));
   end W_Definition;

   procedure W_Defining_Identifier (N : Node_Id) is
   begin
      W_Node_Header
        (Node_Id (N));
      W_Node_Attribute
        ("Next_Node",
         "Node_Id",
         Image (Next_Node (N)),
         Int (Next_Node (N)));
      W_Node_Attribute
        ("Frontend_Node",
         "Node_Id",
         Image (Frontend_Node (N)),
         Int (Frontend_Node (N)));
      W_Node_Attribute
        ("Name",
         "Name_Id",
         Image (Name (N)));
      W_Node_Attribute
        ("Corresponding_Node",
         "Node_Id",
         Image (Corresponding_Node (N)),
         Int (Corresponding_Node (N)));
      W_Node_Attribute
        ("Compile_Unit",
         "Node_Id",
         Image (Compile_Unit (N)),
         Int (Compile_Unit (N)));
      W_Node_Attribute
        ("Is_Pointer",
         "Boolean",
         Image (Is_Pointer (N)));
   end W_Defining_Identifier;

   procedure W_ASN1_File (N : Node_Id) is
   begin
      W_Node_Header
        (Node_Id (N));
      W_Node_Attribute
        ("Next_Node",
         "Node_Id",
         Image (Next_Node (N)),
         Int (Next_Node (N)));
      W_Node_Attribute
        ("Frontend_Node",
         "Node_Id",
         Image (Frontend_Node (N)),
         Int (Frontend_Node (N)));
      W_Node_Attribute
        ("Defining_Identifier",
         "Node_Id",
         Image (Defining_Identifier (N)),
         Int (Defining_Identifier (N)));
      W_Node_Attribute
        ("Module_Node",
         "Node_Id",
         Image (Module_Node (N)),
         Int (Module_Node (N)));
   end W_ASN1_File;

   procedure W_ASN1_Module (N : Node_Id) is
   begin
      W_Node_Header
        (Node_Id (N));
      W_Node_Attribute
        ("Next_Node",
         "Node_Id",
         Image (Next_Node (N)),
         Int (Next_Node (N)));
      W_Node_Attribute
        ("Frontend_Node",
         "Node_Id",
         Image (Frontend_Node (N)),
         Int (Frontend_Node (N)));
      W_Node_Attribute
        ("Name",
         "Name_Id",
         Image (Name (N)));
      W_Node_Attribute
        ("Oid",
         "Node_Id",
         Image (Oid (N)),
         Int (Oid (N)));
      W_Node_Attribute
        ("Automatic_Tags",
         "Boolean",
         Image (Automatic_Tags (N)));
      W_Node_Attribute
        ("Imported_Clauses",
         "List_Id",
         Image (Imported_Clauses (N)),
         Int (Imported_Clauses (N)));
      W_Node_Attribute
        ("Exported_Clauses",
         "List_Id",
         Image (Exported_Clauses (N)),
         Int (Exported_Clauses (N)));
      W_Node_Attribute
        ("Definitions",
         "List_Id",
         Image (Definitions (N)),
         Int (Definitions (N)));
   end W_ASN1_Module;

   procedure W_Import_Export_Clause (N : Node_Id) is
   begin
      W_Node_Header
        (Node_Id (N));
      W_Node_Attribute
        ("Next_Node",
         "Node_Id",
         Image (Next_Node (N)),
         Int (Next_Node (N)));
      W_Node_Attribute
        ("Frontend_Node",
         "Node_Id",
         Image (Frontend_Node (N)),
         Int (Frontend_Node (N)));
      W_Node_Attribute
        ("Name",
         "Name_Id",
         Image (Name (N)));
      W_Node_Attribute
        ("Associated_Module",
         "Name_Id",
         Image (Associated_Module (N)));
   end W_Import_Export_Clause;

   procedure W_Type_Definition (N : Node_Id) is
   begin
      W_Node_Header
        (Node_Id (N));
      W_Node_Attribute
        ("Next_Node",
         "Node_Id",
         Image (Next_Node (N)),
         Int (Next_Node (N)));
      W_Node_Attribute
        ("Frontend_Node",
         "Node_Id",
         Image (Frontend_Node (N)),
         Int (Frontend_Node (N)));
      W_Node_Attribute
        ("Defining_Identifier",
         "Node_Id",
         Image (Defining_Identifier (N)),
         Int (Defining_Identifier (N)));
      W_Node_Attribute
        ("Name",
         "Name_Id",
         Image (Name (N)));
      W_Node_Attribute
        ("Declaration",
         "Node_Id",
         Image (Declaration (N)),
         Int (Declaration (N)));
   end W_Type_Definition;

   procedure W_Enumerated (N : Node_Id) is
   begin
      W_Node_Header
        (Node_Id (N));
      W_Node_Attribute
        ("Next_Node",
         "Node_Id",
         Image (Next_Node (N)),
         Int (Next_Node (N)));
      W_Node_Attribute
        ("Frontend_Node",
         "Node_Id",
         Image (Frontend_Node (N)),
         Int (Frontend_Node (N)));
      W_Node_Attribute
        ("Values",
         "List_Id",
         Image (Values (N)),
         Int (Values (N)));
   end W_Enumerated;

   procedure W_Enumerated_Value_List (N : List_Id) is
   begin
      W_Node_Header
        (Node_Id (N));
      W_Node_Attribute
        ("First_Node",
         "Node_Id",
         Image (First_Node (N)),
         Int (First_Node (N)));
      W_Node_Attribute
        ("Last_Node",
         "Node_Id",
         Image (Last_Node (N)),
         Int (Last_Node (N)));
   end W_Enumerated_Value_List;

   procedure W_Enumerated_Value (N : Node_Id) is
   begin
      W_Node_Header
        (Node_Id (N));
      W_Node_Attribute
        ("Next_Node",
         "Node_Id",
         Image (Next_Node (N)),
         Int (Next_Node (N)));
      W_Node_Attribute
        ("Frontend_Node",
         "Node_Id",
         Image (Frontend_Node (N)),
         Int (Frontend_Node (N)));
      W_Node_Attribute
        ("Name",
         "Name_Id",
         Image (Name (N)));
      W_Node_Attribute
        ("Value",
         "Value_Id",
         Image (Value (N)));
   end W_Enumerated_Value;

   procedure W_Sequence (N : Node_Id) is
   begin
      W_Node_Header
        (Node_Id (N));
      W_Node_Attribute
        ("Next_Node",
         "Node_Id",
         Image (Next_Node (N)),
         Int (Next_Node (N)));
      W_Node_Attribute
        ("Frontend_Node",
         "Node_Id",
         Image (Frontend_Node (N)),
         Int (Frontend_Node (N)));
      W_Node_Attribute
        ("Values",
         "List_Id",
         Image (Values (N)),
         Int (Values (N)));
   end W_Sequence;

   procedure W_Sequence_Member (N : Node_Id) is
   begin
      W_Node_Header
        (Node_Id (N));
      W_Node_Attribute
        ("Next_Node",
         "Node_Id",
         Image (Next_Node (N)),
         Int (Next_Node (N)));
      W_Node_Attribute
        ("Frontend_Node",
         "Node_Id",
         Image (Frontend_Node (N)),
         Int (Frontend_Node (N)));
      W_Node_Attribute
        ("Member_Name",
         "Name_Id",
         Image (Member_Name (N)));
      W_Node_Attribute
        ("Member_Type",
         "Node_Id",
         Image (Member_Type (N)),
         Int (Member_Type (N)));
   end W_Sequence_Member;

   procedure W_Choice (N : Node_Id) is
   begin
      W_Node_Header
        (Node_Id (N));
      W_Node_Attribute
        ("Next_Node",
         "Node_Id",
         Image (Next_Node (N)),
         Int (Next_Node (N)));
      W_Node_Attribute
        ("Frontend_Node",
         "Node_Id",
         Image (Frontend_Node (N)),
         Int (Frontend_Node (N)));
      W_Node_Attribute
        ("Values",
         "List_Id",
         Image (Values (N)),
         Int (Values (N)));
   end W_Choice;

   procedure W_Choice_Member (N : Node_Id) is
   begin
      W_Node_Header
        (Node_Id (N));
      W_Node_Attribute
        ("Next_Node",
         "Node_Id",
         Image (Next_Node (N)),
         Int (Next_Node (N)));
      W_Node_Attribute
        ("Frontend_Node",
         "Node_Id",
         Image (Frontend_Node (N)),
         Int (Frontend_Node (N)));
      W_Node_Attribute
        ("Member_Name",
         "Name_Id",
         Image (Member_Name (N)));
      W_Node_Attribute
        ("Member_Type",
         "Node_Id",
         Image (Member_Type (N)),
         Int (Member_Type (N)));
   end W_Choice_Member;

   procedure W_Literal (N : Node_Id) is
   begin
      W_Node_Header
        (Node_Id (N));
      W_Node_Attribute
        ("Next_Node",
         "Node_Id",
         Image (Next_Node (N)),
         Int (Next_Node (N)));
      W_Node_Attribute
        ("Frontend_Node",
         "Node_Id",
         Image (Frontend_Node (N)),
         Int (Frontend_Node (N)));
      W_Node_Attribute
        ("Value",
         "Value_Id",
         Image (Value (N)));
   end W_Literal;

   procedure W_Type_Designator (N : Node_Id) is
   begin
      W_Node_Header
        (Node_Id (N));
      W_Node_Attribute
        ("Next_Node",
         "Node_Id",
         Image (Next_Node (N)),
         Int (Next_Node (N)));
      W_Node_Attribute
        ("Frontend_Node",
         "Node_Id",
         Image (Frontend_Node (N)),
         Int (Frontend_Node (N)));
      W_Node_Attribute
        ("Type_Name",
         "Node_Id",
         Image (Type_Name (N)),
         Int (Type_Name (N)));
      W_Node_Attribute
        ("Constraints",
         "Node_Id",
         Image (Constraints (N)),
         Int (Constraints (N)));
   end W_Type_Designator;

   procedure W_Type_Constraints (N : Node_Id) is
   begin
      W_Node_Header
        (Node_Id (N));
      W_Node_Attribute
        ("Next_Node",
         "Node_Id",
         Image (Next_Node (N)),
         Int (Next_Node (N)));
      W_Node_Attribute
        ("Frontend_Node",
         "Node_Id",
         Image (Frontend_Node (N)),
         Int (Frontend_Node (N)));
      W_Node_Attribute
        ("Size_Down",
         "Value_Id",
         Image (Size_Down (N)));
      W_Node_Attribute
        ("Size_Up",
         "Value_Id",
         Image (Size_Up (N)));
   end W_Type_Constraints;

   procedure W_Float (N : Base_Type) is
   begin
      W_Node_Header
        (Node_Id (N));
      W_Node_Attribute
        ("Image",
         "Name_Id",
         Image (Image (N)));
   end W_Float;

   procedure W_Int (N : Base_Type) is
   begin
      W_Node_Header
        (Node_Id (N));
      W_Node_Attribute
        ("Image",
         "Name_Id",
         Image (Image (N)));
   end W_Int;

   procedure W_Char (N : Base_Type) is
   begin
      W_Node_Header
        (Node_Id (N));
      W_Node_Attribute
        ("Image",
         "Name_Id",
         Image (Image (N)));
   end W_Char;

   procedure W_String (N : Base_Type) is
   begin
      W_Node_Header
        (Node_Id (N));
      W_Node_Attribute
        ("Image",
         "Name_Id",
         Image (Image (N)));
   end W_String;

end Ocarina.Backends.ASN1_Tree.Nodes;