1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
10 -- Copyright (C) 1992-2000 Free Software Foundation, Inc. --
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. --
23 -- As a special exception, if other files instantiate generics from this --
24 -- unit, or you link this unit with other files to produce an executable, --
25 -- this unit does not by itself cause the resulting executable to be --
26 -- covered by the GNU General Public License. This exception does not --
27 -- however invalidate any other reasons why the executable file might be --
28 -- covered by the GNU Public License. --
30 -- GNAT was originally developed by the GNAT team at New York University. --
31 -- Extensive contributions were provided by Ada Core Technologies Inc. --
33 ------------------------------------------------------------------------------
35 -- This package, together with its child package Fname.UF define the
36 -- association between source file names and unit names as defined
37 -- (see package Uname for definition of format of unit names).
39 with Types
; use Types
;
43 -- Note: this package spec does not depend on the Uname spec in the Ada
44 -- sense, but the comments and description of the semantics do depend on
45 -- the conventions established by Uname.
47 ---------------------------
48 -- File Name Conventions --
49 ---------------------------
51 -- GNAT requires that there be a one to one correspondence between source
52 -- file names (as used in the Osint package interface) and unit names as
53 -- defined by the Uname package. This correspondence is defined by the
54 -- two subprograms defined here in the Fname package.
56 -- For full rules of file naming, see GNAT User's Guide. Note that the
57 -- naming rules are affected by the presence of Source_File_Name pragmas
58 -- that have been previously processed.
60 -- Note that the file name does *not* include the directory name. The
61 -- management of directories is provided by Osint, and full file names
62 -- are used only for error message purposes within GNAT itself.
68 type Expected_Unit_Type
is (Expect_Body
, Expect_Spec
, Unknown
);
69 -- Return value from Get_Expected_Unit_Type
71 function Get_Expected_Unit_Type
72 (Fname
: File_Name_Type
)
73 return Expected_Unit_Type
;
74 -- If possible, determine whether the given file name corresponds to a unit
75 -- that is a spec or body (e.g. by examining the extension). If this cannot
76 -- be determined with the file naming conventions in use, then the returned
77 -- value is set to Unknown.
79 function Is_Predefined_File_Name
80 (Fname
: File_Name_Type
;
81 Renamings_Included
: Boolean := True)
83 -- This function determines if the given file name (which must be a simple
84 -- file name with no directory information) is the file name for one of
85 -- the predefined library units. On return, Name_Buffer contains the
86 -- file name. The Renamings_Included parameter indicates whether annex
87 -- J renamings such as Text_IO are to be considered as predefined. If
88 -- Renamings_Included is True, then Text_IO will return True, otherwise
89 -- only children of Ada, Interfaces and System return True.
91 function Is_Internal_File_Name
92 (Fname
: File_Name_Type
;
93 Renamings_Included
: Boolean := True)
95 -- Similar to Is_Predefined_File_Name. The internal file set is a
96 -- superset of the predefined file set including children of GNAT,
97 -- and also children of DEC for the VMS case.
100 -- Dummy procedure (reads dummy table values from tree file)
102 procedure Tree_Write
;
103 -- Writes out internal tables to current tree file using Tree_Write
104 -- This is actually a dummy routine, since the relevant table is
105 -- no longer used, but we retain it for now, to avoid a tree file
106 -- incompatibility with the 3.13 compiler. Should be removed for
107 -- the 3.14a release ???