/usr/share/ada/adainclude/asis/asis-limited_views.ads is in libasis2014-dev 2014-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 | ------------------------------------------------------------------------------
-- --
-- ASIS-for-GNAT INTERFACE COMPONENTS --
-- --
-- A S I S . L I M I T E D _ V I E W S --
-- --
-- S p e c --
-- --
-- Copyright (C) 2010-2013, Free Software Foundation, Inc. --
-- --
-- This specification is added to be used together with the Ada Semantic --
-- Interface Specification Standard (ISO/IEC 15291) for use with GNAT. --
-- --
-- ASIS-for-GNAT is free software; you can redistribute it and/or modify it --
-- under terms of the GNU General Public License as published by the Free --
-- Software Foundation; either version 2, or (at your option) any later --
-- version. ASIS-for-GNAT is distributed in the hope that it will be use- --
-- ful, but WITHOUT ANY WARRANTY; without even the implied warranty of MER- --
-- CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General --
-- Public License for more details. You should have received a copy of the --
-- GNU General Public License distributed with ASIS-for-GNAT; see file --
-- COPYING. If not, write to the Free Software Foundation, 51 Franklin --
-- Street, Fifth Floor, Boston, MA 02110-1301, USA. --
-- --
-- --
-- --
-- --
-- --
-- --
-- --
-- --
-- ASIS-for-GNAT was originally developed by the ASIS-for-GNAT team at the --
-- Software Engineering Laboratory of the Swiss Federal Institute of --
-- Technology (LGL-EPFL) in Lausanne, Switzerland, in cooperation with the --
-- Scientific Research Computer Center of Moscow State University (SRCC --
-- MSU), Russia, with funding partially provided by grants from the Swiss --
-- National Science Foundation and the Swiss Academy of Engineering --
-- Sciences. ASIS-for-GNAT is now maintained by AdaCore --
-- (http://www.adacore.com). --
-- --
------------------------------------------------------------------------------
package Asis.Limited_Views is
-- This package addresses the issue of limited view that is a consequence of
-- adding 'limited with' clause to Ada 2005. It tries to follow as close as
-- possible the notion of a limited view as it is defined in 10.1.1 (12).
--
-- Here is a summary of the problems an ASIS application may have with limited
-- views. Consider we have an ASIS Context that contains the following units:
--
-- package P is
-- type T is tagged record
-- ...
-- end record;
-- end P;
-- limited with P;
-- package Q is
-- type Access_T is access P.T;
-- end Q;
--
-- An application can apply Corresponding_Name_Declaration (or
-- Corresponding_Name_Definition) to An_Identifier Element denoting the
-- reference to T in Compilation Unit Q. According to Ada 2005 Standard, the
-- result should be a (tagged) limited view of the type P.T. An application
-- may also apply these Corresponding_Name_Declaration/
-- Corresponding_Name_Definition queries to An_Identifier Element that denotes
-- the reference to P in the Compilation Unit Q, and according to the Ada 2005
-- standard, the result should be the limited view of the package P. An
-- application should have the possibility to check if some
-- An_Incomplete_Type_Declaration or A_Tagged_Incomplete_Type_Declaration or
-- A_Package_Declaration Element is actually a limited view (and some
-- A_Defining_Identifier Element is a component of a type or a package
-- limited view). This may be important because of various reasons: according
-- to the Ada 2005 Standard, limited views do not have syntax representations
-- and they are implicit, so Asis.Text queries cannot be applied to them;
-- Traverse_Element cannot work on limited views (??? it just does not have
-- very much sense!) etc.
--
-- An application can start from compilation unit P. For the example given
-- above, P has only its limited view in the given Context, so the
-- possibilities of its structural decomposition are limited by the properties
-- that Ada Standard defines for limited views. So an application may want
-- to know if for a given compilation unit only its limited view is available
-- in the given Context.
--
-- Finally, if Corresponding_Name_Declaration/Corresponding_Name_Definition
-- returns a limited type/package view (or a defining identifier from it,
-- an application may want to go to the corresponding non-limited view (if
-- possible, that is, if for the corresponding enclosing compilation unit not
-- only its limited view is available).
--
-- The interface proposed below tries to address all these application needs.
function Has_Limited_View_Only
(Right : Asis.Compilation_Unit)
return Boolean;
-- Checks if the argument unit in a given Context has a limited view
-- only. All Compilation_Unit_Kinds are expected.
--
-- For the moment, works correctly only for an ASIS Context based on a
-- single tree.
function Is_From_Limited_View (D : Asis.Element) return Boolean;
-- Checks if the argument is a (part of a) limited view. Returns False for
-- any unexpected Element.
--
-- Expected Defining_Names kinds:
-- A_Defining_Identifier
--
-- Expected Declaration_Kinds:
-- An_Incomplete_Type_Declaration
-- A_Tagged_Incomplete_Type_Declaration
-- A_Package_Declaration
function Get_Nonlimited_View (D : Asis.Element) return Asis.Element;
-- If Is_From_Limited_View (D), returns the corresponding full view of the
-- argument in case if
-- not Has_Limited_View_Only (Enclosing_Compilation_Unit (D)), otherwise
-- returns Nil_Element. Raises Asis_Inappropriate_Element if
-- not Is_From_Limited_View (D).
--------------------------------------------
-- Limited view and Standard ASIS Queries --
--------------------------------------------
-- If A_Declaration Element Is_From_Limited_View, and if it represents a
-- limited view of a type, it can be of An_Incomplete_Type_Declaration or
-- A_Tagged_Incomplete_Type_Declaration Kind only.
---------------------
-- Asis.Elements: --
---------------------
-- * if Has_Limited_View_Only (CU), then:
-- - Unit_Declaration (CU) returns the result that Is_From_Limited_View;
--
-- - Context_Clause_Elements (CU) returns Nil_Element_LIst;
--
-- - Compilation_Pragmas (CU) returns Nil_Element_List;
--
-- * if Is_From_Limited_View (E) then:
-- - Enclosing_Element is also Is_From_Limited_View;
-----------------------
-- Asis.Declarations --
-----------------------
-- * If A_Package_Declaration Element Is_From_Limited_View, then for this
-- Element:
--
-- - Visible_Part_Declarative_Items returns only artificial type and
-- local package declarations that all Is_From_Limited_View;
--
-- - Is_Private_Present always returns False;
--
-- - Private_Part_Declarative_Items always returns Nil_Element_List;
--
-- * if A_Declaration Element Is_From_Limited_View, then for this Element:
-- - Names return a list containing a single Is_From_Limited_View
-- Element
--
-- * if A_Defining_Expanded_Name Element Is_From_Limited_View, then for
-- this Element:
-- - Defining_Prefix returns Is_From_Limited_View result;
--
-- - Defining_Selector returns Is_From_Limited_View result;
----------------------
-- Asis.Expressions --
----------------------
-- * If An_Identifier Element Is_From_Limited_View, then for this element:
--
-- - Corresponding_Name_Definition returns Nil_Element;
--
-- - Corresponding_Name_Definition_List returns Nil_Element_List;
--
-- - Corresponding_Name_Declaration returns Nil_Element;
end Asis.Limited_Views;
|