OSDN Git Service

* prj-pp.adb : New file.
[pf3gnuchains/gcc-fork.git] / gcc / ada / prj-pp.ads
1 ------------------------------------------------------------------------------
2 --                                                                          --
3 --                         GNAT COMPILER COMPONENTS                         --
4 --                                                                          --
5 --                               P R J . P P                                --
6 --                                                                          --
7 --                                 S p e c                                  --
8 --                                                                          --
9 --                            $Revision$
10 --                                                                          --
11 --             Copyright (C) 2001 Free Software Foundation, Inc.            --
12 --                                                                          --
13 -- GNAT is free software;  you can  redistribute it  and/or modify it under --
14 -- terms of the  GNU General Public License as published  by the Free Soft- --
15 -- ware  Foundation;  either version 2,  or (at your option) any later ver- --
16 -- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
17 -- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
18 -- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License --
19 -- for  more details.  You should have  received  a copy of the GNU General --
20 -- Public License  distributed with GNAT;  see file COPYING.  If not, write --
21 -- to  the Free Software Foundation,  59 Temple Place - Suite 330,  Boston, --
22 -- MA 02111-1307, USA.                                                      --
23 --                                                                          --
24 -- GNAT was originally developed  by the GNAT team at  New York University. --
25 -- It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). --
26 --                                                                          --
27 ------------------------------------------------------------------------------
28 --
29 --  This package is the Project File Pretty Printer.
30 --  It is used to output a project file from a project file tree.
31 --  It is used by gnatname to update or create project files.
32 --  It is also used GLIDE2 to display project file trees.
33 --  It can also be used for debugging purposes for tools that create project
34 --  file trees.
35
36 with Prj.Tree;
37
38 package Prj.PP is
39
40    --  The following access to procedure types are used
41    --  to redirect output when calling Pretty_Print.
42
43    type Write_Char_Ap is access procedure (C : Character);
44
45    type Write_Eol_Ap  is access procedure;
46
47    type Write_Str_Ap is access procedure (S : String);
48
49    procedure Pretty_Print
50      (Project                            : Prj.Tree.Project_Node_Id;
51       Increment                          : Positive      := 3;
52       Eliminate_Empty_Case_Constructions : Boolean       := False;
53       Minimize_Empty_Lines               : Boolean       := False;
54       W_Char                             : Write_Char_Ap := null;
55       W_Eol                              : Write_Eol_Ap  := null;
56       W_Str                              : Write_Str_Ap  := null);
57    --  Output a project file, using either the default output
58    --  routines, or the ones specified by W_Char, W_Eol and W_Str.
59    --
60    --  Increment is the number of spaces for each indentation level.
61    --
62    --  W_Char, W_Eol and W_Str can be used to change the default output
63    --  procedures. The default values force the output to Standard_Output.
64    --
65    --  If Eliminate_Empty_Case_Constructions is True, then case constructions
66    --  and case items that do not include any declarations will not be output.
67    --
68    --  If Minimize_Empty_Lines is True, empty lines will be output only
69    --  after the last with clause, after the line declaring the project name,
70    --  after the last declarative item of the project and before each
71    --  package declaration. Otherwise, more empty lines are output.
72
73 private
74
75    procedure Output_Statistics;
76    --  This procedure can be used after one or more calls to Pretty_Print
77    --  to display what Project_Node_Kinds have not been exercised by the
78    --  call(s) to Pretty_Print. It is used only for testing purposes.
79
80 end Prj.PP;