OSDN Git Service

2005-03-08 Ed Schonberg <schonberg@adacore.com>
[pf3gnuchains/gcc-fork.git] / gcc / ada / impunit.ads
1 ------------------------------------------------------------------------------
2 --                                                                          --
3 --                         GNAT COMPILER COMPONENTS                         --
4 --                                                                          --
5 --                              I M P U N I T                               --
6 --                                                                          --
7 --                                 S p e c                                  --
8 --                                                                          --
9 --          Copyright (C) 2000-2005 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 contains data and functions used to determine if a given
28 --  unit is an internal unit intended only for use by the implementation
29 --  and which should not be directly WITH'ed by user code. It also checks
30 --  for Ada 05 units that should only be WITH'ed in Ada 05 mode.
31
32 with Types; use Types;
33
34 package Impunit is
35
36    type Kind_Of_Unit is
37      (Implementation_Unit,
38       --  Unit from predefined library intended to be used only by the
39       --  compiler generated code, or from the implementation of the run time.
40       --  Use of such a unit generates a warning unless the client is compiled
41       --  with the -gnatg switch. If we are being super strict, this should be
42       --  an error for the case of Ada units, but that seems over strenuous.
43
44       Not_Predefined_Unit,
45       --  This is not a predefined unit, so no checks are needed
46
47       Ada_95_Unit,
48       --  This unit is defined in the Ada 95 RM, and can be freely with'ed
49       --  in both Ada 95 mode and Ada 05 mode. Note that in Ada 83 mode, no
50       --  child units are allowed, so you can't even name such a unit.
51
52       Ada_05_Unit);
53    --  This unit is defined in the Ada 05 RM. Withing this unit from a
54    --  Ada 95 mode program will generate a warning (again, strictly speaking
55    --  this should be an error, but that seems over-strenuous).
56
57    function Get_Kind_Of_Unit (U : Unit_Number_Type) return Kind_Of_Unit;
58    --  Given the unit number of a unit, this function determines the type
59    --  of the unit, as defined above.
60
61 end Impunit;