OSDN Git Service

* configure.frag: Delete file.
[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 --             Copyright (C) 2001 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 ------------------------------------------------------------------------------
26
27 --  This package defines allowed packages and attributes in GNAT project files
28
29 with Types; use Types;
30 with Table;
31
32 package Prj.Attr is
33
34    --  Define the allowed attributes
35
36    --  All these declarations are uncommented, they all need comments ???
37
38    Attributes_Initial   : constant := 50;
39    Attributes_Increment : constant := 50;
40
41    Attribute_Node_Low_Bound  : constant := 0;
42    Attribute_Node_High_Bound : constant := 099_999_999;
43
44    type Attribute_Node_Id is
45      range Attribute_Node_Low_Bound .. Attribute_Node_High_Bound;
46
47    First_Attribute_Node_Id : constant Attribute_Node_Id :=
48                                Attribute_Node_Low_Bound;
49
50    Empty_Attribute : constant Attribute_Node_Id :=
51                        Attribute_Node_Low_Bound;
52
53    type Attribute_Kind is
54      (Single,
55       Associative_Array,
56       Case_Insensitive_Associative_Array);
57
58    type Attribute_Record is record
59       Name     : Name_Id;
60       Kind_1   : Variable_Kind;
61       Kind_2   : Attribute_Kind;
62       Next     : Attribute_Node_Id;
63    end record;
64
65    package Attributes is
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");
72
73    Attribute_First : constant Attribute_Node_Id := First_Attribute_Node_Id + 1;
74
75    --  Define the allowed packages
76
77    Packages_Initial   : constant := 10;
78    Packages_Increment : constant := 10;
79
80    Package_Node_Low_Bound  : constant := 0;
81    Package_Node_High_Bound : constant := 099_999_999;
82
83    type Package_Node_Id is
84      range Package_Node_Low_Bound .. Package_Node_High_Bound;
85
86    First_Package_Node_Id : constant Package_Node_Id :=
87                              Package_Node_Low_Bound;
88
89    Empty_Package : constant Package_Node_Id := Package_Node_Low_Bound;
90
91    type Package_Record is record
92       Name            : Name_Id;
93       First_Attribute : Attribute_Node_Id;
94    end record;
95
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");
103
104    Package_First : constant Package_Node_Id := Package_Node_Low_Bound + 1;
105
106    procedure Initialize;
107    --  Initialize the two tables above (Attributes and Package_Attributes).
108    --  This procedure should be called by Prj.Initialize.
109
110 end Prj.Attr;