1 |
281 |
jeremybenn |
------------------------------------------------------------------------------
|
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-2009, 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 3, 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 COPYING3. If not, go to --
|
19 |
|
|
-- http://www.gnu.org/licenses for a complete copy of the license. --
|
20 |
|
|
-- --
|
21 |
|
|
-- GNAT was originally developed by the GNAT team at New York University. --
|
22 |
|
|
-- Extensive contributions were provided by Ada Core Technologies Inc. --
|
23 |
|
|
-- --
|
24 |
|
|
------------------------------------------------------------------------------
|
25 |
|
|
|
26 |
|
|
-- This package contains data and functions used to determine if a given
|
27 |
|
|
-- unit is an internal unit intended only for use by the implementation
|
28 |
|
|
-- and which should not be directly WITH'ed by user code. It also checks
|
29 |
|
|
-- for Ada 05 units that should only be WITH'ed in Ada 05 mode.
|
30 |
|
|
|
31 |
|
|
with Types; use Types;
|
32 |
|
|
|
33 |
|
|
package Impunit is
|
34 |
|
|
|
35 |
|
|
type Kind_Of_Unit is
|
36 |
|
|
(Implementation_Unit,
|
37 |
|
|
-- Unit from predefined library intended to be used only by the
|
38 |
|
|
-- compiler generated code, or from the implementation of the run time.
|
39 |
|
|
-- Use of such a unit generates a warning unless the client is compiled
|
40 |
|
|
-- with the -gnatg switch. If we are being super strict, this should be
|
41 |
|
|
-- an error for the case of Ada units, but that seems over strenuous.
|
42 |
|
|
|
43 |
|
|
Not_Predefined_Unit,
|
44 |
|
|
-- This is not a predefined unit, so no checks are needed
|
45 |
|
|
|
46 |
|
|
Ada_95_Unit,
|
47 |
|
|
-- This unit is defined in the Ada 95 RM, and can be freely with'ed
|
48 |
|
|
-- in both Ada 95 mode and Ada 05 mode. Note that in Ada 83 mode, no
|
49 |
|
|
-- child units are allowed, so you can't even name such a unit.
|
50 |
|
|
|
51 |
|
|
Ada_05_Unit);
|
52 |
|
|
-- This unit is defined in the Ada 05 RM. Withing this unit from a
|
53 |
|
|
-- Ada 95 mode program will generate a warning (again, strictly speaking
|
54 |
|
|
-- this should be an error, but that seems over-strenuous).
|
55 |
|
|
|
56 |
|
|
function Get_Kind_Of_Unit (U : Unit_Number_Type) return Kind_Of_Unit;
|
57 |
|
|
-- Given the unit number of a unit, this function determines the type
|
58 |
|
|
-- of the unit, as defined above. If the result is Implementation_Unit,
|
59 |
|
|
-- then the name of a possible atlernative equivalent unit is placed in
|
60 |
|
|
-- Error_Msg_String/Slen on return. If there is no alternative name, or
|
61 |
|
|
-- if the result is not Implementation_Unit, then Error_Msg_Slen is zero
|
62 |
|
|
-- on return, indicating that no alternative name was found.
|
63 |
|
|
|
64 |
|
|
function Is_Known_Unit (Nam : Node_Id) return Boolean;
|
65 |
|
|
-- Nam is the possible name of a child unit, represented as a selected
|
66 |
|
|
-- component node. This function determines whether the name matches
|
67 |
|
|
-- one of the known library units, and if so, returns True. If the name
|
68 |
|
|
-- does not match any known library unit, False is returned.
|
69 |
|
|
|
70 |
|
|
end Impunit;
|