OSDN Git Service

2008-05-27 Vincent Celier <celier@adacore.com>
[pf3gnuchains/gcc-fork.git] / gcc / ada / fname.ads
1 ------------------------------------------------------------------------------
2 --                                                                          --
3 --                         GNAT COMPILER COMPONENTS                         --
4 --                                                                          --
5 --                                F N A M E                                 --
6 --                                                                          --
7 --                                 S p e c                                  --
8 --                                                                          --
9 --          Copyright (C) 1992-2007, Free Software Foundation, Inc.         --
10 --                                                                          --
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 2,  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 COPYING.  If not, write --
19 -- to  the  Free Software Foundation,  51  Franklin  Street,  Fifth  Floor, --
20 -- Boston, MA 02110-1301, USA.                                              --
21 --                                                                          --
22 -- As a special exception,  if other files  instantiate  generics from this --
23 -- unit, or you link  this unit with other files  to produce an executable, --
24 -- this  unit  does not  by itself cause  the resulting  executable  to  be --
25 -- covered  by the  GNU  General  Public  License.  This exception does not --
26 -- however invalidate  any other reasons why  the executable file  might be --
27 -- covered by the  GNU Public License.                                      --
28 --                                                                          --
29 -- GNAT was originally developed  by the GNAT team at  New York University. --
30 -- Extensive contributions were provided by Ada Core Technologies Inc.      --
31 --                                                                          --
32 ------------------------------------------------------------------------------
33
34 --  This package, together with its child package Fname.UF define the
35 --  association between source file names and unit names as defined
36 --  (see package Uname for definition of format of unit names).
37
38 with Namet; use Namet;
39
40 package Fname is
41
42    --  Note: this package spec does not depend on the Uname spec in the Ada
43    --  sense, but the comments and description of the semantics do depend on
44    --  the conventions established by Uname.
45
46    ---------------------------
47    -- File Name Conventions --
48    ---------------------------
49
50    --  GNAT requires that there be a one to one correspondence between source
51    --  file names (as used in the Osint package interface) and unit names as
52    --  defined by the Uname package. This correspondence is defined by the
53    --  two subprograms defined here in the Fname package.
54
55    --   For full rules of file naming, see GNAT User's Guide. Note that the
56    --   naming rules are affected by the presence of Source_File_Name pragmas
57    --   that have been previously processed.
58
59    --  Note that the file name does *not* include the directory name. The
60    --  management of directories is provided by Osint, and full file names
61    --  are used only for error message purposes within GNAT itself.
62
63    -----------------
64    -- Subprograms --
65    -----------------
66
67    function Is_Predefined_File_Name
68      (Fname              : File_Name_Type;
69       Renamings_Included : Boolean := True) return Boolean;
70    --  This function determines if the given file name (which must be a simple
71    --  file name with no directory information) is the file name for one of the
72    --  predefined library units (i.e. part of the Ada, System, or Interface
73    --  hierarchies). Note that units in the GNAT hierarchy are not considered
74    --  predefined (see Is_Internal_File_Name below). On return, Name_Buffer
75    --  contains the file name. The Renamings_Included parameter indicates
76    --  whether annex J renamings such as Text_IO are to be considered as
77    --  predefined. If Renamings_Included is True, then Text_IO will return
78    --  True, otherwise only children of Ada, Interfaces and System return True.
79
80    function Is_Predefined_File_Name
81      (Renamings_Included : Boolean := True) return Boolean;
82    --  This version is called with the file name already in Name_Buffer
83
84    function Is_Internal_File_Name
85      (Fname              : File_Name_Type;
86       Renamings_Included : Boolean := True) return Boolean;
87    --  Similar to Is_Predefined_File_Name. The internal file set is a superset
88    --  of the predefined file set including children of GNAT, and also children
89    --  of DEC for the VMS case.
90
91    procedure Tree_Read;
92    --  Dummy procedure (reads dummy table values from tree file)
93
94    procedure Tree_Write;
95    --  Writes out internal tables to current tree file using Tree_Write
96    --  This is actually a dummy routine, since the relevant table is
97    --  no longer used, but we retain it for now, to avoid a tree file
98    --  incompatibility with the 3.13 compiler. Should be removed for
99    --  the 3.14a release ???
100
101 end Fname;