aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/prj-tree.ads
blob: f4416f9cd77fe6edc662cb33a79c6f7f8b57502c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
------------------------------------------------------------------------------
--                                                                          --
--                         GNAT COMPILER COMPONENTS                         --
--                                                                          --
--                              P R J . T R E E                             --
--                                                                          --
--                                 S p e c                                  --
--                                                                          --
--                            $Revision: 1.4 $
--                                                                          --
--             Copyright (C) 2001 Free Software Foundation, Inc.            --
--                                                                          --
-- GNAT is free software;  you can  redistribute it  and/or modify it under --
-- terms of the  GNU General Public License as published  by the Free Soft- --
-- ware  Foundation;  either version 2,  or (at your option) any later ver- --
-- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT 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  distributed with GNAT;  see file COPYING.  If not, write --
-- to  the Free Software Foundation,  59 Temple Place - Suite 330,  Boston, --
-- MA 02111-1307, USA.                                                      --
--                                                                          --
-- GNAT was originally developed  by the GNAT team at  New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc.      --
--                                                                          --
------------------------------------------------------------------------------

--  This package defines the structure of the Project File tree.

with GNAT.HTable;

with Prj.Attr; use Prj.Attr;
with Prj.Com;  use Prj.Com;
with Types;    use Types;
with Table;

