annotate gcc/ada/pprint.ads @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children 1830386684a0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 ------------------------------------------------------------------------------
kono
parents:
diff changeset
2 -- --
kono
parents:
diff changeset
3 -- GNAT COMPILER COMPONENTS --
kono
parents:
diff changeset
4 -- --
kono
parents:
diff changeset
5 -- P P R I N T --
kono
parents:
diff changeset
6 -- --
kono
parents:
diff changeset
7 -- S p e c --
kono
parents:
diff changeset
8 -- --
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
9 -- Copyright (C) 2008-2018, Free Software Foundation, Inc. --
111
kono
parents:
diff changeset
10 -- --
kono
parents:
diff changeset
11 -- GNAT is free software; you can redistribute it and/or modify it under --
kono
parents:
diff changeset
12 -- terms of the GNU General Public License as published by the Free Soft- --
kono
parents:
diff changeset
13 -- ware Foundation; either version 3, or (at your option) any later ver- --
kono
parents:
diff changeset
14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
kono
parents:
diff changeset
15 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
kono
parents:
diff changeset
16 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
kono
parents:
diff changeset
17 -- for more details. You should have received a copy of the GNU General --
kono
parents:
diff changeset
18 -- Public License distributed with GNAT; see file COPYING3. If not, go to --
kono
parents:
diff changeset
19 -- http://www.gnu.org/licenses for a complete copy of the license. --
kono
parents:
diff changeset
20 -- --
kono
parents:
diff changeset
21 -- GNAT was originally developed by the GNAT team at New York University. --
kono
parents:
diff changeset
22 -- Extensive contributions were provided by Ada Core Technologies Inc. --
kono
parents:
diff changeset
23 -- --
kono
parents:
diff changeset
24 ------------------------------------------------------------------------------
kono
parents:
diff changeset
25
kono
parents:
diff changeset
26 -- This package (pretty print) contains a routine for printing an expression
kono
parents:
diff changeset
27 -- given its node in the syntax tree. Contrarily to the Sprint package, this
kono
parents:
diff changeset
28 -- routine tries to obtain "pretty" output that can be used for e.g. error
kono
parents:
diff changeset
29 -- messages.
kono
parents:
diff changeset
30
kono
parents:
diff changeset
31 with Types; use Types;
kono
parents:
diff changeset
32 with Urealp; use Urealp;
kono
parents:
diff changeset
33
kono
parents:
diff changeset
34 package Pprint is
kono
parents:
diff changeset
35
kono
parents:
diff changeset
36 generic
kono
parents:
diff changeset
37
kono
parents:
diff changeset
38 -- ??? The generic parameters should be removed.
kono
parents:
diff changeset
39
kono
parents:
diff changeset
40 with function Real_Image (U : Ureal) return String;
kono
parents:
diff changeset
41 with function String_Image (S : String_Id) return String;
kono
parents:
diff changeset
42 with function Ident_Image (Expr : Node_Id;
kono
parents:
diff changeset
43 Orig_Expr : Node_Id;
kono
parents:
diff changeset
44 Expand_Type : Boolean) return String;
kono
parents:
diff changeset
45 -- Will be called for printing N_Identifier and N_Defining_Identifier
kono
parents:
diff changeset
46 -- nodes
kono
parents:
diff changeset
47 -- ??? Expand_Type argument should be removed
kono
parents:
diff changeset
48
kono
parents:
diff changeset
49 Hide_Parameter_Blocks : Boolean := False;
kono
parents:
diff changeset
50 -- If true, then "Parameter_Block.Field_Name.all" is
kono
parents:
diff changeset
51 -- instead displayed as "Field_Name".
kono
parents:
diff changeset
52
kono
parents:
diff changeset
53 Hide_Temp_Derefs : Boolean := False;
kono
parents:
diff changeset
54 -- If true, then "Foo.all" is instead displayed as "Foo"
kono
parents:
diff changeset
55 -- in the case where Foo is a compiler-generated constant
kono
parents:
diff changeset
56 -- initialized to Some_Captured_Value'Reference.
kono
parents:
diff changeset
57
kono
parents:
diff changeset
58 function Expression_Image
kono
parents:
diff changeset
59 (Expr : Node_Id;
kono
parents:
diff changeset
60 Default : String) return String;
kono
parents:
diff changeset
61 -- Given a Node for an expression, return a String that is meaningful for
kono
parents:
diff changeset
62 -- the programmer. If the expression comes from source, it is copied from
kono
parents:
diff changeset
63 -- there.
kono
parents:
diff changeset
64 -- Subexpressions outside of the maximum depth (3), the maximal number of
kono
parents:
diff changeset
65 -- accepted nodes (24), and the maximal number of list elements (3), are
kono
parents:
diff changeset
66 -- replaced by the default string.
kono
parents:
diff changeset
67
kono
parents:
diff changeset
68 end Pprint;