OSDN Git Service

New Language: Ada
[pf3gnuchains/gcc-fork.git] / gcc / ada / sem_ch7.ads
1 ------------------------------------------------------------------------------
2 --                                                                          --
3 --                         GNAT COMPILER COMPONENTS                         --
4 --                                                                          --
5 --                              S E M _ C H 7                               --
6 --                                                                          --
7 --                                 S p e c                                  --
8 --                                                                          --
9 --                            $Revision: 1.19 $                             --
10 --                                                                          --
11 --        Copyright (C) 1992,1993,1994 Free Software Foundation, Inc.       --
12 --                                                                          --
13 -- GNAT is free software;  you can  redistribute it  and/or modify it under --
14 -- terms of the  GNU General Public License as published  by the Free Soft- --
15 -- ware  Foundation;  either version 2,  or (at your option) any later ver- --
16 -- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
17 -- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
18 -- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License --
19 -- for  more details.  You should have  received  a copy of the GNU General --
20 -- Public License  distributed with GNAT;  see file COPYING.  If not, write --
21 -- to  the Free Software Foundation,  59 Temple Place - Suite 330,  Boston, --
22 -- MA 02111-1307, USA.                                                      --
23 --                                                                          --
24 -- GNAT was originally developed  by the GNAT team at  New York University. --
25 -- It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). --
26 --                                                                          --
27 ------------------------------------------------------------------------------
28
29 with Types; use Types;
30 package Sem_Ch7  is
31
32    procedure Analyze_Package_Body                       (N : Node_Id);
33    procedure Analyze_Package_Declaration                (N : Node_Id);
34    procedure Analyze_Package_Specification              (N : Node_Id);
35    procedure Analyze_Private_Type_Declaration           (N : Node_Id);
36
37    procedure End_Package_Scope (P : Entity_Id);
38    --  Calls Uninstall_Declarations, and then pops the scope stack.
39
40    procedure Exchange_Declarations (Id : Entity_Id);
41    --  Exchange private and full declaration on entry/exit from a package
42    --  declaration or body. The semantic links of the respective nodes
43    --  are preserved in the exchange.
44
45    procedure Install_Visible_Declarations (P : Entity_Id);
46    procedure Install_Private_Declarations (P : Entity_Id);
47
48    --  On entrance to a package body, make declarations in package spec
49    --  immediately visible.
50
51    --  When compiling the body of a package,  both routines are called in
52    --  succession. When compiling the body of a child package, the call
53    --  to Install_Private_Declaration is immediate for private children,
54    --  but is deffered until the compilation of the  private part of the
55    --  child for public child packages.
56
57    procedure Install_Package_Entity (Id : Entity_Id);
58    --  Basic procedure for the previous two. Places one entity on its
59    --  visibility chain, and recurses on the visible part if the entity
60    --  is an inner package.
61
62    function Unit_Requires_Body (P : Entity_Id) return Boolean;
63    --  Check if a unit requires a body. A specification requires a body
64    --  if it contains declarations that require completion in a body.
65
66    procedure May_Need_Implicit_Body (E : Entity_Id);
67    --  If a package declaration contains tasks and does not require a
68    --  body, create an implicit body at the end of the current declarative
69    --  part to activate those tasks.
70
71    function Is_Fully_Visible (Type_Id : Entity_Id) return Boolean;
72    --  Indicates whether the Full Declaration of a private type is visible.
73
74    procedure New_Private_Type (N : Node_Id; Id : Entity_Id; Def : Node_Id);
75    --  Common processing for private type declarations and for formal
76    --  private type declarations. For private types, N and Def are the type
77    --  declaration node; for formal private types, Def is the formal type
78    --  definition.
79
80    procedure Uninstall_Declarations (P : Entity_Id);
81    --  At the end of a package declaration or body, declarations in the
82    --  visible part are no longer immediately visible, and declarations in
83    --  the private part are not visible at all. For inner packages, place
84    --  visible entities at the end of their homonym chains. For compilation
85    --  units, make all entities invisible. In both cases, exchange private
86    --  and visible declarations to restore order of elaboration.
87 end Sem_Ch7;