annotate gcc/ada/xr_tabls.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 -- X R _ T A B L S --
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) 1998-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 -- We need comment here saying what this package is???
kono
parents:
diff changeset
27
kono
parents:
diff changeset
28 with GNAT.OS_Lib;
kono
parents:
diff changeset
29
kono
parents:
diff changeset
30 package Xr_Tabls is
kono
parents:
diff changeset
31
kono
parents:
diff changeset
32 -------------------
kono
parents:
diff changeset
33 -- Project files --
kono
parents:
diff changeset
34 -------------------
kono
parents:
diff changeset
35
kono
parents:
diff changeset
36 function ALI_File_Name (Ada_File_Name : String) return String;
kono
parents:
diff changeset
37 -- Returns the ali file name corresponding to Ada_File_Name
kono
parents:
diff changeset
38
kono
parents:
diff changeset
39 procedure Create_Project_File (Name : String);
kono
parents:
diff changeset
40 -- Open and parse a new project file. If the file Name could not be
kono
parents:
diff changeset
41 -- opened or is not a valid project file, then a project file associated
kono
parents:
diff changeset
42 -- with the standard default directories is returned
kono
parents:
diff changeset
43
kono
parents:
diff changeset
44 function Next_Obj_Dir return String;
kono
parents:
diff changeset
45 -- Returns the next directory to visit to find related ali files
kono
parents:
diff changeset
46 -- If there are no more such directories, returns a null string.
kono
parents:
diff changeset
47
kono
parents:
diff changeset
48 function Current_Obj_Dir return String;
kono
parents:
diff changeset
49 -- Returns the obj_dir which was returned by the last Next_Obj_Dir call
kono
parents:
diff changeset
50
kono
parents:
diff changeset
51 procedure Reset_Obj_Dir;
kono
parents:
diff changeset
52 -- Reset the iterator for Obj_Dir
kono
parents:
diff changeset
53
kono
parents:
diff changeset
54 ------------
kono
parents:
diff changeset
55 -- Tables --
kono
parents:
diff changeset
56 ------------
kono
parents:
diff changeset
57
kono
parents:
diff changeset
58 type Declaration_Reference is private;
kono
parents:
diff changeset
59 Empty_Declaration : constant Declaration_Reference;
kono
parents:
diff changeset
60
kono
parents:
diff changeset
61 type Declaration_Array is array (Natural range <>) of Declaration_Reference;
kono
parents:
diff changeset
62 type Declaration_Array_Access is access Declaration_Array;
kono
parents:
diff changeset
63
kono
parents:
diff changeset
64 type File_Reference is private;
kono
parents:
diff changeset
65 Empty_File : constant File_Reference;
kono
parents:
diff changeset
66
kono
parents:
diff changeset
67 type Reference is private;
kono
parents:
diff changeset
68 Empty_Reference : constant Reference;
kono
parents:
diff changeset
69
kono
parents:
diff changeset
70 type Reference_Array is array (Natural range <>) of Reference;
kono
parents:
diff changeset
71 type Reference_Array_Access is access Reference_Array;
kono
parents:
diff changeset
72
kono
parents:
diff changeset
73 procedure Free (Arr : in out Reference_Array_Access);
kono
parents:
diff changeset
74
kono
parents:
diff changeset
75 function Add_Declaration
kono
parents:
diff changeset
76 (File_Ref : File_Reference;
kono
parents:
diff changeset
77 Symbol : String;
kono
parents:
diff changeset
78 Line : Natural;
kono
parents:
diff changeset
79 Column : Natural;
kono
parents:
diff changeset
80 Decl_Type : Character;
kono
parents:
diff changeset
81 Is_Parameter : Boolean := False;
kono
parents:
diff changeset
82 Remove_Only : Boolean := False;
kono
parents:
diff changeset
83 Symbol_Match : Boolean := True)
kono
parents:
diff changeset
84 return Declaration_Reference;
kono
parents:
diff changeset
85 -- Add a new declaration in the table and return the index to it. Decl_Type
kono
parents:
diff changeset
86 -- is the type of the entity Any previous instance of this entity in the
kono
parents:
diff changeset
87 -- htable is removed. If Remove_Only is True, then any previous instance is
kono
parents:
diff changeset
88 -- removed, but the new entity is never inserted. Symbol_Match should be
kono
parents:
diff changeset
89 -- set to False if the name of the symbol doesn't match the pattern from
kono
parents:
diff changeset
90 -- the command line. In that case, the entity will not be output by
kono
parents:
diff changeset
91 -- gnatfind. If Symbol_Match is True, the entity will only be output if
kono
parents:
diff changeset
92 -- the file name itself matches. Is_Parameter should be set to True if
kono
parents:
diff changeset
93 -- the entity is known to be a subprogram parameter.
kono
parents:
diff changeset
94
kono
parents:
diff changeset
95 procedure Add_Parent
kono
parents:
diff changeset
96 (Declaration : in out Declaration_Reference;
kono
parents:
diff changeset
97 Symbol : String;
kono
parents:
diff changeset
98 Line : Natural;
kono
parents:
diff changeset
99 Column : Natural;
kono
parents:
diff changeset
100 File_Ref : File_Reference);
kono
parents:
diff changeset
101 -- The parent declaration (Symbol in file File_Ref at position Line and
kono
parents:
diff changeset
102 -- Column) information is added to Declaration.
kono
parents:
diff changeset
103
kono
parents:
diff changeset
104 function Add_To_Xref_File
kono
parents:
diff changeset
105 (File_Name : String;
kono
parents:
diff changeset
106 Visited : Boolean := True;
kono
parents:
diff changeset
107 Emit_Warning : Boolean := False;
kono
parents:
diff changeset
108 Gnatchop_File : String := "";
kono
parents:
diff changeset
109 Gnatchop_Offset : Integer := 0)
kono
parents:
diff changeset
110 return File_Reference;
kono
parents:
diff changeset
111 -- Add a new reference to a file in the table. Ref is used to return the
kono
parents:
diff changeset
112 -- index in the table where this file is stored. Visited is the value which
kono
parents:
diff changeset
113 -- will be used in the table (if True, the file will not be returned by
kono
parents:
diff changeset
114 -- Next_Unvisited_File). If Emit_Warning is True and the ali file does
kono
parents:
diff changeset
115 -- not exist or does not have cross-referencing information, then a
kono
parents:
diff changeset
116 -- warning will be emitted. Gnatchop_File is the name of the file that
kono
parents:
diff changeset
117 -- File_Name was extracted from through a call to "gnatchop -r" (using
kono
parents:
diff changeset
118 -- pragma Source_Reference). Gnatchop_Offset should be the index of the
kono
parents:
diff changeset
119 -- first line of File_Name within the Gnatchop_File.
kono
parents:
diff changeset
120
kono
parents:
diff changeset
121 procedure Add_Line
kono
parents:
diff changeset
122 (File : File_Reference;
kono
parents:
diff changeset
123 Line : Natural;
kono
parents:
diff changeset
124 Column : Natural);
kono
parents:
diff changeset
125 -- Add a new reference in a file, which the user has provided on the
kono
parents:
diff changeset
126 -- command line. This is used for an optimized matching algorithm.
kono
parents:
diff changeset
127
kono
parents:
diff changeset
128 procedure Add_Reference
kono
parents:
diff changeset
129 (Declaration : Declaration_Reference;
kono
parents:
diff changeset
130 File_Ref : File_Reference;
kono
parents:
diff changeset
131 Line : Natural;
kono
parents:
diff changeset
132 Column : Natural;
kono
parents:
diff changeset
133 Ref_Type : Character;
kono
parents:
diff changeset
134 Labels_As_Ref : Boolean);
kono
parents:
diff changeset
135 -- Add a new reference (Ref_Type = 'r'), body (Ref_Type = 'b') or
kono
parents:
diff changeset
136 -- modification (Ref_Type = 'm') to an entity. If Labels_As_Ref is True,
kono
parents:
diff changeset
137 -- then the references to the entity after the end statements ("end Foo")
kono
parents:
diff changeset
138 -- are counted as actual references. This means that the entity will never
kono
parents:
diff changeset
139 -- be reported as unreferenced (for instance in the case of gnatxref -u).
kono
parents:
diff changeset
140
kono
parents:
diff changeset
141 function Get_Declarations
kono
parents:
diff changeset
142 (Sorted : Boolean := True)
kono
parents:
diff changeset
143 return Declaration_Array_Access;
kono
parents:
diff changeset
144 -- Return a sorted list of all the declarations in the application.
kono
parents:
diff changeset
145 -- Freeing this array is the responsibility of the caller, however it
kono
parents:
diff changeset
146 -- shouldn't free the actual contents of the array, which are pointers
kono
parents:
diff changeset
147 -- to internal data
kono
parents:
diff changeset
148
kono
parents:
diff changeset
149 function References_Count
kono
parents:
diff changeset
150 (Decl : Declaration_Reference;
kono
parents:
diff changeset
151 Get_Reads : Boolean := False;
kono
parents:
diff changeset
152 Get_Writes : Boolean := False;
kono
parents:
diff changeset
153 Get_Bodies : Boolean := False)
kono
parents:
diff changeset
154 return Natural;
kono
parents:
diff changeset
155 -- Return the number of references in Decl for the categories specified
kono
parents:
diff changeset
156 -- by the Get_* parameters (read-only accesses, write accesses and bodies)
kono
parents:
diff changeset
157
kono
parents:
diff changeset
158 function Get_References
kono
parents:
diff changeset
159 (Decl : Declaration_Reference;
kono
parents:
diff changeset
160 Get_Reads : Boolean := False;
kono
parents:
diff changeset
161 Get_Writes : Boolean := False;
kono
parents:
diff changeset
162 Get_Bodies : Boolean := False)
kono
parents:
diff changeset
163 return Reference_Array_Access;
kono
parents:
diff changeset
164 -- Return a sorted list of all references to the entity in decl. The
kono
parents:
diff changeset
165 -- parameters Get_* are used to specify what kind of references should be
kono
parents:
diff changeset
166 -- merged and returned (read-only accesses, write accesses and bodies).
kono
parents:
diff changeset
167
kono
parents:
diff changeset
168 function Get_Column (Decl : Declaration_Reference) return String;
kono
parents:
diff changeset
169 function Get_Column (Ref : Reference) return String;
kono
parents:
diff changeset
170
kono
parents:
diff changeset
171 function Get_Declaration
kono
parents:
diff changeset
172 (File_Ref : File_Reference;
kono
parents:
diff changeset
173 Line : Natural;
kono
parents:
diff changeset
174 Column : Natural)
kono
parents:
diff changeset
175 return Declaration_Reference;
kono
parents:
diff changeset
176 -- Returns reference to the declaration found in file File_Ref at the
kono
parents:
diff changeset
177 -- given Line and Column
kono
parents:
diff changeset
178
kono
parents:
diff changeset
179 function Get_Parent
kono
parents:
diff changeset
180 (Decl : Declaration_Reference)
kono
parents:
diff changeset
181 return Declaration_Reference;
kono
parents:
diff changeset
182 -- Returns reference to Decl's parent declaration
kono
parents:
diff changeset
183
kono
parents:
diff changeset
184 function Get_Emit_Warning (File : File_Reference) return Boolean;
kono
parents:
diff changeset
185 -- Returns the Emit_Warning field of the structure
kono
parents:
diff changeset
186
kono
parents:
diff changeset
187 function Get_Gnatchop_File
kono
parents:
diff changeset
188 (File : File_Reference;
kono
parents:
diff changeset
189 With_Dir : Boolean := False)
kono
parents:
diff changeset
190 return String;
kono
parents:
diff changeset
191 function Get_Gnatchop_File
kono
parents:
diff changeset
192 (Ref : Reference;
kono
parents:
diff changeset
193 With_Dir : Boolean := False)
kono
parents:
diff changeset
194 return String;
kono
parents:
diff changeset
195 function Get_Gnatchop_File
kono
parents:
diff changeset
196 (Decl : Declaration_Reference;
kono
parents:
diff changeset
197 With_Dir : Boolean := False)
kono
parents:
diff changeset
198 return String;
kono
parents:
diff changeset
199 -- Return the name of the file that File was extracted from through a
kono
parents:
diff changeset
200 -- call to "gnatchop -r". The file name for File is returned if File
kono
parents:
diff changeset
201 -- was not extracted from such a file. The directory will be given only
kono
parents:
diff changeset
202 -- if With_Dir is True.
kono
parents:
diff changeset
203
kono
parents:
diff changeset
204 function Get_File
kono
parents:
diff changeset
205 (Decl : Declaration_Reference;
kono
parents:
diff changeset
206 With_Dir : Boolean := False) return String;
kono
parents:
diff changeset
207 pragma Inline (Get_File);
kono
parents:
diff changeset
208 -- Extract column number or file name from reference
kono
parents:
diff changeset
209
kono
parents:
diff changeset
210 function Get_File
kono
parents:
diff changeset
211 (Ref : Reference;
kono
parents:
diff changeset
212 With_Dir : Boolean := False) return String;
kono
parents:
diff changeset
213 pragma Inline (Get_File);
kono
parents:
diff changeset
214
kono
parents:
diff changeset
215 function Get_File
kono
parents:
diff changeset
216 (File : File_Reference;
kono
parents:
diff changeset
217 With_Dir : Boolean := False;
kono
parents:
diff changeset
218 Strip : Natural := 0) return String;
kono
parents:
diff changeset
219 -- Returns the file name (and its directory if With_Dir is True or the user
kono
parents:
diff changeset
220 -- has used the -f switch on the command line. If Strip is not 0, then the
kono
parents:
diff changeset
221 -- last Strip-th "-..." substrings are removed first. For instance, with
kono
parents:
diff changeset
222 -- Strip=2, a file name "parent-child1-child2-child3.ali" would be returned
kono
parents:
diff changeset
223 -- as "parent-child1.ali". This is used when looking for the ALI file to
kono
parents:
diff changeset
224 -- use for a package, since for separates with have to use the parent's
kono
parents:
diff changeset
225 -- ALI. The null string is returned if there is no such parent unit.
kono
parents:
diff changeset
226 --
kono
parents:
diff changeset
227 -- Note that this version of Get_File is not inlined
kono
parents:
diff changeset
228
kono
parents:
diff changeset
229 function Get_File_Ref (Ref : Reference) return File_Reference;
kono
parents:
diff changeset
230 function Get_Line (Decl : Declaration_Reference) return String;
kono
parents:
diff changeset
231 function Get_Line (Ref : Reference) return String;
kono
parents:
diff changeset
232 function Get_Symbol (Decl : Declaration_Reference) return String;
kono
parents:
diff changeset
233 function Get_Type (Decl : Declaration_Reference) return Character;
kono
parents:
diff changeset
234 function Is_Parameter (Decl : Declaration_Reference) return Boolean;
kono
parents:
diff changeset
235 -- Functions that return the contents of a declaration
kono
parents:
diff changeset
236
kono
parents:
diff changeset
237 function Get_Source_Line (Ref : Reference) return String;
kono
parents:
diff changeset
238 function Get_Source_Line (Decl : Declaration_Reference) return String;
kono
parents:
diff changeset
239 -- Return the source line associated with the reference
kono
parents:
diff changeset
240
kono
parents:
diff changeset
241 procedure Grep_Source_Files;
kono
parents:
diff changeset
242 -- Parse all the source files which have at least one reference, and grep
kono
parents:
diff changeset
243 -- the appropriate source lines so that we'll be able to display them. This
kono
parents:
diff changeset
244 -- function should be called once all the .ali files have been parsed, and
kono
parents:
diff changeset
245 -- only if the appropriate user switch
kono
parents:
diff changeset
246 -- has been used (gnatfind -s).
kono
parents:
diff changeset
247 --
kono
parents:
diff changeset
248 -- Note: To save memory, the strings for the source lines are shared. Thus
kono
parents:
diff changeset
249 -- it is no longer possible to free the references, or we would free the
kono
parents:
diff changeset
250 -- same chunk multiple times. It doesn't matter, though, since this is only
kono
parents:
diff changeset
251 -- called once, prior to exiting gnatfind.
kono
parents:
diff changeset
252
kono
parents:
diff changeset
253 function Longest_File_Name return Natural;
kono
parents:
diff changeset
254 -- Returns the longest file name found
kono
parents:
diff changeset
255
kono
parents:
diff changeset
256 function Match (Decl : Declaration_Reference) return Boolean;
kono
parents:
diff changeset
257 -- Return True if the declaration matches
kono
parents:
diff changeset
258
kono
parents:
diff changeset
259 function Match
kono
parents:
diff changeset
260 (File : File_Reference;
kono
parents:
diff changeset
261 Line : Natural;
kono
parents:
diff changeset
262 Column : Natural)
kono
parents:
diff changeset
263 return Boolean;
kono
parents:
diff changeset
264 -- Returns True if File:Line:Column was given on the command line
kono
parents:
diff changeset
265 -- by the user
kono
parents:
diff changeset
266
kono
parents:
diff changeset
267 function Next_Unvisited_File return File_Reference;
kono
parents:
diff changeset
268 -- Returns the next unvisited library file in the list If there is no more
kono
parents:
diff changeset
269 -- unvisited file, return Empty_File. Two calls to this subprogram will
kono
parents:
diff changeset
270 -- return different files.
kono
parents:
diff changeset
271
kono
parents:
diff changeset
272 procedure Set_Default_Match (Value : Boolean);
kono
parents:
diff changeset
273 -- Set the default value for match in declarations.
kono
parents:
diff changeset
274 -- This is used so that if no file was provided in the
kono
parents:
diff changeset
275 -- command line, then every file match
kono
parents:
diff changeset
276
kono
parents:
diff changeset
277 procedure Reset_Directory (File : File_Reference);
kono
parents:
diff changeset
278 -- Reset the cached directory for file. Next time Get_File is called, the
kono
parents:
diff changeset
279 -- directory will be recomputed.
kono
parents:
diff changeset
280
kono
parents:
diff changeset
281 procedure Set_Unvisited (File_Ref : File_Reference);
kono
parents:
diff changeset
282 -- Set File_Ref as unvisited. So Next_Unvisited_File will return it
kono
parents:
diff changeset
283
kono
parents:
diff changeset
284 procedure Read_File
kono
parents:
diff changeset
285 (File_Name : String;
kono
parents:
diff changeset
286 Contents : out GNAT.OS_Lib.String_Access);
kono
parents:
diff changeset
287 -- Reads File_Name into the newly allocated string Contents. Types.EOF
kono
parents:
diff changeset
288 -- character will be added to the returned Contents to simplify parsing.
kono
parents:
diff changeset
289 -- Name_Error is raised if the file was not found. End_Error is raised if
kono
parents:
diff changeset
290 -- the file could not be read correctly. For most systems correct reading
kono
parents:
diff changeset
291 -- means that the number of bytes read is equal to the file size.
kono
parents:
diff changeset
292
kono
parents:
diff changeset
293 private
kono
parents:
diff changeset
294 type Project_File (Src_Dir_Length, Obj_Dir_Length : Natural) is record
kono
parents:
diff changeset
295 Src_Dir_Index : Integer;
kono
parents:
diff changeset
296 Obj_Dir_Index : Integer;
kono
parents:
diff changeset
297 Last_Obj_Dir_Start : Natural;
kono
parents:
diff changeset
298 Src_Dir : String (1 .. Src_Dir_Length);
kono
parents:
diff changeset
299 Obj_Dir : String (1 .. Obj_Dir_Length);
kono
parents:
diff changeset
300 end record;
kono
parents:
diff changeset
301
kono
parents:
diff changeset
302 type Project_File_Ptr is access all Project_File;
kono
parents:
diff changeset
303 -- This is actually a list of all the directories to be searched,
kono
parents:
diff changeset
304 -- either for source files or for library files
kono
parents:
diff changeset
305
kono
parents:
diff changeset
306 type Ref_In_File;
kono
parents:
diff changeset
307 type Ref_In_File_Ptr is access all Ref_In_File;
kono
parents:
diff changeset
308
kono
parents:
diff changeset
309 type Ref_In_File is record
kono
parents:
diff changeset
310 Line : Natural;
kono
parents:
diff changeset
311 Column : Natural;
kono
parents:
diff changeset
312 Next : Ref_In_File_Ptr := null;
kono
parents:
diff changeset
313 end record;
kono
parents:
diff changeset
314
kono
parents:
diff changeset
315 type File_Record;
kono
parents:
diff changeset
316 type File_Reference is access all File_Record;
kono
parents:
diff changeset
317
kono
parents:
diff changeset
318 Empty_File : constant File_Reference := null;
kono
parents:
diff changeset
319 type Cst_String_Access is access constant String;
kono
parents:
diff changeset
320
kono
parents:
diff changeset
321 procedure Free (Str : in out Cst_String_Access);
kono
parents:
diff changeset
322
kono
parents:
diff changeset
323 type File_Record is record
kono
parents:
diff changeset
324 File : Cst_String_Access;
kono
parents:
diff changeset
325 Dir : GNAT.OS_Lib.String_Access;
kono
parents:
diff changeset
326 Lines : Ref_In_File_Ptr := null;
kono
parents:
diff changeset
327 Visited : Boolean := False;
kono
parents:
diff changeset
328 Emit_Warning : Boolean := False;
kono
parents:
diff changeset
329 Gnatchop_File : GNAT.OS_Lib.String_Access := null;
kono
parents:
diff changeset
330 Gnatchop_Offset : Integer := 0;
kono
parents:
diff changeset
331 Next : File_Reference := null;
kono
parents:
diff changeset
332 end record;
kono
parents:
diff changeset
333 -- Holds a reference to a source file, that was referenced in at least one
kono
parents:
diff changeset
334 -- ALI file. Gnatchop_File will contain the name of the file that File was
kono
parents:
diff changeset
335 -- extracted From. Gnatchop_Offset contains the index of the first line of
kono
parents:
diff changeset
336 -- File within Gnatchop_File. These two fields are used to properly support
kono
parents:
diff changeset
337 -- gnatchop files and pragma Source_Reference.
kono
parents:
diff changeset
338 --
kono
parents:
diff changeset
339 -- Lines is used for files that were given on the command line, to
kono
parents:
diff changeset
340 -- memorize the lines and columns that the user specified.
kono
parents:
diff changeset
341
kono
parents:
diff changeset
342 type Reference_Record;
kono
parents:
diff changeset
343 type Reference is access all Reference_Record;
kono
parents:
diff changeset
344
kono
parents:
diff changeset
345 Empty_Reference : constant Reference := null;
kono
parents:
diff changeset
346
kono
parents:
diff changeset
347 type Reference_Record is record
kono
parents:
diff changeset
348 File : File_Reference;
kono
parents:
diff changeset
349 Line : Natural;
kono
parents:
diff changeset
350 Column : Natural;
kono
parents:
diff changeset
351 Source_Line : Cst_String_Access;
kono
parents:
diff changeset
352 Next : Reference := null;
kono
parents:
diff changeset
353 end record;
kono
parents:
diff changeset
354 -- File is a reference to the Ada source file
kono
parents:
diff changeset
355 -- Source_Line is the Line as it appears in the source file. This
kono
parents:
diff changeset
356 -- field is only used when the switch is set on the command line of
kono
parents:
diff changeset
357 -- gnatfind.
kono
parents:
diff changeset
358
kono
parents:
diff changeset
359 type Declaration_Record;
kono
parents:
diff changeset
360 type Declaration_Reference is access all Declaration_Record;
kono
parents:
diff changeset
361
kono
parents:
diff changeset
362 Empty_Declaration : constant Declaration_Reference := null;
kono
parents:
diff changeset
363
kono
parents:
diff changeset
364 type Declaration_Record (Symbol_Length : Natural) is record
kono
parents:
diff changeset
365 Key : Cst_String_Access;
kono
parents:
diff changeset
366 Decl : Reference;
kono
parents:
diff changeset
367 Is_Parameter : Boolean := False; -- True if entity is subprog param
kono
parents:
diff changeset
368 Decl_Type : Character;
kono
parents:
diff changeset
369 Body_Ref : Reference := null;
kono
parents:
diff changeset
370 Ref_Ref : Reference := null;
kono
parents:
diff changeset
371 Modif_Ref : Reference := null;
kono
parents:
diff changeset
372 Match : Boolean := False;
kono
parents:
diff changeset
373 Par_Symbol : Declaration_Reference := null;
kono
parents:
diff changeset
374 Next : Declaration_Reference := null;
kono
parents:
diff changeset
375 Symbol : String (1 .. Symbol_Length);
kono
parents:
diff changeset
376 end record;
kono
parents:
diff changeset
377 -- The lists of referenced (Body_Ref, Ref_Ref and Modif_Ref) are
kono
parents:
diff changeset
378 -- kept unsorted until the results needs to be printed. This saves
kono
parents:
diff changeset
379 -- lots of time while the internal tables are created.
kono
parents:
diff changeset
380
kono
parents:
diff changeset
381 pragma Inline (Get_Column);
kono
parents:
diff changeset
382 pragma Inline (Get_Emit_Warning);
kono
parents:
diff changeset
383 pragma Inline (Get_File_Ref);
kono
parents:
diff changeset
384 pragma Inline (Get_Line);
kono
parents:
diff changeset
385 pragma Inline (Get_Symbol);
kono
parents:
diff changeset
386 pragma Inline (Get_Type);
kono
parents:
diff changeset
387 pragma Inline (Longest_File_Name);
kono
parents:
diff changeset
388 end Xr_Tabls;