1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
9 -- Copyright (C) 2011, 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 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. --
21 -- GNAT was originally developed by the GNAT team at New York University. --
22 -- Extensive contributions were provided by Ada Core Technologies Inc. --
24 ------------------------------------------------------------------------------
26 with Output; use Output;
37 -- Dump Alfa file table
39 Write_Line ("Alfa File Table");
40 Write_Line ("---------------");
42 for Index in 1 .. Alfa_File_Table.Last loop
44 AFR : Alfa_File_Record renames Alfa_File_Table.Table (Index);
48 Write_Int (Int (Index));
49 Write_Str (". File_Num = ");
50 Write_Int (Int (AFR.File_Num));
51 Write_Str (" File_Name = """);
53 if AFR.File_Name /= null then
54 Write_Str (AFR.File_Name.all);
58 Write_Str (" From = ");
59 Write_Int (Int (AFR.From_Scope));
61 Write_Int (Int (AFR.To_Scope));
66 -- Dump Alfa scope table
69 Write_Line ("Alfa Scope Table");
70 Write_Line ("----------------");
72 for Index in 1 .. Alfa_Scope_Table.Last loop
74 ASR : Alfa_Scope_Record renames Alfa_Scope_Table.Table (Index);
78 Write_Int (Int (Index));
79 Write_Str (". File_Num = ");
80 Write_Int (Int (ASR.File_Num));
81 Write_Str (" Scope_Num = ");
82 Write_Int (Int (ASR.Scope_Num));
83 Write_Str (" Scope_Name = """);
85 if ASR.Scope_Name /= null then
86 Write_Str (ASR.Scope_Name.all);
90 Write_Str (" Line = ");
91 Write_Int (Int (ASR.Line));
92 Write_Str (" Col = ");
93 Write_Int (Int (ASR.Col));
94 Write_Str (" Type = ");
95 Write_Char (ASR.Stype);
96 Write_Str (" From = ");
97 Write_Int (Int (ASR.From_Xref));
99 Write_Int (Int (ASR.To_Xref));
100 Write_Str (" Scope_Entity = ");
101 Write_Int (Int (ASR.Scope_Entity));
106 -- Dump Alfa cross-reference table
109 Write_Line ("Alfa Xref Table");
110 Write_Line ("---------------");
112 for Index in 1 .. Alfa_Xref_Table.Last loop
114 AXR : Alfa_Xref_Record renames Alfa_Xref_Table.Table (Index);
118 Write_Int (Int (Index));
119 Write_Str (". Entity_Name = """);
121 if AXR.Entity_Name /= null then
122 Write_Str (AXR.Entity_Name.all);
126 Write_Str (" Entity_Line = ");
127 Write_Int (Int (AXR.Entity_Line));
128 Write_Str (" Entity_Col = ");
129 Write_Int (Int (AXR.Entity_Col));
130 Write_Str (" File_Num = ");
131 Write_Int (Int (AXR.File_Num));
132 Write_Str (" Scope_Num = ");
133 Write_Int (Int (AXR.Scope_Num));
134 Write_Str (" Line = ");
135 Write_Int (Int (AXR.Line));
136 Write_Str (" Col = ");
137 Write_Int (Int (AXR.Col));
138 Write_Str (" Type = ");
139 Write_Char (AXR.Rtype);
149 procedure Initialize_Alfa_Tables is
151 Alfa_File_Table.Init;
152 Alfa_Scope_Table.Init;
153 Alfa_Xref_Table.Init;
154 end Initialize_Alfa_Tables;
162 procedure Write_Info_Char (C : Character) renames Write_Char;
163 -- Write one character;
165 function Write_Info_Col return Positive;
166 -- Return next column for writing
168 procedure Write_Info_Initiate (Key : Character) renames Write_Char;
169 -- Start new one and write one character;
171 procedure Write_Info_Nat (N : Nat);
174 procedure Write_Info_Terminate renames Write_Eol;
175 -- Terminate current line
181 function Write_Info_Col return Positive is
183 return Positive (Column);
190 procedure Write_Info_Nat (N : Nat) is
195 procedure Debug_Put_Alfa is new Put_Alfa;
197 -- Start of processing for palfa