package Prj.Tree is

   Project_Nodes_Initial   : constant := 1_000;
   Project_Nodes_Increment : constant := 100;
   --  Allocation parameters for initializing and extending number
   --  of nodes in table Tree_Private_Part.Project_Nodes

   Project_Node_Low_Bound  : constant := 0;
   Project_Node_High_Bound : constant := 099_999_999;
   --  Range of values for project node id's (in practice infinite)

   type Project_Node_Id is range
     Project_Node_Low_Bound .. Project_Node_High_Bound;
   --  The index of table Tree_Private_Part.Project_Nodes

   Empty_Node : constant Project_Node_Id := Project_Node_Low_Bound;
   --  Designates no node in table Project_Nodes

   First_Node_Id : constant Project_Node_Id := Project_Node_Low_Bound;

   subtype Variable_Node_Id is Project_Node_Id;
   --  Used to designate a node whose expected kind is one of
   --  N_Typed_Variable_Declaration, N_Variable_Declaration or
   --  N_Variable_Reference.

   subtype Package_Declaration_Id is Project_Node_Id;
   --  Used to designate a node whose expected kind is N_Proect_Declaration

   type Project_Node_Kind is
     (N_Project,
      N_With_Clause,
      N_Project_Declaration,
      N_Declarative_Item,
      N_Package_Declaration,
      N_String_Type_Declaration,
      N_Literal_String,
      N_Attribute_Declaration,
      N_Typed_Variable_Declaration,
      N_Variable_Declaration,
      N_Expression,
      N_Term,
      N_Literal_String_List,
      N_Variable_Reference,
      N_External_Value,
      N_Attribute_Reference,
      N_Case_Construction,
      N_Case_Item);
   --  Each node in the tree is of a Project_Node_Kind
   --  For the signification of the fields in each node of a
   --  Project_Node_Kind, look at package Tree_Private_Part.

   procedure Initialize;
   --  Initialize the Project File tree: empty the Project_Nodes table
   --  and reset the Projects_Htable.

   function Default_Project_Node
     (Of_Kind       : Project_Node_Kind;
      And_Expr_Kind : Variable_Kind := Undefined)
      return          Project_Node_Id;
   --  Returns a Project_Node_Record with the specified Kind and
   --  Expr_Kind; all the other components have default nil values.

   ----------------------
   -- Access Functions --
   ----------------------

   --  The following query functions are part of the abstract interface
   --  of the Project File tree

   function Name_Of (Node : Project_Node_Id) return Name_Id;
   --  Valid for all non empty nodes. May return No_Name for nodes that have
   --  no names.

   function Kind_Of (Node : Project_Node_Id) return Project_Node_Kind;
   --  Valid for all non empty nodes

   function Location_Of (Node : Project_Node_Id) return Source_Ptr;
   --  Valid for all non empty nodes

   function Directory_Of (Node : Project_Node_Id) return Name_Id;
   --  Only valid for N_Project nodes.

   function Expression_Kind_Of (Node : Project_Node_Id) return Variable_Kind;
   --  Only valid for N_Literal_String, N_Attribute_Declaration,
   --  N_Variable_Declaration, N_Typed_Variable_Declaration, N_Expression,
   --  N_Term, N_Variable_Reference or N_Attribute_Reference nodes.

   function First_Variable_Of
     (Node  : Project_Node_Id)
      return  Variable_Node_Id;
   --  Only valid for N_Project or N_Package_Declaration nodes

   function First_Package_Of
     (Node  : Project_Node_Id)
      return  Package_Declaration_Id;
   --  Only valid for N_Project nodes

   function Package_Id_Of (Node  : Project_Node_Id) return Package_Node_Id;
   --  Only valid for N_Package_Declaration nodes

   function Path_Name_Of (Node  : Project_Node_Id) return Name_Id;
   --  Only valid for N_Project and N_With_Clause nodes.

   function String_Value_Of (Node  : Project_Node_Id) return String_Id;
   --  Only valid for N_With_Clause or N_Literal_String nodes.

   function First_With_Clause_Of
     (Node  : Project_Node_Id)
      return  Project_Node_Id;
   --  Only valid for N_Project nodes

   function Project_Declaration_Of
     (Node  : Project_Node_Id)
      return  Project_Node_Id;
   --  Only valid for N_Project nodes

   function First_String_Type_Of
     (Node  : Project_Node_Id)
      return  Project_Node_Id;
   --  Only valid for N_Project nodes

   function Modified_Project_Path_Of
     (Node  : Project_Node_Id)
      return  String_Id;
   --  Only valid for N_With_Clause nodes

   function Project_Node_Of
     (Node  : Project_Node_Id)
      return  Project_Node_Id;
   --  Only valid for N_Project nodes

   function Next_With_Clause_Of
     (Node  : Project_Node_Id)
      return  Project_Node_Id;
   --  Only valid for N_With_Clause nodes

   function First_Declarative_Item_Of
     (Node  : Project_Node_Id)
      return  Project_Node_Id;
   --  Only valid for N_With_Clause nodes

   function Modified_Project_Of
     (Node  : Project_Node_Id)
      return Project_Node_Id;
   --  Only valid for N_With_Clause nodes

   function Current_Item_Node
     (Node  : Project_Node_Id)
      return  Project_Node_Id;
   --  Only valid for N_Declarative_Item nodes

   function Next_Declarative_Item
     (Node  : Project_Node_Id)
      return  Project_Node_Id;
   --  Only valid for N_Declarative_Item node

   function Project_Of_Renamed_Package_Of
     (Node  : Project_Node_Id)
      return  Project_Node_Id;
   --  Only valid for N_Package_Declaration nodes.
   --  May return Empty_Node.

   function Next_Package_In_Project
     (Node  : Project_Node_Id)
      return  Project_Node_Id;
   --  Only valid for N_Package_Declaration nodes

   function First_Literal_String
     (Node  : Project_Node_Id)
      return  Project_Node_Id;
   --  Only valid for N_String_Type_Declaration nodes

   function Next_String_Type
     (Node  : Project_Node_Id)
      return  Project_Node_Id;
   --  Only valid for N_String_Type_Declaration nodes

   function Next_Literal_String
     (Node  : Project_Node_Id)
      return  Project_Node_Id;
   --  Only valid for N_Literal_String nodes

   function Expression_Of
     (Node  : Project_Node_Id)
      return  Project_Node_Id;
   --  Only valid for N_Attribute_Declaration, N_Typed_Variable_Declaration
   --  or N_Variable_Declaration nodes

   function Value_Is_Valid
     (For_Typed_Variable : Project_Node_Id;
      Value              : String_Id)
      return               Boolean;
   --  Only valid for N_Typed_Variable_Declaration. Returns True if Value is
   --  in the list of allowed strings for For_Typed_Variable. False otherwise.

   function Associative_Array_Index_Of
     (Node  : Project_Node_Id)
      return  String_Id;
   --  Only valid for N_Attribute_Declaration.
   --  Returns No_String for non associative array attributes.

   function Next_Variable
     (Node  : Project_Node_Id)
      return  Project_Node_Id;
   --  Only valid for N_Typed_Variable_Declaration or N_Variable_Declaration
   --  nodes.

   function First_Term
     (Node  : Project_Node_Id)
      return  Project_Node_Id;
   --  Only valid for N_Expression nodes

   function Next_Expression_In_List
     (Node  : Project_Node_Id)
      return  Project_Node_Id;
   --  Only valid for N_Expression nodes

   function Current_Term
     (Node  : Project_Node_Id)
      return  Project_Node_Id;
   --  Only valid for N_Term nodes

   function Next_Term
     (Node  : Project_Node_Id)
      return  Project_Node_Id;
   --  Only valid for N_Term nodes

   function First_Expression_In_List
     (Node  : Project_Node_Id)
      return  Project_Node_Id;
   --  Only valid for N_Literal_String_List nodes

   function Package_Node_Of
     (Node  : Project_Node_Id)
      return  Project_Node_Id;
   --  Only valid for N_Variable_Reference or N_Attribute_Reference nodes.
   --  May return Empty_Node.

   function String_Type_Of
     (Node  : Project_Node_Id)
      return  Project_Node_Id;
   --  Only valid for N_Variable_Reference or N_Typed_Variable_Declaration
   --  nodes.

   function External_Reference_Of
     (Node  : Project_Node_Id)
      return  Project_Node_Id;
   --  Only valid for N_External_Value nodes

   function External_Default_Of
     (Node  : Project_Node_Id)
      return  Project_Node_Id;
   --  Only valid for N_External_Value nodes

   function Case_Variable_Reference_Of
     (Node  : Project_Node_Id)
      return  Project_Node_Id;
   --  Only valid for N_Case_Construction nodes

   function First_Case_Item_Of
     (Node  : Project_Node_Id)
      return  Project_Node_Id;
   --  Only valid for N_Case_Construction nodes

   function First_Choice_Of
     (Node  : Project_Node_Id)
      return  Project_Node_Id;
   --  Return the first choice in a N_Case_Item, or Empty_Node if
   --  this is when others.

   function Next_Case_Item
     (Node  : Project_Node_Id)
      return  Project_Node_Id;
   --  Only valid for N_Case_Item nodes

   function Case_Insensitive (Node : Project_Node_Id) return Boolean;
   --  Only valid for N_Attribute_Declaration nodes

   --------------------
   -- Set Procedures --
   --------------------

   --  The following procedures are part of the abstract interface of
   --  the Project File tree.

   --  Each Set_* procedure is valid only for the same Project_Node_Kind
   --  nodes as the corresponding query function above.

   procedure Set_Name_Of
     (Node : Project_Node_Id;
      To   : Name_Id);

   procedure Set_Kind_Of
     (Node : Project_Node_Id;
      To   : Project_Node_Kind);

   procedure Set_Location_Of
     (Node : Project_Node_Id;
      To   : Source_Ptr);

   procedure Set_Directory_Of
     (Node : Project_Node_Id;
      To   : Name_Id);

   procedure Set_Expression_Kind_Of
     (Node : Project_Node_Id;
      To   : Variable_Kind);

   procedure Set_First_Variable_Of
     (Node : Project_Node_Id;
      To   : Variable_Node_Id);

   procedure Set_First_Package_Of
     (Node : Project_Node_Id;
      To   : Package_Declaration_Id);

   procedure Set_Package_Id_Of
     (Node : Project_Node_Id;
      To   : Package_Node_Id);

   procedure Set_Path_Name_Of
     (Node : Project_Node_Id;
      To   : Name_Id);

   procedure Set_String_Value_Of
     (Node : Project_Node_Id;
      To   : String_Id);

   procedure Set_First_With_Clause_Of
     (Node : Project_Node_Id;
      To   : Project_Node_Id);

   procedure Set_Project_Declaration_Of
     (Node : Project_Node_Id;
      To   : Project_Node_Id);

   procedure Set_First_String_Type_Of
     (Node : Project_Node_Id;
      To   : Project_Node_Id);

   procedure Set_Modified_Project_Path_Of
     (Node : Project_Node_Id;
      To   : String_Id);

   procedure Set_Project_Node_Of
     (Node : Project_Node_Id;
      To   : Project_Node_Id);

   procedure Set_Next_With_Clause_Of
     (Node : Project_Node_Id;
      To   : Project_Node_Id);

   procedure Set_First_Declarative_Item_Of
     (Node : Project_Node_Id;
      To   : Project_Node_Id);

   procedure Set_Modified_Project_Of
     (Node : Project_Node_Id;
      To   : Project_Node_Id);

   procedure Set_Current_Item_Node
     (Node : Project_Node_Id;
      To   : Project_Node_Id);

   procedure Set_Next_Declarative_Item
     (Node : Project_Node_Id;
      To   : Project_Node_Id);

   procedure Set_Project_Of_Renamed_Package_Of
     (Node : Project_Node_Id;
      To   : Project_Node_Id);

   procedure Set_Next_Package_In_Project
     (Node : Project_Node_Id;
      To   : Project_Node_Id);

   procedure Set_First_Literal_String
     (Node : Project_Node_Id;
      To   : Project_Node_Id);

   procedure Set_Next_String_Type
     (Node : Project_Node_Id;
      To   : Project_Node_Id);

   procedure Set_Next_Literal_String
     (Node : Project_Node_Id;
      To   : Project_Node_Id);

   procedure Set_Expression_Of
     (Node : Project_Node_Id;
      To   : Project_Node_Id);

   procedure Set_Associative_Array_Index_Of
     (Node : Project_Node_Id;
      To   : String_Id);

   procedure Set_Next_Variable
     (Node : Project_Node_Id;
      To   : Project_Node_Id);

   procedure Set_First_Term
     (Node : Project_Node_Id;
      To   : Project_Node_Id);

   procedure Set_Next_Expression_In_List
     (Node : Project_Node_Id;
      To   : Project_Node_Id);

   procedure Set_Current_Term
     (Node : Project_Node_Id;
      To   : Project_Node_Id);

   procedure Set_Next_Term
     (Node : Project_Node_Id;
      To   : Project_Node_Id);

   procedure Set_First_Expression_In_List
     (Node : Project_Node_Id;
      To   : Project_Node_Id);

   procedure Set_Package_Node_Of
     (Node : Project_Node_Id;
      To   : Project_Node_Id);

   procedure Set_String_Type_Of
     (Node : Project_Node_Id;
      To   : Project_Node_Id);

   procedure Set_External_Reference_Of
     (Node : Project_Node_Id;
      To   : Project_Node_Id);

   procedure Set_External_Default_Of
     (Node : Project_Node_Id;
      To   : Project_Node_Id);

   procedure Set_Case_Variable_Reference_Of
     (Node : Project_Node_Id;
      To   : Project_Node_Id);

   procedure Set_First_Case_Item_Of
     (Node : Project_Node_Id;
      To   : Project_Node_Id);

   procedure Set_First_Choice_Of
     (Node : Project_Node_Id;
      To   : Project_Node_Id);

   procedure Set_Next_Case_Item
     (Node : Project_Node_Id;
      To   : Project_Node_Id);

   procedure Set_Case_Insensitive
     (Node : Project_Node_Id;
      To   : Boolean);

   -------------------------------
   -- Restricted Access Section --
   -------------------------------

   package Tree_Private_Part is

      --  This is conceptually in the private part.
      --  However, for efficiency, some packages are accessing it directly.

      type Project_Node_Record is record

         Kind : Project_Node_Kind;

         Location : Source_Ptr := No_Location;

         Directory : Name_Id       := No_Name;
         --  Only for N_Project

         Expr_Kind : Variable_Kind := Undefined;
         --  See below for what Project_Node_Kind it is used

         Variables : Variable_Node_Id := Empty_Node;
         --  First variable in a project or a package

         Packages : Package_Declaration_Id := Empty_Node;
         --  First package declaration in a project

         Pkg_Id : Package_Node_Id := Empty_Package;
         --  Only used for N_Package_Declaration
         --  The component Pkg_Id is an entry into the table Package_Attributes
         --  (in Prj.Attr). It is used to indicate all the attributes of the
         --  package with their characteristics.
         --
         --  The tables Prj.Attr.Attributes and Prj.Attr.Package_Attributes
         --  are built once and for all through a call (from Prj.Initialize)
         --  to procedure Prj.Attr.Initialize. It is never modified after that.

         Name : Name_Id := No_Name;
         --  See below for what Project_Node_Kind it is used

         Path_Name : Name_Id := No_Name;
         --  See below for what Project_Node_Kind it is used

         Value : String_Id := No_String;
         --  See below for what Project_Node_Kind it is used

         Field1 : Project_Node_Id := Empty_Node;
         --  See below the meaning for each Project_Node_Kind

         Field2 : Project_Node_Id := Empty_Node;
         --  See below the meaning for each Project_Node_Kind

         Field3 : Project_Node_Id := Empty_Node;
         --  See below the meaning for each Project_Node_Kind

         Case_Insensitive : Boolean := False;
         --  Significant only for N_Attribute_Declaration
         --  Indicates, for an associative array attribute, that the
         --  index is case insensitive.

      end record;

      --  type Project_Node_Kind is

      --   (N_Project,
      --    --  Name:      project name
      --    --  Path_Name: project path name
      --    --  Expr_Kind: Undefined
      --    --  Field1:    first with clause
      --    --  Field2:    project declaration
      --    --  Field3:    first string type
      --    --  Value:     modified project path name (if any)

      --    N_With_Clause,
      --    --  Name:      imported project name
      --    --  Path_Name: imported project path name
      --    --  Expr_Kind: Undefined
      --    --  Field1:    project node
      --    --  Field2:    next with clause
      --    --  Field3:    not used
      --    --  Value:     literal string withed

      --    N_Project_Declaration,
      --    --  Name:      not used
      --    --  Path_Name: not used
      --    --  Expr_Kind: Undefined
      --    --  Field1:    first declarative item
      --    --  Field2:    modified project
      --    --  Field3:    not used
      --    --  Value:     not used

      --    N_Declarative_Item,
      --    --  Name:      not used
      --    --  Path_Name: not used
      --    --  Expr_Kind: Undefined
      --    --  Field1:    current item node
      --    --  Field2:    next declarative item
      --    --  Field3:    not used
      --    --  Value:     not used

      --    N_Package_Declaration,
      --    --  Name:      package name
      --    --  Path_Name: not used
      --    --  Expr_Kind: Undefined
      --    --  Field1:    project of renamed package (if any)
      --    --  Field2:    first declarative item
      --    --  Field3:    next package in project
      --    --  Value:     not used

      --    N_String_Type_Declaration,
      --    --  Name:      type name
      --    --  Path_Name: not used
      --    --  Expr_Kind: Undefined
      --    --  Field1:    first literal string
      --    --  Field2:    next string type
      --    --  Field3:    not used
      --    --  Value:     not used

      --    N_Literal_String,
      --    --  Name:      not used
      --    --  Path_Name: not used
      --    --  Expr_Kind: Single
      --    --  Field1:    next literal string
      --    --  Field2:    not used
      --    --  Field3:    not used
      --    --  Value:     string value

      --    N_Attribute_Declaration,
      --    --  Name:      attribute name
      --    --  Path_Name: not used
      --    --  Expr_Kind: attribute kind
      --    --  Field1:    expression
      --    --  Field2:    not used
      --    --  Field3:    not used
      --    --  Value:     associative array index
      --    --             (if an associative array element)

      --    N_Typed_Variable_Declaration,
      --    --  Name:      variable name
      --    --  Path_Name: not used
      --    --  Expr_Kind: Single
      --    --  Field1:    expression
      --    --  Field2:    type of variable (N_String_Type_Declaration)
      --    --  Field3:    next variable
      --    --  Value:     not used

      --    N_Variable_Declaration,
      --    --  Name:      variable name
      --    --  Path_Name: not used
      --    --  Expr_Kind: variable kind
      --    --  Field1:    expression
      --    --  Field2:    not used
      --    --             Field3 is used for next variable, instead of Field2,
      --    --             so that it is the same field for
      --    --             N_Variable_Declaration and
      --    --             N_Typed_Variable_Declaration
      --    --  Field3:    next variable
      --    --  Value:     not used

      --    N_Expression,
      --    --  Name:      not used
      --    --  Path_Name: not used
      --    --  Expr_Kind: expression kind
      --    --  Field1:    first term
      --    --  Field2:    next expression in list
      --    --  Field3:    not used
      --    --  Value:     not used

      --    N_Term,
      --    --  Name:      not used
      --    --  Path_Name: not used
      --    --  Expr_Kind: term kind
      --    --  Field1:    current term
      --    --  Field2:    next term in the expression
      --    --  Field3:    not used
      --    --  Value:     not used

      --    N_Literal_String_List,
      --    --  Designates a list of string expressions between brackets
      --    --  separated by commas. The string expressions are not necessarily
      --    --  literal strings.
      --    --  Name:      not used
      --    --  Path_Name: not used
      --    --  Expr_Kind: List
      --    --  Field1:    first expression
      --    --  Field2:    not used
      --    --  Field3:    not used
      --    --  Value:     not used

      --    N_Variable_Reference,
      --    --  Name:      variable name
      --    --  Path_Name: not used
      --    --  Expr_Kind: variable kind
      --    --  Field1:    project (if specified)
      --    --  Field2:    package (if specified)
      --    --  Field3:    type of variable (N_String_Type_Declaration), if any
      --    --  Value:     not used

      --    N_External_Value,
      --    --  Name:      not used
      --    --  Path_Name: not used
      --    --  Expr_Kind: Single
      --    --  Field1:    Name of the external reference (literal string)
      --    --  Field2:    Default (literal string)
      --    --  Field3:    not used
      --    --  Value:     not used

      --    N_Attribute_Reference,
      --    --  Name:      attribute name
      --    --  Path_Name: not used
      --    --  Expr_Kind: attribute kind
      --    --  Field1:    project
      --    --  Field2:    package (if attribute of a package)
      --    --  Field3:    not used
      --    --  Value:     not used

      --    N_Case_Construction,
      --    --  Name:      not used
      --    --  Path_Name: not used
      --    --  Expr_Kind: Undefined
      --    --  Field1:    case variable reference
      --    --  Field2:    first case item
      --    --  Field3:    not used
      --    --  Value:     not used

      --    N_Case_Item);
      --    --  Name:      not used
      --    --  Path_Name: not used
      --    --  Expr_Kind: not used
      --    --  Field1:    first choice (literal string), or Empty_Node
      --    --             for when others
      --    --  Field2:    first declarative item
      --    --  Field3:    next case item
      --    --  Value:     not used

      package Project_Nodes is
         new Table.Table (Table_Component_Type => Project_Node_Record,
                          Table_Index_Type     => Project_Node_Id,
                          Table_Low_Bound      => First_Node_Id,
                          Table_Initial        => Project_Nodes_Initial,
                          Table_Increment      => Project_Nodes_Increment,
                          Table_Name           => "Project_Nodes");
      --  This table contains the syntactic tree of project data
      --  from project files.

      type Project_Name_And_Node is record
         Name : Name_Id;
         --  Name of the project

         Node : Project_Node_Id;
         --  Node of the project in table Project_Nodes

         Modified : Boolean;
         --  True when the project is being modified by another project
      end record;

      No_Project_Name_And_Node : constant Project_Name_And_Node :=
        (Name => No_Name, Node => Empty_Node, Modified => True);

      package Projects_Htable is new GNAT.HTable.Simple_HTable
        (Header_Num => Header_Num,
         Element    => Project_Name_And_Node,
         No_Element => No_Project_Name_And_Node,
         Key        => Name_Id,
         Hash       => Hash,
         Equal      => "=");
      --  This hash table contains a mapping of project names to project nodes.
      --  Note that this hash table contains only the nodes whose Kind is
      --  N_Project. It is used to find the node of a project from its
      --  name, and to verify if a project has already been parsed, knowing
      --  its name.

   end Tree_Private_Part;

end Prj.Tree;