OSDN Git Service

* 41intnam.ads, 42intnam.ads, 4aintnam.ads, 4cintnam.ads,
[pf3gnuchains/gcc-fork.git] / gcc / ada / prj-tree.ads
index c5526b8..14d281a 100644 (file)
@@ -38,27 +38,30 @@ with Table;
 package Prj.Tree is
 
    Project_Nodes_Initial   : constant := 1_000;
-   --  Initial number of nodes in table Tree_Private_Part.Project_Nodes
    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; -- In practice, infinite
+   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;
+   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
+   First_Node_Id : constant Project_Node_Id := Project_Node_Low_Bound + 1;
+
+   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_Project_Declaration.
+   --  Used to designate a node whose expected kind is N_Proect_Declaration
 
    type Project_Node_Kind is
      (N_Project,
@@ -90,7 +93,7 @@ package Prj.Tree is
    function Default_Project_Node
      (Of_Kind       : Project_Node_Kind;
       And_Expr_Kind : Variable_Kind := Undefined)
-     return Project_Node_Id;
+      return          Project_Node_Id;
    --  Returns a Project_Node_Record with the specified Kind and
    --  Expr_Kind; all the other components have default nil values.
 
@@ -121,7 +124,7 @@ package Prj.Tree is
 
    function First_Variable_Of
      (Node  : Project_Node_Id)
-      return Variable_Node_Id;
+      return  Variable_Node_Id;
    --  Only valid for N_Project or N_Package_Declaration nodes
 
    function First_Package_Of
@@ -230,7 +233,7 @@ package Prj.Tree is
    function Associative_Array_Index_Of
      (Node  : Project_Node_Id)
       return  String_Id;
-   --  Only valid for N_Attribute_Declaration.
+   --  Only valid for N_Attribute_Declaration and N_Attribute_Reference.
    --  Returns No_String for non associative array attributes.
 
    function Next_Variable
@@ -308,7 +311,7 @@ package Prj.Tree is
    --  Only valid for N_Case_Item nodes
 
    function Case_Insensitive (Node : Project_Node_Id) return Boolean;
-   --  Only valid for N_Attribute_Declaration nodes
+   --  Only valid for N_Attribute_Declaration and N_Attribute_Reference nodes
 
    --------------------
    -- Set Procedures --
@@ -499,46 +502,54 @@ package Prj.Tree is
 
       type Project_Node_Record is record
 
-         Kind             : Project_Node_Kind;
+         Kind : Project_Node_Kind;
 
-         Location         : Source_Ptr    := No_Location;
+         Location : Source_Ptr := No_Location;
 
-         Directory        : Name_Id       := No_Name;
+         Directory : Name_Id       := No_Name;
          --  Only for N_Project
 
-         Expr_Kind        : Variable_Kind := Undefined;
+         Expr_Kind : Variable_Kind := Undefined;
          --  See below for what Project_Node_Kind it is used
 
-         Variables        : Variable_Node_Id := Empty_Node;
+         Variables : Variable_Node_Id := Empty_Node;
          --  First variable in a project or a package
 
-         Packages         : Package_Declaration_Id := Empty_Node;
+         Packages : Package_Declaration_Id := Empty_Node;
          --  First package declaration in a project
 
-         Pkg_Id           : Package_Node_Id := Empty_Package;
-         --  Only use in Package_Declaration
-
-         Name             : Name_Id         := No_Name;
+         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;
+         Path_Name : Name_Id := No_Name;
          --  See below for what Project_Node_Kind it is used
 
-         Value            : String_Id       := No_String;
+         Value : String_Id := No_String;
          --  See below for what Project_Node_Kind it is used
 
-         Field1           : Project_Node_Id := Empty_Node;
+         Field1 : Project_Node_Id := Empty_Node;
          --  See below the meaning for each Project_Node_Kind
 
-         Field2           : Project_Node_Id := Empty_Node;
+         Field2 : Project_Node_Id := Empty_Node;
          --  See below the meaning for each Project_Node_Kind
 
-         Field3           : Project_Node_Id := Empty_Node;
+         Field3 : Project_Node_Id := Empty_Node;
          --  See below the meaning for each Project_Node_Kind
 
-         Case_Insensitive : Boolean         := False;
-         --  Indicates, for an associative array attribute, that the
-         --  index is case insensitive.
+         Case_Insensitive : Boolean := False;
+         --  This flag is significant only for N_Attribute_Declaration and
+         --  N_Atribute_Reference. It indicates for an associative array
+         --  attribute, that the index is case insensitive.
 
       end record;
 
@@ -694,7 +705,8 @@ package Prj.Tree is
       --    --  Field1:    project
       --    --  Field2:    package (if attribute of a package)
       --    --  Field3:    not used
-      --    --  Value:     not used
+      --    --  Value:     associative array index
+      --    --             (if an associative array element)
 
       --    N_Case_Construction,
       --    --  Name:      not used
@@ -726,10 +738,12 @@ package Prj.Tree is
       --  from project files.
 
       type Project_Name_And_Node is record
-         Name     : Name_Id;
+         Name : Name_Id;
          --  Name of the project
-         Node     : Project_Node_Id;
+
+         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;