| 1 |
!standard 3.9.10 06-12-14 SI99-0006-1/03 |
|---|
| 2 |
!standard 3.9.11 |
|---|
| 3 |
!standard 3.9.15 |
|---|
| 4 |
!standard 15.51 |
|---|
| 5 |
!standard 16.19 |
|---|
| 6 |
!class binding interpretation 06-04-10 |
|---|
| 7 |
!status ARG Approved 8-0-1 06-06-09 |
|---|
| 8 |
!status work item 06-04-10 |
|---|
| 9 |
!status received 06-02-13 |
|---|
| 10 |
!priority High |
|---|
| 11 |
!difficulty Easy |
|---|
| 12 |
!qualifier Omission |
|---|
| 13 |
!subject Add new An_Interface_Type_Definition to Type_Kinds. |
|---|
| 14 |
|
|---|
| 15 |
!summary |
|---|
| 16 |
|
|---|
| 17 |
Interface Types, their various kinds and access to their kinds needs to |
|---|
| 18 |
be added to ASIS. |
|---|
| 19 |
|
|---|
| 20 |
!question |
|---|
| 21 |
|
|---|
| 22 |
The Amendment (Ada 2005) defines new Interface types, should these be |
|---|
| 23 |
Asis.Type_Kinds? (Yes) |
|---|
| 24 |
|
|---|
| 25 |
!recommendation |
|---|
| 26 |
|
|---|
| 27 |
(See summary.) |
|---|
| 28 |
|
|---|
| 29 |
!wording |
|---|
| 30 |
|
|---|
| 31 |
In clause 3.9.10, add An_Interface_Type_Definition after A_Tagged_Record_Type_Definition |
|---|
| 32 |
in Type_Kinds: |
|---|
| 33 |
|
|---|
| 34 |
An_Interface_Type_Definition, -- 3.9.4 (2) |
|---|
| 35 |
|
|---|
| 36 |
In clause 3.9.11, add A_Formal_Interface_Type_Definition to the end of Formal_Type_Kinds: |
|---|
| 37 |
|
|---|
| 38 |
A_Formal_Interface_Type_Definition, -- 12.5.5 (2) |
|---|
| 39 |
|
|---|
| 40 |
Correct the section references for A_Formal_Access_Type_Definition to 12.5.4(2); |
|---|
| 41 |
A_Formal_Unconstrained_Array_Definition to 12.5.3(2), 3.6(3); and |
|---|
| 42 |
A_Formal_Constrained_Array_Definition to 12.5.3(2), 3.6(5). |
|---|
| 43 |
|
|---|
| 44 |
Add a new clause after 3.9.15: |
|---|
| 45 |
|
|---|
| 46 |
3.9.xx type Interface_Types |
|---|
| 47 |
|
|---|
| 48 |
type Interface_Kinds is ( -- 3.9.4 (2) |
|---|
| 49 |
|
|---|
| 50 |
Not_An_Interface, -- An unexpected element |
|---|
| 51 |
An_Ordinary_Interface, -- 3.9.4(2) interface ... |
|---|
| 52 |
A_Limited_Interface, -- 3.9.4(2) limited interface ... |
|---|
| 53 |
A_Task_Interface, -- 3.9.4(2) task interface ... |
|---|
| 54 |
A_Protected_Interface, -- 3.9.4(2) protected interface ... |
|---|
| 55 |
A_Synchronized_Interface); -- 3.9.4(2) synchronized interface ... |
|---|
| 56 |
|
|---|
| 57 |
Add a new clause after 13.17 (in ASIS.Elements): |
|---|
| 58 |
|
|---|
| 59 |
13.xx function Interface_Kind |
|---|
| 60 |
|
|---|
| 61 |
function Interface_Kind |
|---|
| 62 |
(Definition : Asis.Definition) |
|---|
| 63 |
return Asis.Interface_Kinds; |
|---|
| 64 |
|
|---|
| 65 |
Definition specifies the Definition to query. |
|---|
| 66 |
|
|---|
| 67 |
Returns the Interface_Kinds value of the Definition. |
|---|
| 68 |
|
|---|
| 69 |
Returns Not_An_Interface for any unexpected element such as a |
|---|
| 70 |
Nil_Element, A_Statement, or A_Declaration. |
|---|
| 71 |
|
|---|
| 72 |
Expected Definition_Kinds: |
|---|
| 73 |
A_Type_Definition |
|---|
| 74 |
A_Formal_Type_Definition |
|---|
| 75 |
|
|---|
| 76 |
Expected Type_Kinds: |
|---|
| 77 |
An_Interface_Type_Definition |
|---|
| 78 |
|
|---|
| 79 |
Expected Formal_Type_Kinds: |
|---|
| 80 |
A_Formal_Interface_Type_Definition |
|---|
| 81 |
|
|---|
| 82 |
Add new clause at the end of section 15 (Asis.Declarations): |
|---|
| 83 |
|
|---|
| 84 |
15.xx function Progenitor_List (Declaration) |
|---|
| 85 |
|
|---|
| 86 |
function Progenitor_List |
|---|
| 87 |
(Declaration : Asis.Definition) |
|---|
| 88 |
return Asis.Name_List; |
|---|
| 89 |
|
|---|
| 90 |
Declaration specifies the declaration to query. |
|---|
| 91 |
|
|---|
| 92 |
Returns a list of subtype marks making up the interface_list in the |
|---|
| 93 |
argument declaration, in their order of appearance. |
|---|
| 94 |
|
|---|
| 95 |
Appropriate Declaration_Kinds: |
|---|
| 96 |
A_Private_Extension_Declaration |
|---|
| 97 |
A_Private_Type_Declaration |
|---|
| 98 |
A_Task_Type_Declaration |
|---|
| 99 |
A_Protected_Type_Declaration |
|---|
| 100 |
A_Single_Task_Declaration |
|---|
| 101 |
A_Single_Protected_Declaration |
|---|
| 102 |
|
|---|
| 103 |
Returns Expression_Kinds: |
|---|
| 104 |
An_Identifier |
|---|
| 105 |
A_Selected_Component |
|---|
| 106 |
|
|---|
| 107 |
Add new clause at the end of section 16 (Asis.Definitions): |
|---|
| 108 |
|
|---|
| 109 |
16.xx function Progenitor_List (Definition) |
|---|
| 110 |
|
|---|
| 111 |
function Progenitor_List |
|---|
| 112 |
(Type_Definition : Asis.Definition) |
|---|
| 113 |
return Asis.Name_List; |
|---|
| 114 |
|
|---|
| 115 |
Type_Definition specifies the definition to query. |
|---|
| 116 |
|
|---|
| 117 |
Returns a list of subtype marks making up the interface_list in the |
|---|
| 118 |
argument definition, in their order of appearance. |
|---|
| 119 |
|
|---|
| 120 |
Appropriate Type_Kinds: |
|---|
| 121 |
A_Derived_Record_Extension_Definition |
|---|
| 122 |
An_Interface_Type_Definition |
|---|
| 123 |
|
|---|
| 124 |
Appropriate Formal_Type_Kinds: |
|---|
| 125 |
A_Formal_Derived_Type_Definition |
|---|
| 126 |
A_Formal_Interface_Type_Definition |
|---|
| 127 |
|
|---|
| 128 |
Returns Expression_Kinds: |
|---|
| 129 |
An_Identifier |
|---|
| 130 |
A_Selected_Component |
|---|
| 131 |
|
|---|
| 132 |
!discussion |
|---|
| 133 |
|
|---|
| 134 |
!appendix |
|---|
| 135 |
|
|---|
| 136 |
Subject: Summary of the proposals for updating the ASIS Standard for Ada 2005 |
|---|
| 137 |
From: Sergey I. Rybin |
|---|
| 138 |
Date: Mon, 13 Feb 2006 13:55:06 +0300 |
|---|
| 139 |
|
|---|
| 140 |
Formally the ASIS revision process is supposed to be started only after |
|---|
| 141 |
finishing all the technical work with the new revision of the Ada Standard, |
|---|
| 142 |
but I think we can start some preliminary technical work with new ASIS |
|---|
| 143 |
definition already now (all the changes in Ada definition are stable |
|---|
| 144 |
enough to start the ASIS revision). |
|---|
| 145 |
|
|---|
| 146 |
At AdaCore we have developed a draft version of the new ASIS specification |
|---|
| 147 |
and most of the proposed changes are already implemented in the latest |
|---|
| 148 |
version of GNAT/ASIS technology. The attached file contains the summary |
|---|
| 149 |
of the changes in the ASIS Standard we have made to adopt the new Ada |
|---|
| 150 |
features. The interesting thing I've realized when working on |
|---|
| 151 |
our draft of the new ASIS specification is that if we would like |
|---|
| 152 |
to keep the upward compatibility as much as possible and if we |
|---|
| 153 |
would like to keep changes as small as possible, |
|---|
| 154 |
the new Ada definition gives us very limited freedom in making changes |
|---|
| 155 |
in the ASIS spec. It does not mean that we think that our proposals |
|---|
| 156 |
are the only possible solution for ASIS 2005, but it gives us some |
|---|
| 157 |
hope that we can do ASIS revision for Ada 2005 fast enough. |
|---|
| 158 |
|
|---|
| 159 |
There is quite a natural mapping of the proposed changes in the ASIS |
|---|
| 160 |
specification onto the existing set of Ada Issues used for Ada revision, |
|---|
| 161 |
and the attached file is structured and ordered by AIs. The only |
|---|
| 162 |
exception is the new values in the ASIS Element Classification needed |
|---|
| 163 |
to represent the new Ada 2005 predefined attributes and pragmas (of course, |
|---|
| 164 |
this could be also mapped onto AIs, but I do not think that it would make |
|---|
| 165 |
sense, because this is the easiest and completely straightforward part |
|---|
| 166 |
of the ASIS revision). |
|---|
| 167 |
|
|---|
| 168 |
My main goal of sending this ASIS 2005 Draft summary is to start |
|---|
| 169 |
the ASIS 2005 discussion. The document itself would hardly be a convenient |
|---|
| 170 |
background for this discussion - we will have at least split it on |
|---|
| 171 |
changes related to different language issues, we will also have to |
|---|
| 172 |
find a way for documenting the revision discussion, probably we |
|---|
| 173 |
may need a separate mailing list for it. But let's get started! |
|---|
| 174 |
|
|---|
| 175 |
Sergey Rybin |
|---|
| 176 |
|
|---|
| 177 |
..... |
|---|
| 178 |
|
|---|
| 179 |
---------------------------- |
|---|
| 180 |
-- AI-251 Interface Types -- |
|---|
| 181 |
---------------------------- |
|---|
| 182 |
RM-06 3.9.4 |
|---|
| 183 |
|
|---|
| 184 |
* Extend existing element classification: |
|---|
| 185 |
- add An_Interface_Type_Definition to Type_Kinds; |
|---|
| 186 |
|
|---|
| 187 |
- add A_Formal_Interface_Type_Definition to Formal_Type_Kinds; |
|---|
| 188 |
|
|---|
| 189 |
- add to the package Asis the new Interface_Kinds type to classify interface |
|---|
| 190 |
definitions: |
|---|
| 191 |
|
|---|
| 192 |
type Interface_Kinds is ( -- 3.9.4 |
|---|
| 193 |
|
|---|
| 194 |
Not_An_Interface, -- An unexpected element |
|---|
| 195 |
An_Ordinary_Interface, -- interface ... |
|---|
| 196 |
A_Limited_Interface, -- limited interface ... |
|---|
| 197 |
A_Task_Interface, -- task interface ... |
|---|
| 198 |
A_Protected_Interface, -- protected interface ... |
|---|
| 199 |
A_Synchronized_Interface); -- synchronized interface ... |
|---|
| 200 |
|
|---|
| 201 |
- add new corresponding classification query to Asis.Elements: |
|---|
| 202 |
|
|---|
| 203 |
function Interface_Kind |
|---|
| 204 |
(Definition : Asis.Definition) |
|---|
| 205 |
return Asis.Interface_Kinds; |
|---|
| 206 |
------------------------------------------------------------------------------ |
|---|
| 207 |
-- Definition - Specifies the Definition to query |
|---|
| 208 |
-- |
|---|
| 209 |
-- Returns the Interface_Kinds value of the Definition. |
|---|
| 210 |
-- |
|---|
| 211 |
-- Returns Not_An_Interface for any unexpected element such as a |
|---|
| 212 |
-- Nil_Element, A_Statement, or A_Declaration. |
|---|
| 213 |
-- |
|---|
| 214 |
-- Expected Definition_Kinds: |
|---|
| 215 |
-- A_Type_Definition |
|---|
| 216 |
-- A_Formal_Type_Definition |
|---|
| 217 |
-- |
|---|
| 218 |
-- Expected Type_Kinds: |
|---|
| 219 |
-- An_Interface_Type_Definition |
|---|
| 220 |
-- |
|---|
| 221 |
-- Expected Formal_Type_Kinds: |
|---|
| 222 |
-- A_Formal_Interface_Type_Definition |
|---|
| 223 |
|
|---|
| 224 |
* Add two new structural queries - one to Asis.Declarations and another to |
|---|
| 225 |
Asis.Definitions for obtaining interface_list |
|---|
| 226 |
|
|---|
| 227 |
- Query to be added to Asis.Declarations: |
|---|
| 228 |
|
|---|
| 229 |
function Declaration_Interface_List |
|---|
| 230 |
(Declaration : Asis.Definition) |
|---|
| 231 |
return Asis.Expression_List; |
|---|
| 232 |
|
|---|
| 233 |
------------------------------------------------------------------------------ |
|---|
| 234 |
-- Declaration - Specifies the declaration to query |
|---|
| 235 |
-- |
|---|
| 236 |
-- Returns a list of subtype mark names making up the interface_list in the |
|---|
| 237 |
-- argument declaration, in their order of appearance. |
|---|
| 238 |
-- |
|---|
| 239 |
-- Appropriate Declaration_Kinds: |
|---|
| 240 |
-- A_Private_Extension_Declaration |
|---|
| 241 |
-- A_Private_Type_Declaration |
|---|
| 242 |
-- A_Task_Type_Declaration |
|---|
| 243 |
-- A_Protected_Type_Declaration |
|---|
| 244 |
-- A_Single_Task_Declaration |
|---|
| 245 |
-- A_Single_Protected_Declaration |
|---|
| 246 |
-- |
|---|
| 247 |
-- Returns Expression_Kinds: |
|---|
| 248 |
-- An_Identifier |
|---|
| 249 |
-- A_Selected_Component |
|---|
| 250 |
|
|---|
| 251 |
- Query to be added to Asis.Definitions: |
|---|
| 252 |
|
|---|
| 253 |
function Definition_Interface_List |
|---|
| 254 |
(Type_Definition : Asis.Definition) |
|---|
| 255 |
return Asis.Expression_List; |
|---|
| 256 |
|
|---|
| 257 |
------------------------------------------------------------------------------ |
|---|
| 258 |
-- Type_Definition - Specifies the definition to query |
|---|
| 259 |
-- |
|---|
| 260 |
-- Returns a list of subtype mark names making up the interface_list in the |
|---|
| 261 |
-- argument definition, in their order of appearance. |
|---|
| 262 |
-- |
|---|
| 263 |
-- Appropriate Type_Kinds: |
|---|
| 264 |
-- A_Derived_Record_Extension_Definition |
|---|
| 265 |
-- An_Interface_Type_Definition |
|---|
| 266 |
-- |
|---|
| 267 |
-- Appropriate Formal_Type_Kinds: |
|---|
| 268 |
-- A_Formal_Derived_Type_Definition |
|---|
| 269 |
-- A_Formal_Interface_Type_Definition |
|---|
| 270 |
-- |
|---|
| 271 |
-- Returns Expression_Kinds: |
|---|
| 272 |
-- An_Identifier |
|---|
| 273 |
-- A_Selected_Component |
|---|
| 274 |
|
|---|
| 275 |
**************************************************************** |
|---|
| 276 |
|
|---|