1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
9 -- Copyright (C) 1992,1993,1994 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 with Types; use Types;
30 procedure Analyze_Package_Body (N : Node_Id);
31 procedure Analyze_Package_Declaration (N : Node_Id);
32 procedure Analyze_Package_Specification (N : Node_Id);
33 procedure Analyze_Private_Type_Declaration (N : Node_Id);
35 procedure End_Package_Scope (P : Entity_Id);
36 -- Calls Uninstall_Declarations, and then pops the scope stack.
38 procedure Exchange_Declarations (Id : Entity_Id);
39 -- Exchange private and full declaration on entry/exit from a package
40 -- declaration or body. The semantic links of the respective nodes
41 -- are preserved in the exchange.
43 procedure Install_Visible_Declarations (P : Entity_Id);
44 procedure Install_Private_Declarations (P : Entity_Id);
46 -- On entrance to a package body, make declarations in package spec
47 -- immediately visible.
49 -- When compiling the body of a package, both routines are called in
50 -- succession. When compiling the body of a child package, the call
51 -- to Install_Private_Declaration is immediate for private children,
52 -- but is deffered until the compilation of the private part of the
53 -- child for public child packages.
55 procedure Install_Package_Entity (Id : Entity_Id);
56 -- Basic procedure for the previous two. Places one entity on its
57 -- visibility chain, and recurses on the visible part if the entity
58 -- is an inner package.
60 function Unit_Requires_Body (P : Entity_Id) return Boolean;
61 -- Check if a unit requires a body. A specification requires a body
62 -- if it contains declarations that require completion in a body.
64 procedure May_Need_Implicit_Body (E : Entity_Id);
65 -- If a package declaration contains tasks and does not require a
66 -- body, create an implicit body at the end of the current declarative
67 -- part to activate those tasks.
69 function Is_Fully_Visible (Type_Id : Entity_Id) return Boolean;
70 -- Indicates whether the Full Declaration of a private type is visible.
72 procedure New_Private_Type (N : Node_Id; Id : Entity_Id; Def : Node_Id);
73 -- Common processing for private type declarations and for formal
74 -- private type declarations. For private types, N and Def are the type
75 -- declaration node; for formal private types, Def is the formal type
78 procedure Uninstall_Declarations (P : Entity_Id);
79 -- At the end of a package declaration or body, declarations in the
80 -- visible part are no longer immediately visible, and declarations in
81 -- the private part are not visible at all. For inner packages, place
82 -- visible entities at the end of their homonym chains. For compilation
83 -- units, make all entities invisible. In both cases, exchange private
84 -- and visible declarations to restore order of elaboration.