1------------------------------------------------------------------------------ 2-- -- 3-- GNAT COMPILER COMPONENTS -- 4-- -- 5-- S E M _ C H 7 -- 6-- -- 7-- S p e c -- 8-- -- 9-- Copyright (C) 1992-2013, 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 26with Types; use Types; 27 28package Sem_Ch7 is 29 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); 34 35 procedure Analyze_Package_Body_Contract (Body_Id : Entity_Id); 36 -- Analyze all delayed aspects chained on the contract of package body 37 -- Body_Id as if they appeared at the end of a declarative region. The 38 -- aspects that are considered are: 39 -- Refined_State 40 41 procedure Analyze_Package_Contract (Pack_Id : Entity_Id); 42 -- Analyze all delayed aspects chained on the contract of package Pack_Id 43 -- as if they appeared at the end of a declarative region. The aspects 44 -- that are considered are: 45 -- Initial_Condition 46 -- Initializes 47 -- Part_Of 48 49 procedure End_Package_Scope (P : Entity_Id); 50 -- Calls Uninstall_Declarations, and then pops the scope stack 51 52 procedure Exchange_Declarations (Id : Entity_Id); 53 -- Exchange private and full declaration on entry/exit from a package 54 -- declaration or body. The semantic links of the respective nodes 55 -- are preserved in the exchange. 56 57 procedure Install_Visible_Declarations (P : Entity_Id); 58 procedure Install_Private_Declarations (P : Entity_Id); 59 60 -- On entrance to a package body, make declarations in package spec 61 -- immediately visible. 62 -- 63 -- When compiling the body of a package, both routines are called in 64 -- succession. When compiling the body of a child package, the call 65 -- to Install_Private_Declaration is immediate for private children, 66 -- but is deferred until the compilation of the private part of the 67 -- child for public child packages. 68 69 function Unit_Requires_Body 70 (P : Entity_Id; 71 Ignore_Abstract_State : Boolean := False) return Boolean; 72 -- Check if a unit requires a body. A specification requires a body if it 73 -- contains declarations that require completion in a body. If the flag 74 -- Ignore_Abstract_State is set True, then the test for a non-null abstract 75 -- state (which normally requires a body) is not carried out. This allows 76 -- the use of this routine to tell if there is some other reason that a 77 -- body is required (as is required for analyzing Abstract_State). This 78 -- is not currently used, but may be useful in future if we implement a 79 -- compatibility mode which warns about possible incompatibilities if a 80 -- SPARK 2014 program is compiled with a SPARK-unaware compiler. 81 82 procedure May_Need_Implicit_Body (E : Entity_Id); 83 -- If a package declaration contains tasks or RACWs and does not require 84 -- a body, create an implicit body at the end of the current declarative 85 -- part to activate those tasks or contain the bodies for the RACW 86 -- calling stubs. 87 88 procedure New_Private_Type (N : Node_Id; Id : Entity_Id; Def : Node_Id); 89 -- Common processing for private type declarations and for formal private 90 -- type declarations. For private types, N and Def are the type declaration 91 -- node; for formal private types, Def is the formal type definition. 92 93 procedure Uninstall_Declarations (P : Entity_Id); 94 -- At the end of a package declaration or body, declarations in the visible 95 -- part are no longer immediately visible, and declarations in the private 96 -- part are not visible at all. For inner packages, place visible entities 97 -- at the end of their homonym chains. For compilation units, make 98 -- all entities invisible. In both cases, exchange private and visible 99 -- declarations to restore order of elaboration. 100 101end Sem_Ch7; 102