2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / ada / prj-com.ads
bloba7420447011e7b0852c75d5c46a758c511cffb08
1 ------------------------------------------------------------------------------
2 -- --
3 -- GNAT COMPILER COMPONENTS --
4 -- --
5 -- P R J . C O M --
6 -- --
7 -- S p e c --
8 -- --
9 -- Copyright (C) 2000-2003 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, 59 Temple Place - Suite 330, Boston, --
20 -- MA 02111-1307, USA. --
21 -- --
22 -- GNAT was originally developed by the GNAT team at New York University. --
23 -- Extensive contributions were provided by Ada Core Technologies Inc. --
24 -- --
25 ------------------------------------------------------------------------------
27 -- The following package declares data types for GNAT project.
28 -- These data types are used in the bodies of the Prj hierarchy.
30 with GNAT.HTable;
31 with Osint;
32 with Table;
33 with Types; use Types;
35 package Prj.Com is
37 -- At one point, this package was private.
38 -- It cannot be private, because it is used outside of
39 -- the Prj hierarchy.
41 type Fail_Proc is access procedure
42 (S1 : String; S2 : String := ""; S3 : String := "");
44 Fail : Fail_Proc := Osint.Fail'Access;
45 -- This procedure is used in the project facility, instead of
46 -- directly calling Osint.Fail.
47 -- It may be specified by tools to do clean up before calling
48 -- Osint.Fail, or to simply report an error and return.
50 Tool_Name : Name_Id := No_Name;
52 Current_Verbosity : Verbosity := Default;
54 type Spec_Or_Body is
55 (Specification, Body_Part);
57 type File_Name_Data is record
58 Name : Name_Id := No_Name;
59 Display_Name : Name_Id := No_Name;
60 Path : Name_Id := No_Name;
61 Display_Path : Name_Id := No_Name;
62 Project : Project_Id := No_Project;
63 Needs_Pragma : Boolean := False;
64 end record;
65 -- File and Path name of a spec or body.
67 type File_Names_Data is array (Spec_Or_Body) of File_Name_Data;
69 type Unit_Id is new Nat;
70 No_Unit : constant Unit_Id := 0;
71 type Unit_Data is record
72 Name : Name_Id := No_Name;
73 File_Names : File_Names_Data;
74 end record;
75 -- File and Path names of a unit, with a reference to its
76 -- GNAT Project File.
78 package Units is new Table.Table
79 (Table_Component_Type => Unit_Data,
80 Table_Index_Type => Unit_Id,
81 Table_Low_Bound => 1,
82 Table_Initial => 100,
83 Table_Increment => 100,
84 Table_Name => "Prj.Com.Units");
86 type Header_Num is range 0 .. 2047;
88 function Hash is new GNAT.HTable.Hash (Header_Num => Header_Num);
90 function Hash (Name : Name_Id) return Header_Num;
92 function Hash (Name : String_Id) return Header_Num;
94 package Units_Htable is new GNAT.HTable.Simple_HTable
95 (Header_Num => Header_Num,
96 Element => Unit_Id,
97 No_Element => No_Unit,
98 Key => Name_Id,
99 Hash => Hash,
100 Equal => "=");
102 end Prj.Com;