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;
42 Write_Info_Initiate ('F');
43 Write_Info_Char ('D');
44 Write_Info_Char (' ');
45 Write_Info_Nat (F.File_Num);
46 Write_Info_Char (' ');
48 for N in F.File_Name'Range loop
49 Write_Info_Char (F.File_Name (N));
54 -- Loop through scope entries for this file
57 exit when Start = Stop + 1;
58 pragma Assert (Start <= Stop);
61 S : Alfa_Scope_Record renames Alfa_Scope_Table.Table (Start);
64 Write_Info_Initiate ('F');
65 Write_Info_Char ('S');
66 Write_Info_Char (' ');
67 Write_Info_Char ('.');
68 Write_Info_Nat (S.Scope_Num);
69 Write_Info_Char (' ');
70 Write_Info_Nat (S.Line);
71 Write_Info_Char (S.Stype);
72 Write_Info_Nat (S.Col);
73 Write_Info_Char (' ');
75 pragma Assert (S.Scope_Name.all /= "");
77 for N in S.Scope_Name'Range loop
78 Write_Info_Char (S.Scope_Name (N));
81 if S.Spec_File_Num /= 0 then
82 Write_Info_Char (' ');
83 Write_Info_Char ('-');
84 Write_Info_Char ('>');
85 Write_Info_Char (' ');
86 Write_Info_Nat (S.Spec_File_Num);
87 Write_Info_Char ('.');
88 Write_Info_Nat (S.Spec_Scope_Num);
99 -- Loop through entries in Alfa_File_Table
101 for J in 1 .. Alfa_File_Table.Last loop
103 F : Alfa_File_Record renames Alfa_File_Table.Table (J);
112 Start := F.From_Scope;
115 -- Loop through scope entries for this file
118 exit when Start = Stop + 1;
119 pragma Assert (Start <= Stop);
121 Output_One_Scope : declare
122 S : Alfa_Scope_Record renames Alfa_Scope_Table.Table (Start);
128 XStart := S.From_Xref;
131 if XStart > XStop then
135 Write_Info_Initiate ('F');
136 Write_Info_Char ('X');
137 Write_Info_Char (' ');
138 Write_Info_Nat (F.File_Num);
139 Write_Info_Char (' ');
141 for N in F.File_Name'Range loop
142 Write_Info_Char (F.File_Name (N));
145 Write_Info_Char (' ');
146 Write_Info_Char ('.');
147 Write_Info_Nat (S.Scope_Num);
148 Write_Info_Char (' ');
150 for N in S.Scope_Name'Range loop
151 Write_Info_Char (S.Scope_Name (N));
154 -- Default value of (0,0) is used for the special __HEAP
155 -- variable so use another default value.
160 -- Loop through cross reference entries for this scope
163 exit when XStart = XStop + 1;
164 pragma Assert (XStart <= XStop);
166 Output_One_Xref : declare
167 R : Alfa_Xref_Record renames
168 Alfa_Xref_Table.Table (XStart);
171 if R.Entity_Line /= Entity_Line
172 or else R.Entity_Col /= Entity_Col
174 Write_Info_Terminate;
176 Write_Info_Initiate ('F');
177 Write_Info_Char (' ');
178 Write_Info_Nat (R.Entity_Line);
179 Write_Info_Char (R.Etype);
180 Write_Info_Nat (R.Entity_Col);
181 Write_Info_Char (' ');
183 for N in R.Entity_Name'Range loop
184 Write_Info_Char (R.Entity_Name (N));
187 Entity_Line := R.Entity_Line;
188 Entity_Col := R.Entity_Col;
190 Scope := S.Scope_Num;
193 if Write_Info_Col > 72 then
194 Write_Info_Terminate;
195 Write_Info_Initiate ('.');
198 Write_Info_Char (' ');
200 if R.File_Num /= File then
201 Write_Info_Nat (R.File_Num);
202 Write_Info_Char ('|');
207 if R.Scope_Num /= Scope then
208 Write_Info_Char ('.');
209 Write_Info_Nat (R.Scope_Num);
210 Write_Info_Char (':');
211 Scope := R.Scope_Num;
214 Write_Info_Nat (R.Line);
215 Write_Info_Char (R.Rtype);
216 Write_Info_Nat (R.Col);
219 XStart := XStart + 1;
222 Write_Info_Terminate;
223 end Output_One_Scope;