2014-11-18 Christophe Lyon <christophe.lyon@linaro.org>
[official-gcc.git] / gcc / ada / pprint.ads
blob8fc1036b1e4dc69b88a972f885865d6cc9a8caf9
1 ------------------------------------------------------------------------------
2 -- --
3 -- GNAT COMPILER COMPONENTS --
4 -- --
5 -- P P R I N T --
6 -- --
7 -- S p e c --
8 -- --
9 -- Copyright (C) 2008-2012, Free Software Foundation, Inc. --
10 -- --
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. --
20 -- --
21 -- GNAT was originally developed by the GNAT team at New York University. --
22 -- Extensive contributions were provided by Ada Core Technologies Inc. --
23 -- --
24 ------------------------------------------------------------------------------
26 -- This package (pretty print) contains a routine for printing an expression
27 -- given its node in the syntax tree. Contrarily to the Sprint package, this
28 -- routine tries to obtain "pretty" output that can be used for e.g. error
29 -- messages.
31 with Types; use Types;
32 with Urealp; use Urealp;
34 package Pprint is
36 generic
38 -- ??? The generic parameters should be removed.
40 with function Real_Image (U : Ureal) return String;
41 with function String_Image (S : String_Id) return String;
42 with function Ident_Image (Expr : Node_Id;
43 Orig_Expr : Node_Id;
44 Expand_Type : Boolean)
45 return String;
46 -- Will be called for printing N_Identifier and N_Defining_Identifier
47 -- nodes
48 -- ??? Expand_Type argument should be removed
50 function Expression_Image (Expr : Node_Id;
51 Default : String)
52 return String;
53 -- Given a Node for an expression, return a String that is meaningful for
54 -- the programmer. If the expression comes from source, it is copied from
55 -- there.
56 -- Subexpressions outside of the maximum depth (3), the maximal number of
57 -- accepted nodes (24), and the maximal number of list elements (3), are
58 -- replaced by the default string.
60 end Pprint;