1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
9 -- Copyright (C) 2001 Free Software Foundation, Inc. --
11 -- GNAT is free software; you can redistribute it and/or modify it under --
12 -- terms of the GNU General Public License as published by the Free Soft- --
13 -- ware Foundation; either version 2, or (at your option) any later ver- --
14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
15 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
16 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
17 -- for more details. You should have received a copy of the GNU General --
18 -- Public License distributed with GNAT; see file COPYING. If not, write --
19 -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
20 -- MA 02111-1307, USA. --
22 -- GNAT was originally developed by the GNAT team at New York University. --
23 -- Extensive contributions were provided by Ada Core Technologies Inc. --
25 ------------------------------------------------------------------------------
27 with Stringt
; use Stringt
;
29 package body Prj
.Tree
is
31 use Tree_Private_Part
;
33 --------------------------------
34 -- Associative_Array_Index_Of --
35 --------------------------------
37 function Associative_Array_Index_Of
38 (Node
: Project_Node_Id
)
45 (Project_Nodes
.Table
(Node
).Kind
= N_Attribute_Declaration
47 Project_Nodes
.Table
(Node
).Kind
= N_Attribute_Reference
));
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
62 Project_Nodes
.Table
(Node
).Kind
= N_Attribute_Reference
));
63 return Project_Nodes
.Table
(Node
).Case_Insensitive
;
66 --------------------------------
67 -- Case_Variable_Reference_Of --
68 --------------------------------
70 function Case_Variable_Reference_Of
71 (Node
: Project_Node_Id
)
72 return Project_Node_Id
78 Project_Nodes
.Table
(Node
).Kind
= N_Case_Construction
);
79 return Project_Nodes
.Table
(Node
).Field1
;
80 end Case_Variable_Reference_Of
;
82 -----------------------
83 -- Current_Item_Node --
84 -----------------------
86 function Current_Item_Node
87 (Node
: Project_Node_Id
)
88 return Project_Node_Id
94 Project_Nodes
.Table
(Node
).Kind
= N_Declarative_Item
);
95 return Project_Nodes
.Table
(Node
).Field1
;
96 end Current_Item_Node
;
102 function Current_Term
103 (Node
: Project_Node_Id
)
104 return Project_Node_Id
110 Project_Nodes
.Table
(Node
).Kind
= N_Term
);
111 return Project_Nodes
.Table
(Node
).Field1
;
114 --------------------------
115 -- Default_Project_Node --
116 --------------------------
118 function Default_Project_Node
119 (Of_Kind
: Project_Node_Kind
;
120 And_Expr_Kind
: Variable_Kind
:= Undefined
)
121 return Project_Node_Id
124 Project_Nodes
.Increment_Last
;
125 Project_Nodes
.Table
(Project_Nodes
.Last
) :=
127 Location
=> No_Location
,
128 Directory
=> No_Name
,
129 Expr_Kind
=> And_Expr_Kind
,
130 Variables
=> Empty_Node
,
131 Packages
=> Empty_Node
,
132 Pkg_Id
=> Empty_Package
,
134 Path_Name
=> No_Name
,
136 Field1
=> Empty_Node
,
137 Field2
=> Empty_Node
,
138 Field3
=> Empty_Node
,
139 Case_Insensitive
=> False);
140 return Project_Nodes
.Last
;
141 end Default_Project_Node
;
147 function Directory_Of
(Node
: Project_Node_Id
) return Name_Id
is
152 Project_Nodes
.Table
(Node
).Kind
= N_Project
);
153 return Project_Nodes
.Table
(Node
).Directory
;
156 ------------------------
157 -- Expression_Kind_Of --
158 ------------------------
160 function Expression_Kind_Of
(Node
: Project_Node_Id
) return Variable_Kind
is
165 (Project_Nodes
.Table
(Node
).Kind
= N_Literal_String
167 Project_Nodes
.Table
(Node
).Kind
= N_Attribute_Declaration
169 Project_Nodes
.Table
(Node
).Kind
= N_Variable_Declaration
171 Project_Nodes
.Table
(Node
).Kind
= N_Typed_Variable_Declaration
173 Project_Nodes
.Table
(Node
).Kind
= N_Expression
175 Project_Nodes
.Table
(Node
).Kind
= N_Term
177 Project_Nodes
.Table
(Node
).Kind
= N_Variable_Reference
179 Project_Nodes
.Table
(Node
).Kind
= N_Attribute_Reference
));
181 return Project_Nodes
.Table
(Node
).Expr_Kind
;
182 end Expression_Kind_Of
;
188 function Expression_Of
189 (Node
: Project_Node_Id
)
190 return Project_Node_Id
196 (Project_Nodes
.Table
(Node
).Kind
= N_Attribute_Declaration
198 Project_Nodes
.Table
(Node
).Kind
= N_Typed_Variable_Declaration
200 Project_Nodes
.Table
(Node
).Kind
= N_Variable_Declaration
));
202 return Project_Nodes
.Table
(Node
).Field1
;
205 ---------------------------
206 -- External_Reference_Of --
207 ---------------------------
209 function External_Reference_Of
210 (Node
: Project_Node_Id
)
211 return Project_Node_Id
217 Project_Nodes
.Table
(Node
).Kind
= N_External_Value
);
218 return Project_Nodes
.Table
(Node
).Field1
;
219 end External_Reference_Of
;
221 -------------------------
222 -- External_Default_Of --
223 -------------------------
225 function External_Default_Of
226 (Node
: Project_Node_Id
)
227 return Project_Node_Id
233 Project_Nodes
.Table
(Node
).Kind
= N_External_Value
);
234 return Project_Nodes
.Table
(Node
).Field2
;
235 end External_Default_Of
;
237 ------------------------
238 -- First_Case_Item_Of --
239 ------------------------
241 function First_Case_Item_Of
242 (Node
: Project_Node_Id
)
243 return Project_Node_Id
249 Project_Nodes
.Table
(Node
).Kind
= N_Case_Construction
);
250 return Project_Nodes
.Table
(Node
).Field2
;
251 end First_Case_Item_Of
;
253 ---------------------
254 -- First_Choice_Of --
255 ---------------------
257 function First_Choice_Of
258 (Node
: Project_Node_Id
)
259 return Project_Node_Id
265 Project_Nodes
.Table
(Node
).Kind
= N_Case_Item
);
266 return Project_Nodes
.Table
(Node
).Field1
;
269 -------------------------------
270 -- First_Declarative_Item_Of --
271 -------------------------------
273 function First_Declarative_Item_Of
274 (Node
: Project_Node_Id
)
275 return Project_Node_Id
281 (Project_Nodes
.Table
(Node
).Kind
= N_Project_Declaration
283 Project_Nodes
.Table
(Node
).Kind
= N_Case_Item
285 Project_Nodes
.Table
(Node
).Kind
= N_Package_Declaration
));
287 if Project_Nodes
.Table
(Node
).Kind
= N_Project_Declaration
then
288 return Project_Nodes
.Table
(Node
).Field1
;
290 return Project_Nodes
.Table
(Node
).Field2
;
292 end First_Declarative_Item_Of
;
294 ------------------------------
295 -- First_Expression_In_List --
296 ------------------------------
298 function First_Expression_In_List
299 (Node
: Project_Node_Id
)
300 return Project_Node_Id
306 Project_Nodes
.Table
(Node
).Kind
= N_Literal_String_List
);
307 return Project_Nodes
.Table
(Node
).Field1
;
308 end First_Expression_In_List
;
310 --------------------------
311 -- First_Literal_String --
312 --------------------------
314 function First_Literal_String
315 (Node
: Project_Node_Id
)
316 return Project_Node_Id
322 Project_Nodes
.Table
(Node
).Kind
= N_String_Type_Declaration
);
323 return Project_Nodes
.Table
(Node
).Field1
;
324 end First_Literal_String
;
326 ----------------------
327 -- First_Package_Of --
328 ----------------------
330 function First_Package_Of
331 (Node
: Project_Node_Id
)
332 return Package_Declaration_Id
338 Project_Nodes
.Table
(Node
).Kind
= N_Project
);
339 return Project_Nodes
.Table
(Node
).Packages
;
340 end First_Package_Of
;
342 --------------------------
343 -- First_String_Type_Of --
344 --------------------------
346 function First_String_Type_Of
347 (Node
: Project_Node_Id
)
348 return Project_Node_Id
354 Project_Nodes
.Table
(Node
).Kind
= N_Project
);
355 return Project_Nodes
.Table
(Node
).Field3
;
356 end First_String_Type_Of
;
363 (Node
: Project_Node_Id
)
364 return Project_Node_Id
370 Project_Nodes
.Table
(Node
).Kind
= N_Expression
);
371 return Project_Nodes
.Table
(Node
).Field1
;
374 -----------------------
375 -- First_Variable_Of --
376 -----------------------
378 function First_Variable_Of
379 (Node
: Project_Node_Id
)
380 return Variable_Node_Id
386 (Project_Nodes
.Table
(Node
).Kind
= N_Project
388 Project_Nodes
.Table
(Node
).Kind
= N_Package_Declaration
));
390 return Project_Nodes
.Table
(Node
).Variables
;
391 end First_Variable_Of
;
393 --------------------------
394 -- First_With_Clause_Of --
395 --------------------------
397 function First_With_Clause_Of
398 (Node
: Project_Node_Id
)
399 return Project_Node_Id
405 Project_Nodes
.Table
(Node
).Kind
= N_Project
);
406 return Project_Nodes
.Table
(Node
).Field1
;
407 end First_With_Clause_Of
;
413 procedure Initialize
is
415 Project_Nodes
.Set_Last
(Empty_Node
);
416 Projects_Htable
.Reset
;
423 function Kind_Of
(Node
: Project_Node_Id
) return Project_Node_Kind
is
425 pragma Assert
(Node
/= Empty_Node
);
426 return Project_Nodes
.Table
(Node
).Kind
;
433 function Location_Of
(Node
: Project_Node_Id
) return Source_Ptr
is
435 pragma Assert
(Node
/= Empty_Node
);
436 return Project_Nodes
.Table
(Node
).Location
;
439 -------------------------
440 -- Modified_Project_Of --
441 -------------------------
443 function Modified_Project_Of
444 (Node
: Project_Node_Id
)
445 return Project_Node_Id
451 Project_Nodes
.Table
(Node
).Kind
= N_Project_Declaration
);
452 return Project_Nodes
.Table
(Node
).Field2
;
453 end Modified_Project_Of
;
455 ------------------------------
456 -- Modified_Project_Path_Of --
457 ------------------------------
459 function Modified_Project_Path_Of
460 (Node
: Project_Node_Id
)
467 Project_Nodes
.Table
(Node
).Kind
= N_Project
);
468 return Project_Nodes
.Table
(Node
).Value
;
469 end Modified_Project_Path_Of
;
475 function Name_Of
(Node
: Project_Node_Id
) return Name_Id
is
477 pragma Assert
(Node
/= Empty_Node
);
478 return Project_Nodes
.Table
(Node
).Name
;
485 function Next_Case_Item
486 (Node
: Project_Node_Id
)
487 return Project_Node_Id
493 Project_Nodes
.Table
(Node
).Kind
= N_Case_Item
);
494 return Project_Nodes
.Table
(Node
).Field3
;
497 ---------------------------
498 -- Next_Declarative_Item --
499 ---------------------------
501 function Next_Declarative_Item
502 (Node
: Project_Node_Id
)
503 return Project_Node_Id
509 Project_Nodes
.Table
(Node
).Kind
= N_Declarative_Item
);
510 return Project_Nodes
.Table
(Node
).Field2
;
511 end Next_Declarative_Item
;
513 -----------------------------
514 -- Next_Expression_In_List --
515 -----------------------------
517 function Next_Expression_In_List
518 (Node
: Project_Node_Id
)
519 return Project_Node_Id
525 Project_Nodes
.Table
(Node
).Kind
= N_Expression
);
526 return Project_Nodes
.Table
(Node
).Field2
;
527 end Next_Expression_In_List
;
529 -------------------------
530 -- Next_Literal_String --
531 -------------------------
533 function Next_Literal_String
534 (Node
: Project_Node_Id
)
535 return Project_Node_Id
541 Project_Nodes
.Table
(Node
).Kind
= N_Literal_String
);
542 return Project_Nodes
.Table
(Node
).Field1
;
543 end Next_Literal_String
;
545 -----------------------------
546 -- Next_Package_In_Project --
547 -----------------------------
549 function Next_Package_In_Project
550 (Node
: Project_Node_Id
)
551 return Project_Node_Id
557 Project_Nodes
.Table
(Node
).Kind
= N_Package_Declaration
);
558 return Project_Nodes
.Table
(Node
).Field3
;
559 end Next_Package_In_Project
;
561 ----------------------
562 -- Next_String_Type --
563 ----------------------
565 function Next_String_Type
566 (Node
: Project_Node_Id
)
567 return Project_Node_Id
573 Project_Nodes
.Table
(Node
).Kind
= N_String_Type_Declaration
);
574 return Project_Nodes
.Table
(Node
).Field2
;
575 end Next_String_Type
;
582 (Node
: Project_Node_Id
)
583 return Project_Node_Id
589 Project_Nodes
.Table
(Node
).Kind
= N_Term
);
590 return Project_Nodes
.Table
(Node
).Field2
;
597 function Next_Variable
598 (Node
: Project_Node_Id
)
599 return Project_Node_Id
605 (Project_Nodes
.Table
(Node
).Kind
= N_Typed_Variable_Declaration
607 Project_Nodes
.Table
(Node
).Kind
= N_Variable_Declaration
));
609 return Project_Nodes
.Table
(Node
).Field3
;
612 -------------------------
613 -- Next_With_Clause_Of --
614 -------------------------
616 function Next_With_Clause_Of
617 (Node
: Project_Node_Id
)
618 return Project_Node_Id
624 Project_Nodes
.Table
(Node
).Kind
= N_With_Clause
);
625 return Project_Nodes
.Table
(Node
).Field2
;
626 end Next_With_Clause_Of
;
632 function Package_Id_Of
(Node
: Project_Node_Id
) return Package_Node_Id
is
637 Project_Nodes
.Table
(Node
).Kind
= N_Package_Declaration
);
638 return Project_Nodes
.Table
(Node
).Pkg_Id
;
641 ---------------------
642 -- Package_Node_Of --
643 ---------------------
645 function Package_Node_Of
646 (Node
: Project_Node_Id
)
647 return Project_Node_Id
653 (Project_Nodes
.Table
(Node
).Kind
= N_Variable_Reference
655 Project_Nodes
.Table
(Node
).Kind
= N_Attribute_Reference
));
656 return Project_Nodes
.Table
(Node
).Field2
;
663 function Path_Name_Of
(Node
: Project_Node_Id
) return Name_Id
is
668 (Project_Nodes
.Table
(Node
).Kind
= N_Project
670 Project_Nodes
.Table
(Node
).Kind
= N_With_Clause
));
671 return Project_Nodes
.Table
(Node
).Path_Name
;
674 ----------------------------
675 -- Project_Declaration_Of --
676 ----------------------------
678 function Project_Declaration_Of
679 (Node
: Project_Node_Id
)
680 return Project_Node_Id
686 Project_Nodes
.Table
(Node
).Kind
= N_Project
);
687 return Project_Nodes
.Table
(Node
).Field2
;
688 end Project_Declaration_Of
;
690 ---------------------
691 -- Project_Node_Of --
692 ---------------------
694 function Project_Node_Of
695 (Node
: Project_Node_Id
)
696 return Project_Node_Id
702 (Project_Nodes
.Table
(Node
).Kind
= N_With_Clause
704 Project_Nodes
.Table
(Node
).Kind
= N_Variable_Reference
706 Project_Nodes
.Table
(Node
).Kind
= N_Attribute_Reference
));
707 return Project_Nodes
.Table
(Node
).Field1
;
710 -----------------------------------
711 -- Project_Of_Renamed_Package_Of --
712 -----------------------------------
714 function Project_Of_Renamed_Package_Of
715 (Node
: Project_Node_Id
)
716 return Project_Node_Id
722 Project_Nodes
.Table
(Node
).Kind
= N_Package_Declaration
);
723 return Project_Nodes
.Table
(Node
).Field1
;
724 end Project_Of_Renamed_Package_Of
;
726 ------------------------------------
727 -- Set_Associative_Array_Index_Of --
728 ------------------------------------
730 procedure Set_Associative_Array_Index_Of
731 (Node
: Project_Node_Id
;
738 (Project_Nodes
.Table
(Node
).Kind
= N_Attribute_Declaration
740 Project_Nodes
.Table
(Node
).Kind
= N_Attribute_Reference
));
741 Project_Nodes
.Table
(Node
).Value
:= To
;
742 end Set_Associative_Array_Index_Of
;
744 --------------------------
745 -- Set_Case_Insensitive --
746 --------------------------
748 procedure Set_Case_Insensitive
749 (Node
: Project_Node_Id
;
756 (Project_Nodes
.Table
(Node
).Kind
= N_Attribute_Declaration
758 Project_Nodes
.Table
(Node
).Kind
= N_Attribute_Reference
));
759 Project_Nodes
.Table
(Node
).Case_Insensitive
:= To
;
760 end Set_Case_Insensitive
;
762 ------------------------------------
763 -- Set_Case_Variable_Reference_Of --
764 ------------------------------------
766 procedure Set_Case_Variable_Reference_Of
767 (Node
: Project_Node_Id
;
768 To
: Project_Node_Id
)
774 Project_Nodes
.Table
(Node
).Kind
= N_Case_Construction
);
775 Project_Nodes
.Table
(Node
).Field1
:= To
;
776 end Set_Case_Variable_Reference_Of
;
778 ---------------------------
779 -- Set_Current_Item_Node --
780 ---------------------------
782 procedure Set_Current_Item_Node
783 (Node
: Project_Node_Id
;
784 To
: Project_Node_Id
)
790 Project_Nodes
.Table
(Node
).Kind
= N_Declarative_Item
);
791 Project_Nodes
.Table
(Node
).Field1
:= To
;
792 end Set_Current_Item_Node
;
794 ----------------------
795 -- Set_Current_Term --
796 ----------------------
798 procedure Set_Current_Term
799 (Node
: Project_Node_Id
;
800 To
: Project_Node_Id
)
806 Project_Nodes
.Table
(Node
).Kind
= N_Term
);
807 Project_Nodes
.Table
(Node
).Field1
:= To
;
808 end Set_Current_Term
;
810 ----------------------
811 -- Set_Directory_Of --
812 ----------------------
814 procedure Set_Directory_Of
815 (Node
: Project_Node_Id
;
822 Project_Nodes
.Table
(Node
).Kind
= N_Project
);
823 Project_Nodes
.Table
(Node
).Directory
:= To
;
824 end Set_Directory_Of
;
826 ----------------------------
827 -- Set_Expression_Kind_Of --
828 ----------------------------
830 procedure Set_Expression_Kind_Of
831 (Node
: Project_Node_Id
;
838 (Project_Nodes
.Table
(Node
).Kind
= N_Literal_String
840 Project_Nodes
.Table
(Node
).Kind
= N_Attribute_Declaration
842 Project_Nodes
.Table
(Node
).Kind
= N_Variable_Declaration
844 Project_Nodes
.Table
(Node
).Kind
= N_Typed_Variable_Declaration
846 Project_Nodes
.Table
(Node
).Kind
= N_Expression
848 Project_Nodes
.Table
(Node
).Kind
= N_Term
850 Project_Nodes
.Table
(Node
).Kind
= N_Variable_Reference
852 Project_Nodes
.Table
(Node
).Kind
= N_Attribute_Reference
));
853 Project_Nodes
.Table
(Node
).Expr_Kind
:= To
;
854 end Set_Expression_Kind_Of
;
856 -----------------------
857 -- Set_Expression_Of --
858 -----------------------
860 procedure Set_Expression_Of
861 (Node
: Project_Node_Id
;
862 To
: Project_Node_Id
)
868 (Project_Nodes
.Table
(Node
).Kind
= N_Attribute_Declaration
870 Project_Nodes
.Table
(Node
).Kind
= N_Typed_Variable_Declaration
872 Project_Nodes
.Table
(Node
).Kind
= N_Variable_Declaration
));
873 Project_Nodes
.Table
(Node
).Field1
:= To
;
874 end Set_Expression_Of
;
876 -------------------------------
877 -- Set_External_Reference_Of --
878 -------------------------------
880 procedure Set_External_Reference_Of
881 (Node
: Project_Node_Id
;
882 To
: Project_Node_Id
)
888 Project_Nodes
.Table
(Node
).Kind
= N_External_Value
);
889 Project_Nodes
.Table
(Node
).Field1
:= To
;
890 end Set_External_Reference_Of
;
892 -----------------------------
893 -- Set_External_Default_Of --
894 -----------------------------
896 procedure Set_External_Default_Of
897 (Node
: Project_Node_Id
;
898 To
: Project_Node_Id
)
904 Project_Nodes
.Table
(Node
).Kind
= N_External_Value
);
905 Project_Nodes
.Table
(Node
).Field2
:= To
;
906 end Set_External_Default_Of
;
908 ----------------------------
909 -- Set_First_Case_Item_Of --
910 ----------------------------
912 procedure Set_First_Case_Item_Of
913 (Node
: Project_Node_Id
;
914 To
: Project_Node_Id
)
920 Project_Nodes
.Table
(Node
).Kind
= N_Case_Construction
);
921 Project_Nodes
.Table
(Node
).Field2
:= To
;
922 end Set_First_Case_Item_Of
;
924 -------------------------
925 -- Set_First_Choice_Of --
926 -------------------------
928 procedure Set_First_Choice_Of
929 (Node
: Project_Node_Id
;
930 To
: Project_Node_Id
)
936 Project_Nodes
.Table
(Node
).Kind
= N_Case_Item
);
937 Project_Nodes
.Table
(Node
).Field1
:= To
;
938 end Set_First_Choice_Of
;
940 ------------------------
941 -- Set_Next_Case_Item --
942 ------------------------
944 procedure Set_Next_Case_Item
945 (Node
: Project_Node_Id
;
946 To
: Project_Node_Id
)
952 Project_Nodes
.Table
(Node
).Kind
= N_Case_Item
);
953 Project_Nodes
.Table
(Node
).Field3
:= To
;
954 end Set_Next_Case_Item
;
956 -----------------------------------
957 -- Set_First_Declarative_Item_Of --
958 -----------------------------------
960 procedure Set_First_Declarative_Item_Of
961 (Node
: Project_Node_Id
;
962 To
: Project_Node_Id
)
968 (Project_Nodes
.Table
(Node
).Kind
= N_Project_Declaration
970 Project_Nodes
.Table
(Node
).Kind
= N_Case_Item
972 Project_Nodes
.Table
(Node
).Kind
= N_Package_Declaration
));
974 if Project_Nodes
.Table
(Node
).Kind
= N_Project_Declaration
then
975 Project_Nodes
.Table
(Node
).Field1
:= To
;
977 Project_Nodes
.Table
(Node
).Field2
:= To
;
979 end Set_First_Declarative_Item_Of
;
981 ----------------------------------
982 -- Set_First_Expression_In_List --
983 ----------------------------------
985 procedure Set_First_Expression_In_List
986 (Node
: Project_Node_Id
;
987 To
: Project_Node_Id
)
993 Project_Nodes
.Table
(Node
).Kind
= N_Literal_String_List
);
994 Project_Nodes
.Table
(Node
).Field1
:= To
;
995 end Set_First_Expression_In_List
;
997 ------------------------------
998 -- Set_First_Literal_String --
999 ------------------------------
1001 procedure Set_First_Literal_String
1002 (Node
: Project_Node_Id
;
1003 To
: Project_Node_Id
)
1009 Project_Nodes
.Table
(Node
).Kind
= N_String_Type_Declaration
);
1010 Project_Nodes
.Table
(Node
).Field1
:= To
;
1011 end Set_First_Literal_String
;
1013 --------------------------
1014 -- Set_First_Package_Of --
1015 --------------------------
1017 procedure Set_First_Package_Of
1018 (Node
: Project_Node_Id
;
1019 To
: Package_Declaration_Id
)
1025 Project_Nodes
.Table
(Node
).Kind
= N_Project
);
1026 Project_Nodes
.Table
(Node
).Packages
:= To
;
1027 end Set_First_Package_Of
;
1029 ------------------------------
1030 -- Set_First_String_Type_Of --
1031 ------------------------------
1033 procedure Set_First_String_Type_Of
1034 (Node
: Project_Node_Id
;
1035 To
: Project_Node_Id
)
1041 Project_Nodes
.Table
(Node
).Kind
= N_Project
);
1042 Project_Nodes
.Table
(Node
).Field3
:= To
;
1043 end Set_First_String_Type_Of
;
1045 --------------------
1046 -- Set_First_Term --
1047 --------------------
1049 procedure Set_First_Term
1050 (Node
: Project_Node_Id
;
1051 To
: Project_Node_Id
)
1057 Project_Nodes
.Table
(Node
).Kind
= N_Expression
);
1058 Project_Nodes
.Table
(Node
).Field1
:= To
;
1061 ---------------------------
1062 -- Set_First_Variable_Of --
1063 ---------------------------
1065 procedure Set_First_Variable_Of
1066 (Node
: Project_Node_Id
;
1067 To
: Variable_Node_Id
)
1073 (Project_Nodes
.Table
(Node
).Kind
= N_Project
1075 Project_Nodes
.Table
(Node
).Kind
= N_Package_Declaration
));
1076 Project_Nodes
.Table
(Node
).Variables
:= To
;
1077 end Set_First_Variable_Of
;
1079 ------------------------------
1080 -- Set_First_With_Clause_Of --
1081 ------------------------------
1083 procedure Set_First_With_Clause_Of
1084 (Node
: Project_Node_Id
;
1085 To
: Project_Node_Id
)
1091 Project_Nodes
.Table
(Node
).Kind
= N_Project
);
1092 Project_Nodes
.Table
(Node
).Field1
:= To
;
1093 end Set_First_With_Clause_Of
;
1099 procedure Set_Kind_Of
1100 (Node
: Project_Node_Id
;
1101 To
: Project_Node_Kind
)
1104 pragma Assert
(Node
/= Empty_Node
);
1105 Project_Nodes
.Table
(Node
).Kind
:= To
;
1108 ---------------------
1109 -- Set_Location_Of --
1110 ---------------------
1112 procedure Set_Location_Of
1113 (Node
: Project_Node_Id
;
1117 pragma Assert
(Node
/= Empty_Node
);
1118 Project_Nodes
.Table
(Node
).Location
:= To
;
1119 end Set_Location_Of
;
1121 -----------------------------
1122 -- Set_Modified_Project_Of --
1123 -----------------------------
1125 procedure Set_Modified_Project_Of
1126 (Node
: Project_Node_Id
;
1127 To
: Project_Node_Id
)
1133 Project_Nodes
.Table
(Node
).Kind
= N_Project_Declaration
);
1134 Project_Nodes
.Table
(Node
).Field2
:= To
;
1135 end Set_Modified_Project_Of
;
1137 ----------------------------------
1138 -- Set_Modified_Project_Path_Of --
1139 ----------------------------------
1141 procedure Set_Modified_Project_Path_Of
1142 (Node
: Project_Node_Id
;
1149 Project_Nodes
.Table
(Node
).Kind
= N_Project
);
1150 Project_Nodes
.Table
(Node
).Value
:= To
;
1151 end Set_Modified_Project_Path_Of
;
1157 procedure Set_Name_Of
1158 (Node
: Project_Node_Id
;
1162 pragma Assert
(Node
/= Empty_Node
);
1163 Project_Nodes
.Table
(Node
).Name
:= To
;
1166 -------------------------------
1167 -- Set_Next_Declarative_Item --
1168 -------------------------------
1170 procedure Set_Next_Declarative_Item
1171 (Node
: Project_Node_Id
;
1172 To
: Project_Node_Id
)
1178 Project_Nodes
.Table
(Node
).Kind
= N_Declarative_Item
);
1179 Project_Nodes
.Table
(Node
).Field2
:= To
;
1180 end Set_Next_Declarative_Item
;
1182 ---------------------------------
1183 -- Set_Next_Expression_In_List --
1184 ---------------------------------
1186 procedure Set_Next_Expression_In_List
1187 (Node
: Project_Node_Id
;
1188 To
: Project_Node_Id
)
1194 Project_Nodes
.Table
(Node
).Kind
= N_Expression
);
1195 Project_Nodes
.Table
(Node
).Field2
:= To
;
1196 end Set_Next_Expression_In_List
;
1198 -----------------------------
1199 -- Set_Next_Literal_String --
1200 -----------------------------
1202 procedure Set_Next_Literal_String
1203 (Node
: Project_Node_Id
;
1204 To
: Project_Node_Id
)
1210 Project_Nodes
.Table
(Node
).Kind
= N_Literal_String
);
1211 Project_Nodes
.Table
(Node
).Field1
:= To
;
1212 end Set_Next_Literal_String
;
1214 ---------------------------------
1215 -- Set_Next_Package_In_Project --
1216 ---------------------------------
1218 procedure Set_Next_Package_In_Project
1219 (Node
: Project_Node_Id
;
1220 To
: Project_Node_Id
)
1226 Project_Nodes
.Table
(Node
).Kind
= N_Package_Declaration
);
1227 Project_Nodes
.Table
(Node
).Field3
:= To
;
1228 end Set_Next_Package_In_Project
;
1230 --------------------------
1231 -- Set_Next_String_Type --
1232 --------------------------
1234 procedure Set_Next_String_Type
1235 (Node
: Project_Node_Id
;
1236 To
: Project_Node_Id
)
1242 Project_Nodes
.Table
(Node
).Kind
= N_String_Type_Declaration
);
1243 Project_Nodes
.Table
(Node
).Field2
:= To
;
1244 end Set_Next_String_Type
;
1250 procedure Set_Next_Term
1251 (Node
: Project_Node_Id
;
1252 To
: Project_Node_Id
)
1258 Project_Nodes
.Table
(Node
).Kind
= N_Term
);
1259 Project_Nodes
.Table
(Node
).Field2
:= To
;
1262 -----------------------
1263 -- Set_Next_Variable --
1264 -----------------------
1266 procedure Set_Next_Variable
1267 (Node
: Project_Node_Id
;
1268 To
: Project_Node_Id
)
1274 (Project_Nodes
.Table
(Node
).Kind
= N_Typed_Variable_Declaration
1276 Project_Nodes
.Table
(Node
).Kind
= N_Variable_Declaration
));
1277 Project_Nodes
.Table
(Node
).Field3
:= To
;
1278 end Set_Next_Variable
;
1280 -----------------------------
1281 -- Set_Next_With_Clause_Of --
1282 -----------------------------
1284 procedure Set_Next_With_Clause_Of
1285 (Node
: Project_Node_Id
;
1286 To
: Project_Node_Id
)
1292 Project_Nodes
.Table
(Node
).Kind
= N_With_Clause
);
1293 Project_Nodes
.Table
(Node
).Field2
:= To
;
1294 end Set_Next_With_Clause_Of
;
1296 -----------------------
1297 -- Set_Package_Id_Of --
1298 -----------------------
1300 procedure Set_Package_Id_Of
1301 (Node
: Project_Node_Id
;
1302 To
: Package_Node_Id
)
1308 Project_Nodes
.Table
(Node
).Kind
= N_Package_Declaration
);
1309 Project_Nodes
.Table
(Node
).Pkg_Id
:= To
;
1310 end Set_Package_Id_Of
;
1312 -------------------------
1313 -- Set_Package_Node_Of --
1314 -------------------------
1316 procedure Set_Package_Node_Of
1317 (Node
: Project_Node_Id
;
1318 To
: Project_Node_Id
)
1324 (Project_Nodes
.Table
(Node
).Kind
= N_Variable_Reference
1326 Project_Nodes
.Table
(Node
).Kind
= N_Attribute_Reference
));
1327 Project_Nodes
.Table
(Node
).Field2
:= To
;
1328 end Set_Package_Node_Of
;
1330 ----------------------
1331 -- Set_Path_Name_Of --
1332 ----------------------
1334 procedure Set_Path_Name_Of
1335 (Node
: Project_Node_Id
;
1342 (Project_Nodes
.Table
(Node
).Kind
= N_Project
1344 Project_Nodes
.Table
(Node
).Kind
= N_With_Clause
));
1345 Project_Nodes
.Table
(Node
).Path_Name
:= To
;
1346 end Set_Path_Name_Of
;
1348 --------------------------------
1349 -- Set_Project_Declaration_Of --
1350 --------------------------------
1352 procedure Set_Project_Declaration_Of
1353 (Node
: Project_Node_Id
;
1354 To
: Project_Node_Id
)
1360 Project_Nodes
.Table
(Node
).Kind
= N_Project
);
1361 Project_Nodes
.Table
(Node
).Field2
:= To
;
1362 end Set_Project_Declaration_Of
;
1364 -------------------------
1365 -- Set_Project_Node_Of --
1366 -------------------------
1368 procedure Set_Project_Node_Of
1369 (Node
: Project_Node_Id
;
1370 To
: Project_Node_Id
)
1376 (Project_Nodes
.Table
(Node
).Kind
= N_With_Clause
1378 Project_Nodes
.Table
(Node
).Kind
= N_Variable_Reference
1380 Project_Nodes
.Table
(Node
).Kind
= N_Attribute_Reference
));
1381 Project_Nodes
.Table
(Node
).Field1
:= To
;
1382 end Set_Project_Node_Of
;
1384 ---------------------------------------
1385 -- Set_Project_Of_Renamed_Package_Of --
1386 ---------------------------------------
1388 procedure Set_Project_Of_Renamed_Package_Of
1389 (Node
: Project_Node_Id
;
1390 To
: Project_Node_Id
)
1396 Project_Nodes
.Table
(Node
).Kind
= N_Package_Declaration
);
1397 Project_Nodes
.Table
(Node
).Field1
:= To
;
1398 end Set_Project_Of_Renamed_Package_Of
;
1400 ------------------------
1401 -- Set_String_Type_Of --
1402 ------------------------
1404 procedure Set_String_Type_Of
1405 (Node
: Project_Node_Id
;
1406 To
: Project_Node_Id
)
1412 (Project_Nodes
.Table
(Node
).Kind
= N_Variable_Reference
1414 Project_Nodes
.Table
(Node
).Kind
= N_Typed_Variable_Declaration
)
1416 Project_Nodes
.Table
(To
).Kind
= N_String_Type_Declaration
);
1418 if Project_Nodes
.Table
(Node
).Kind
= N_Variable_Reference
then
1419 Project_Nodes
.Table
(Node
).Field3
:= To
;
1421 Project_Nodes
.Table
(Node
).Field2
:= To
;
1423 end Set_String_Type_Of
;
1425 -------------------------
1426 -- Set_String_Value_Of --
1427 -------------------------
1429 procedure Set_String_Value_Of
1430 (Node
: Project_Node_Id
;
1437 (Project_Nodes
.Table
(Node
).Kind
= N_With_Clause
1439 Project_Nodes
.Table
(Node
).Kind
= N_Literal_String
));
1440 Project_Nodes
.Table
(Node
).Value
:= To
;
1441 end Set_String_Value_Of
;
1443 --------------------
1444 -- String_Type_Of --
1445 --------------------
1447 function String_Type_Of
(Node
: Project_Node_Id
)
1448 return Project_Node_Id
is
1453 (Project_Nodes
.Table
(Node
).Kind
= N_Variable_Reference
1455 Project_Nodes
.Table
(Node
).Kind
= N_Typed_Variable_Declaration
));
1457 if Project_Nodes
.Table
(Node
).Kind
= N_Variable_Reference
then
1458 return Project_Nodes
.Table
(Node
).Field3
;
1460 return Project_Nodes
.Table
(Node
).Field2
;
1464 ---------------------
1465 -- String_Value_Of --
1466 ---------------------
1468 function String_Value_Of
(Node
: Project_Node_Id
) return String_Id
is
1473 (Project_Nodes
.Table
(Node
).Kind
= N_With_Clause
1475 Project_Nodes
.Table
(Node
).Kind
= N_Literal_String
));
1476 return Project_Nodes
.Table
(Node
).Value
;
1477 end String_Value_Of
;
1479 --------------------
1480 -- Value_Is_Valid --
1481 --------------------
1483 function Value_Is_Valid
1484 (For_Typed_Variable
: Project_Node_Id
;
1490 (For_Typed_Variable
/= Empty_Node
1492 (Project_Nodes
.Table
(For_Typed_Variable
).Kind
=
1493 N_Typed_Variable_Declaration
));
1496 Current_String
: Project_Node_Id
:=
1497 First_Literal_String
1498 (String_Type_Of
(For_Typed_Variable
));
1501 while Current_String
/= Empty_Node
1503 not String_Equal
(String_Value_Of
(Current_String
), Value
)
1506 Next_Literal_String
(Current_String
);
1509 return Current_String
/= Empty_Node
;