1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
9 -- Copyright (C) 1992-2018, 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 ------------------------------------------------------------------------------
26 -- This child package contains a routine to read and process Source_File_Name
27 -- pragmas from the gnat.adc file in the current directory. In order to use
28 -- the routines in package Fname.UF, it is required that Source_File_Name
29 -- pragmas be processed. There are two places where such processing takes
32 -- The compiler front end (par-prag.adb), which is the general circuit
33 -- for processing all pragmas, including Source_File_Name.
35 -- The stand alone routine in this unit, which is convenient to use
36 -- from tools that do not want to include the compiler front end.
38 -- Note that this unit does depend on several of the compiler front-end
39 -- sources, including osint. If it is necessary to scan source file name
40 -- pragmas with less dependence on such sources, look at unit SFN_Scan.
44 procedure Read_Source_File_Name_Pragmas
;
45 -- This procedure is called to read the gnat.adc file and process any
46 -- Source_File_Name pragmas contained in this file. All other pragmas
47 -- are ignored. The result is appropriate calls to routines in the
48 -- package Fname.UF to register the pragmas so that subsequent calls
49 -- to Get_File_Name work correctly.
51 -- Note: The caller must have made an appropriate call to the
52 -- Osint.Initialize routine to initialize Osint before calling
55 -- If a syntax error is detected while scanning the gnat.adc file,
56 -- then the exception SFN_Scan.Syntax_Error_In_GNAT_ADC is raised
57 -- and SFN_Scan.Cursor contains the approximate index relative to
58 -- the start of the gnat.adc file of the error.