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 ------------------------------------------------------------------------------
30 -- Loop through entries in ALFA_File_Table
32 for J in 1 .. ALFA_File_Table.Last loop
34 F : ALFA_File_Record renames ALFA_File_Table.Table (J);
39 Start := F.From_Scope;
43 Write_Info_Initiate ('F');
44 Write_Info_Char ('D');
45 Write_Info_Char (' ');
46 Write_Info_Nat (F.File_Num);
47 Write_Info_Char (' ');
49 for N in F.File_Name'Range loop
50 Write_Info_Char (F.File_Name (N));
56 -- Loop through scope entries for this file
59 exit when Start = Stop + 1;
60 pragma Assert (Start <= Stop);
63 S : ALFA_Scope_Record renames ALFA_Scope_Table.Table (Start);
66 Write_Info_Initiate ('F');
67 Write_Info_Char ('S');
68 Write_Info_Char (' ');
69 Write_Info_Char ('.');
70 Write_Info_Nat (S.Scope_Num);
71 Write_Info_Char (' ');
72 Write_Info_Nat (S.Line);
73 Write_Info_Char (S.Stype);
74 Write_Info_Nat (S.Col);
75 Write_Info_Char (' ');
77 pragma Assert (S.Scope_Name.all /= "");
79 for N in S.Scope_Name'Range loop
80 Write_Info_Char (S.Scope_Name (N));
83 if S.Spec_File_Num /= 0 then
84 Write_Info_Char (' ');
85 Write_Info_Char ('-');
86 Write_Info_Char ('>');
87 Write_Info_Char (' ');
88 Write_Info_Nat (S.Spec_File_Num);
89 Write_Info_Char ('.');
90 Write_Info_Nat (S.Spec_Scope_Num);
101 -- Loop through entries in ALFA_File_Table
103 for J in 1 .. ALFA_File_Table.Last loop
105 F : ALFA_File_Record renames ALFA_File_Table.Table (J);
114 Start := F.From_Scope;
117 -- Loop through scope entries for this file
120 exit when Start = Stop + 1;
121 pragma Assert (Start <= Stop);
123 Output_One_Scope : declare
124 S : ALFA_Scope_Record renames ALFA_Scope_Table.Table (Start);
130 XStart := S.From_Xref;
133 if XStart > XStop then
137 Write_Info_Initiate ('F');
138 Write_Info_Char ('X');
139 Write_Info_Char (' ');
140 Write_Info_Nat (F.File_Num);
141 Write_Info_Char (' ');
143 for N in F.File_Name'Range loop
144 Write_Info_Char (F.File_Name (N));
147 Write_Info_Char (' ');
148 Write_Info_Char ('.');
149 Write_Info_Nat (S.Scope_Num);
150 Write_Info_Char (' ');
152 for N in S.Scope_Name'Range loop
153 Write_Info_Char (S.Scope_Name (N));
159 -- Loop through cross reference entries for this scope
162 exit when XStart = XStop + 1;
163 pragma Assert (XStart <= XStop);
165 Output_One_Xref : declare
166 R : ALFA_Xref_Record renames
167 ALFA_Xref_Table.Table (XStart);
170 if R.Entity_Line /= Entity_Line
171 or else R.Entity_Col /= Entity_Col
173 Write_Info_Terminate;
175 Write_Info_Initiate ('F');
176 Write_Info_Char (' ');
177 Write_Info_Nat (R.Entity_Line);
178 Write_Info_Char (R.Etype);
179 Write_Info_Nat (R.Entity_Col);
180 Write_Info_Char (' ');
182 for N in R.Entity_Name'Range loop
183 Write_Info_Char (R.Entity_Name (N));
186 Entity_Line := R.Entity_Line;
187 Entity_Col := R.Entity_Col;
189 Scope := S.Scope_Num;
192 if Write_Info_Col > 72 then
193 Write_Info_Terminate;
194 Write_Info_Initiate ('.');
197 Write_Info_Char (' ');
199 if R.File_Num /= File then
200 Write_Info_Nat (R.File_Num);
201 Write_Info_Char ('|');
206 if R.Scope_Num /= Scope then
207 Write_Info_Char ('.');
208 Write_Info_Nat (R.Scope_Num);
209 Write_Info_Char (':');
210 Scope := R.Scope_Num;
213 Write_Info_Nat (R.Line);
214 Write_Info_Char (R.Rtype);
215 Write_Info_Nat (R.Col);
218 XStart := XStart + 1;
221 Write_Info_Terminate;
222 end Output_One_Scope;