OSDN Git Service

* g++.old-deja/g++.benjamin/16077.C: Adjust warnings.
[pf3gnuchains/gcc-fork.git] / gcc / ada / prj-com.ads
1 ------------------------------------------------------------------------------
2 --                                                                          --
3 --                         GNAT COMPILER COMPONENTS                         --
4 --                                                                          --
5 --                              P R J . C O M                               --
6 --                                                                          --
7 --                                 S p e c                                  --
8 --                                                                          --
9 --                                                                          --
10 --          Copyright (C) 1992-2000 Free Software Foundation, Inc.          --
11 --                                                                          --
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.                                                      --
22 --                                                                          --
23 -- GNAT was originally developed  by the GNAT team at  New York University. --
24 -- Extensive contributions were provided by Ada Core Technologies Inc.      --
25 --                                                                          --
26 ------------------------------------------------------------------------------
27
28 --  The following package declares data types for GNAT project.
29 --  These data types are used in the bodies of the Prj hierarchy.
30
31 with GNAT.HTable;
32 with Table;
33 with Types; use Types;
34
35 package Prj.Com is
36
37    --  At one point, this package was private.
38    --  It cannot be private, because it is used outside of
39    --  the Prj hierarchy.
40
41    Tool_Name : Name_Id := No_Name;
42
43    Current_Verbosity : Verbosity := Default;
44
45    type Spec_Or_Body is
46      (Specification, Body_Part);
47
48    type File_Name_Data is record
49       Name         : Name_Id := No_Name;
50       Path         : Name_Id := No_Name;
51       Project      : Project_Id := No_Project;
52       Needs_Pragma : Boolean := False;
53    end record;
54    --  File and Path name of a spec or body.
55
56    type File_Names_Data is array (Spec_Or_Body) of File_Name_Data;
57
58    type Unit_Id is new Nat;
59    No_Unit : constant Unit_Id := 0;
60    type Unit_Data is record
61       Name       : Name_Id    := No_Name;
62       File_Names : File_Names_Data;
63    end record;
64    --  File and Path names of a unit, with a reference to its
65    --  GNAT Project File.
66
67    package Units is new Table.Table
68      (Table_Component_Type => Unit_Data,
69       Table_Index_Type     => Unit_Id,
70       Table_Low_Bound      => 1,
71       Table_Initial        => 100,
72       Table_Increment      => 100,
73       Table_Name           => "Prj.Com.Units");
74
75    type Header_Num is range 0 .. 2047;
76
77    function Hash is new GNAT.HTable.Hash (Header_Num => Header_Num);
78
79    function Hash (Name : Name_Id) return Header_Num;
80
81    function Hash (Name : String_Id) return Header_Num;
82
83    package Units_Htable is new GNAT.HTable.Simple_HTable
84      (Header_Num => Header_Num,
85       Element    => Unit_Id,
86       No_Element => No_Unit,
87       Key        => Name_Id,
88       Hash       => Hash,
89       Equal      => "=");
90
91 end Prj.Com;