annotate gcc/ada/treepr.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 -- T R E E P R --
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) 1992-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 with Types; use Types;
kono
parents:
diff changeset
27 package Treepr is
kono
parents:
diff changeset
28
kono
parents:
diff changeset
29 -- This package provides printing routines for the abstract syntax tree
kono
parents:
diff changeset
30 -- These routines are intended only for debugging use.
kono
parents:
diff changeset
31
kono
parents:
diff changeset
32 procedure Tree_Dump;
kono
parents:
diff changeset
33 -- This routine is called from the GNAT main program to dump trees as
kono
parents:
diff changeset
34 -- requested by debug options (including tree of Standard if requested).
kono
parents:
diff changeset
35
kono
parents:
diff changeset
36 procedure Print_Tree_Node (N : Node_Id; Label : String := "");
kono
parents:
diff changeset
37 -- Prints a single tree node, without printing descendants. The Label
kono
parents:
diff changeset
38 -- string is used to preface each line of the printed output.
kono
parents:
diff changeset
39
kono
parents:
diff changeset
40 procedure Print_Node_Briefly (N : Node_Id);
kono
parents:
diff changeset
41 -- Terse version of Print_Tree_Node
kono
parents:
diff changeset
42
kono
parents:
diff changeset
43 procedure Print_Tree_List (L : List_Id);
kono
parents:
diff changeset
44 -- Prints a single node list, without printing the descendants of any
kono
parents:
diff changeset
45 -- of the nodes in the list
kono
parents:
diff changeset
46
kono
parents:
diff changeset
47 procedure Print_Tree_Elist (E : Elist_Id);
kono
parents:
diff changeset
48 -- Prints a single node list, without printing the descendants of any
kono
parents:
diff changeset
49 -- of the nodes in the list
kono
parents:
diff changeset
50
kono
parents:
diff changeset
51 procedure Print_Node_Subtree (N : Node_Id);
kono
parents:
diff changeset
52 -- Prints the subtree rooted at a specified tree node, including all
kono
parents:
diff changeset
53 -- referenced descendants.
kono
parents:
diff changeset
54
kono
parents:
diff changeset
55 procedure Print_List_Subtree (L : List_Id);
kono
parents:
diff changeset
56 -- Prints the subtree consisting of the given node list and all its
kono
parents:
diff changeset
57 -- referenced descendants.
kono
parents:
diff changeset
58
kono
parents:
diff changeset
59 procedure Print_Elist_Subtree (E : Elist_Id);
kono
parents:
diff changeset
60 -- Prints the subtree consisting of the given element list and all its
kono
parents:
diff changeset
61 -- referenced descendants.
kono
parents:
diff changeset
62
kono
parents:
diff changeset
63 -- The following debugging procedures are intended to be called from gdb.
kono
parents:
diff changeset
64 -- Note that in several cases there are synonyms which represent historical
kono
parents:
diff changeset
65 -- development, and we keep them because some people are used to them!
kono
parents:
diff changeset
66
kono
parents:
diff changeset
67 function p (N : Union_Id) return Node_Or_Entity_Id;
kono
parents:
diff changeset
68 function par (N : Union_Id) return Node_Or_Entity_Id;
kono
parents:
diff changeset
69 pragma Export (Ada, p);
kono
parents:
diff changeset
70 pragma Export (Ada, par);
kono
parents:
diff changeset
71 -- Return parent of a list or node (depending on the value of N). If N
kono
parents:
diff changeset
72 -- is neither a list nor a node id, then prints a message to that effect
kono
parents:
diff changeset
73 -- and returns Empty.
kono
parents:
diff changeset
74
kono
parents:
diff changeset
75 procedure pn (N : Union_Id);
kono
parents:
diff changeset
76 procedure pp (N : Union_Id);
kono
parents:
diff changeset
77 procedure pe (N : Union_Id);
kono
parents:
diff changeset
78 pragma Export (Ada, pn);
kono
parents:
diff changeset
79 pragma Export (Ada, pp);
kono
parents:
diff changeset
80 pragma Export (Ada, pe);
kono
parents:
diff changeset
81 -- Print a node, node list, uint, or anything else that falls under
kono
parents:
diff changeset
82 -- the definition of Union_Id. Historically this was only for printing
kono
parents:
diff changeset
83 -- nodes, hence the name.
kono
parents:
diff changeset
84
kono
parents:
diff changeset
85 procedure pt (N : Union_Id);
kono
parents:
diff changeset
86 procedure ppp (N : Union_Id);
kono
parents:
diff changeset
87 pragma Export (Ada, pt);
kono
parents:
diff changeset
88 pragma Export (Ada, ppp);
kono
parents:
diff changeset
89 -- Same as pn/pp, except prints subtrees. For Nodes, it is exactly the same
kono
parents:
diff changeset
90 -- as Print_Node_Subtree. For Elists it is the same as Print_Elist_Subtree.
kono
parents:
diff changeset
91 -- For Lists, it is the same as Print_Tree_List. If given anything other
kono
parents:
diff changeset
92 -- than a Node, List, or Elist, same effect as pn.
kono
parents:
diff changeset
93
kono
parents:
diff changeset
94 procedure pl (L : Int);
kono
parents:
diff changeset
95 pragma Export (Ada, pl);
kono
parents:
diff changeset
96 -- Same as Print_Tree_List, except that you can use e.g. 66 instead of
kono
parents:
diff changeset
97 -- -99999966. In other words for the positive case we fill out to 8 digits
kono
parents:
diff changeset
98 -- on the left and add a minus sign. This just saves some typing in the
kono
parents:
diff changeset
99 -- debugger.
kono
parents:
diff changeset
100
kono
parents:
diff changeset
101 end Treepr;