home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Geek Gadgets 1
/
ADE-1.bin
/
ade-dist
/
gnat-2.06-src.tgz
/
tar.out
/
fsf
/
gnat
/
ada
/
lib-load.ads
< prev
next >
Wrap
Text File
|
1996-09-28
|
5KB
|
83 lines
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- L I B . L O A D --
-- --
-- S p e c --
-- --
-- $Revision: 1.1 $ --
-- --
-- Copyright (c) 1992,1993,1994,1995 NYU, All Rights Reserved --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. --
-- --
------------------------------------------------------------------------------
-- This child package contains the function used to load a separately
-- compiled unit, as well as the routine used to initialize the unit
-- table and load the main source file.
--
package Lib.Load is
procedure Initialize;
-- Called at the start of compiling a new main source unit to initialize
-- the library processing for the new main source. Establishes and
-- initializes the units table entry for the new main unit (leaving
-- the Unit_File_Name entry of Main_Unit set to No_File if there are no
-- more files. Otherwise the main source file has been opened and read
-- and then closed on return.
function Load_Unit
(Uname : Unit_Name_Type;
Required : Boolean;
Enode : Node_Id)
return Unit_Number_Type;
-- This function loads and parses the unit specified by Unit_Name_Type
-- (or returns the unit number for the previously constructed units table
-- entry if this is not the first call for this unit). Required indicates
-- the behavior on a file not found condition, as further described below,
-- and Enode is the node in the calling program to which error messages
-- are to be attached.
--
-- If the corresponding file is found, the value returned by Load is the
-- unit number that indexes the corresponding entry in the units table. If
-- a serious enough parser error occurs to prevent subsequent semantic
-- analysis, then the Fatal_Error flag of the returned entry is set and
-- in addition, the fatal error flag of the calling unit is also set.
--
-- If the corresponding file is not found, then the behavior depends on
-- the setting of Required. If Required is False, then No_Unit is returned
-- and no error messages are issued. If Required is True, then a fatal
-- error message is posted, and Unrecoverable_Error raised to abandon the
-- compilation.
--
-- A special case arises in the call from Rtsfind, where Enode is set to
-- Empty. In this case Required is False, and the caller in any case treats
-- any error as fatal.
procedure Make_Instance_Unit (N : Node_Id);
-- When a compilation unit is an instantiation, it contains both the
-- declaration and the body of the instance, each of which can have its
-- own elaboration routine. The file itself corresponds to the declaration.
-- We create an additional entry for the body, so that the binder can
-- generate the proper elaboration calls to both. The argument N is the
-- compilation unit node created for the body.
procedure Version_Update (U : Node_Id; From : Node_Id);
-- This routine is called when unit U is found to be semantically
-- dependent on unit From. It updates the version of U to register
-- dependence on the version of From. The arguments are compilation
-- unit nodes for the relevant library nodes.
end Lib.Load;