-- --
-- B o d y --
-- --
--- Copyright (C) 2001-2005 Free Software Foundation, Inc. --
+-- Copyright (C) 2001-2005, 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- --
Not_Tested : array (Project_Node_Kind) of Boolean := (others => True);
Max_Line_Length : constant := Hostparm.Max_Line_Length - 5;
- -- Maximum length of a line.
+ -- Maximum length of a line
Column : Natural := 0;
-- Column number of the last character in the line. Used to avoid
-- Outputs a name
procedure Start_Line (Indent : Natural);
- -- Outputs the indentation at the beginning of the line.
+ -- Outputs the indentation at the beginning of the line
procedure Output_String (S : Name_Id);
-- Outputs a string using the default output procedures
Write_Char : Write_Char_Ap := Output.Write_Char'Access;
Write_Eol : Write_Eol_Ap := Output.Write_Eol'Access;
Write_Str : Write_Str_Ap := Output.Write_Str'Access;
- -- These three access to procedure values are used for the output.
+ -- These three access to procedure values are used for the output
Last_Line_Is_Empty : Boolean := False;
- -- Used to avoid two consecutive empty lines.
+ -- Used to avoid two consecutive empty lines
---------------------------
-- Output_Attribute_Name --
if Extended_Project_Path_Of (Node, In_Tree) /= No_Name then
Write_String (" extends ");
+
+ if Is_Extending_All (Node, In_Tree) then
+ Write_String ("all ");
+ end if;
+
Output_String (Extended_Project_Path_Of (Node, In_Tree));
end if;
when N_With_Clause =>
pragma Debug (Indicate_Tested (N_With_Clause));
- if Name_Of (Node, In_Tree) /= No_Name then
+ -- The with clause will sometimes contain an invalid name
+ -- when we are importing a virtual project from an
+ -- extending all project. Do not output anything in this
+ -- case
+
+ if Name_Of (Node, In_Tree) /= No_Name
+ and then String_Value_Of (Node, In_Tree) /= No_Name
+ then
if First_With_In_List then
Print (First_Comment_Before (Node, In_Tree), Indent);
Start_Line (Indent);
-- --
-- S p e c --
-- --
--- Copyright (C) 2001-2005 Free Software Foundation, Inc. --
+-- Copyright (C) 2001-2005, 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- --
N_Case_Item,
N_Comment_Zones,
N_Comment);
- -- 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.
+ -- Each node in the tree is of a Project_Node_Kind. For the signification
+ -- of the fields in each node of Project_Node_Kind, look at package
+ -- Tree_Private_Part.
procedure Initialize (Tree : Project_Node_Tree_Ref);
-- Initialize the Project File tree: empty the Project_Nodes table
(In_Tree : Project_Node_Tree_Ref;
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.
+ -- Returns a Project_Node_Record with the specified Kind and Expr_Kind. All
+ -- the other components have default nil values.
function Hash (N : Project_Node_Id) return Header_Num;
-- Used for hash tables where the key is a Project_Node_Id
-- comment, then it should be associated with this node.
procedure Set_Next_End_Node (To : Project_Node_Id);
- -- Put node To on the top of the end node stack. When an "end" line
- -- is found with this node on the top of the end node stack, the comments,
- -- if any, immediately preceding this "end" line will be associated with
- -- this node.
+ -- Put node To on the top of the end node stack. When an END line is found
+ -- with this node on the top of the end node stack, the comments, if any,
+ -- immediately preceding this "end" line will be associated with this node.
procedure Remove_Next_End_Node;
-- Remove the top of the end node stack
Follows_Empty_Line : Boolean := False;
Is_Followed_By_Empty_Line : Boolean := False;
end record;
+ -- Component type for Comments Table below
package Comments is new Table.Table
(Table_Component_Type => Comment_Data,
type Comment_Location is
(Before, After, Before_End, After_End, End_Of_Line);
+ -- Used in call to Add_Comments below
procedure Add_Comments
(To : Project_Node_Id;
----------------------
-- The following query functions are part of the abstract interface
- -- of the Project File tree
+ -- of the Project File tree. They provide access to fields of a project.
+
+ -- In the following, there are "valid if" comments, but no indication
+ -- of what happens if they are called with invalid arguments ???
function Name_Of
(Node : Project_Node_Id;
(Node : Project_Node_Id;
In_Tree : Project_Node_Tree_Ref) return Name_Id;
pragma Inline (String_Value_Of);
- -- Only valid for N_With_Clause, N_Literal_String nodes or N_Comment
+ -- Only valid for N_With_Clause, N_Literal_String nodes or N_Comment.
+ -- For a N_With_Clause created automatically for a virtual extending
+ -- project, No_Name is returned.
function Source_Index_Of
(Node : Project_Node_Id;