1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
11 -- Copyright (C) 2001 Free Software Foundation, Inc. --
13 -- GNAT is free software; you can redistribute it and/or modify it under --
14 -- terms of the GNU General Public License as published by the Free Soft- --
15 -- ware Foundation; either version 2, or (at your option) any later ver- --
16 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
17 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
18 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
19 -- for more details. You should have received a copy of the GNU General --
20 -- Public License distributed with GNAT; see file COPYING. If not, write --
21 -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
22 -- MA 02111-1307, USA. --
24 -- GNAT was originally developed by the GNAT team at New York University. --
25 -- It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). --
27 ------------------------------------------------------------------------------
29 with Stringt
; use Stringt
;
31 package body Prj
.Tree
is
33 use Tree_Private_Part
;
35 --------------------------------
36 -- Associative_Array_Index_Of --
37 --------------------------------
39 function Associative_Array_Index_Of
40 (Node
: Project_Node_Id
)
47 (Project_Nodes
.Table
(Node
).Kind
= N_Attribute_Declaration
));
48 return Project_Nodes
.Table
(Node
).Value
;
49 end Associative_Array_Index_Of
;
51 ----------------------
52 -- Case_Insensitive --
53 ----------------------
55 function Case_Insensitive
(Node
: Project_Node_Id
) return Boolean is
60 (Project_Nodes
.Table
(Node
).Kind
= N_Attribute_Declaration
));
61 return Project_Nodes
.Table
(Node
).Case_Insensitive
;
64 --------------------------------
65 -- Case_Variable_Reference_Of --
66 --------------------------------
68 function Case_Variable_Reference_Of
69 (Node
: Project_Node_Id
)
70 return Project_Node_Id
76 Project_Nodes
.Table
(Node
).Kind
= N_Case_Construction
);
77 return Project_Nodes
.Table
(Node
).Field1
;
78 end Case_Variable_Reference_Of
;
80 -----------------------
81 -- Current_Item_Node --
82 -----------------------
84 function Current_Item_Node
85 (Node
: Project_Node_Id
)
86 return Project_Node_Id
92 Project_Nodes
.Table
(Node
).Kind
= N_Declarative_Item
);
93 return Project_Nodes
.Table
(Node
).Field1
;
94 end Current_Item_Node
;
100 function Current_Term
101 (Node
: Project_Node_Id
)
102 return Project_Node_Id
108 Project_Nodes
.Table
(Node
).Kind
= N_Term
);
109 return Project_Nodes
.Table
(Node
).Field1
;
112 --------------------------
113 -- Default_Project_Node --
114 --------------------------
116 function Default_Project_Node
117 (Of_Kind
: Project_Node_Kind
;
118 And_Expr_Kind
: Variable_Kind
:= Undefined
)
119 return Project_Node_Id
122 Project_Nodes
.Increment_Last
;
123 Project_Nodes
.Table
(Project_Nodes
.Last
) :=
125 Location
=> No_Location
,
126 Directory
=> No_Name
,
127 Expr_Kind
=> And_Expr_Kind
,
128 Variables
=> Empty_Node
,
129 Packages
=> Empty_Node
,
130 Pkg_Id
=> Empty_Package
,
132 Path_Name
=> No_Name
,
134 Field1
=> Empty_Node
,
135 Field2
=> Empty_Node
,
136 Field3
=> Empty_Node
,
137 Case_Insensitive
=> False);
138 return Project_Nodes
.Last
;
139 end Default_Project_Node
;
145 function Directory_Of
(Node
: Project_Node_Id
) return Name_Id
is
150 Project_Nodes
.Table
(Node
).Kind
= N_Project
);
151 return Project_Nodes
.Table
(Node
).Directory
;
154 ------------------------
155 -- Expression_Kind_Of --
156 ------------------------
158 function Expression_Kind_Of
(Node
: Project_Node_Id
) return Variable_Kind
is
163 (Project_Nodes
.Table
(Node
).Kind
= N_Literal_String
165 Project_Nodes
.Table
(Node
).Kind
= N_Attribute_Declaration
167 Project_Nodes
.Table
(Node
).Kind
= N_Variable_Declaration
169 Project_Nodes
.Table
(Node
).Kind
= N_Typed_Variable_Declaration
171 Project_Nodes
.Table
(Node
).Kind
= N_Expression
173 Project_Nodes
.Table
(Node
).Kind
= N_Term
175 Project_Nodes
.Table
(Node
).Kind
= N_Variable_Reference
177 Project_Nodes
.Table
(Node
).Kind
= N_Attribute_Reference
));
179 return Project_Nodes
.Table
(Node
).Expr_Kind
;
180 end Expression_Kind_Of
;
186 function Expression_Of
187 (Node
: Project_Node_Id
)
188 return Project_Node_Id
194 (Project_Nodes
.Table
(Node
).Kind
= N_Attribute_Declaration
196 Project_Nodes
.Table
(Node
).Kind
= N_Typed_Variable_Declaration
198 Project_Nodes
.Table
(Node
).Kind
= N_Variable_Declaration
));
200 return Project_Nodes
.Table
(Node
).Field1
;
203 ---------------------------
204 -- External_Reference_Of --
205 ---------------------------
207 function External_Reference_Of
208 (Node
: Project_Node_Id
)
209 return Project_Node_Id
215 Project_Nodes
.Table
(Node
).Kind
= N_External_Value
);
216 return Project_Nodes
.Table
(Node
).Field1
;
217 end External_Reference_Of
;
219 -------------------------
220 -- External_Default_Of --
221 -------------------------
223 function External_Default_Of
224 (Node
: Project_Node_Id
)
225 return Project_Node_Id
231 Project_Nodes
.Table
(Node
).Kind
= N_External_Value
);
232 return Project_Nodes
.Table
(Node
).Field2
;
233 end External_Default_Of
;
235 ------------------------
236 -- First_Case_Item_Of --
237 ------------------------
239 function First_Case_Item_Of
240 (Node
: Project_Node_Id
)
241 return Project_Node_Id
247 Project_Nodes
.Table
(Node
).Kind
= N_Case_Construction
);
248 return Project_Nodes
.Table
(Node
).Field2
;
249 end First_Case_Item_Of
;
251 ---------------------
252 -- First_Choice_Of --
253 ---------------------
255 function First_Choice_Of
256 (Node
: Project_Node_Id
)
257 return Project_Node_Id
263 Project_Nodes
.Table
(Node
).Kind
= N_Case_Item
);
264 return Project_Nodes
.Table
(Node
).Field1
;
267 -------------------------------
268 -- First_Declarative_Item_Of --
269 -------------------------------
271 function First_Declarative_Item_Of
272 (Node
: Project_Node_Id
)
273 return Project_Node_Id
279 (Project_Nodes
.Table
(Node
).Kind
= N_Project_Declaration
281 Project_Nodes
.Table
(Node
).Kind
= N_Case_Item
283 Project_Nodes
.Table
(Node
).Kind
= N_Package_Declaration
));
285 if Project_Nodes
.Table
(Node
).Kind
= N_Project_Declaration
then
286 return Project_Nodes
.Table
(Node
).Field1
;
288 return Project_Nodes
.Table
(Node
).Field2
;
290 end First_Declarative_Item_Of
;
292 ------------------------------
293 -- First_Expression_In_List --
294 ------------------------------
296 function First_Expression_In_List
297 (Node
: Project_Node_Id
)
298 return Project_Node_Id
304 Project_Nodes
.Table
(Node
).Kind
= N_Literal_String_List
);
305 return Project_Nodes
.Table
(Node
).Field1
;
306 end First_Expression_In_List
;
308 --------------------------
309 -- First_Literal_String --
310 --------------------------
312 function First_Literal_String
313 (Node
: Project_Node_Id
)
314 return Project_Node_Id
320 Project_Nodes
.Table
(Node
).Kind
= N_String_Type_Declaration
);
321 return Project_Nodes
.Table
(Node
).Field1
;
322 end First_Literal_String
;
324 ----------------------
325 -- First_Package_Of --
326 ----------------------
328 function First_Package_Of
329 (Node
: Project_Node_Id
)
330 return Package_Declaration_Id
336 Project_Nodes
.Table
(Node
).Kind
= N_Project
);
337 return Project_Nodes
.Table
(Node
).Packages
;
338 end First_Package_Of
;
340 --------------------------
341 -- First_String_Type_Of --
342 --------------------------
344 function First_String_Type_Of
345 (Node
: Project_Node_Id
)
346 return Project_Node_Id
352 Project_Nodes
.Table
(Node
).Kind
= N_Project
);
353 return Project_Nodes
.Table
(Node
).Field3
;
354 end First_String_Type_Of
;
361 (Node
: Project_Node_Id
)
362 return Project_Node_Id
368 Project_Nodes
.Table
(Node
).Kind
= N_Expression
);
369 return Project_Nodes
.Table
(Node
).Field1
;
372 -----------------------
373 -- First_Variable_Of --
374 -----------------------
376 function First_Variable_Of
377 (Node
: Project_Node_Id
)
378 return Variable_Node_Id
384 (Project_Nodes
.Table
(Node
).Kind
= N_Project
386 Project_Nodes
.Table
(Node
).Kind
= N_Package_Declaration
));
388 return Project_Nodes
.Table
(Node
).Variables
;
389 end First_Variable_Of
;
391 --------------------------
392 -- First_With_Clause_Of --
393 --------------------------
395 function First_With_Clause_Of
396 (Node
: Project_Node_Id
)
397 return Project_Node_Id
403 Project_Nodes
.Table
(Node
).Kind
= N_Project
);
404 return Project_Nodes
.Table
(Node
).Field1
;
405 end First_With_Clause_Of
;
411 procedure Initialize
is
413 Project_Nodes
.Set_Last
(Empty_Node
);
414 Projects_Htable
.Reset
;
421 function Kind_Of
(Node
: Project_Node_Id
) return Project_Node_Kind
is
423 pragma Assert
(Node
/= Empty_Node
);
424 return Project_Nodes
.Table
(Node
).Kind
;
431 function Location_Of
(Node
: Project_Node_Id
) return Source_Ptr
is
433 pragma Assert
(Node
/= Empty_Node
);
434 return Project_Nodes
.Table
(Node
).Location
;
437 -------------------------
438 -- Modified_Project_Of --
439 -------------------------
441 function Modified_Project_Of
442 (Node
: Project_Node_Id
)
443 return Project_Node_Id
449 Project_Nodes
.Table
(Node
).Kind
= N_Project_Declaration
);
450 return Project_Nodes
.Table
(Node
).Field2
;
451 end Modified_Project_Of
;
453 ------------------------------
454 -- Modified_Project_Path_Of --
455 ------------------------------
457 function Modified_Project_Path_Of
458 (Node
: Project_Node_Id
)
465 Project_Nodes
.Table
(Node
).Kind
= N_Project
);
466 return Project_Nodes
.Table
(Node
).Value
;
467 end Modified_Project_Path_Of
;
473 function Name_Of
(Node
: Project_Node_Id
) return Name_Id
is
475 pragma Assert
(Node
/= Empty_Node
);
476 return Project_Nodes
.Table
(Node
).Name
;
483 function Next_Case_Item
484 (Node
: Project_Node_Id
)
485 return Project_Node_Id
491 Project_Nodes
.Table
(Node
).Kind
= N_Case_Item
);
492 return Project_Nodes
.Table
(Node
).Field3
;
495 ---------------------------
496 -- Next_Declarative_Item --
497 ---------------------------
499 function Next_Declarative_Item
500 (Node
: Project_Node_Id
)
501 return Project_Node_Id
507 Project_Nodes
.Table
(Node
).Kind
= N_Declarative_Item
);
508 return Project_Nodes
.Table
(Node
).Field2
;
509 end Next_Declarative_Item
;
511 -----------------------------
512 -- Next_Expression_In_List --
513 -----------------------------
515 function Next_Expression_In_List
516 (Node
: Project_Node_Id
)
517 return Project_Node_Id
523 Project_Nodes
.Table
(Node
).Kind
= N_Expression
);
524 return Project_Nodes
.Table
(Node
).Field2
;
525 end Next_Expression_In_List
;
527 -------------------------
528 -- Next_Literal_String --
529 -------------------------
531 function Next_Literal_String
532 (Node
: Project_Node_Id
)
533 return Project_Node_Id
539 Project_Nodes
.Table
(Node
).Kind
= N_Literal_String
);
540 return Project_Nodes
.Table
(Node
).Field1
;
541 end Next_Literal_String
;
543 -----------------------------
544 -- Next_Package_In_Project --
545 -----------------------------
547 function Next_Package_In_Project
548 (Node
: Project_Node_Id
)
549 return Project_Node_Id
555 Project_Nodes
.Table
(Node
).Kind
= N_Package_Declaration
);
556 return Project_Nodes
.Table
(Node
).Field3
;
557 end Next_Package_In_Project
;
559 ----------------------
560 -- Next_String_Type --
561 ----------------------
563 function Next_String_Type
564 (Node
: Project_Node_Id
)
565 return Project_Node_Id
571 Project_Nodes
.Table
(Node
).Kind
= N_String_Type_Declaration
);
572 return Project_Nodes
.Table
(Node
).Field2
;
573 end Next_String_Type
;
580 (Node
: Project_Node_Id
)
581 return Project_Node_Id
587 Project_Nodes
.Table
(Node
).Kind
= N_Term
);
588 return Project_Nodes
.Table
(Node
).Field2
;
595 function Next_Variable
596 (Node
: Project_Node_Id
)
597 return Project_Node_Id
603 (Project_Nodes
.Table
(Node
).Kind
= N_Typed_Variable_Declaration
605 Project_Nodes
.Table
(Node
).Kind
= N_Variable_Declaration
));
607 return Project_Nodes
.Table
(Node
).Field3
;
610 -------------------------
611 -- Next_With_Clause_Of --
612 -------------------------
614 function Next_With_Clause_Of
615 (Node
: Project_Node_Id
)
616 return Project_Node_Id
622 Project_Nodes
.Table
(Node
).Kind
= N_With_Clause
);
623 return Project_Nodes
.Table
(Node
).Field2
;
624 end Next_With_Clause_Of
;
630 function Package_Id_Of
(Node
: Project_Node_Id
) return Package_Node_Id
is
635 Project_Nodes
.Table
(Node
).Kind
= N_Package_Declaration
);
636 return Project_Nodes
.Table
(Node
).Pkg_Id
;
639 ---------------------
640 -- Package_Node_Of --
641 ---------------------
643 function Package_Node_Of
644 (Node
: Project_Node_Id
)
645 return Project_Node_Id
651 (Project_Nodes
.Table
(Node
).Kind
= N_Variable_Reference
653 Project_Nodes
.Table
(Node
).Kind
= N_Attribute_Reference
));
654 return Project_Nodes
.Table
(Node
).Field2
;
661 function Path_Name_Of
(Node
: Project_Node_Id
) return Name_Id
is
666 (Project_Nodes
.Table
(Node
).Kind
= N_Project
668 Project_Nodes
.Table
(Node
).Kind
= N_With_Clause
));
669 return Project_Nodes
.Table
(Node
).Path_Name
;
672 ----------------------------
673 -- Project_Declaration_Of --
674 ----------------------------
676 function Project_Declaration_Of
677 (Node
: Project_Node_Id
)
678 return Project_Node_Id
684 Project_Nodes
.Table
(Node
).Kind
= N_Project
);
685 return Project_Nodes
.Table
(Node
).Field2
;
686 end Project_Declaration_Of
;
688 ---------------------
689 -- Project_Node_Of --
690 ---------------------
692 function Project_Node_Of
693 (Node
: Project_Node_Id
)
694 return Project_Node_Id
700 (Project_Nodes
.Table
(Node
).Kind
= N_With_Clause
702 Project_Nodes
.Table
(Node
).Kind
= N_Variable_Reference
704 Project_Nodes
.Table
(Node
).Kind
= N_Attribute_Reference
));
705 return Project_Nodes
.Table
(Node
).Field1
;
708 -----------------------------------
709 -- Project_Of_Renamed_Package_Of --
710 -----------------------------------
712 function Project_Of_Renamed_Package_Of
713 (Node
: Project_Node_Id
)
714 return Project_Node_Id
720 Project_Nodes
.Table
(Node
).Kind
= N_Package_Declaration
);
721 return Project_Nodes
.Table
(Node
).Field1
;
722 end Project_Of_Renamed_Package_Of
;
724 ------------------------------------
725 -- Set_Associative_Array_Index_Of --
726 ------------------------------------
728 procedure Set_Associative_Array_Index_Of
729 (Node
: Project_Node_Id
;
736 Project_Nodes
.Table
(Node
).Kind
= N_Attribute_Declaration
);
737 Project_Nodes
.Table
(Node
).Value
:= To
;
738 end Set_Associative_Array_Index_Of
;
740 --------------------------
741 -- Set_Case_Insensitive --
742 --------------------------
744 procedure Set_Case_Insensitive
745 (Node
: Project_Node_Id
;
752 Project_Nodes
.Table
(Node
).Kind
= N_Attribute_Declaration
);
753 Project_Nodes
.Table
(Node
).Case_Insensitive
:= To
;
754 end Set_Case_Insensitive
;
756 ------------------------------------
757 -- Set_Case_Variable_Reference_Of --
758 ------------------------------------
760 procedure Set_Case_Variable_Reference_Of
761 (Node
: Project_Node_Id
;
762 To
: Project_Node_Id
)
768 Project_Nodes
.Table
(Node
).Kind
= N_Case_Construction
);
769 Project_Nodes
.Table
(Node
).Field1
:= To
;
770 end Set_Case_Variable_Reference_Of
;
772 ---------------------------
773 -- Set_Current_Item_Node --
774 ---------------------------
776 procedure Set_Current_Item_Node
777 (Node
: Project_Node_Id
;
778 To
: Project_Node_Id
)
784 Project_Nodes
.Table
(Node
).Kind
= N_Declarative_Item
);
785 Project_Nodes
.Table
(Node
).Field1
:= To
;
786 end Set_Current_Item_Node
;
788 ----------------------
789 -- Set_Current_Term --
790 ----------------------
792 procedure Set_Current_Term
793 (Node
: Project_Node_Id
;
794 To
: Project_Node_Id
)
800 Project_Nodes
.Table
(Node
).Kind
= N_Term
);
801 Project_Nodes
.Table
(Node
).Field1
:= To
;
802 end Set_Current_Term
;
804 ----------------------
805 -- Set_Directory_Of --
806 ----------------------
808 procedure Set_Directory_Of
809 (Node
: Project_Node_Id
;
816 Project_Nodes
.Table
(Node
).Kind
= N_Project
);
817 Project_Nodes
.Table
(Node
).Directory
:= To
;
818 end Set_Directory_Of
;
820 ----------------------------
821 -- Set_Expression_Kind_Of --
822 ----------------------------
824 procedure Set_Expression_Kind_Of
825 (Node
: Project_Node_Id
;
832 (Project_Nodes
.Table
(Node
).Kind
= N_Literal_String
834 Project_Nodes
.Table
(Node
).Kind
= N_Attribute_Declaration
836 Project_Nodes
.Table
(Node
).Kind
= N_Variable_Declaration
838 Project_Nodes
.Table
(Node
).Kind
= N_Typed_Variable_Declaration
840 Project_Nodes
.Table
(Node
).Kind
= N_Expression
842 Project_Nodes
.Table
(Node
).Kind
= N_Term
844 Project_Nodes
.Table
(Node
).Kind
= N_Variable_Reference
846 Project_Nodes
.Table
(Node
).Kind
= N_Attribute_Reference
));
847 Project_Nodes
.Table
(Node
).Expr_Kind
:= To
;
848 end Set_Expression_Kind_Of
;
850 -----------------------
851 -- Set_Expression_Of --
852 -----------------------
854 procedure Set_Expression_Of
855 (Node
: Project_Node_Id
;
856 To
: Project_Node_Id
)
862 (Project_Nodes
.Table
(Node
).Kind
= N_Attribute_Declaration
864 Project_Nodes
.Table
(Node
).Kind
= N_Typed_Variable_Declaration
866 Project_Nodes
.Table
(Node
).Kind
= N_Variable_Declaration
));
867 Project_Nodes
.Table
(Node
).Field1
:= To
;
868 end Set_Expression_Of
;
870 -------------------------------
871 -- Set_External_Reference_Of --
872 -------------------------------
874 procedure Set_External_Reference_Of
875 (Node
: Project_Node_Id
;
876 To
: Project_Node_Id
)
882 Project_Nodes
.Table
(Node
).Kind
= N_External_Value
);
883 Project_Nodes
.Table
(Node
).Field1
:= To
;
884 end Set_External_Reference_Of
;
886 -----------------------------
887 -- Set_External_Default_Of --
888 -----------------------------
890 procedure Set_External_Default_Of
891 (Node
: Project_Node_Id
;
892 To
: Project_Node_Id
)
898 Project_Nodes
.Table
(Node
).Kind
= N_External_Value
);
899 Project_Nodes
.Table
(Node
).Field2
:= To
;
900 end Set_External_Default_Of
;
902 ----------------------------
903 -- Set_First_Case_Item_Of --
904 ----------------------------
906 procedure Set_First_Case_Item_Of
907 (Node
: Project_Node_Id
;
908 To
: Project_Node_Id
)
914 Project_Nodes
.Table
(Node
).Kind
= N_Case_Construction
);
915 Project_Nodes
.Table
(Node
).Field2
:= To
;
916 end Set_First_Case_Item_Of
;
918 -------------------------
919 -- Set_First_Choice_Of --
920 -------------------------
922 procedure Set_First_Choice_Of
923 (Node
: Project_Node_Id
;
924 To
: Project_Node_Id
)
930 Project_Nodes
.Table
(Node
).Kind
= N_Case_Item
);
931 Project_Nodes
.Table
(Node
).Field1
:= To
;
932 end Set_First_Choice_Of
;
934 ------------------------
935 -- Set_Next_Case_Item --
936 ------------------------
938 procedure Set_Next_Case_Item
939 (Node
: Project_Node_Id
;
940 To
: Project_Node_Id
)
946 Project_Nodes
.Table
(Node
).Kind
= N_Case_Item
);
947 Project_Nodes
.Table
(Node
).Field3
:= To
;
948 end Set_Next_Case_Item
;
950 -----------------------------------
951 -- Set_First_Declarative_Item_Of --
952 -----------------------------------
954 procedure Set_First_Declarative_Item_Of
955 (Node
: Project_Node_Id
;
956 To
: Project_Node_Id
)
962 (Project_Nodes
.Table
(Node
).Kind
= N_Project_Declaration
964 Project_Nodes
.Table
(Node
).Kind
= N_Case_Item
966 Project_Nodes
.Table
(Node
).Kind
= N_Package_Declaration
));
968 if Project_Nodes
.Table
(Node
).Kind
= N_Project_Declaration
then
969 Project_Nodes
.Table
(Node
).Field1
:= To
;
971 Project_Nodes
.Table
(Node
).Field2
:= To
;
973 end Set_First_Declarative_Item_Of
;
975 ----------------------------------
976 -- Set_First_Expression_In_List --
977 ----------------------------------
979 procedure Set_First_Expression_In_List
980 (Node
: Project_Node_Id
;
981 To
: Project_Node_Id
)
987 Project_Nodes
.Table
(Node
).Kind
= N_Literal_String_List
);
988 Project_Nodes
.Table
(Node
).Field1
:= To
;
989 end Set_First_Expression_In_List
;
991 ------------------------------
992 -- Set_First_Literal_String --
993 ------------------------------
995 procedure Set_First_Literal_String
996 (Node
: Project_Node_Id
;
997 To
: Project_Node_Id
)
1003 Project_Nodes
.Table
(Node
).Kind
= N_String_Type_Declaration
);
1004 Project_Nodes
.Table
(Node
).Field1
:= To
;
1005 end Set_First_Literal_String
;
1007 --------------------------
1008 -- Set_First_Package_Of --
1009 --------------------------
1011 procedure Set_First_Package_Of
1012 (Node
: Project_Node_Id
;
1013 To
: Package_Declaration_Id
)
1019 Project_Nodes
.Table
(Node
).Kind
= N_Project
);
1020 Project_Nodes
.Table
(Node
).Packages
:= To
;
1021 end Set_First_Package_Of
;
1023 ------------------------------
1024 -- Set_First_String_Type_Of --
1025 ------------------------------
1027 procedure Set_First_String_Type_Of
1028 (Node
: Project_Node_Id
;
1029 To
: Project_Node_Id
)
1035 Project_Nodes
.Table
(Node
).Kind
= N_Project
);
1036 Project_Nodes
.Table
(Node
).Field3
:= To
;
1037 end Set_First_String_Type_Of
;
1039 --------------------
1040 -- Set_First_Term --
1041 --------------------
1043 procedure Set_First_Term
1044 (Node
: Project_Node_Id
;
1045 To
: Project_Node_Id
)
1051 Project_Nodes
.Table
(Node
).Kind
= N_Expression
);
1052 Project_Nodes
.Table
(Node
).Field1
:= To
;
1055 ---------------------------
1056 -- Set_First_Variable_Of --
1057 ---------------------------
1059 procedure Set_First_Variable_Of
1060 (Node
: Project_Node_Id
;
1061 To
: Variable_Node_Id
)
1067 (Project_Nodes
.Table
(Node
).Kind
= N_Project
1069 Project_Nodes
.Table
(Node
).Kind
= N_Package_Declaration
));
1070 Project_Nodes
.Table
(Node
).Variables
:= To
;
1071 end Set_First_Variable_Of
;
1073 ------------------------------
1074 -- Set_First_With_Clause_Of --
1075 ------------------------------
1077 procedure Set_First_With_Clause_Of
1078 (Node
: Project_Node_Id
;
1079 To
: Project_Node_Id
)
1085 Project_Nodes
.Table
(Node
).Kind
= N_Project
);
1086 Project_Nodes
.Table
(Node
).Field1
:= To
;
1087 end Set_First_With_Clause_Of
;
1093 procedure Set_Kind_Of
1094 (Node
: Project_Node_Id
;
1095 To
: Project_Node_Kind
)
1098 pragma Assert
(Node
/= Empty_Node
);
1099 Project_Nodes
.Table
(Node
).Kind
:= To
;
1102 ---------------------
1103 -- Set_Location_Of --
1104 ---------------------
1106 procedure Set_Location_Of
1107 (Node
: Project_Node_Id
;
1111 pragma Assert
(Node
/= Empty_Node
);
1112 Project_Nodes
.Table
(Node
).Location
:= To
;
1113 end Set_Location_Of
;
1115 -----------------------------
1116 -- Set_Modified_Project_Of --
1117 -----------------------------
1119 procedure Set_Modified_Project_Of
1120 (Node
: Project_Node_Id
;
1121 To
: Project_Node_Id
)
1127 Project_Nodes
.Table
(Node
).Kind
= N_Project_Declaration
);
1128 Project_Nodes
.Table
(Node
).Field2
:= To
;
1129 end Set_Modified_Project_Of
;
1131 ----------------------------------
1132 -- Set_Modified_Project_Path_Of --
1133 ----------------------------------
1135 procedure Set_Modified_Project_Path_Of
1136 (Node
: Project_Node_Id
;
1143 Project_Nodes
.Table
(Node
).Kind
= N_Project
);
1144 Project_Nodes
.Table
(Node
).Value
:= To
;
1145 end Set_Modified_Project_Path_Of
;
1151 procedure Set_Name_Of
1152 (Node
: Project_Node_Id
;
1156 pragma Assert
(Node
/= Empty_Node
);
1157 Project_Nodes
.Table
(Node
).Name
:= To
;
1160 -------------------------------
1161 -- Set_Next_Declarative_Item --
1162 -------------------------------
1164 procedure Set_Next_Declarative_Item
1165 (Node
: Project_Node_Id
;
1166 To
: Project_Node_Id
)
1172 Project_Nodes
.Table
(Node
).Kind
= N_Declarative_Item
);
1173 Project_Nodes
.Table
(Node
).Field2
:= To
;
1174 end Set_Next_Declarative_Item
;
1176 ---------------------------------
1177 -- Set_Next_Expression_In_List --
1178 ---------------------------------
1180 procedure Set_Next_Expression_In_List
1181 (Node
: Project_Node_Id
;
1182 To
: Project_Node_Id
)
1188 Project_Nodes
.Table
(Node
).Kind
= N_Expression
);
1189 Project_Nodes
.Table
(Node
).Field2
:= To
;
1190 end Set_Next_Expression_In_List
;
1192 -----------------------------
1193 -- Set_Next_Literal_String --
1194 -----------------------------
1196 procedure Set_Next_Literal_String
1197 (Node
: Project_Node_Id
;
1198 To
: Project_Node_Id
)
1204 Project_Nodes
.Table
(Node
).Kind
= N_Literal_String
);
1205 Project_Nodes
.Table
(Node
).Field1
:= To
;
1206 end Set_Next_Literal_String
;
1208 ---------------------------------
1209 -- Set_Next_Package_In_Project --
1210 ---------------------------------
1212 procedure Set_Next_Package_In_Project
1213 (Node
: Project_Node_Id
;
1214 To
: Project_Node_Id
)
1220 Project_Nodes
.Table
(Node
).Kind
= N_Package_Declaration
);
1221 Project_Nodes
.Table
(Node
).Field3
:= To
;
1222 end Set_Next_Package_In_Project
;
1224 --------------------------
1225 -- Set_Next_String_Type --
1226 --------------------------
1228 procedure Set_Next_String_Type
1229 (Node
: Project_Node_Id
;
1230 To
: Project_Node_Id
)
1236 Project_Nodes
.Table
(Node
).Kind
= N_String_Type_Declaration
);
1237 Project_Nodes
.Table
(Node
).Field2
:= To
;
1238 end Set_Next_String_Type
;
1244 procedure Set_Next_Term
1245 (Node
: Project_Node_Id
;
1246 To
: Project_Node_Id
)
1252 Project_Nodes
.Table
(Node
).Kind
= N_Term
);
1253 Project_Nodes
.Table
(Node
).Field2
:= To
;
1256 -----------------------
1257 -- Set_Next_Variable --
1258 -----------------------
1260 procedure Set_Next_Variable
1261 (Node
: Project_Node_Id
;
1262 To
: Project_Node_Id
)
1268 (Project_Nodes
.Table
(Node
).Kind
= N_Typed_Variable_Declaration
1270 Project_Nodes
.Table
(Node
).Kind
= N_Variable_Declaration
));
1271 Project_Nodes
.Table
(Node
).Field3
:= To
;
1272 end Set_Next_Variable
;
1274 -----------------------------
1275 -- Set_Next_With_Clause_Of --
1276 -----------------------------
1278 procedure Set_Next_With_Clause_Of
1279 (Node
: Project_Node_Id
;
1280 To
: Project_Node_Id
)
1286 Project_Nodes
.Table
(Node
).Kind
= N_With_Clause
);
1287 Project_Nodes
.Table
(Node
).Field2
:= To
;
1288 end Set_Next_With_Clause_Of
;
1290 -----------------------
1291 -- Set_Package_Id_Of --
1292 -----------------------
1294 procedure Set_Package_Id_Of
1295 (Node
: Project_Node_Id
;
1296 To
: Package_Node_Id
)
1302 Project_Nodes
.Table
(Node
).Kind
= N_Package_Declaration
);
1303 Project_Nodes
.Table
(Node
).Pkg_Id
:= To
;
1304 end Set_Package_Id_Of
;
1306 -------------------------
1307 -- Set_Package_Node_Of --
1308 -------------------------
1310 procedure Set_Package_Node_Of
1311 (Node
: Project_Node_Id
;
1312 To
: Project_Node_Id
)
1318 (Project_Nodes
.Table
(Node
).Kind
= N_Variable_Reference
1320 Project_Nodes
.Table
(Node
).Kind
= N_Attribute_Reference
));
1321 Project_Nodes
.Table
(Node
).Field2
:= To
;
1322 end Set_Package_Node_Of
;
1324 ----------------------
1325 -- Set_Path_Name_Of --
1326 ----------------------
1328 procedure Set_Path_Name_Of
1329 (Node
: Project_Node_Id
;
1336 (Project_Nodes
.Table
(Node
).Kind
= N_Project
1338 Project_Nodes
.Table
(Node
).Kind
= N_With_Clause
));
1339 Project_Nodes
.Table
(Node
).Path_Name
:= To
;
1340 end Set_Path_Name_Of
;
1342 --------------------------------
1343 -- Set_Project_Declaration_Of --
1344 --------------------------------
1346 procedure Set_Project_Declaration_Of
1347 (Node
: Project_Node_Id
;
1348 To
: Project_Node_Id
)
1354 Project_Nodes
.Table
(Node
).Kind
= N_Project
);
1355 Project_Nodes
.Table
(Node
).Field2
:= To
;
1356 end Set_Project_Declaration_Of
;
1358 -------------------------
1359 -- Set_Project_Node_Of --
1360 -------------------------
1362 procedure Set_Project_Node_Of
1363 (Node
: Project_Node_Id
;
1364 To
: Project_Node_Id
)
1370 (Project_Nodes
.Table
(Node
).Kind
= N_With_Clause
1372 Project_Nodes
.Table
(Node
).Kind
= N_Variable_Reference
1374 Project_Nodes
.Table
(Node
).Kind
= N_Attribute_Reference
));
1375 Project_Nodes
.Table
(Node
).Field1
:= To
;
1376 end Set_Project_Node_Of
;
1378 ---------------------------------------
1379 -- Set_Project_Of_Renamed_Package_Of --
1380 ---------------------------------------
1382 procedure Set_Project_Of_Renamed_Package_Of
1383 (Node
: Project_Node_Id
;
1384 To
: Project_Node_Id
)
1390 Project_Nodes
.Table
(Node
).Kind
= N_Package_Declaration
);
1391 Project_Nodes
.Table
(Node
).Field1
:= To
;
1392 end Set_Project_Of_Renamed_Package_Of
;
1394 ------------------------
1395 -- Set_String_Type_Of --
1396 ------------------------
1398 procedure Set_String_Type_Of
1399 (Node
: Project_Node_Id
;
1400 To
: Project_Node_Id
)
1406 (Project_Nodes
.Table
(Node
).Kind
= N_Variable_Reference
1408 Project_Nodes
.Table
(Node
).Kind
= N_Typed_Variable_Declaration
)
1410 Project_Nodes
.Table
(To
).Kind
= N_String_Type_Declaration
);
1412 if Project_Nodes
.Table
(Node
).Kind
= N_Variable_Reference
then
1413 Project_Nodes
.Table
(Node
).Field3
:= To
;
1415 Project_Nodes
.Table
(Node
).Field2
:= To
;
1417 end Set_String_Type_Of
;
1419 -------------------------
1420 -- Set_String_Value_Of --
1421 -------------------------
1423 procedure Set_String_Value_Of
1424 (Node
: Project_Node_Id
;
1431 (Project_Nodes
.Table
(Node
).Kind
= N_With_Clause
1433 Project_Nodes
.Table
(Node
).Kind
= N_Literal_String
));
1434 Project_Nodes
.Table
(Node
).Value
:= To
;
1435 end Set_String_Value_Of
;
1437 --------------------
1438 -- String_Type_Of --
1439 --------------------
1441 function String_Type_Of
(Node
: Project_Node_Id
)
1442 return Project_Node_Id
is
1447 (Project_Nodes
.Table
(Node
).Kind
= N_Variable_Reference
1449 Project_Nodes
.Table
(Node
).Kind
= N_Typed_Variable_Declaration
));
1451 if Project_Nodes
.Table
(Node
).Kind
= N_Variable_Reference
then
1452 return Project_Nodes
.Table
(Node
).Field3
;
1454 return Project_Nodes
.Table
(Node
).Field2
;
1458 ---------------------
1459 -- String_Value_Of --
1460 ---------------------
1462 function String_Value_Of
(Node
: Project_Node_Id
) return String_Id
is
1467 (Project_Nodes
.Table
(Node
).Kind
= N_With_Clause
1469 Project_Nodes
.Table
(Node
).Kind
= N_Literal_String
));
1470 return Project_Nodes
.Table
(Node
).Value
;
1471 end String_Value_Of
;
1473 --------------------
1474 -- Value_Is_Valid --
1475 --------------------
1477 function Value_Is_Valid
1478 (For_Typed_Variable
: Project_Node_Id
;
1484 (For_Typed_Variable
/= Empty_Node
1486 (Project_Nodes
.Table
(For_Typed_Variable
).Kind
=
1487 N_Typed_Variable_Declaration
));
1490 Current_String
: Project_Node_Id
:=
1491 First_Literal_String
1492 (String_Type_Of
(For_Typed_Variable
));
1495 while Current_String
/= Empty_Node
1497 not String_Equal
(String_Value_Of
(Current_String
), Value
)
1500 Next_Literal_String
(Current_String
);
1503 return Current_String
/= Empty_Node
;