-- --
-- S p e c --
-- --
--- $Revision: 1.14 $ --
--- --
--- Copyright (C) 1992-2001, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- 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- --
+-- ware Foundation; either version 3, 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, 59 Temple Place - Suite 330, Boston, --
--- MA 02111-1307, USA. --
+-- Public License distributed with GNAT; see file COPYING3. If not, go to --
+-- http://www.gnu.org/licenses for a complete copy of the license. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
--- It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). --
+-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- off into a child package to avoid a dependence of Sinput on Osint which
-- would cause trouble in the tree read/write routines.
-with Types; use Types;
-
package Sinput.L is
- -------------------------------------------
- -- Subprograms for Loading Source Files --
- -------------------------------------------
+ ------------------------------------------
+ -- Subprograms for Loading Source Files --
+ ------------------------------------------
function Load_Source_File (N : File_Name_Type) return Source_File_Index;
-- Given a source file name, returns the index of the corresponding entry
function Load_Config_File (N : File_Name_Type) return Source_File_Index;
-- Similar to Load_Source_File, except that the file name is always
-- interpreted in the context of the current working directory.
+ -- The file is never preprocessed.
+
+ function Load_Definition_File
+ (N : File_Name_Type) return Source_File_Index;
+ -- Loads preprocessing definition file. Similar to Load_Source_File
+ -- except that this file is not itself preprocessed.
+
+ function Load_Preprocessing_Data_File
+ (N : File_Name_Type) return Source_File_Index;
+ -- Loads preprocessing data file. Similar to Load_Source_File except
+ -- that this file is not itself preprocessed.
procedure Complete_Source_File_Entry;
-- Called on completing the parsing of a source file. This call completes
-- the source file table entry for the current source file.
+ function Source_File_Is_No_Body (X : Source_File_Index) return Boolean;
+ -- Returns true if the designated source file contains pragma No_Body;
+ -- and no other tokens. If the source file contains anything other than
+ -- this sequence of three tokens, then False is returned.
+
function Source_File_Is_Subunit (X : Source_File_Index) return Boolean;
-- This function determines if a source file represents a subunit. It
-- works by scanning for the first compilation unit token, and returning
-- calls to Adjust_Instantiation_Sloc.
procedure Create_Instantiation_Source
- (Inst_Node : Entity_Id;
- Template_Id : Entity_Id;
- A : out Sloc_Adjustment);
+ (Inst_Node : Entity_Id;
+ Template_Id : Entity_Id;
+ Inlined_Body : Boolean;
+ A : out Sloc_Adjustment);
-- This procedure creates the source table entry for an instantiation.
-- Inst_Node is the instantiation node, and Template_Id is the defining
-- identifier of the generic declaration or body unit as appropriate.
-- A is set to an adjustment factor to be used in subsequent calls to
- -- Adjust_Instantiation_Sloc.
+ -- Adjust_Instantiation_Sloc. The instantiation mechanism is also used
+ -- for inlined function and procedure calls. The parameter Inlined_Body
+ -- is set to True in such cases, and False for a generic instantiation.
+ -- This is used for generating error messages that distinguish these
+ -- two cases, otherwise the two cases are handled identically.
procedure Adjust_Instantiation_Sloc (N : Node_Id; A : Sloc_Adjustment);
-- The instantiation tree is created by copying the tree of the generic
-- Adjust_Instantiation_Sloc to each copied node to adjust the Sloc
-- to reference the source entry for the instantiation.
- ------------------------------------------------
- -- Subprograms for Writing Debug Source Files --
- ------------------------------------------------
-
- procedure Create_Debug_Source
- (Source : Source_File_Index;
- Loc : out Source_Ptr);
- -- Given a source file, creates a new source file table entry to be used
- -- for the debug source file output (Debug_Generated_Code switch set).
- -- Loc is set to the initial Sloc value for the first line. This call
- -- also creates the debug source output file (using Create_Debug_File).
-
- procedure Write_Debug_Line (Str : String; Loc : in out Source_Ptr);
- -- This procedure is called to write a line to the debug source file
- -- previously created by Create_Debug_Source using Write_Debug_Info.
- -- Str is the source line to be written to the file (it does not include
- -- an end of line character). On entry Loc is the Sloc value previously
- -- returned by Create_Debug_Source or Write_Debug_Line, and on exit,
- -- Sloc is updated to point to the start of the next line to be written,
- -- taking into account the length of the ternminator that was written by
- -- Write_Debug_Info.
-
- procedure Close_Debug_Source;
- -- This procedure completes the source table entry for the debug file
- -- previously created by Create_Debug_Source, and written using the
- -- Write_Debug_Line procedure. It then calls Close_Debug_File to
- -- complete the writing of the file itself.
-
private
type Sloc_Adjustment is record