/scripts/config/

ef='#n41'>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
--  PSL - Nodes definition.  This is in fact -*- Ada -*-
--  Copyright (C) 2002-2016 Tristan Gingold
--
--  GHDL is free software; you can redistribute it and/or modify it under
--  the terms of the GNU General Public License as published by the Free
--  Software Foundation; either version 2, or (at your option) any later
--  version.
--
--  GHDL is distributed in the hope that it will be useful, but WITHOUT ANY
--  WARRANTY; without even the implied warranty of MERCHANTABILITY or
--  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
--  for more details.
--
--  You should have received a copy of the GNU General Public License
--  along with GHDL; see the file COPYING.  If not, write to the Free
--  Software Foundation, 59 Temple Place - Suite 330, Boston, MA
--  02111-1307, USA.

with Ada.Unchecked_Conversion;
with Tables;
with PSL.Errors;
with PSL.Hash;
with PSL.Nodes_Meta; use PSL.Nodes_Meta;

package body PSL.Nodes is
   --  Suppress the access check of the table base.  This is really safe to
   --  suppress this check because the table base cannot be null.
   pragma Suppress (Access_Check);

   --  Suppress the index check on the table.
   --  Could be done during non-debug, since this may catch errors (reading
   --  Null_Node.
   --pragma Suppress (Index_Check);

   type Format_Type is
     (
      Format_Short
     );

   -- Common fields are:
   --   Flag1 : Boolean
   --   Flag2 : Boolean
   --   Flag3 : Boolean
   --   Flag4 : Boolean
   --   Flag5 : Boolean
   --   Flag6 : Boolean
   --   Nkind : Kind_Type
   --   State1 : Bit2_Type
   --   State2 : Bit2_Type
   --   Location : Int32
   --   Field1 : Node
   --   Field2 : Node
   --   Field3 : Node
   --   Field4 : Node

   -- Fields of Format_Short:
   --   Field5 : Node
   --   Field6 : Node

   type State_Type is range 0 .. 3;
   type Bit3_Type is range 0 .. 7;

   type Node_Record is record
      Kind : Nkind;
      Flag1 : Boolean;
      Flag2 : Boolean;
      Flag3 : Boolean;
      Flag4 : Boolean;
      Flag5 : Boolean;
      Flag6 : Boolean;
      Flag7 : Boolean;
      Flag8 : Boolean;
      Flag9 : Boolean;
      Flag10 : Boolean;
      Flag11 : Boolean;
      Flag12 : Boolean;
      Flag13 : Boolean;
      Flag14 : Boolean;
      Flag15 : Boolean;
      Flag16 : Boolean;
      State1 : State_Type;
      B3_1 : Bit3_Type;
      Flag17 : Boolean;
      Flag18 : Boolean;
      Flag19 : Boolean;

      Location : Int32;
      Field1 : Node;
      Field2 : Node;
      Field3 : Node;
      Field4 : Node;
      Field5 : Node;
      Field6 : Node;
   end record;
   pragma Pack (Node_Record);
   for Node_Record'Size use 8 * 32;

   package Nodet is new Tables
     (Table_Component_Type => Node_Record,
      Table_Index_Type => Node,
      Table_Low_Bound => 1,
      Table_Initial => 1024);

   Init_Node : constant Node_Record := (Kind => N_Error,
                                        Flag1 => False,
                                        Flag2 => False,
                                        State1 => 0,
                                        B3_1 => 0,
                                        Location => 0,
                                        Field1 => 0,
                                        Field2 => 0,
                                        Field3 => 0,
                                        Field4 => 0,
                                        Field5 => 0,
                                        Field6 => 0,
                                        others => False);

   Free_Nodes : Node := Null_Node;


   function Get_Last_Node return Node is
   begin
      return Nodet.Last;
   end Get_Last_Node;

   function Node_To_Uns32 is new Ada.Unchecked_Conversion
     (Source => Node, Target => Uns32);

   function Uns32_To_Node is new Ada.Unchecked_Conversion
     (Source => Uns32, Target => Node);

   function Node_To_Int32 is new Ada.Unchecked_Conversion
     (Source => Node, Target => Int32);

   function Int32_To_Node is new Ada.Unchecked_Conversion
     (Source => Int32, Target => Node);

   function Node_To_NFA is new Ada.Unchecked_Conversion
     (Source => Node, Target => NFA);

   function NFA_To_Node is new Ada.Unchecked_Conversion
     (Source => NFA, Target => Node);

   function Node_To_HDL_Node is new Ada.Unchecked_Conversion
     (Source => Node, Target => HDL_Node);

   function HDL_Node_To_Node is new Ada.Unchecked_Conversion
     (Source => HDL_Node, Target => Node);

   procedure Set_Kind (N : Node; K : Nkind) is
   begin
      Nodet.Table (N).Kind := K;
   end Set_Kind;

   function Get_Kind (N : Node) return Nkind is
   begin
      return Nodet.Table (N).Kind;
   end Get_Kind;


   procedure Set_Flag1 (N : Node; Flag : Boolean) is
   begin
      Nodet.Table (N).Flag1 := Flag;
   end Set_Flag1;

   function Get_Flag1 (N : Node) return Boolean is
   begin
      return Nodet.Table (N).Flag1;
   end Get_Flag1;

   procedure Set_Flag2 (N : Node; Flag : Boolean) is
   begin
      Nodet.Table (N).Flag2 := Flag;
   end Set_Flag2;

   function Get_Flag2 (N : Node) return Boolean is
   begin
      return Nodet.Table (N).Flag2;
   end Get_Flag2;


   procedure Set_State1 (N : Node; S : State_Type) is
   begin
      Nodet.Table (N).State1 := S;
   end Set_State1;

   function Get_State1 (N : Node) return State_Type is
   begin
      return Nodet.Table (N).State1;
   end Get_State1;


   function Get_Location (N : Node) return Location_Type is
   begin
      return Location_Type (Nodet.Table (N).Location);
   end Get_Location;

   procedure Set_Location (N : Node; Loc : Location_Type) is
   begin
      Nodet.Table (N).Location := Int32 (Loc);
   end Set_Location;


   procedure Set_Field1 (N : Node; V : Node) is
   begin
      Nodet.Table (N).Field1 := V;
   end Set_Field1;

   function Get_Field1 (N : Node) return Node is
   begin
      return Nodet.Table (N).Field1;
   end Get_Field1;


   procedure Set_Field2 (N : Node; V : Node) is
   begin
      Nodet.Table (N).Field2 := V;
   end Set_Field2;

   function Get_Field2 (N : Node) return Node is
   begin
      return Nodet.Table (N).Field2;
   end Get_Field2;


   function Get_Field3 (N : Node) return Node is
   begin
      return Nodet.Table (N).Field3;
   end Get_Field3;

   procedure Set_Field3 (N : Node; V : Node) is
   begin
      Nodet.Table (N).Field3 := V;
   end Set_Field3;


   function Get_Field4 (N : Node) return Node is
   begin
      return Nodet.Table (N).Field4;
   end Get_Field4;

   procedure Set_Field4 (N : Node; V : Node) is
   begin
      Nodet.Table (N).Field4 := V;
   end Set_Field4;


   function Get_Field5 (N : Node) return Node is
   begin
      return Nodet.Table (N).Field5;
   end Get_Field5;

   procedure Set_Field5 (N : Node; V : Node) is
   begin
      Nodet.Table (N).Field5 := V;
   end Set_Field5;


   function Get_Field6 (N : Node) return Node is
   begin
      return Nodet.Table (N).Field6;
   end Get_Field6;

   procedure Set_Field6 (N : Node; V : Node) is
   begin
      Nodet.Table (N).Field6 := V;
   end Set_Field6;


   function Get_Format (Kind : Nkind) return Format_Type;
   pragma Unreferenced (Get_Format);

   function Create_Node (Kind : Nkind) return Node
   is
      Res : Node;
   begin
      if Free_Nodes /= Null_Node then
         Res := Free_Nodes;
         Free_Nodes := Get_Field1 (Res);
      else
         Nodet.Increment_Last;
         Res := Nodet.Last;
      end if;
      Nodet.Table (Res) := Init_Node;
      Set_Kind (Res, Kind);
      return Res;
   end Create_Node;

   procedure Free_Node (N : Node)
   is
   begin
      Set_Kind (N, N_Error);
      Set_Field1 (N, Free_Nodes);
      Free_Nodes := N;
   end Free_Node;

   procedure Failed (Msg : String; N : Node)
   is
   begin
      Errors.Error_Kind (Msg, N);
   end Failed;

   procedure Init is
   begin
      Nodet.Init;
      if Create_Node (N_False) /= False_Node then
         raise Internal_Error;
      end if;
      if Create_Node (N_True) /= True_Node then
         raise Internal_Error;
      end if;
      if Create_Node (N_Number) /= One_Node then
         raise Internal_Error;
      end if;
      Set_Value (One_Node, 1);
      if Create_Node (N_EOS) /= EOS_Node then
         raise Internal_Error;
      end if;
      Set_Hash (EOS_Node, 0);
      PSL.Hash.Init;
   end Init;

   function Get_Psl_Type (N : Node) return PSL_Types is
   begin
      case Get_Kind (N) is
         when N_And_Prop
           | N_Or_Prop
           | N_Paren_Prop
           | N_Log_Imp_Prop
           | N_Always
           | N_Never
           | N_Eventually
           | N_Next
           | N_Next_E
           | N_Next_A
           | N_Next_Event
           | N_Next_Event_A
           | N_Next_Event_E
           | N_Before
           | N_Until
           | N_Abort
           | N_Strong
           | N_Property_Parameter
           | N_Property_Instance =>
            return Type_Property;
         when N_Braced_SERE
           | N_Concat_SERE
           | N_Fusion_SERE
           | N_Within_SERE
           | N_Clocked_SERE
           | N_Overlap_Imp_Seq
           | N_Imp_Seq
           | N_And_Seq
           | N_Or_Seq
           | N_Match_And_Seq
           | N_Star_Repeat_Seq
           | N_Goto_Repeat_Seq
           | N_Equal_Repeat_Seq
           | N_Plus_Repeat_Seq
           | N_Clock_Event
           | N_Sequence_Instance
           | N_Endpoint_Instance
           | N_Sequence_Parameter =>
            return Type_Sequence;
         when N_Name =>
            return Get_Psl_Type (Get_Decl (N));
         when N_HDL_Expr =>
            --  FIXME.
            return Type_Boolean;
         when N_Or_Bool
           | N_And_Bool
           | N_Not_Bool
           | N_Imp_Bool
           | N_False
           | N_True
           | N_Boolean_Parameter
           | N_Paren_Bool =>
            return Type_Boolean;
         when N_Number
           | N_Const_Parameter =>
            return Type_Numeric;
         when N_Vmode
           | N_Vunit
           | N_Vprop
           | N_Hdl_Mod_Name
           | N_Assert_Directive
           | N_Sequence_Declaration
           | N_Endpoint_Declaration
           | N_Property_Declaration
           | N_Actual
           | N_Name_Decl
           | N_Error
           | N_EOS =>
            PSL.Errors.Error_Kind ("get_psl_type", N);
      end case;
   end Get_Psl_Type;

   procedure Reference_Failed (Msg : String; N : Node) is
   begin
      Failed (Msg, N);
   end Reference_Failed;
   pragma Unreferenced (Reference_Failed);

   --  Subprograms
   function Get_Format (Kind : Nkind) return Format_Type is
   begin
      case Kind is
         when N_Error
           | N_Vmode
           | N_Vunit
           | N_Vprop
           | N_Hdl_Mod_Name
           | N_Assert_Directive
           | N_Property_Declaration
           | N_Sequence_Declaration
           | N_Endpoint_Declaration
           | N_Const_Parameter
           | N_Boolean_Parameter
           | N_Property_Parameter
           | N_Sequence_Parameter
           | N_Sequence_Instance
           | N_Endpoint_Instance
           | N_Property_Instance
           | N_Actual
           | N_Clock_Event
           | N_Always
           | N_Never
           | N_Eventually
           | N_Strong
           | N_Imp_Seq
           | N_Overlap_Imp_Seq
           | N_Log_Imp_Prop
           | N_Next
           | N_Next_A
           | N_Next_E
           | N_Next_Event
           | N_Next_Event_A
           | N_Next_Event_E
           | N_Abort
           | N_Until
           | N_Before
           | N_Or_Prop
           | N_And_Prop
           | N_Paren_Prop
           | N_Braced_SERE
           | N_Concat_SERE
           | N_Fusion_SERE
           | N_Within_SERE
           | N_Clocked_SERE
           | N_Match_And_Seq
           | N_And_Seq
           | N_Or_Seq
           | N_Star_Repeat_Seq
           | N_Goto_Repeat_Seq
           | N_Plus_Repeat_Seq
           | N_Equal_Repeat_Seq
           | N_Paren_Bool
           | N_Not_Bool
           | N_And_Bool
           | N_Or_Bool
           | N_Imp_Bool
           | N_HDL_Expr
           | N_False
           | N_True
           | N_EOS
           | N_Name
           | N_Name_Decl
           | N_Number =>
            return Format_Short;
      end case;
   end Get_Format;

   function Get_Identifier (N : Node) return Name_Id is
   begin
      pragma Assert (N /= Null_Node);
      pragma Assert (Has_Identifier (Get_Kind (N)),
                     "no field Identifier");
      return Name_Id'Val (Get_Field1 (N));
   end Get_Identifier;

   procedure Set_Identifier (N : Node; Id : Name_Id) is
   begin
      pragma Assert (N /= Null_Node);
      pragma Assert (Has_Identifier (Get_Kind (N)),
                     "no field Identifier");
      Set_Field1 (N, Name_Id'Pos (Id));
   end Set_Identifier;

   function Get_Label (N : Node) return Name_Id is
   begin
      pragma Assert (N /= Null_Node);
      pragma Assert (Has_Label (Get_Kind (N)),
                     "no field Label");
      return Name_Id'Val (Get_Field1 (N));
   end Get_Label;

   procedure Set_Label (N : Node; Id : Name_Id) is
   begin
      pragma Assert (N /= Null_Node);
      pragma Assert (Has_Label (Get_Kind (N)),
                     "no field Label");
      Set_Field1 (N, Name_Id'Pos (Id));
   end Set_Label;

   function Get_Chain (N : Node) return Node is
   begin
      pragma Assert (N /= Null_Node);
      pragma Assert (Has_Chain (Get_Kind (N)),
                     "no field Chain");
      return Get_Field2 (N);
   end Get_Chain;

   procedure Set_Chain (N : Node; Chain : Node) is
   begin
      pragma Assert (N /= Null_Node);
      pragma Assert (Has_Chain (Get_Kind (N)),
                     "no field Chain");
      Set_Field2 (N, Chain);
   end Set_Chain;

   function Get_Instance (N : Node) return Node is
   begin
      pragma Assert (N /= Null_Node);
      pragma Assert (Has_Instance (Get_Kind (N)),
                     "no field Instance");
      return Get_Field3 (N);
   end Get_Instance;

   procedure Set_Instance (N : Node; Instance : Node) is
   begin
      pragma Assert (N /= Null_Node);
      pragma Assert (Has_Instance (Get_Kind (N)),
                     "no field Instance");
      Set_Field3 (N, Instance);
   end Set_Instance;

   function Get_Prefix (N : Node) return Node is
   begin
      pragma Assert (N /= Null_Node);
      pragma Assert (Has_Prefix (Get_Kind (N)),
                     "no field Prefix");
      return Get_Field2 (N);
   end Get_Prefix;

   procedure Set_Prefix (N : Node; Prefix : Node) is
   begin
      pragma Assert (N /= Null_Node);
      pragma Assert (Has_Prefix (Get_Kind (N)),
                     "no field Prefix");
      Set_Field2 (N, Prefix);
   end Set_Prefix;

   function Get_Item_Chain (N : Node) return Node is
   begin
      pragma Assert (N /= Null_Node);
      pragma Assert (Has_Item_Chain (Get_Kind (N)),
                     "no field Item_Chain");
      return Get_Field4 (N);
   end Get_Item_Chain;

   procedure Set_Item_Chain (N : Node; Item : Node) is
   begin
      pragma Assert (N /= Null_Node);
      pragma Assert (Has_Item_Chain (Get_Kind (N)),
                     "no field Item_Chain");
      Set_Field4 (N, Item);
   end Set_Item_Chain;

   function Get_Property (N : Node) return Node is
   begin
      pragma Assert (N /= Null_Node);
      pragma Assert (Has_Property (Get_Kind (N)),
                     "no field Property");
      return Get_Field4 (N);
   end Get_Property;

   procedure Set_Property (N : Node; Property : Node) is
   begin
      pragma Assert (N /= Null_Node);
      pragma Assert (Has_Property (Get_Kind (N)),
                     "no field Property");
      Set_Field4 (N, Property);
   end Set_Property;

   function Get_String (N : Node) return Node is
   begin
      pragma Assert (N /= Null_Node);
      pragma Assert (Has_String (Get_Kind (N)),
                     "no field String");
      return Get_Field3 (N);
   end Get_String;

   procedure Set_String (N : Node; Str : Node) is
   begin
      pragma Assert (N /= Null_Node);
      pragma Assert (Has_String (Get_Kind (N)),
                     "no field String");
      Set_Field3 (N, Str);
   end Set_String;

   function Get_SERE (N : Node) return Node is
   begin
      pragma Assert (N /= Null_Node);
      pragma Assert (Has_SERE (Get_Kind (N)),
                     "no field SERE");
      return Get_Field1 (N);
   end Get_SERE;

   procedure Set_SERE (N : Node; S : Node) is
   begin
      pragma Assert (N /= Null_Node);
      pragma Assert (Has_SERE (Get_Kind (N)),
                     "no field SERE");
      Set_Field1 (N, S);
   end Set_SERE;

   function Get_Left (N : Node) return Node is
   begin
      pragma Assert (N /= Null_Node);
      pragma Assert (Has_Left (Get_Kind (N)),
                     "no field Left");
      return Get_Field1 (N);
   end Get_Left;

   procedure Set_Left (N : Node; S : Node) is
   begin
      pragma Assert (N /= Null_Node);
      pragma Assert (Has_Left (Get_Kind (N)),
                     "no field Left");
      Set_Field1 (N, S);
   end Set_Left;

   function Get_Right (N : Node) return Node is
   begin
      pragma Assert (N /= Null_Node);
      pragma Assert (Has_Right (Get_Kind (N)),
                     "no field Right");
      return Get_Field2 (N);
   end Get_Right;

   procedure Set_Right (N : Node; S : Node) is
   begin
      pragma Assert (N /= Null_Node);
      pragma Assert (Has_Right (Get_Kind (N)),
                     "no field Right");
      Set_Field2 (N, S);
   end Set_Right;

   function Get_Sequence (N : Node) return Node is
   begin
      pragma Assert (N /= Null_Node);
      pragma Assert (Has_Sequence (Get_Kind (N)),
                     "no field Sequence");
      return Get_Field3 (N);
   end Get_Sequence;

   procedure Set_Sequence (N : Node; S : Node) is
   begin
      pragma Assert (N /= Null_Node);
      pragma Assert (Has_Sequence (Get_Kind (N)),
                     "no field Sequence");
      Set_Field3 (N, S);
   end Set_Sequence;

   function Get_Strong_Flag (N : Node) return Boolean is
   begin
      pragma Assert (N /= Null_Node);
      pragma Assert (Has_Strong_Flag (Get_Kind (N)),
                     "no field Strong_Flag");
      return Get_Flag1 (N);
   end Get_Strong_Flag;

   procedure Set_Strong_Flag (N : Node; B : Boolean) is
   begin
      pragma Assert (N /= Null_Node);
      pragma Assert (Has_Strong_Flag (Get_Kind (N)),
                     "no field Strong_Flag");
      Set_Flag1 (N, B);
   end Set_Strong_Flag;

   function Get_Inclusive_Flag (N : Node) return Boolean is
   begin
      pragma Assert (N /= Null_Node);
      pragma Assert (Has_Inclusive_Flag (Get_Kind (N)),
                     "no field Inclusive_Flag");
      return Get_Flag2 (N);
   end Get_Inclusive_Flag;

   procedure Set_Inclusive_Flag (N : Node; B : Boolean) is
   begin
      pragma Assert (N /= Null_Node);
      pragma Assert (Has_Inclusive_Flag (Get_Kind (N)),
                     "no field Inclusive_Flag");
      Set_Flag2 (N, B);
   end Set_Inclusive_Flag;

   function Get_Low_Bound (N : Node) return Node is
   begin
      pragma Assert (N /= Null_Node);
      pragma Assert (Has_Low_Bound (Get_Kind (N)),
                     "no field Low_Bound");
      return Get_Field1 (N);
   end Get_Low_Bound;

   procedure Set_Low_Bound (N : Node; S : Node) is
   begin
      pragma Assert (N /= Null_Node);
      pragma Assert (Has_Low_Bound (Get_Kind (N)),
                     "no field Low_Bound");
      Set_Field1 (N, S);
   end Set_Low_Bound;

   function Get_High_Bound (N : Node) return Node is
   begin
      pragma Assert (N /= Null_Node);
      pragma Assert (Has_High_Bound (Get_Kind (N)),
                     "no field High_Bound");
      return Get_Field2 (N);
   end Get_High_Bound;

   procedure Set_High_Bound (N : Node; S : Node) is
   begin
      pragma Assert (N /= Null_Node);
      pragma Assert (Has_High_Bound (Get_Kind (N)),
                     "no field High_Bound");
      Set_Field2 (N, S);
   end Set_High_Bound;

   function Get_Number (N : Node) return Node is
   begin
      pragma Assert (N /= Null_Node);
      pragma Assert (Has_Number (Get_Kind (N)),
                     "no field Number");
      return Get_Field1 (N);
   end Get_Number;

   procedure Set_Number (N : Node; S : Node) is
   begin
      pragma Assert (N /= Null_Node);
      pragma Assert (Has_Number (Get_Kind (N)),
                     "no field Number");
      Set_Field1 (N, S);
   end Set_Number;

   function Get_Value (N : Node) return Uns32 is
   begin
      pragma Assert (N /= Null_Node);
      pragma Assert (Has_Value (Get_Kind (N)),
                     "no field Value");
      return Node_To_Uns32 (Get_Field1 (N));
   end Get_Value;

   procedure Set_Value (N : Node; Val : Uns32) is
   begin
      pragma Assert (N /= Null_Node);
      pragma Assert (Has_Value (Get_Kind (N)),
                     "no field Value");
      Set_Field1 (N, Uns32_To_Node (Val));
   end Set_Value;

   function Get_Boolean (N : Node) return Node is
   begin
      pragma Assert (N /= Null_Node);
      pragma Assert (Has_Boolean (Get_Kind (N)),
                     "no field Boolean");
      return Get_Field3 (N);
   end Get_Boolean;

   procedure Set_Boolean (N : Node; B : Node) is
   begin
      pragma Assert (N /= Null_Node);
      pragma Assert (Has_Boolean (Get_Kind (N)),
                     "no field Boolean");
      Set_Field3 (N, B);
   end Set_Boolean;

   function Get_Decl (N : Node) return Node is
   begin
      pragma Assert (N /= Null_Node);
      pragma Assert (Has_Decl (Get_Kind (N)),
                     "no field Decl");
      return Get_Field2 (N);
   end Get_Decl;

   procedure Set_Decl (N : Node; D : Node) is
   begin
      pragma Assert (N /= Null_Node);
      pragma Assert (Has_Decl (Get_Kind (N)),
                     "no field Decl");
      Set_Field2 (N, D);
   end Set_Decl;

   function Get_HDL_Node (N : Node) return HDL_Node is
   begin
      pragma Assert (N /= Null_Node);
      pragma Assert (Has_HDL_Node (Get_Kind (N)),
                     "no field HDL_Node");
      return Node_To_HDL_Node (Get_Field1 (N));
   end Get_HDL_Node;

   procedure Set_HDL_Node (N : Node; H : HDL_Node) is
   begin
      pragma Assert (N /= Null_Node);
      pragma Assert (Has_HDL_Node (Get_Kind (N)),
                     "no field HDL_Node");
      Set_Field1 (N, HDL_Node_To_Node (H));
   end Set_HDL_Node;

   function Get_Hash (N : Node) return Uns32 is
   begin
      pragma Assert (N /= Null_Node);
      pragma Assert (Has_Hash (Get_Kind (N)),
                     "no field Hash");
      return Node_To_Uns32 (Get_Field5 (N));
   end Get_Hash;

   procedure Set_Hash (N : Node; E : Uns32) is
   begin
      pragma Assert (N /= Null_Node);
      pragma Assert (Has_Hash (Get_Kind (N)),
                     "no field Hash");
      Set_Field5 (N, Uns32_To_Node (E));
   end Set_Hash;

   function Get_Hash_Link (N : Node) return Node is
   begin
      pragma Assert (N /= Null_Node);
      pragma Assert (Has_Hash_Link (Get_Kind (N)),
                     "no field Hash_Link");
      return Get_Field6 (N);
   end Get_Hash_Link;

   procedure Set_Hash_Link (N : Node; E : Node) is
   begin
      pragma Assert (N /= Null_Node);
      pragma Assert (Has_Hash_Link (Get_Kind (N)),
                     "no field Hash_Link");
      Set_Field6 (N, E);
   end Set_Hash_Link;

   function Get_HDL_Index (N : Node) return Int32 is
   begin
      pragma Assert (N /= Null_Node);
      pragma Assert (Has_HDL_Index (Get_Kind (N)),
                     "no field HDL_Index");
      return Node_To_Int32 (Get_Field2 (N));
   end Get_HDL_Index;

   procedure Set_HDL_Index (N : Node; Idx : Int32) is
   begin
      pragma Assert (N /= Null_Node);
      pragma Assert (Has_HDL_Index (Get_Kind (N)),
                     "no field HDL_Index");
      Set_Field2 (N, Int32_To_Node (Idx));
   end Set_HDL_Index;

   function Get_Presence (N : Node) return PSL_Presence_Kind is
   begin
      pragma Assert (N /= Null_Node);
      pragma Assert (Has_Presence (Get_Kind (N)),
                     "no field Presence");
      return PSL_Presence_Kind'Val (Get_State1 (N));
   end Get_Presence;

   procedure Set_Presence (N : Node; P : PSL_Presence_Kind) is
   begin
      pragma Assert (N /= Null_Node);
      pragma Assert (Has_Presence (Get_Kind (N)),
                     "no field Presence");
      Set_State1 (N, PSL_Presence_Kind'Pos (P));
   end Set_Presence;

   function Get_NFA (N : Node) return NFA is
   begin
      pragma Assert (N /= Null_Node);
      pragma Assert (Has_NFA (Get_Kind (N)),
                     "no field NFA");
      return Node_To_NFA (Get_Field5 (N));
   end Get_NFA;

   procedure Set_NFA (N : Node; P : NFA) is
   begin
      pragma Assert (N /= Null_Node);
      pragma Assert (Has_NFA (Get_Kind (N)),
                     "no field NFA");
      Set_Field5 (N, NFA_To_Node (P));
   end Set_NFA;

   function Get_Parameter_List (N : Node) return Node is
   begin
      pragma Assert (N /= Null_Node);
      pragma Assert (Has_Parameter_List (Get_Kind (N)),
                     "no field Parameter_List");
      return Get_Field5 (N);
   end Get_Parameter_List;

   procedure Set_Parameter_List (N : Node; E : Node) is
   begin
      pragma Assert (N /= Null_Node);
      pragma Assert (Has_Parameter_List (Get_Kind (N)),
                     "no field Parameter_List");
      Set_Field5 (N, E);
   end Set_Parameter_List;

   function Get_Actual (N : Node) return Node is
   begin
      pragma Assert (N /= Null_Node);
      pragma Assert (Has_Actual (Get_Kind (N)),
                     "no field Actual");
      return Get_Field3 (N);
   end Get_Actual;

   procedure Set_Actual (N : Node; E : Node) is
   begin
      pragma Assert (N /= Null_Node);
      pragma Assert (Has_Actual (Get_Kind (N)),
                     "no field Actual");
      Set_Field3 (N, E);
   end Set_Actual;

   function Get_Formal (N : Node) return Node is
   begin
      pragma Assert (N /= Null_Node);
      pragma Assert (Has_Formal (Get_Kind (N)),
                     "no field Formal");
      return Get_Field4 (N);
   end Get_Formal;

   procedure Set_Formal (N : Node; E : Node) is
   begin
      pragma Assert (N /= Null_Node);
      pragma Assert (Has_Formal (Get_Kind (N)),
                     "no field Formal");
      Set_Field4 (N, E);
   end Set_Formal;

   function Get_Declaration (N : Node) return Node is
   begin
      pragma Assert (N /= Null_Node);
      pragma Assert (Has_Declaration (Get_Kind (N)),
                     "no field Declaration");
      return Get_Field1 (N);
   end Get_Declaration;

   procedure Set_Declaration (N : Node; Decl : Node) is
   begin
      pragma Assert (N /= Null_Node);
      pragma Assert (Has_Declaration (Get_Kind (N)),
                     "no field Declaration");
      Set_Field1 (N, Decl);
   end Set_Declaration;

   function Get_Association_Chain (N : Node) return Node is
   begin
      pragma Assert (N /= Null_Node);
      pragma Assert (Has_Association_Chain (Get_Kind (N)),
                     "no field Association_Chain");
      return Get_Field2 (N);
   end Get_Association_Chain;

   procedure Set_Association_Chain (N : Node; Chain : Node) is
   begin
      pragma Assert (N /= Null_Node);
      pragma Assert (Has_Association_Chain (Get_Kind (N)),
                     "no field Association_Chain");
      Set_Field2 (N, Chain);
   end Set_Association_Chain;

   function Get_Global_Clock (N : Node) return Node is
   begin
      pragma Assert (N /= Null_Node);
      pragma Assert (Has_Global_Clock (Get_Kind (N)),
                     "no field Global_Clock");
      return Get_Field3 (N);
   end Get_Global_Clock;

   procedure Set_Global_Clock (N : Node; Clock : Node) is
   begin
      pragma Assert (N /= Null_Node);
      pragma Assert (Has_Global_Clock (Get_Kind (N)),
                     "no field Global_Clock");
      Set_Field3 (N, Clock);
   end Set_Global_Clock;


end PSL.Nodes;