1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
9 -- Copyright (C) 2001-2002 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 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. --
22 -- GNAT was originally developed by the GNAT team at New York University. --
23 -- Extensive contributions were provided by Ada Core Technologies Inc. --
25 ------------------------------------------------------------------------------
27 -- This package defines allowed packages and attributes in GNAT project files
29 with Types
; use Types
;
34 -- Define the allowed attributes
36 -- All these declarations are uncommented, they all need comments ???
38 Attributes_Initial
: constant := 50;
39 Attributes_Increment
: constant := 50;
41 Attribute_Node_Low_Bound
: constant := 0;
42 Attribute_Node_High_Bound
: constant := 099_999_999
;
44 type Attribute_Node_Id
is
45 range Attribute_Node_Low_Bound
.. Attribute_Node_High_Bound
;
47 First_Attribute_Node_Id
: constant Attribute_Node_Id
:=
48 Attribute_Node_Low_Bound
+ 1;
50 Empty_Attribute
: constant Attribute_Node_Id
:=
51 Attribute_Node_Low_Bound
;
53 type Attribute_Kind
is
56 Case_Insensitive_Associative_Array
);
58 type Attribute_Record
is record
60 Kind_1
: Variable_Kind
;
61 Kind_2
: Attribute_Kind
;
62 Next
: Attribute_Node_Id
;
66 new Table
.Table
(Table_Component_Type
=> Attribute_Record
,
67 Table_Index_Type
=> Attribute_Node_Id
,
68 Table_Low_Bound
=> First_Attribute_Node_Id
,
69 Table_Initial
=> Attributes_Initial
,
70 Table_Increment
=> Attributes_Increment
,
71 Table_Name
=> "Prj.Attr.Attributes");
73 Attribute_First
: constant Attribute_Node_Id
:= First_Attribute_Node_Id
;
75 -- Define the allowed packages
77 Packages_Initial
: constant := 10;
78 Packages_Increment
: constant := 50;
80 Package_Node_Low_Bound
: constant := 0;
81 Package_Node_High_Bound
: constant := 099_999_999
;
83 type Package_Node_Id
is
84 range Package_Node_Low_Bound
.. Package_Node_High_Bound
;
86 First_Package_Node_Id
: constant Package_Node_Id
:=
87 Package_Node_Low_Bound
+ 1;
89 Empty_Package
: constant Package_Node_Id
:= Package_Node_Low_Bound
;
91 type Package_Record
is record
93 First_Attribute
: Attribute_Node_Id
;
96 package Package_Attributes
is
97 new Table
.Table
(Table_Component_Type
=> Package_Record
,
98 Table_Index_Type
=> Package_Node_Id
,
99 Table_Low_Bound
=> First_Package_Node_Id
,
100 Table_Initial
=> Packages_Initial
,
101 Table_Increment
=> Packages_Increment
,
102 Table_Name
=> "Prj.Attr.Packages");
104 Package_First
: constant Package_Node_Id
:= First_Package_Node_Id
;
106 procedure Initialize
;
107 -- Initialize the two tables above (Attributes and Package_Attributes).
108 -- This procedure should be called by Prj.Initialize.