1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
9 -- Copyright (C) 2001-2003 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 -- This package defines the structure of the Project File tree.
31 with Prj.Attr; use Prj.Attr;
32 with Prj.Com; use Prj.Com;
33 with Types; use Types;
38 Project_Nodes_Initial : constant := 1_000;
39 Project_Nodes_Increment : constant := 100;
40 -- Allocation parameters for initializing and extending number
41 -- of nodes in table Tree_Private_Part.Project_Nodes
43 Project_Node_Low_Bound : constant := 0;
44 Project_Node_High_Bound : constant := 099_999_999;
45 -- Range of values for project node id's (in practice infinite)
47 type Project_Node_Id is range
48 Project_Node_Low_Bound .. Project_Node_High_Bound;
49 -- The index of table Tree_Private_Part.Project_Nodes
51 Empty_Node : constant Project_Node_Id := Project_Node_Low_Bound;
52 -- Designates no node in table Project_Nodes
54 First_Node_Id : constant Project_Node_Id := Project_Node_Low_Bound + 1;
56 subtype Variable_Node_Id is Project_Node_Id;
57 -- Used to designate a node whose expected kind is one of
58 -- N_Typed_Variable_Declaration, N_Variable_Declaration or
59 -- N_Variable_Reference.
61 subtype Package_Declaration_Id is Project_Node_Id;
62 -- Used to designate a node whose expected kind is N_Proect_Declaration
64 type Project_Node_Kind is
67 N_Project_Declaration,
69 N_Package_Declaration,
70 N_String_Type_Declaration,
72 N_Attribute_Declaration,
73 N_Typed_Variable_Declaration,
74 N_Variable_Declaration,
77 N_Literal_String_List,
80 N_Attribute_Reference,
83 -- Each node in the tree is of a Project_Node_Kind
84 -- For the signification of the fields in each node of a
85 -- Project_Node_Kind, look at package Tree_Private_Part.
88 -- Initialize the Project File tree: empty the Project_Nodes table
89 -- and reset the Projects_Htable.
91 function Default_Project_Node
92 (Of_Kind : Project_Node_Kind;
93 And_Expr_Kind : Variable_Kind := Undefined)
94 return Project_Node_Id;
95 -- Returns a Project_Node_Record with the specified Kind and
96 -- Expr_Kind; all the other components have default nil values.
98 function Hash (N : Project_Node_Id) return Header_Num;
99 -- Used for hash tables where the key is a Project_Node_Id
101 function Imported_Or_Extended_Project_Of
102 (Project : Project_Node_Id;
104 return Project_Node_Id;
105 -- Return the node of a project imported or extended by project Project and
106 -- whose name is With_Name. Return Empty_Node if there is no such project.
108 ----------------------
109 -- Access Functions --
110 ----------------------
112 -- The following query functions are part of the abstract interface
113 -- of the Project File tree
115 function Name_Of (Node : Project_Node_Id) return Name_Id;
116 pragma Inline (Name_Of);
117 -- Valid for all non empty nodes. May return No_Name for nodes that have
120 function Kind_Of (Node : Project_Node_Id) return Project_Node_Kind;
121 pragma Inline (Kind_Of);
122 -- Valid for all non empty nodes
124 function Location_Of (Node : Project_Node_Id) return Source_Ptr;
125 pragma Inline (Location_Of);
126 -- Valid for all non empty nodes
128 function Directory_Of (Node : Project_Node_Id) return Name_Id;
129 pragma Inline (Directory_Of);
130 -- Only valid for N_Project nodes.
132 function Expression_Kind_Of (Node : Project_Node_Id) return Variable_Kind;
133 pragma Inline (Expression_Kind_Of);
134 -- Only valid for N_Literal_String, N_Attribute_Declaration,
135 -- N_Variable_Declaration, N_Typed_Variable_Declaration, N_Expression,
136 -- N_Term, N_Variable_Reference or N_Attribute_Reference nodes.
138 function First_Variable_Of
139 (Node : Project_Node_Id)
140 return Variable_Node_Id;
141 pragma Inline (First_Variable_Of);
142 -- Only valid for N_Project or N_Package_Declaration nodes
144 function First_Package_Of
145 (Node : Project_Node_Id)
146 return Package_Declaration_Id;
147 pragma Inline (First_Package_Of);
148 -- Only valid for N_Project nodes
150 function Package_Id_Of (Node : Project_Node_Id) return Package_Node_Id;
151 pragma Inline (Package_Id_Of);
152 -- Only valid for N_Package_Declaration nodes
154 function Path_Name_Of (Node : Project_Node_Id) return Name_Id;
155 pragma Inline (Path_Name_Of);
156 -- Only valid for N_Project and N_With_Clause nodes.
158 function String_Value_Of (Node : Project_Node_Id) return Name_Id;
159 pragma Inline (String_Value_Of);
160 -- Only valid for N_With_Clause or N_Literal_String nodes.
162 function First_With_Clause_Of
163 (Node : Project_Node_Id)
164 return Project_Node_Id;
165 pragma Inline (First_With_Clause_Of);
166 -- Only valid for N_Project nodes
168 function Project_Declaration_Of
169 (Node : Project_Node_Id)
170 return Project_Node_Id;
171 pragma Inline (Project_Declaration_Of);
172 -- Only valid for N_Project nodes
174 function Extending_Project_Of
175 (Node : Project_Node_Id)
176 return Project_Node_Id;
177 pragma Inline (Extending_Project_Of);
178 -- Only valid for N_Project_Declaration nodes
180 function First_String_Type_Of
181 (Node : Project_Node_Id)
182 return Project_Node_Id;
183 pragma Inline (First_String_Type_Of);
184 -- Only valid for N_Project nodes
186 function Extended_Project_Path_Of
187 (Node : Project_Node_Id)
189 pragma Inline (Extended_Project_Path_Of);
190 -- Only valid for N_With_Clause nodes
192 function Project_Node_Of
193 (Node : Project_Node_Id)
194 return Project_Node_Id;
195 pragma Inline (Project_Node_Of);
196 -- Only valid for N_With_Clause, N_Variable_Reference and
197 -- N_Attribute_Reference nodes.
199 function Non_Limited_Project_Node_Of
200 (Node : Project_Node_Id)
201 return Project_Node_Id;
202 pragma Inline (Non_Limited_Project_Node_Of);
203 -- Only valid for N_With_Clause nodes. Returns Empty_Node for limited
204 -- imported project files, otherwise returns the same result as
207 function Next_With_Clause_Of
208 (Node : Project_Node_Id)
209 return Project_Node_Id;
210 pragma Inline (Next_With_Clause_Of);
211 -- Only valid for N_With_Clause nodes
213 function First_Declarative_Item_Of
214 (Node : Project_Node_Id)
215 return Project_Node_Id;
216 pragma Inline (First_Declarative_Item_Of);
217 -- Only valid for N_With_Clause nodes
219 function Extended_Project_Of
220 (Node : Project_Node_Id)
221 return Project_Node_Id;
222 pragma Inline (Extended_Project_Of);
223 -- Only valid for N_With_Clause nodes
225 function Current_Item_Node
226 (Node : Project_Node_Id)
227 return Project_Node_Id;
228 pragma Inline (Current_Item_Node);
229 -- Only valid for N_Declarative_Item nodes
231 function Next_Declarative_Item
232 (Node : Project_Node_Id)
233 return Project_Node_Id;
234 pragma Inline (Next_Declarative_Item);
235 -- Only valid for N_Declarative_Item node
237 function Project_Of_Renamed_Package_Of
238 (Node : Project_Node_Id)
239 return Project_Node_Id;
240 pragma Inline (Project_Of_Renamed_Package_Of);
241 -- Only valid for N_Package_Declaration nodes.
242 -- May return Empty_Node.
244 function Next_Package_In_Project
245 (Node : Project_Node_Id)
246 return Project_Node_Id;
247 pragma Inline (Next_Package_In_Project);
248 -- Only valid for N_Package_Declaration nodes
250 function First_Literal_String
251 (Node : Project_Node_Id)
252 return Project_Node_Id;
253 pragma Inline (First_Literal_String);
254 -- Only valid for N_String_Type_Declaration nodes
256 function Next_String_Type
257 (Node : Project_Node_Id)
258 return Project_Node_Id;
259 pragma Inline (Next_String_Type);
260 -- Only valid for N_String_Type_Declaration nodes
262 function Next_Literal_String
263 (Node : Project_Node_Id)
264 return Project_Node_Id;
265 pragma Inline (Next_Literal_String);
266 -- Only valid for N_Literal_String nodes
268 function Expression_Of
269 (Node : Project_Node_Id)
270 return Project_Node_Id;
271 pragma Inline (Expression_Of);
272 -- Only valid for N_Attribute_Declaration, N_Typed_Variable_Declaration
273 -- or N_Variable_Declaration nodes
275 function Associative_Project_Of
276 (Node : Project_Node_Id)
277 return Project_Node_Id;
278 pragma Inline (Associative_Project_Of);
279 -- Only valid for N_Attribute_Declaration nodes
281 function Associative_Package_Of
282 (Node : Project_Node_Id)
283 return Project_Node_Id;
284 pragma Inline (Associative_Package_Of);
285 -- Only valid for N_Attribute_Declaration nodes
287 function Value_Is_Valid
288 (For_Typed_Variable : Project_Node_Id;
291 pragma Inline (Value_Is_Valid);
292 -- Only valid for N_Typed_Variable_Declaration. Returns True if Value is
293 -- in the list of allowed strings for For_Typed_Variable. False otherwise.
295 function Associative_Array_Index_Of
296 (Node : Project_Node_Id)
298 pragma Inline (Associative_Array_Index_Of);
299 -- Only valid for N_Attribute_Declaration and N_Attribute_Reference.
300 -- Returns No_String for non associative array attributes.
302 function Next_Variable
303 (Node : Project_Node_Id)
304 return Project_Node_Id;
305 pragma Inline (Next_Variable);
306 -- Only valid for N_Typed_Variable_Declaration or N_Variable_Declaration
310 (Node : Project_Node_Id)
311 return Project_Node_Id;
312 pragma Inline (First_Term);
313 -- Only valid for N_Expression nodes
315 function Next_Expression_In_List
316 (Node : Project_Node_Id)
317 return Project_Node_Id;
318 pragma Inline (Next_Expression_In_List);
319 -- Only valid for N_Expression nodes
321 function Current_Term
322 (Node : Project_Node_Id)
323 return Project_Node_Id;
324 pragma Inline (Current_Term);
325 -- Only valid for N_Term nodes
328 (Node : Project_Node_Id)
329 return Project_Node_Id;
330 pragma Inline (Next_Term);
331 -- Only valid for N_Term nodes
333 function First_Expression_In_List
334 (Node : Project_Node_Id)
335 return Project_Node_Id;
336 pragma Inline (First_Expression_In_List);
337 -- Only valid for N_Literal_String_List nodes
339 function Package_Node_Of
340 (Node : Project_Node_Id)
341 return Project_Node_Id;
342 pragma Inline (Package_Node_Of);
343 -- Only valid for N_Variable_Reference or N_Attribute_Reference nodes.
344 -- May return Empty_Node.
346 function String_Type_Of
347 (Node : Project_Node_Id)
348 return Project_Node_Id;
349 pragma Inline (String_Type_Of);
350 -- Only valid for N_Variable_Reference or N_Typed_Variable_Declaration
353 function External_Reference_Of
354 (Node : Project_Node_Id)
355 return Project_Node_Id;
356 pragma Inline (External_Reference_Of);
357 -- Only valid for N_External_Value nodes
359 function External_Default_Of
360 (Node : Project_Node_Id)
361 return Project_Node_Id;
362 pragma Inline (External_Default_Of);
363 -- Only valid for N_External_Value nodes
365 function Case_Variable_Reference_Of
366 (Node : Project_Node_Id)
367 return Project_Node_Id;
368 pragma Inline (Case_Variable_Reference_Of);
369 -- Only valid for N_Case_Construction nodes
371 function First_Case_Item_Of
372 (Node : Project_Node_Id)
373 return Project_Node_Id;
374 pragma Inline (First_Case_Item_Of);
375 -- Only valid for N_Case_Construction nodes
377 function First_Choice_Of
378 (Node : Project_Node_Id)
379 return Project_Node_Id;
380 pragma Inline (First_Choice_Of);
381 -- Return the first choice in a N_Case_Item, or Empty_Node if
382 -- this is when others.
384 function Next_Case_Item
385 (Node : Project_Node_Id)
386 return Project_Node_Id;
387 pragma Inline (Next_Case_Item);
388 -- Only valid for N_Case_Item nodes
390 function Case_Insensitive (Node : Project_Node_Id) return Boolean;
391 -- Only valid for N_Attribute_Declaration and N_Attribute_Reference nodes
397 -- The following procedures are part of the abstract interface of
398 -- the Project File tree.
400 -- Each Set_* procedure is valid only for the same Project_Node_Kind
401 -- nodes as the corresponding query function above.
403 procedure Set_Name_Of
404 (Node : Project_Node_Id;
406 pragma Inline (Set_Name_Of);
408 procedure Set_Kind_Of
409 (Node : Project_Node_Id;
410 To : Project_Node_Kind);
411 pragma Inline (Set_Kind_Of);
413 procedure Set_Location_Of
414 (Node : Project_Node_Id;
416 pragma Inline (Set_Location_Of);
418 procedure Set_Directory_Of
419 (Node : Project_Node_Id;
421 pragma Inline (Set_Directory_Of);
423 procedure Set_Expression_Kind_Of
424 (Node : Project_Node_Id;
426 pragma Inline (Set_Expression_Kind_Of);
428 procedure Set_First_Variable_Of
429 (Node : Project_Node_Id;
430 To : Variable_Node_Id);
431 pragma Inline (Set_First_Variable_Of);
433 procedure Set_First_Package_Of
434 (Node : Project_Node_Id;
435 To : Package_Declaration_Id);
436 pragma Inline (Set_First_Package_Of);
438 procedure Set_Package_Id_Of
439 (Node : Project_Node_Id;
440 To : Package_Node_Id);
441 pragma Inline (Set_Package_Id_Of);
443 procedure Set_Path_Name_Of
444 (Node : Project_Node_Id;
446 pragma Inline (Set_Path_Name_Of);
448 procedure Set_String_Value_Of
449 (Node : Project_Node_Id;
451 pragma Inline (Set_String_Value_Of);
453 procedure Set_First_With_Clause_Of
454 (Node : Project_Node_Id;
455 To : Project_Node_Id);
456 pragma Inline (Set_First_With_Clause_Of);
458 procedure Set_Project_Declaration_Of
459 (Node : Project_Node_Id;
460 To : Project_Node_Id);
461 pragma Inline (Set_Project_Declaration_Of);
463 procedure Set_Extending_Project_Of
464 (Node : Project_Node_Id;
465 To : Project_Node_Id);
466 pragma Inline (Set_Extending_Project_Of);
468 procedure Set_First_String_Type_Of
469 (Node : Project_Node_Id;
470 To : Project_Node_Id);
471 pragma Inline (Set_First_String_Type_Of);
473 procedure Set_Extended_Project_Path_Of
474 (Node : Project_Node_Id;
476 pragma Inline (Set_Extended_Project_Path_Of);
478 procedure Set_Project_Node_Of
479 (Node : Project_Node_Id;
480 To : Project_Node_Id;
481 Limited_With : Boolean := False);
482 pragma Inline (Set_Project_Node_Of);
484 procedure Set_Next_With_Clause_Of
485 (Node : Project_Node_Id;
486 To : Project_Node_Id);
487 pragma Inline (Set_Next_With_Clause_Of);
489 procedure Set_First_Declarative_Item_Of
490 (Node : Project_Node_Id;
491 To : Project_Node_Id);
492 pragma Inline (Set_First_Declarative_Item_Of);
494 procedure Set_Extended_Project_Of
495 (Node : Project_Node_Id;
496 To : Project_Node_Id);
497 pragma Inline (Set_Extended_Project_Of);
499 procedure Set_Current_Item_Node
500 (Node : Project_Node_Id;
501 To : Project_Node_Id);
502 pragma Inline (Set_Current_Item_Node);
504 procedure Set_Next_Declarative_Item
505 (Node : Project_Node_Id;
506 To : Project_Node_Id);
507 pragma Inline (Set_Next_Declarative_Item);
509 procedure Set_Project_Of_Renamed_Package_Of
510 (Node : Project_Node_Id;
511 To : Project_Node_Id);
512 pragma Inline (Set_Project_Of_Renamed_Package_Of);
514 procedure Set_Next_Package_In_Project
515 (Node : Project_Node_Id;
516 To : Project_Node_Id);
517 pragma Inline (Set_Next_Package_In_Project);
519 procedure Set_First_Literal_String
520 (Node : Project_Node_Id;
521 To : Project_Node_Id);
522 pragma Inline (Set_First_Literal_String);
524 procedure Set_Next_String_Type
525 (Node : Project_Node_Id;
526 To : Project_Node_Id);
527 pragma Inline (Set_Next_String_Type);
529 procedure Set_Next_Literal_String
530 (Node : Project_Node_Id;
531 To : Project_Node_Id);
532 pragma Inline (Set_Next_Literal_String);
534 procedure Set_Expression_Of
535 (Node : Project_Node_Id;
536 To : Project_Node_Id);
537 pragma Inline (Set_Expression_Of);
539 procedure Set_Associative_Project_Of
540 (Node : Project_Node_Id;
541 To : Project_Node_Id);
542 pragma Inline (Set_Associative_Project_Of);
544 procedure Set_Associative_Package_Of
545 (Node : Project_Node_Id;
546 To : Project_Node_Id);
547 pragma Inline (Set_Associative_Package_Of);
549 procedure Set_Associative_Array_Index_Of
550 (Node : Project_Node_Id;
552 pragma Inline (Set_Associative_Array_Index_Of);
554 procedure Set_Next_Variable
555 (Node : Project_Node_Id;
556 To : Project_Node_Id);
557 pragma Inline (Set_Next_Variable);
559 procedure Set_First_Term
560 (Node : Project_Node_Id;
561 To : Project_Node_Id);
562 pragma Inline (Set_First_Term);
564 procedure Set_Next_Expression_In_List
565 (Node : Project_Node_Id;
566 To : Project_Node_Id);
567 pragma Inline (Set_Next_Expression_In_List);
569 procedure Set_Current_Term
570 (Node : Project_Node_Id;
571 To : Project_Node_Id);
572 pragma Inline (Set_Current_Term);
574 procedure Set_Next_Term
575 (Node : Project_Node_Id;
576 To : Project_Node_Id);
577 pragma Inline (Set_Next_Term);
579 procedure Set_First_Expression_In_List
580 (Node : Project_Node_Id;
581 To : Project_Node_Id);
582 pragma Inline (Set_First_Expression_In_List);
584 procedure Set_Package_Node_Of
585 (Node : Project_Node_Id;
586 To : Project_Node_Id);
587 pragma Inline (Set_Package_Node_Of);
589 procedure Set_String_Type_Of
590 (Node : Project_Node_Id;
591 To : Project_Node_Id);
592 pragma Inline (Set_String_Type_Of);
594 procedure Set_External_Reference_Of
595 (Node : Project_Node_Id;
596 To : Project_Node_Id);
597 pragma Inline (Set_External_Reference_Of);
599 procedure Set_External_Default_Of
600 (Node : Project_Node_Id;
601 To : Project_Node_Id);
602 pragma Inline (Set_External_Default_Of);
604 procedure Set_Case_Variable_Reference_Of
605 (Node : Project_Node_Id;
606 To : Project_Node_Id);
607 pragma Inline (Set_Case_Variable_Reference_Of);
609 procedure Set_First_Case_Item_Of
610 (Node : Project_Node_Id;
611 To : Project_Node_Id);
612 pragma Inline (Set_First_Case_Item_Of);
614 procedure Set_First_Choice_Of
615 (Node : Project_Node_Id;
616 To : Project_Node_Id);
617 pragma Inline (Set_First_Choice_Of);
619 procedure Set_Next_Case_Item
620 (Node : Project_Node_Id;
621 To : Project_Node_Id);
622 pragma Inline (Set_Next_Case_Item);
624 procedure Set_Case_Insensitive
625 (Node : Project_Node_Id;
628 -------------------------------
629 -- Restricted Access Section --
630 -------------------------------
632 package Tree_Private_Part is
634 -- This is conceptually in the private part.
635 -- However, for efficiency, some packages are accessing it directly.
637 type Project_Node_Record is record
639 Kind : Project_Node_Kind;
641 Location : Source_Ptr := No_Location;
643 Directory : Name_Id := No_Name;
644 -- Only for N_Project
646 Expr_Kind : Variable_Kind := Undefined;
647 -- See below for what Project_Node_Kind it is used
649 Variables : Variable_Node_Id := Empty_Node;
650 -- First variable in a project or a package
652 Packages : Package_Declaration_Id := Empty_Node;
653 -- First package declaration in a project
655 Pkg_Id : Package_Node_Id := Empty_Package;
656 -- Only used for N_Package_Declaration
657 -- The component Pkg_Id is an entry into the table Package_Attributes
658 -- (in Prj.Attr). It is used to indicate all the attributes of the
659 -- package with their characteristics.
661 -- The tables Prj.Attr.Attributes and Prj.Attr.Package_Attributes
662 -- are built once and for all through a call (from Prj.Initialize)
663 -- to procedure Prj.Attr.Initialize. It is never modified after that.
665 Name : Name_Id := No_Name;
666 -- See below for what Project_Node_Kind it is used
668 Path_Name : Name_Id := No_Name;
669 -- See below for what Project_Node_Kind it is used
671 Value : Name_Id := No_Name;
672 -- See below for what Project_Node_Kind it is used
674 Field1 : Project_Node_Id := Empty_Node;
675 -- See below the meaning for each Project_Node_Kind
677 Field2 : Project_Node_Id := Empty_Node;
678 -- See below the meaning for each Project_Node_Kind
680 Field3 : Project_Node_Id := Empty_Node;
681 -- See below the meaning for each Project_Node_Kind
683 Case_Insensitive : Boolean := False;
684 -- This flag is significant only for N_Attribute_Declaration and
685 -- N_Atribute_Reference. It indicates for an associative array
686 -- attribute, that the index is case insensitive.
690 -- type Project_Node_Kind is
693 -- -- Name: project name
694 -- -- Path_Name: project path name
695 -- -- Expr_Kind: Undefined
696 -- -- Field1: first with clause
697 -- -- Field2: project declaration
698 -- -- Field3: first string type
699 -- -- Value: extended project path name (if any)
702 -- -- Name: imported project name
703 -- -- Path_Name: imported project path name
704 -- -- Expr_Kind: Undefined
705 -- -- Field1: project node
706 -- -- Field2: next with clause
707 -- -- Field3: project node or empty if "limited with"
708 -- -- Value: literal string withed
710 -- N_Project_Declaration,
712 -- -- Path_Name: not used
713 -- -- Expr_Kind: Undefined
714 -- -- Field1: first declarative item
715 -- -- Field2: extended project
716 -- -- Field3: extending project
717 -- -- Value: not used
719 -- N_Declarative_Item,
721 -- -- Path_Name: not used
722 -- -- Expr_Kind: Undefined
723 -- -- Field1: current item node
724 -- -- Field2: next declarative item
725 -- -- Field3: not used
726 -- -- Value: not used
728 -- N_Package_Declaration,
729 -- -- Name: package name
730 -- -- Path_Name: not used
731 -- -- Expr_Kind: Undefined
732 -- -- Field1: project of renamed package (if any)
733 -- -- Field2: first declarative item
734 -- -- Field3: next package in project
735 -- -- Value: not used
737 -- N_String_Type_Declaration,
738 -- -- Name: type name
739 -- -- Path_Name: not used
740 -- -- Expr_Kind: Undefined
741 -- -- Field1: first literal string
742 -- -- Field2: next string type
743 -- -- Field3: not used
744 -- -- Value: not used
748 -- -- Path_Name: not used
749 -- -- Expr_Kind: Single
750 -- -- Field1: next literal string
751 -- -- Field2: not used
752 -- -- Field3: not used
753 -- -- Value: string value
755 -- N_Attribute_Declaration,
756 -- -- Name: attribute name
757 -- -- Path_Name: not used
758 -- -- Expr_Kind: attribute kind
759 -- -- Field1: expression
760 -- -- Field2: project of full associative array
761 -- -- Field3: package of full associative array
762 -- -- Value: associative array index
763 -- -- (if an associative array element)
765 -- N_Typed_Variable_Declaration,
766 -- -- Name: variable name
767 -- -- Path_Name: not used
768 -- -- Expr_Kind: Single
769 -- -- Field1: expression
770 -- -- Field2: type of variable (N_String_Type_Declaration)
771 -- -- Field3: next variable
772 -- -- Value: not used
774 -- N_Variable_Declaration,
775 -- -- Name: variable name
776 -- -- Path_Name: not used
777 -- -- Expr_Kind: variable kind
778 -- -- Field1: expression
779 -- -- Field2: not used
780 -- -- Field3 is used for next variable, instead of Field2,
781 -- -- so that it is the same field for
782 -- -- N_Variable_Declaration and
783 -- -- N_Typed_Variable_Declaration
784 -- -- Field3: next variable
785 -- -- Value: not used
789 -- -- Path_Name: not used
790 -- -- Expr_Kind: expression kind
791 -- -- Field1: first term
792 -- -- Field2: next expression in list
793 -- -- Field3: not used
794 -- -- Value: not used
798 -- -- Path_Name: not used
799 -- -- Expr_Kind: term kind
800 -- -- Field1: current term
801 -- -- Field2: next term in the expression
802 -- -- Field3: not used
803 -- -- Value: not used
805 -- N_Literal_String_List,
806 -- -- Designates a list of string expressions between brackets
807 -- -- separated by commas. The string expressions are not necessarily
808 -- -- literal strings.
810 -- -- Path_Name: not used
811 -- -- Expr_Kind: List
812 -- -- Field1: first expression
813 -- -- Field2: not used
814 -- -- Field3: not used
815 -- -- Value: not used
817 -- N_Variable_Reference,
818 -- -- Name: variable name
819 -- -- Path_Name: not used
820 -- -- Expr_Kind: variable kind
821 -- -- Field1: project (if specified)
822 -- -- Field2: package (if specified)
823 -- -- Field3: type of variable (N_String_Type_Declaration), if any
824 -- -- Value: not used
828 -- -- Path_Name: not used
829 -- -- Expr_Kind: Single
830 -- -- Field1: Name of the external reference (literal string)
831 -- -- Field2: Default (literal string)
832 -- -- Field3: not used
833 -- -- Value: not used
835 -- N_Attribute_Reference,
836 -- -- Name: attribute name
837 -- -- Path_Name: not used
838 -- -- Expr_Kind: attribute kind
839 -- -- Field1: project
840 -- -- Field2: package (if attribute of a package)
841 -- -- Field3: not used
842 -- -- Value: associative array index
843 -- -- (if an associative array element)
845 -- N_Case_Construction,
847 -- -- Path_Name: not used
848 -- -- Expr_Kind: Undefined
849 -- -- Field1: case variable reference
850 -- -- Field2: first case item
851 -- -- Field3: not used
852 -- -- Value: not used
856 -- -- Path_Name: not used
857 -- -- Expr_Kind: not used
858 -- -- Field1: first choice (literal string), or Empty_Node
859 -- -- for when others
860 -- -- Field2: first declarative item
861 -- -- Field3: next case item
862 -- -- Value: not used
864 package Project_Nodes is
865 new Table.Table (Table_Component_Type => Project_Node_Record,
866 Table_Index_Type => Project_Node_Id,
867 Table_Low_Bound => First_Node_Id,
868 Table_Initial => Project_Nodes_Initial,
869 Table_Increment => Project_Nodes_Increment,
870 Table_Name => "Project_Nodes");
871 -- This table contains the syntactic tree of project data
872 -- from project files.
874 type Project_Name_And_Node is record
876 -- Name of the project
878 Node : Project_Node_Id;
879 -- Node of the project in table Project_Nodes
882 -- True when the project is being extended by another project
885 No_Project_Name_And_Node : constant Project_Name_And_Node :=
886 (Name => No_Name, Node => Empty_Node, Extended => True);
888 package Projects_Htable is new GNAT.HTable.Simple_HTable
889 (Header_Num => Header_Num,
890 Element => Project_Name_And_Node,
891 No_Element => No_Project_Name_And_Node,
895 -- This hash table contains a mapping of project names to project nodes.
896 -- Note that this hash table contains only the nodes whose Kind is
897 -- N_Project. It is used to find the node of a project from its
898 -- name, and to verify if a project has already been parsed, knowing
901 end Tree_Private_Part;