1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
9 -- Copyright (C) 2001-2013, 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 3, 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 COPYING3. If not, go to --
19 -- http://www.gnu.org/licenses for a complete copy of the license. --
21 -- GNAT was originally developed by the GNAT team at New York University. --
22 -- Extensive contributions were provided by Ada Core Technologies Inc. --
24 ------------------------------------------------------------------------------
26 with Ada
.Characters
.Handling
; use Ada
.Characters
.Handling
;
28 with Output
; use Output
;
31 package body Prj
.PP
is
35 Not_Tested
: array (Project_Node_Kind
) of Boolean := (others => True);
37 procedure Indicate_Tested
(Kind
: Project_Node_Kind
);
38 -- Set the corresponding component of array Not_Tested to False.
39 -- Only called by pragmas Debug.
45 procedure Indicate_Tested
(Kind
: Project_Node_Kind
) is
47 Not_Tested
(Kind
) := False;
54 procedure Pretty_Print
55 (Project
: Prj
.Tree
.Project_Node_Id
;
56 In_Tree
: Prj
.Tree
.Project_Node_Tree_Ref
;
57 Increment
: Positive := 3;
58 Eliminate_Empty_Case_Constructions
: Boolean := False;
59 Minimize_Empty_Lines
: Boolean := False;
60 W_Char
: Write_Char_Ap
:= null;
61 W_Eol
: Write_Eol_Ap
:= null;
62 W_Str
: Write_Str_Ap
:= null;
63 Backward_Compatibility
: Boolean;
64 Id
: Prj
.Project_Id
:= Prj
.No_Project
;
65 Max_Line_Length
: Max_Length_Of_Line
:=
66 Max_Length_Of_Line
'Last)
68 procedure Print
(Node
: Project_Node_Id
; Indent
: Natural);
69 -- A recursive procedure that traverses a project file tree and outputs
70 -- its source. Current_Prj is the project that we are printing. This
71 -- is used when printing attributes, since in nested packages they
72 -- need to use a fully qualified name.
74 procedure Output_Attribute_Name
(Name
: Name_Id
; Indent
: Natural);
75 -- Outputs an attribute name, taking into account the value of
76 -- Backward_Compatibility.
81 Capitalize
: Boolean := True);
84 procedure Start_Line
(Indent
: Natural);
85 -- Outputs the indentation at the beginning of the line
87 procedure Output_String
(S
: Name_Id
; Indent
: Natural);
88 procedure Output_String
(S
: Path_Name_Type
; Indent
: Natural);
89 -- Outputs a string using the default output procedures
91 procedure Write_Empty_Line
(Always
: Boolean := False);
92 -- Outputs an empty line, only if the previous line was not empty
93 -- already and either Always is True or Minimize_Empty_Lines is
96 procedure Write_Line
(S
: String);
97 -- Outputs S followed by a new line
99 procedure Write_String
102 Truncated
: Boolean := False);
103 -- Outputs S using Write_Str, starting a new line if line would
104 -- become too long, when Truncated = False.
105 -- When Truncated = True, only the part of the string that can fit on
106 -- the line is output.
108 procedure Write_End_Of_Line_Comment
(Node
: Project_Node_Id
);
110 Write_Char
: Write_Char_Ap
:= Output
.Write_Char
'Access;
111 Write_Eol
: Write_Eol_Ap
:= Output
.Write_Eol
'Access;
112 Write_Str
: Write_Str_Ap
:= Output
.Write_Str
'Access;
113 -- These three access to procedure values are used for the output
115 Last_Line_Is_Empty
: Boolean := False;
116 -- Used to avoid two consecutive empty lines
118 Column
: Natural := 0;
119 -- Column number of the last character in the line. Used to avoid
120 -- outputting lines longer than Max_Line_Length.
122 First_With_In_List
: Boolean := True;
123 -- Indicate that the next with clause is first in a list such as
125 -- First_With_In_List will be True for "A", but not for "B".
127 ---------------------------
128 -- Output_Attribute_Name --
129 ---------------------------
131 procedure Output_Attribute_Name
(Name
: Name_Id
; Indent
: Natural) is
133 if Backward_Compatibility
then
135 when Snames
.Name_Spec
=>
136 Output_Name
(Snames
.Name_Specification
, Indent
);
138 when Snames
.Name_Spec_Suffix
=>
139 Output_Name
(Snames
.Name_Specification_Suffix
, Indent
);
141 when Snames
.Name_Body
=>
142 Output_Name
(Snames
.Name_Implementation
, Indent
);
144 when Snames
.Name_Body_Suffix
=>
145 Output_Name
(Snames
.Name_Implementation_Suffix
, Indent
);
148 Output_Name
(Name
, Indent
);
152 Output_Name
(Name
, Indent
);
154 end Output_Attribute_Name
;
160 procedure Output_Name
163 Capitalize
: Boolean := True)
165 Capital
: Boolean := Capitalize
;
168 if Column
= 0 and then Indent
/= 0 then
169 Start_Line
(Indent
+ Increment
);
172 Get_Name_String
(Name
);
174 -- If line would become too long, create new line
176 if Column
+ Name_Len
> Max_Line_Length
then
181 Start_Line
(Indent
+ Increment
);
185 for J
in 1 .. Name_Len
loop
187 Write_Char
(To_Upper
(Name_Buffer
(J
)));
189 Write_Char
(Name_Buffer
(J
));
194 Name_Buffer
(J
) = '_'
195 or else Is_Digit
(Name_Buffer
(J
));
199 Column
:= Column
+ Name_Len
;
206 procedure Output_String
(S
: Name_Id
; Indent
: Natural) is
208 if Column
= 0 and then Indent
/= 0 then
209 Start_Line
(Indent
+ Increment
);
214 -- If line could become too long, create new line. Note that the
215 -- number of characters on the line could be twice the number of
216 -- character in the string (if every character is a '"') plus two
217 -- (the initial and final '"').
219 if Column
+ Name_Len
+ Name_Len
+ 2 > Max_Line_Length
then
224 Start_Line
(Indent
+ Increment
);
229 Column
:= Column
+ 1;
232 for J
in 1 .. Name_Len
loop
233 if Name_Buffer
(J
) = '"' then
236 Column
:= Column
+ 2;
238 Write_Char
(Name_Buffer
(J
));
239 Column
:= Column
+ 1;
242 -- If the string does not fit on one line, cut it in parts and
245 if J
< Name_Len
and then Column
>= Max_Line_Length
then
249 Start_Line
(Indent
+ Increment
);
251 Column
:= Column
+ 1;
256 Column
:= Column
+ 1;
259 procedure Output_String
(S
: Path_Name_Type
; Indent
: Natural) is
261 Output_String
(Name_Id
(S
), Indent
);
268 procedure Start_Line
(Indent
: Natural) is
270 if not Minimize_Empty_Lines
then
271 Write_Str
((1 .. Indent
=> ' '));
272 Column
:= Column
+ Indent
;
276 ----------------------
277 -- Write_Empty_Line --
278 ----------------------
280 procedure Write_Empty_Line
(Always
: Boolean := False) is
282 if (Always
or else not Minimize_Empty_Lines
)
283 and then not Last_Line_Is_Empty
287 Last_Line_Is_Empty
:= True;
289 end Write_Empty_Line
;
291 -------------------------------
292 -- Write_End_Of_Line_Comment --
293 -------------------------------
295 procedure Write_End_Of_Line_Comment
(Node
: Project_Node_Id
) is
296 Value
: constant Name_Id
:= End_Of_Line_Comment
(Node
, In_Tree
);
299 if Value
/= No_Name
then
300 Write_String
(" --", 0);
301 Write_String
(Get_Name_String
(Value
), 0, Truncated
=> True);
305 end Write_End_Of_Line_Comment
;
311 procedure Write_Line
(S
: String) is
314 Last_Line_Is_Empty
:= False;
323 procedure Write_String
326 Truncated
: Boolean := False) is
327 Length
: Natural := S
'Length;
329 if Column
= 0 and then Indent
/= 0 then
330 Start_Line
(Indent
+ Increment
);
333 -- If the string would not fit on the line,
336 if Column
+ Length
> Max_Line_Length
then
338 Length
:= Max_Line_Length
- Column
;
345 Start_Line
(Indent
+ Increment
);
350 Write_Str
(S
(S
'First .. S
'First + Length
- 1));
351 Column
:= Column
+ Length
;
358 procedure Print
(Node
: Project_Node_Id
; Indent
: Natural) is
360 if Present
(Node
) then
362 case Kind_Of
(Node
, In_Tree
) is
365 pragma Debug
(Indicate_Tested
(N_Project
));
366 if Present
(First_With_Clause_Of
(Node
, In_Tree
)) then
370 First_With_In_List
:= True;
371 Print
(First_With_Clause_Of
(Node
, In_Tree
), Indent
);
372 Write_Empty_Line
(Always
=> True);
375 Print
(First_Comment_Before
(Node
, In_Tree
), Indent
);
378 case Project_Qualifier_Of
(Node
, In_Tree
) is
379 when Unspecified | Standard
=>
382 Write_String
("aggregate ", Indent
);
383 when Aggregate_Library
=>
384 Write_String
("aggregate library ", Indent
);
386 Write_String
("library ", Indent
);
387 when Configuration
=>
388 Write_String
("configuration ", Indent
);
390 Write_String
("abstract ", Indent
);
393 Write_String
("project ", Indent
);
395 if Id
/= Prj
.No_Project
then
396 Output_Name
(Id
.Display_Name
, Indent
);
398 Output_Name
(Name_Of
(Node
, In_Tree
), Indent
);
401 -- Check if this project extends another project
403 if Extended_Project_Path_Of
(Node
, In_Tree
) /= No_Path
then
404 Write_String
(" extends ", Indent
);
406 if Is_Extending_All
(Node
, In_Tree
) then
407 Write_String
("all ", Indent
);
411 (Extended_Project_Path_Of
(Node
, In_Tree
),
415 Write_String
(" is", Indent
);
416 Write_End_Of_Line_Comment
(Node
);
418 (First_Comment_After
(Node
, In_Tree
), Indent
+ Increment
);
419 Write_Empty_Line
(Always
=> True);
421 -- Output all of the declarations in the project
423 Print
(Project_Declaration_Of
(Node
, In_Tree
), Indent
);
425 (First_Comment_Before_End
(Node
, In_Tree
),
428 Write_String
("end ", Indent
);
430 if Id
/= Prj
.No_Project
then
431 Output_Name
(Id
.Display_Name
, Indent
);
433 Output_Name
(Name_Of
(Node
, In_Tree
), Indent
);
437 Print
(First_Comment_After_End
(Node
, In_Tree
), Indent
);
439 when N_With_Clause
=>
440 pragma Debug
(Indicate_Tested
(N_With_Clause
));
442 -- The with clause will sometimes contain an invalid name
443 -- when we are importing a virtual project from an
444 -- extending all project. Do not output anything in this
447 if Name_Of
(Node
, In_Tree
) /= No_Name
448 and then String_Value_Of
(Node
, In_Tree
) /= No_Name
450 if First_With_In_List
then
451 Print
(First_Comment_Before
(Node
, In_Tree
), Indent
);
454 if Non_Limited_Project_Node_Of
(Node
, In_Tree
) =
457 Write_String
("limited ", Indent
);
460 Write_String
("with ", Indent
);
463 Output_String
(String_Value_Of
(Node
, In_Tree
), Indent
);
465 if Is_Not_Last_In_List
(Node
, In_Tree
) then
466 Write_String
(", ", Indent
);
467 First_With_In_List
:= False;
470 Write_String
(";", Indent
);
471 Write_End_Of_Line_Comment
(Node
);
472 Print
(First_Comment_After
(Node
, In_Tree
), Indent
);
473 First_With_In_List
:= True;
477 Print
(Next_With_Clause_Of
(Node
, In_Tree
), Indent
);
479 when N_Project_Declaration
=>
480 pragma Debug
(Indicate_Tested
(N_Project_Declaration
));
483 Present
(First_Declarative_Item_Of
(Node
, In_Tree
))
486 (First_Declarative_Item_Of
(Node
, In_Tree
),
488 Write_Empty_Line
(Always
=> True);
491 when N_Declarative_Item
=>
492 pragma Debug
(Indicate_Tested
(N_Declarative_Item
));
493 Print
(Current_Item_Node
(Node
, In_Tree
), Indent
);
494 Print
(Next_Declarative_Item
(Node
, In_Tree
), Indent
);
496 when N_Package_Declaration
=>
497 pragma Debug
(Indicate_Tested
(N_Package_Declaration
));
498 Write_Empty_Line
(Always
=> True);
499 Print
(First_Comment_Before
(Node
, In_Tree
), Indent
);
501 Write_String
("package ", Indent
);
502 Output_Name
(Name_Of
(Node
, In_Tree
), Indent
);
504 if Project_Of_Renamed_Package_Of
(Node
, In_Tree
) /=
507 Write_String
(" renames ", Indent
);
510 (Project_Of_Renamed_Package_Of
(Node
, In_Tree
),
513 Write_String
(".", Indent
);
514 Output_Name
(Name_Of
(Node
, In_Tree
), Indent
);
515 Write_String
(";", Indent
);
516 Write_End_Of_Line_Comment
(Node
);
517 Print
(First_Comment_After_End
(Node
, In_Tree
), Indent
);
520 Write_String
(" is", Indent
);
521 Write_End_Of_Line_Comment
(Node
);
522 Print
(First_Comment_After
(Node
, In_Tree
),
525 if First_Declarative_Item_Of
(Node
, In_Tree
) /=
529 (First_Declarative_Item_Of
(Node
, In_Tree
),
533 Print
(First_Comment_Before_End
(Node
, In_Tree
),
536 Write_String
("end ", Indent
);
537 Output_Name
(Name_Of
(Node
, In_Tree
), Indent
);
539 Print
(First_Comment_After_End
(Node
, In_Tree
), Indent
);
543 when N_String_Type_Declaration
=>
544 pragma Debug
(Indicate_Tested
(N_String_Type_Declaration
));
545 Print
(First_Comment_Before
(Node
, In_Tree
), Indent
);
547 Write_String
("type ", Indent
);
548 Output_Name
(Name_Of
(Node
, In_Tree
), Indent
);
550 Start_Line
(Indent
+ Increment
);
551 Write_String
("(", Indent
);
554 String_Node
: Project_Node_Id
:=
555 First_Literal_String
(Node
, In_Tree
);
558 while Present
(String_Node
) loop
560 (String_Value_Of
(String_Node
, In_Tree
),
563 Next_Literal_String
(String_Node
, In_Tree
);
565 if Present
(String_Node
) then
566 Write_String
(", ", Indent
);
571 Write_String
(");", Indent
);
572 Write_End_Of_Line_Comment
(Node
);
573 Print
(First_Comment_After
(Node
, In_Tree
), Indent
);
575 when N_Literal_String
=>
576 pragma Debug
(Indicate_Tested
(N_Literal_String
));
577 Output_String
(String_Value_Of
(Node
, In_Tree
), Indent
);
579 if Source_Index_Of
(Node
, In_Tree
) /= 0 then
580 Write_String
(" at", Indent
);
582 (Source_Index_Of
(Node
, In_Tree
)'Img,
586 when N_Attribute_Declaration
=>
587 pragma Debug
(Indicate_Tested
(N_Attribute_Declaration
));
588 Print
(First_Comment_Before
(Node
, In_Tree
), Indent
);
590 Write_String
("for ", Indent
);
591 Output_Attribute_Name
(Name_Of
(Node
, In_Tree
), Indent
);
593 if Associative_Array_Index_Of
(Node
, In_Tree
) /= No_Name
then
594 Write_String
(" (", Indent
);
596 (Associative_Array_Index_Of
(Node
, In_Tree
),
599 if Source_Index_Of
(Node
, In_Tree
) /= 0 then
600 Write_String
(" at", Indent
);
602 (Source_Index_Of
(Node
, In_Tree
)'Img,
606 Write_String
(")", Indent
);
609 Write_String
(" use ", Indent
);
611 if Present
(Expression_Of
(Node
, In_Tree
)) then
612 Print
(Expression_Of
(Node
, In_Tree
), Indent
);
615 -- Full associative array declaration
618 Present
(Associative_Project_Of
(Node
, In_Tree
))
622 (Associative_Project_Of
(Node
, In_Tree
),
627 Present
(Associative_Package_Of
(Node
, In_Tree
))
629 Write_String
(".", Indent
);
632 (Associative_Package_Of
(Node
, In_Tree
),
638 Present
(Associative_Package_Of
(Node
, In_Tree
))
642 (Associative_Package_Of
(Node
, In_Tree
),
647 Write_String
("'", Indent
);
648 Output_Attribute_Name
(Name_Of
(Node
, In_Tree
), Indent
);
651 Write_String
(";", Indent
);
652 Write_End_Of_Line_Comment
(Node
);
653 Print
(First_Comment_After
(Node
, In_Tree
), Indent
);
655 when N_Typed_Variable_Declaration
=>
657 (Indicate_Tested
(N_Typed_Variable_Declaration
));
658 Print
(First_Comment_Before
(Node
, In_Tree
), Indent
);
660 Output_Name
(Name_Of
(Node
, In_Tree
), Indent
);
661 Write_String
(" : ", Indent
);
663 (Name_Of
(String_Type_Of
(Node
, In_Tree
), In_Tree
),
665 Write_String
(" := ", Indent
);
666 Print
(Expression_Of
(Node
, In_Tree
), Indent
);
667 Write_String
(";", Indent
);
668 Write_End_Of_Line_Comment
(Node
);
669 Print
(First_Comment_After
(Node
, In_Tree
), Indent
);
671 when N_Variable_Declaration
=>
672 pragma Debug
(Indicate_Tested
(N_Variable_Declaration
));
673 Print
(First_Comment_Before
(Node
, In_Tree
), Indent
);
675 Output_Name
(Name_Of
(Node
, In_Tree
), Indent
);
676 Write_String
(" := ", Indent
);
677 Print
(Expression_Of
(Node
, In_Tree
), Indent
);
678 Write_String
(";", Indent
);
679 Write_End_Of_Line_Comment
(Node
);
680 Print
(First_Comment_After
(Node
, In_Tree
), Indent
);
683 pragma Debug
(Indicate_Tested
(N_Expression
));
685 Term
: Project_Node_Id
:= First_Term
(Node
, In_Tree
);
688 while Present
(Term
) loop
689 Print
(Term
, Indent
);
690 Term
:= Next_Term
(Term
, In_Tree
);
692 if Present
(Term
) then
693 Write_String
(" & ", Indent
);
699 pragma Debug
(Indicate_Tested
(N_Term
));
700 Print
(Current_Term
(Node
, In_Tree
), Indent
);
702 when N_Literal_String_List
=>
703 pragma Debug
(Indicate_Tested
(N_Literal_String_List
));
704 Write_String
("(", Indent
);
707 Expression
: Project_Node_Id
:=
708 First_Expression_In_List
(Node
, In_Tree
);
711 while Present
(Expression
) loop
712 Print
(Expression
, Indent
);
714 Next_Expression_In_List
(Expression
, In_Tree
);
716 if Present
(Expression
) then
717 Write_String
(", ", Indent
);
722 Write_String
(")", Indent
);
724 when N_Variable_Reference
=>
725 pragma Debug
(Indicate_Tested
(N_Variable_Reference
));
726 if Present
(Project_Node_Of
(Node
, In_Tree
)) then
728 (Name_Of
(Project_Node_Of
(Node
, In_Tree
), In_Tree
),
730 Write_String
(".", Indent
);
733 if Present
(Package_Node_Of
(Node
, In_Tree
)) then
735 (Name_Of
(Package_Node_Of
(Node
, In_Tree
), In_Tree
),
737 Write_String
(".", Indent
);
740 Output_Name
(Name_Of
(Node
, In_Tree
), Indent
);
742 when N_External_Value
=>
743 pragma Debug
(Indicate_Tested
(N_External_Value
));
744 Write_String
("external (", Indent
);
745 Print
(External_Reference_Of
(Node
, In_Tree
), Indent
);
747 if Present
(External_Default_Of
(Node
, In_Tree
)) then
748 Write_String
(", ", Indent
);
749 Print
(External_Default_Of
(Node
, In_Tree
), Indent
);
752 Write_String
(")", Indent
);
754 when N_Attribute_Reference
=>
755 pragma Debug
(Indicate_Tested
(N_Attribute_Reference
));
757 if Present
(Project_Node_Of
(Node
, In_Tree
))
758 and then Project_Node_Of
(Node
, In_Tree
) /= Project
761 (Name_Of
(Project_Node_Of
(Node
, In_Tree
), In_Tree
),
764 if Present
(Package_Node_Of
(Node
, In_Tree
)) then
765 Write_String
(".", Indent
);
767 (Name_Of
(Package_Node_Of
(Node
, In_Tree
), In_Tree
),
771 elsif Present
(Package_Node_Of
(Node
, In_Tree
)) then
773 (Name_Of
(Package_Node_Of
(Node
, In_Tree
), In_Tree
),
777 Write_String
("project", Indent
);
780 Write_String
("'", Indent
);
781 Output_Attribute_Name
(Name_Of
(Node
, In_Tree
), Indent
);
784 Index
: constant Name_Id
:=
785 Associative_Array_Index_Of
(Node
, In_Tree
);
788 if Index
/= No_Name
then
789 Write_String
(" (", Indent
);
790 Output_String
(Index
, Indent
);
791 Write_String
(")", Indent
);
795 when N_Case_Construction
=>
796 pragma Debug
(Indicate_Tested
(N_Case_Construction
));
799 Case_Item
: Project_Node_Id
;
800 Is_Non_Empty
: Boolean := False;
803 Case_Item
:= First_Case_Item_Of
(Node
, In_Tree
);
804 while Present
(Case_Item
) loop
806 (First_Declarative_Item_Of
(Case_Item
, In_Tree
))
807 or else not Eliminate_Empty_Case_Constructions
809 Is_Non_Empty
:= True;
813 Case_Item
:= Next_Case_Item
(Case_Item
, In_Tree
);
818 Print
(First_Comment_Before
(Node
, In_Tree
), Indent
);
820 Write_String
("case ", Indent
);
822 (Case_Variable_Reference_Of
(Node
, In_Tree
),
824 Write_String
(" is", Indent
);
825 Write_End_Of_Line_Comment
(Node
);
827 (First_Comment_After
(Node
, In_Tree
),
831 Case_Item
: Project_Node_Id
:=
832 First_Case_Item_Of
(Node
, In_Tree
);
834 while Present
(Case_Item
) loop
836 (Kind_Of
(Case_Item
, In_Tree
) = N_Case_Item
);
837 Print
(Case_Item
, Indent
+ Increment
);
839 Next_Case_Item
(Case_Item
, In_Tree
);
843 Print
(First_Comment_Before_End
(Node
, In_Tree
),
846 Write_Line
("end case;");
848 (First_Comment_After_End
(Node
, In_Tree
), Indent
);
853 pragma Debug
(Indicate_Tested
(N_Case_Item
));
855 if Present
(First_Declarative_Item_Of
(Node
, In_Tree
))
856 or else not Eliminate_Empty_Case_Constructions
859 Print
(First_Comment_Before
(Node
, In_Tree
), Indent
);
861 Write_String
("when ", Indent
);
863 if No
(First_Choice_Of
(Node
, In_Tree
)) then
864 Write_String
("others", Indent
);
868 Label
: Project_Node_Id
:=
869 First_Choice_Of
(Node
, In_Tree
);
871 while Present
(Label
) loop
872 Print
(Label
, Indent
);
873 Label
:= Next_Literal_String
(Label
, In_Tree
);
875 if Present
(Label
) then
876 Write_String
(" | ", Indent
);
882 Write_String
(" =>", Indent
);
883 Write_End_Of_Line_Comment
(Node
);
885 (First_Comment_After
(Node
, In_Tree
),
889 First
: constant Project_Node_Id
:=
890 First_Declarative_Item_Of
(Node
, In_Tree
);
895 Print
(First
, Indent
+ Increment
);
900 when N_Comment_Zones
=>
902 -- Nothing to do, because it will not be processed directly
907 pragma Debug
(Indicate_Tested
(N_Comment
));
909 if Follows_Empty_Line
(Node
, In_Tree
) then
914 Write_String
("--", Indent
);
916 (Get_Name_String
(String_Value_Of
(Node
, In_Tree
)),
921 if Is_Followed_By_Empty_Line
(Node
, In_Tree
) then
925 Print
(Next_Comment
(Node
, In_Tree
), Indent
);
930 -- Start of processing for Pretty_Print
933 if W_Char
= null then
934 Write_Char
:= Output
.Write_Char
'Access;
936 Write_Char
:= W_Char
;
940 Write_Eol
:= Output
.Write_Eol
'Access;
946 Write_Str
:= Output
.Write_Str
'Access;
954 -----------------------
955 -- Output_Statistics --
956 -----------------------
958 procedure Output_Statistics
is
960 Output
.Write_Line
("Project_Node_Kinds not tested:");
962 for Kind
in Project_Node_Kind
loop
963 if Kind
/= N_Comment_Zones
and then Not_Tested
(Kind
) then
964 Output
.Write_Str
(" ");
965 Output
.Write_Line
(Project_Node_Kind
'Image (Kind
));
970 end Output_Statistics
;
977 (Project
: Prj
.Tree
.Project_Node_Id
;
978 In_Tree
: Prj
.Tree
.Project_Node_Tree_Ref
) is
980 Pretty_Print
(Project
, In_Tree
, Backward_Compatibility
=> False);