OSDN Git Service

Delete all lines containing "$Revision:".
[pf3gnuchains/gcc-fork.git] / gcc / ada / prj-attr.ads
1 ------------------------------------------------------------------------------
2 --                                                                          --
3 --                         GNAT COMPILER COMPONENTS                         --
4 --                                                                          --
5 --                              P R J . A T T R                             --
6 --                                                                          --
7 --                                 S p e c                                  --
8 --                                                                          --
9 --                                                                          --
10 --             Copyright (C) 2001 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 -- It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). --
25 --                                                                          --
26 ------------------------------------------------------------------------------
27
28 --  This package defines allowed packages and attributes in GNAT project files
29
30 with Types; use Types;
31 with Table;
32
33 package Prj.Attr is
34
35    --  Define the allowed attributes
36
37    --  All these declarations are uncommented, they all need comments ???
38
39    Attributes_Initial   : constant := 50;
40    Attributes_Increment : constant := 50;
41
42    Attribute_Node_Low_Bound  : constant := 0;
43    Attribute_Node_High_Bound : constant := 099_999_999;
44
45    type Attribute_Node_Id is
46      range Attribute_Node_Low_Bound .. Attribute_Node_High_Bound;
47
48    First_Attribute_Node_Id : constant Attribute_Node_Id :=
49                                Attribute_Node_Low_Bound;
50
51    Empty_Attribute : constant Attribute_Node_Id :=
52                        Attribute_Node_Low_Bound;
53
54    type Attribute_Kind is
55      (Single,
56       Associative_Array,
57       Case_Insensitive_Associative_Array);
58
59    type Attribute_Record is record
60       Name     : Name_Id;
61       Kind_1   : Variable_Kind;
62       Kind_2   : Attribute_Kind;
63       Next     : Attribute_Node_Id;
64    end record;
65
66    package Attributes is
67       new Table.Table (Table_Component_Type => Attribute_Record,
68                        Table_Index_Type     => Attribute_Node_Id,
69                        Table_Low_Bound      => First_Attribute_Node_Id,
70                        Table_Initial        => Attributes_Initial,
71                        Table_Increment      => Attributes_Increment,
72                        Table_Name           => "Prj.Attr.Attributes");
73
74    Attribute_First : constant Attribute_Node_Id := First_Attribute_Node_Id + 1;
75
76    --  Define the allowed packages
77
78    Packages_Initial   : constant := 10;
79    Packages_Increment : constant := 10;
80
81    Package_Node_Low_Bound  : constant := 0;
82    Package_Node_High_Bound : constant := 099_999_999;
83
84    type Package_Node_Id is
85      range Package_Node_Low_Bound .. Package_Node_High_Bound;
86
87    First_Package_Node_Id : constant Package_Node_Id :=
88                              Package_Node_Low_Bound;
89
90    Empty_Package : constant Package_Node_Id := Package_Node_Low_Bound;
91
92    type Package_Record is record
93       Name            : Name_Id;
94       First_Attribute : Attribute_Node_Id;
95    end record;
96
97    package Package_Attributes is
98       new Table.Table (Table_Component_Type => Package_Record,
99                        Table_Index_Type     => Package_Node_Id,
100                        Table_Low_Bound      => First_Package_Node_Id,
101                        Table_Initial        => Packages_Initial,
102                        Table_Increment      => Packages_Increment,
103                        Table_Name           => "Prj.Attr.Packages");
104
105    Package_First : constant Package_Node_Id := Package_Node_Low_Bound + 1;
106
107    procedure Initialize;
108    --  Initialize the two tables above (Attributes and Package_Attributes).
109    --  This procedure should be called by Prj.Initialize.
110
111 end Prj.Attr;