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 is the Project File Pretty Printer.
28 -- It is used to output a project file from a project file tree.
29 -- It is used by gnatname to update or create project files.
30 -- It is also used GLIDE2 to display project file trees.
31 -- It can also be used for debugging purposes for tools that create project
38 -- The following access to procedure types are used
39 -- to redirect output when calling Pretty_Print.
41 type Write_Char_Ap
is access procedure (C
: Character);
43 type Write_Eol_Ap
is access procedure;
45 type Write_Str_Ap
is access procedure (S
: String);
47 procedure Pretty_Print
48 (Project
: Prj
.Tree
.Project_Node_Id
;
49 Increment
: Positive := 3;
50 Eliminate_Empty_Case_Constructions
: Boolean := False;
51 Minimize_Empty_Lines
: Boolean := False;
52 W_Char
: Write_Char_Ap
:= null;
53 W_Eol
: Write_Eol_Ap
:= null;
54 W_Str
: Write_Str_Ap
:= null;
55 Backward_Compatibility
: Boolean);
56 -- Output a project file, using either the default output
57 -- routines, or the ones specified by W_Char, W_Eol and W_Str.
59 -- Increment is the number of spaces for each indentation level.
61 -- W_Char, W_Eol and W_Str can be used to change the default output
62 -- procedures. The default values force the output to Standard_Output.
64 -- If Eliminate_Empty_Case_Constructions is True, then case constructions
65 -- and case items that do not include any declarations will not be output.
67 -- If Minimize_Empty_Lines is True, empty lines will be output only
68 -- after the last with clause, after the line declaring the project name,
69 -- after the last declarative item of the project and before each
70 -- package declaration. Otherwise, more empty lines are output.
72 -- If Backward_Compatibility is True, then new attributes (Spec,
73 -- Spec_Suffix, Body, Body_Suffix) will be replaced by obsolete ones
74 -- (Specification, Specification_Suffix, Implementation,
75 -- Implementation_Suffix).
79 procedure Output_Statistics
;
80 -- This procedure can be used after one or more calls to Pretty_Print
81 -- to display what Project_Node_Kinds have not been exercised by the
82 -- call(s) to Pretty_Print. It is used only for testing purposes.