OSDN Git Service

Delete all lines containing "$Revision:".
[pf3gnuchains/gcc-fork.git] / gcc / ada / ali.ads
1 ------------------------------------------------------------------------------
2 --                                                                          --
3 --                         GNAT COMPILER COMPONENTS                         --
4 --                                                                          --
5 --                                  A L I                                   --
6 --                                                                          --
7 --                                 S p e c                                  --
8 --                                                                          --
9 --                                                                          --
10 --          Copyright (C) 1992-2002 Free Software Foundation, Inc.          --
11 --                                                                          --
12 -- GNAT is free software;  you can  redistribute it  and/or modify it under --
13 -- terms of the  GNU General Public License as published  by the Free Soft- --
14 -- ware  Foundation;  either version 2,  or (at your option) any later ver- --
15 -- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
16 -- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
17 -- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License --
18 -- for  more details.  You should have  received  a copy of the GNU General --
19 -- Public License  distributed with GNAT;  see file COPYING.  If not, write --
20 -- to  the Free Software Foundation,  59 Temple Place - Suite 330,  Boston, --
21 -- MA 02111-1307, USA.                                                      --
22 --                                                                          --
23 -- GNAT was originally developed  by the GNAT team at  New York University. --
24 -- It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). --
25 --                                                                          --
26 ------------------------------------------------------------------------------
27
28 --  This package defines the internal data structures used for representation
29 --  of Ada Library Information (ALI) acquired from the ALI files generated
30 --  by the front end.
31
32 with Casing;  use Casing;
33 with Gnatvsn; use Gnatvsn;
34 with Rident;  use Rident;
35 with Table;
36 with Types;   use Types;
37
38 with GNAT.HTable; use GNAT.HTable;
39
40 package ALI is
41
42    --------------
43    -- Id Types --
44    --------------
45
46    --  The various entries are stored in tables with distinct subscript
47    --  ranges. The following type definitions indicate the ranges used
48    --  for the subscripts (Id values) for the various tables.
49
50    type ALI_Id is range 0 .. 999_999;
51    --  Id values used for ALIs table entries
52
53    type Unit_Id is range 1_000_000 .. 1_999_999;
54    --  Id values used for Unit table entries
55
56    type With_Id is range 2_000_000 .. 2_999_999;
57    --  Id values used for Withs table entries
58
59    type Arg_Id is range 3_000_000 .. 3_999_999;
60    --  Id values used for argument table entries
61
62    type Sdep_Id is range 4_000_000 .. 4_999_999;
63    --  Id values used for Sdep table entries
64
65    type Source_Id is range 5_000_000 .. 5_999_999;
66    --  Id values used for Source table entries
67
68    --------------------
69    -- ALI File Table --
70    --------------------
71
72    --  Each ALI file read generates an entry in the ALIs table
73
74    No_ALI_Id : constant ALI_Id := ALI_Id'First;
75    --  Special value indicating no ALI entry
76
77    First_ALI_Entry : constant ALI_Id := No_ALI_Id + 1;
78    --  Id of first actual entry in table
79
80    type Main_Program_Type is (None, Proc, Func);
81    --  Indicator of whether unit can be used as main program
82
83    type Restrictions_String is array (All_Restrictions) of Character;
84    --  Type used to hold string from R line
85
86    type ALIs_Record is record
87
88       Afile : File_Name_Type;
89       --  Name of ALI file
90
91       Ofile_Full_Name : Name_Id;
92       --  Full name of object file corresponding to the ALI file
93
94       Sfile : File_Name_Type;
95       --  Name of source file that generates this ALI file (which is equal
96       --  to the name of the source file in the first unit table entry for
97       --  this ALI file, since the body if present is always first).
98
99       Ver : String (1 .. Ver_Len_Max);
100       --  Value of library version (V line in ALI file)
101
102       Ver_Len : Natural;
103       --  Length of characters stored in Ver
104
105       First_Unit : Unit_Id;
106       --  Id of first Unit table entry for this file
107
108       Last_Unit : Unit_Id;
109       --  Id of last Unit table entry for this file
110
111       First_Sdep : Sdep_Id;
112       --  Id of first Sdep table entry for this file
113
114       Last_Sdep : Sdep_Id;
115       --  Id of last Sdep table entry for this file
116
117       Main_Program : Main_Program_Type;
118       --  Indicator of whether first unit can be used as main program
119
120       Main_Priority : Int;
121       --  Indicates priority value if Main_Program field indicates that
122       --  this can be a main program. A value of -1 (No_Main_Priority)
123       --  indicates that no parameter was found, or no M line was present.
124
125       Time_Slice_Value : Int;
126       --  Indicates value of time slice parameter from T=xxx on main program
127       --  line. A value of -1 indicates that no T=xxx parameter was found,
128       --  or no M line was present.
129
130       WC_Encoding : Character;
131       --  Wide character encoding if main procedure. Otherwise not relevant.
132
133       Locking_Policy : Character;
134       --  Indicates locking policy for units in this file. Space means
135       --  tasking was not used, or that no Locking_Policy pragma was
136       --  present or that this is a language defined unit. Otherwise set
137       --  to first character (upper case) of policy name.
138
139       Queuing_Policy : Character;
140       --  Indicates queuing policy for units in this file. Space means
141       --  tasking was not used, or that no Queuing_Policy pragma was
142       --  present or that this is a language defined unit. Otherwise set
143       --  to first character (upper case) of policy name.
144
145       Task_Dispatching_Policy : Character;
146       --  Indicates task dispatching policy for units in this file. Space
147       --  means tasking was not used, or that no Task_Dispatching_Policy
148       --  pragma was present or that this is a language defined unit.
149       --  Otherwise set to first character (upper case) of policy name.
150
151       Compile_Errors : Boolean;
152       --  Set to True if compile errors for unit. Note that No_Object
153       --  will always be set as well in this case.
154
155       Float_Format : Character;
156       --  Set to float format (set to I if no float-format given)
157
158       No_Object : Boolean;
159       --  Set to True if no object file generated
160
161       No_Run_Time : Boolean;
162       --  Set to True if file was compiled with pragma No_Run_Time
163
164       Normalize_Scalars : Boolean;
165       --  Set to True if file was compiled with Normalize_Scalars
166
167       Unit_Exception_Table : Boolean;
168       --  Set to True if unit exception table pointer generated
169
170       Zero_Cost_Exceptions : Boolean;
171       --  Set to True if file was compiled with zero cost exceptions
172
173       Restrictions : Restrictions_String;
174       --  Copy of restrictions letters from R line
175
176    end record;
177
178    No_Main_Priority : constant Int := -1;
179    --  Code for no main priority set
180
181    package ALIs is new Table.Table (
182      Table_Component_Type => ALIs_Record,
183      Table_Index_Type     => ALI_Id,
184      Table_Low_Bound      => First_ALI_Entry,
185      Table_Initial        => 500,
186      Table_Increment      => 200,
187      Table_Name           => "ALIs");
188
189    ----------------
190    -- Unit Table --
191    ----------------
192
193    --  Each unit within an ALI file generates an entry in the unit table
194
195    No_Unit_Id : constant Unit_Id := Unit_Id'First;
196    --  Special value indicating no unit table entry
197
198    First_Unit_Entry : constant Unit_Id := No_Unit_Id + 1;
199    --  Id of first actual entry in table
200
201    type Unit_Type is (Is_Spec, Is_Body, Is_Spec_Only, Is_Body_Only);
202    --  Indicates type of entry, if both body and spec appear in the ALI file,
203    --  then the first unit is marked Is_Body, and the second is marked Is_Spec.
204    --  If only a spec appears, then it is marked as Is_Spec_Only, and if only
205    --  a body appears, then it is marked Is_Body_Only).
206
207    subtype Version_String is String (1 .. 8);
208    --  Version string, taken from unit record
209
210    type Unit_Record is record
211
212       My_ALI : ALI_Id;
213       --  Corresponding ALI entry
214
215       Uname : Unit_Name_Type;
216       --  Name of Unit
217
218       Sfile : File_Name_Type;
219       --  Name of source file
220
221       Preelab : Boolean;
222       --  Indicates presence of PR parameter for a preelaborated package
223
224       No_Elab : Boolean;
225       --  Indicates presence of NE parameter for a unit that has does not
226       --  have an elaboration routine (since it has no elaboration code).
227
228       Pure : Boolean;
229       --  Indicates presence of PU parameter for a pure package
230
231       Dynamic_Elab : Boolean;
232       --  Set to True if the unit was compiled with dynamic elaboration
233       --  checks (i.e. either -gnatE or pragma Elaboration_Checks (Static)
234       --  was used to compile the unit).
235
236       Elaborate_Body : Boolean;
237       --  Indicates presence of EB parameter for a package which has a
238       --  pragma Preelaborate_Body.
239
240       Set_Elab_Entity : Boolean;
241       --  Indicates presence of EE parameter for a unit which has an
242       --  elaboration entity which must be set true as part of the
243       --  elaboration of the entity.
244
245       Has_RACW : Boolean;
246       --  Indicates presence of RA parameter for a package that declares
247       --  at least one Remote Access to Class_Wide (RACW) object.
248
249       Remote_Types : Boolean;
250       --  Indicates presence of RT parameter for a package which has a
251       --  pragma Remote_Types.
252
253       Shared_Passive : Boolean;
254       --  Indicates presence of SP parameter for a package which has a
255       --  pragma Shared_Passive.
256
257       RCI : Boolean;
258       --  Indicates presence of RC parameter for a package which has a
259       --  pragma Remote_Call_Interface.
260
261       Predefined : Boolean;
262       --  Indicates if unit is language predefined (or a child of such a unit)
263
264       Internal : Boolean;
265       --  Indicates if unit is an internal unit (or a child of such a unit)
266
267       First_With : With_Id;
268       --  Id of first withs table entry for this file
269
270       Last_With : With_Id;
271       --  Id of last withs table entry for this file
272
273       First_Arg : Arg_Id;
274       --  Id of first args table entry for this file
275
276       Last_Arg : Arg_Id;
277       --  Id of last args table entry for this file
278
279       Utype : Unit_Type;
280       --  Type of entry
281
282       Is_Generic : Boolean;
283       --  True for generic unit (i.e. a generic declaration, or a generic
284       --  body). False for a non-generic unit.
285
286       Unit_Kind : Character;
287       --  Indicates the nature of the unit. 'p' for Packages and 's' for
288       --  subprograms.
289
290       Version : Version_String;
291       --  Version of unit
292
293       Icasing : Casing_Type;
294       --  Indicates casing of identifiers in source file for this unit. This
295       --  is used for informational output, and also for constructing the
296       --  main unit if it is being built in Ada.
297
298       Kcasing : Casing_Type;
299       --  Indicates casing of keyowords in source file for this unit. This
300       --  is used for informational output, and also for constructing the
301       --  main unit if it is being built in Ada.
302
303       Elab_Position : aliased Natural;
304       --  Initialized to zero. Set non-zero when a unit is chosen and
305       --  placed in the elaboration order. The value represents the
306       --  ordinal position in the elaboration order.
307
308       Init_Scalars : Boolean;
309       --  Set True if IS qualifier appears in ALI file, indicating that
310       --  an Initialize_Scalars pragma applies to the unit.
311
312    end record;
313
314    package Units is new Table.Table (
315      Table_Component_Type => Unit_Record,
316      Table_Index_Type     => Unit_Id,
317      Table_Low_Bound      => First_Unit_Entry,
318      Table_Initial        => 100,
319      Table_Increment      => 200,
320      Table_Name           => "Unit");
321
322    --------------
323    -- Switches --
324    --------------
325
326    --  These switches record status information about ali files that
327    --  have been read, for quick reference without searching tables.
328
329    Dynamic_Elaboration_Checks_Specified : Boolean := False;
330    --  Set to False by Initialize_ALI. Set to True if Read_ALI reads
331    --  a unit for which dynamic elaboration checking is enabled.
332
333    Float_Format_Specified : Character := ' ';
334    --  Set to blank by Initialize_ALI. Set to appropriate float format
335    --  character (V or I, see Opt.Float_Format) if an an ali file that
336    --  is read contains an F line setting the floating point format.
337
338    Initialize_Scalars_Used : Boolean := False;
339    --  Set True if an ali file contains the Initialize_Scalars flag
340
341    Locking_Policy_Specified : Character := ' ';
342    --  Set to blank by Initialize_ALI. Set to the appropriate locking policy
343    --  character if an ali file contains a P line setting the locking policy.
344
345    No_Normalize_Scalars_Specified : Boolean := False;
346    --  Set to False by Initialize_ALI. Set to True if an ali file indicates
347    --  that the file was compiled without normalize scalars.
348
349    No_Object_Specified : Boolean := False;
350    --  Set to False by Initialize_ALI. Set to True if an ali file contains
351    --  the No_Object flag.
352
353    Normalize_Scalars_Specified : Boolean := False;
354    --  Set to False by Initialize_ALI. Set to True if an ali file indicates
355    --  that the file was compiled in Normalize_Scalars mode.
356
357    No_Run_Time_Specified : Boolean := False;
358    --  Set to False by Initialize_ALI, Set to True if an ali file indicates
359    --  that the file was compiled in No_Run_Time mode.
360
361    Queuing_Policy_Specified : Character := ' ';
362    --  Set to blank by Initialize_ALI. Set to the appropriate queuing policy
363    --  character if an ali file contains a P line setting the queuing policy.
364
365    Restrictions : Restrictions_String := (others => 'n');
366    --  This array records the cumulative contributions of R lines in all
367    --  ali files. An entry is changed will be set to v if any ali file
368    --  indicates that the restriction is violated, and otherwise will be
369    --  set to r if the restriction is specified by some unit.
370
371    Static_Elaboration_Model_Used : Boolean := False;
372    --  Set to False by Initialize_ALI. Set to True if any ALI file for a
373    --  non-internal unit compiled with the static elaboration model is
374    --  encountered.
375
376    Task_Dispatching_Policy_Specified : Character := ' ';
377    --  Set to blank by Initialize_ALI. Set to the appropriate task dispatching
378    --  policy character if an ali file contains a P line setting the
379    --  task dispatching policy.
380
381    Unreserve_All_Interrupts_Specified : Boolean := False;
382    --  Set to False by Initialize_ALI. Set to True if an ali file is read that
383    --  has  P line specifying unreserve all interrupts mode.
384
385    Zero_Cost_Exceptions_Specified : Boolean := False;
386    --  Set to False by Initialize_ALI. Set to True if an ali file is read that
387    --  has a P line specifying the generation of zero cost exceptions.
388
389    -----------------
390    -- Withs Table --
391    -----------------
392
393    --  Each With line (W line) in an ALI file generates a Withs table entry
394
395    No_With_Id : constant With_Id := With_Id'First;
396    --  Special value indicating no withs table entry
397
398    First_With_Entry : constant With_Id := No_With_Id + 1;
399    --  Id of first actual entry in table
400
401    type With_Record is record
402
403       Uname : Unit_Name_Type;
404       --  Name of Unit
405
406       Sfile : File_Name_Type;
407       --  Name of source file, set to No_File in generic case
408
409       Afile : File_Name_Type;
410       --  Name of ALI file, set to No_File in generic case
411
412       Elaborate : Boolean;
413       --  Indicates presence of E parameter
414
415       Elaborate_All : Boolean;
416       --  Indicates presence of EA parameter
417
418       Elab_All_Desirable : Boolean;
419       --  Indicates presence of ED parameter
420
421    end record;
422
423    package Withs is new Table.Table (
424      Table_Component_Type => With_Record,
425      Table_Index_Type     => With_Id,
426      Table_Low_Bound      => First_With_Entry,
427      Table_Initial        => 5000,
428      Table_Increment      => 200,
429      Table_Name           => "Withs");
430
431    ---------------------
432    -- Arguments Table --
433    ---------------------
434
435    --  Each Arg line (A line) in an ALI file generates an Args table entry
436
437    No_Arg_Id : constant Arg_Id := Arg_Id'First;
438    --  Special value indicating no args table entry
439
440    First_Arg_Entry : constant Arg_Id := No_Arg_Id + 1;
441    --  Id of first actual entry in table
442
443    package Args is new Table.Table (
444      Table_Component_Type => String_Ptr,
445      Table_Index_Type     => Arg_Id,
446      Table_Low_Bound      => First_Arg_Entry,
447      Table_Initial        => 1000,
448      Table_Increment      => 100,
449      Table_Name           => "Args");
450
451    --------------------------
452    -- Linker_Options Table --
453    --------------------------
454
455    --  If an ALI file has one of more Linker_Options lines, then a single
456    --  entry is made in this table. If more than one Linker_Options lines
457    --  appears in a given ALI file, then the arguments are concatenated
458    --  to form the entry in this table, using a NUL character as the
459    --  separator, and a final NUL character is appended to the end.
460
461    type Linker_Option_Record is record
462       Name : Name_Id;
463       --  Name entry containing concatenated list of Linker_Options
464       --  arguments separated by NUL and ended by NUL as described above.
465
466       Unit : Unit_Id;
467       --  Unit_Id for the entry
468
469       Internal_File : Boolean;
470       --  Set True if the linker options are from an internal file. This is
471       --  used to insert certain standard entries after all the user entries
472       --  but before the entries from the run-time.
473
474       Original_Pos : Positive;
475       --  Keep track of original position in the linker options table. This
476       --  is used to implement a stable sort when we sort the linker options
477       --  table.
478    end record;
479
480    --  Declare the Linker_Options Table
481
482    --  The indexes of active entries in this table range from 1 to the
483    --  value of Linker_Options.Last. The zero'th element is for sort call.
484
485    package Linker_Options is new Table.Table (
486      Table_Component_Type => Linker_Option_Record,
487      Table_Index_Type     => Integer,
488      Table_Low_Bound      => 0,
489      Table_Initial        => 200,
490      Table_Increment      => 400,
491      Table_Name           => "Linker_Options");
492
493    -------------------------------------------
494    -- External Version Reference Hash Table --
495    -------------------------------------------
496
497    --  This hash table keeps track of external version reference strings
498    --  as read from E lines in the ali file. The stored values do not
499    --  include the terminating quote characters.
500
501    type Vindex is range 0 .. 98;
502    --  Type to define range of headers
503
504    function SHash (S : String_Ptr) return Vindex;
505    --  Hash function for this table
506
507    function SEq (F1, F2 : String_Ptr) return Boolean;
508    --  Equality function for this table
509
510    package Version_Ref is new Simple_HTable (
511      Header_Num => Vindex,
512      Element    => Boolean,
513      No_Element => False,
514      Key        => String_Ptr,
515      Hash       => SHash,
516      Equal      => SEq);
517
518    ------------------------------------
519    -- Sdep (Source Dependency) Table --
520    ------------------------------------
521
522    --  Each source dependency (D line) in an ALI file generates an
523    --  entry in the Sdep table.
524
525    No_Sdep_Id : constant Sdep_Id := Sdep_Id'First;
526    --  Special value indicating no Sdep table entry
527
528    First_Sdep_Entry : constant Sdep_Id := No_Sdep_Id + 1;
529    --  Id of first actual entry in table
530
531    type Sdep_Record is record
532
533       Sfile : File_Name_Type;
534       --  Name of source file
535
536       Stamp : Time_Stamp_Type;
537       --  Time stamp value. Note that this will be all zero characters
538       --  for the dummy entries for missing or non-dependent files.
539
540       Checksum : Word;
541       --  Checksum value. Note that this will be all zero characters
542       --  for the dummy entries for missing or non-dependent files
543
544       Dummy_Entry : Boolean;
545       --  Set True for dummy entries that correspond to missing files
546       --  or files where no dependency relationship exists.
547
548       Subunit_Name : Name_Id;
549       --  Name_Id for subunit name if present, else No_Name
550
551       Rfile : File_Name_Type;
552       --  Reference file name. Same as Sfile unless a Source_Reference
553       --  pragma was used, in which case it reflects the name used in
554       --  the pragma.
555
556       Start_Line : Nat;
557       --  Starting line number in file. Always 1, unless a Source_Reference
558       --  pragma was used, in which case it reflects the line number value
559       --  given in the pragma.
560
561    end record;
562
563    package Sdep is new Table.Table (
564      Table_Component_Type => Sdep_Record,
565      Table_Index_Type     => Sdep_Id,
566      Table_Low_Bound      => First_Sdep_Entry,
567      Table_Initial        => 5000,
568      Table_Increment      => 200,
569      Table_Name           => "Sdep");
570
571    ----------------------------
572    -- Use of Name Table Info --
573    ----------------------------
574
575    --  All unit names and file names are entered into the Names table. The
576    --  Info fields of these entries are used as follows:
577
578    --    Unit name           Info field has Unit_Id of unit table entry
579    --    ALI file name       Info field has ALI_Id of ALI table entry
580    --    Source file name    Info field has Source_Id of source table entry
581
582    --------------------------
583    -- Cross-Reference Data --
584    --------------------------
585
586    --  The following table records cross-reference sections, there is one
587    --  entry for each X header line in the ALI file for an xref section.
588    --  Note that there will be no entries in this table if the Read_Xref
589    --  parameter to Scan_ALI was set to False.
590
591    type Xref_Section_Record is record
592       File_Num : Sdep_Id;
593       --  Dependency number for file (entry in Sdep.Table)
594
595       File_Name : Name_Id;
596       --  Name of file
597
598       First_Entity : Nat;
599       --  First entry in Xref_Entity table
600
601       Last_Entity : Nat;
602       --  Last entry in Xref_Entity table
603
604    end record;
605
606    package Xref_Section is new Table.Table (
607      Table_Component_Type => Xref_Section_Record,
608      Table_Index_Type     => Nat,
609      Table_Low_Bound      => 1,
610      Table_Initial        => 50,
611      Table_Increment      => 300,
612      Table_Name           => "Xref_Section");
613
614    --  The following is used to indicate whether a typeref field is present
615    --  for the entity, and if so what kind of typeref field.
616
617    type Tref_Kind is (
618      Tref_None,    --  No typeref present
619      Tref_Access,  --  Access type typeref (points to designated type)
620      Tref_Derived, --  Derived type typeref (points to parent type)
621      Tref_Type);   --  All other cases
622
623    --  The following table records entities for which xrefs are recorded
624
625    type Xref_Entity_Record is record
626       Line : Pos;
627       --  Line number of definition
628
629       Etype : Character;
630       --  Set to the identification character for the entity. See section
631       --  "Cross-Reference Entity Identifiers in lib-xref.ads for details.
632
633       Col : Pos;
634       --  Column number of definition
635
636       Lib : Boolean;
637       --  True if entity is library level entity
638
639       Entity : Name_Id;
640       --  Name of entity
641
642       Rref_Line : Nat;
643       --  This field is set to the line number of a renaming reference if
644       --  one is present, or to zero if no renaming reference is present
645
646       Rref_Col : Nat;
647       --  This field is set to the column number of a renaming reference
648       --  if one is present, or to zero if no renaming reference is present.
649
650       Tref : Tref_Kind;
651       --  Indicates if a typeref is present, and if so what kind. Set to
652       --  Tref_None if no typeref field is present.
653
654       Tref_File_Num : Sdep_Id;
655       --  This field is set to No_Sdep_Id if no typeref is present, or
656       --  if the typeref refers to an entity in standard. Otherwise it
657       --  it is the dependency reference for the file containing the
658       --  declaration of the typeref entity.
659
660       Tref_Line : Nat;
661       --  This field is set to zero if no typeref is present, or if the
662       --  typeref refers to an entity in standard. Otherwise it contains
663       --  the line number of the declaration of the typeref entity.
664
665       Tref_Type : Character;
666       --  This field is set to blank if no typeref is present, or if the
667       --  typeref refers to an entity in standard. Otherwise it contains
668       --  the identification character for the typeref entity. See section
669       --  "Cross-Reference Entity Identifiers in lib-xref.ads for details.
670
671       Tref_Col : Nat;
672       --  This field is set to zero if no typeref is present, or if the
673       --  typeref refers to an entity in standard. Otherwise it contains
674       --  the column number of the declaration of the parent type.
675
676       Tref_Standard_Entity : Name_Id;
677       --  This field is set to No_Name if no typeref is present or if the
678       --  typeref refers to a declared entity rather than an entity in
679       --  package Standard. If there is a typeref that references an
680       --  entity in package Standard, then this field is a Name_Id
681       --  reference for the entity name.
682
683       First_Xref : Nat;
684       --  Index into Xref table of first cross-reference
685
686       Last_Xref : Nat;
687       --  Index into Xref table of last cross-reference. The value in
688       --  Last_Xref can be less than the First_Xref value to indicate
689       --  that no entries are present in the Xref Table.
690    end record;
691
692    package Xref_Entity is new Table.Table (
693      Table_Component_Type => Xref_Entity_Record,
694      Table_Index_Type     => Nat,
695      Table_Low_Bound      => 1,
696      Table_Initial        => 500,
697      Table_Increment      => 300,
698      Table_Name           => "Xref_Entity");
699
700    --  The following table records actual cross-references
701
702    type Xref_Record is record
703       File_Num : Sdep_Id;
704       --  Set to the file dependency number for the cross-reference. Note
705       --  that if no file entry is present explicitly, this is just a copy
706       --  of the reference for the current cross-reference section.
707
708       Line : Pos;
709       --  Line number for the reference
710
711       Rtype : Character;
712       --  Indicates type of reference, using code used in ALI file:
713       --    r = reference
714       --    m = modification
715       --    b = body entity
716       --    c = completion of private or incomplete type
717       --    x = type extension
718       --    i = implicit reference
719       --  See description in lib-xref.ads for further details
720
721       Col : Nat;
722       --  Column number for the reference
723
724       --  Note: for instantiation references, Rtype is set to ' ', and Col is
725       --  set to zero. One or more such entries can follow any other reference.
726    end record;
727
728    package Xref is new Table.Table (
729      Table_Component_Type => Xref_Record,
730      Table_Index_Type     => Nat,
731      Table_Low_Bound      => 1,
732      Table_Initial        => 2000,
733      Table_Increment      => 300,
734      Table_Name           => "Xref");
735
736    --------------------------------------
737    -- Subprograms for Reading ALI File --
738    --------------------------------------
739
740    procedure Initialize_ALI;
741    --  Initialize the ALI tables. Also resets all switch values to defaults.
742
743    function Scan_ALI
744      (F         : File_Name_Type;
745       T         : Text_Buffer_Ptr;
746       Ignore_ED : Boolean;
747       Err       : Boolean;
748       Read_Xref : Boolean := False)
749       return      ALI_Id;
750    --  Given the text, T, of an ALI file, F, scan and store the information
751    --  from the file, and return the Id of the resulting entry in the ALI
752    --  table. Switch settings may be modified as described above in the
753    --  switch description settings.
754    --
755    --    Ignore_ED is normally False. If set to True, it indicates that
756    --    all ED (elaboration desirable) indications in the ALI file are
757    --    to be ignored.
758    --
759    --    Err determines the action taken on an incorrectly formatted file.
760    --    If Err is False, then an error message is output, and the program
761    --    is terminated. If Err is True, then no error message is output,
762    --    and No_ALI_Id is returned.
763    --
764    --    Read_XREF is set True to read and acquire the cross-reference
765    --    information, otherwise the scan is terminated when a cross-
766    --    reference line is encountered.
767
768 end ALI;