root/trunk/tendra/src/producers/ada/spec/SI99-0009-1.TXT

Revision 2582, 5.4 kB (checked in by maxr, 3 years ago)

ada-2005: add box to array/record aggregates (SI99-0009-1)

  • Property svn:eol-style set to native
Line 
1 !standard 3.9.17                                      07-06-15  SI99-0009-1/04
2 !standard 17.1
3 !standard 17.20
4 !class binding interpretation 06-04-20
5 !status ARG Approved  11-0-0  07-06-02
6 !status work item 06-04-20
7 !status received 06-02-13
8 !priority High
9 !difficulty Easy
10 !qualifier Omission
11 !subject Handle new aggregate features
12
13 !summary
14
15 Update the semantics of Asis.Expressions.Component_Expression
16 to handle this new association.
17
18 !question
19
20 The Amendment (Ada 2005) defines a new record and array component association with a box;
21 should ASIS be updated to correctly return these and associated expressions? (Yes.)
22
23 !recommendation
24
25 (See summary.)
26
27 !wording
28
29 Add A_Box_Expression after Not_An_Expression to type Expression_Kinds -- ASIS 3.9.17
30
31     A_Box_Expression, -- 4.3.1(4), 4.3.3(3,6)
32
33 Add the following to the end bulleted list in ASIS section 17.1 (also, correct the penultimate
34 bullet to end with a period rather than a semicolon):
35
36     * A_Box_Expression returned by Component_Expression applied to an unnormalized
37       record association.
38
39     AASIS Note: This is necessary as the <> of an unnnormalized record association
40     may represent several components of different types. If the record association
41     is normalized, it has a single component and the type of A_Box_Expression is
42     that of the component. Similarly, the type of A_Box_Expression for an array
43     association is that of the component type.
44
45 Add the following to ASIS section 17.20 (Component_Expression), just before
46 "Appropriate Association Kinds"
47
48
49     For An_Array_Component_Association and non-normalized
50     A_Record_Component_Association where the association contains a
51     box expression, Asis.Expressions.Component_Expression
52     returns A_Box_Expression.
53
54     For a normalized A_Record_Component_Association, where the association
55     contains a a box expression, if the corresponding record type that
56     contains this component contains a default expression,
57     Asis.Expressions.Component_Expression returns this default
58     expression, otherwise Asis.Expressions.Component_Expression
59     returns A_Box_Expression.
60
61
62 !discussion
63
64 The appendix has the original proposal from Sergey Rybin on this topic.
65 At the Porto meeting it was decided that adding a A_Box_Expression to the
66 Expression_Kinds would better address this language feature, and would
67 avoid the problem of a Nil_Element being returned unnecessarily.
68
69 !appendix
70
71 Subject: Summary of the proposals for updating the ASIS Standard for Ada 2005
72 From: Sergey I. Rybin
73 Date: Mon, 13 Feb 2006 13:55:06 +0300
74
75 Formally the ASIS revision process is supposed to be started only after
76 finishing all the technical work with the new revision of the Ada Standard,
77 but I think we can start some preliminary technical work with new ASIS
78 definition already now (all the changes in Ada definition are stable
79 enough to start the ASIS revision).
80
81 At AdaCore we have developed a draft version of the new ASIS specification
82 and most of the proposed changes are already implemented in the latest
83 version of GNAT/ASIS technology. The attached file contains the summary
84 of the changes in the ASIS Standard we have made to adopt the new Ada
85 features. The interesting thing I've realized when working on
86 our draft of the new ASIS specification is that if we would like
87 to keep the upward compatibility as much as possible and if we
88 would like to keep changes as small as possible,
89 the new Ada definition gives us very limited freedom in making changes
90 in the ASIS spec. It does not mean that we think that our proposals
91 are the only possible solution for ASIS 2005, but it gives us some
92 hope that we can do ASIS revision for Ada 2005 fast enough.
93
94 There is quite a natural mapping of the proposed changes in the ASIS
95 specification onto the existing set of Ada Issues used for Ada revision,
96 and the attached file is structured and ordered by AIs. The only
97 exception is the new values in the ASIS Element Classification needed
98 to represent the new Ada 2005 predefined attributes and pragmas (of course,
99 this could be also mapped onto AIs, but I do not think that it would make
100 sense, because this is the easiest and completely straightforward part
101 of the ASIS revision).
102
103 My main goal of sending this ASIS 2005 Draft summary is to start
104 the ASIS 2005 discussion. The document itself would hardly be a convenient
105 background for this discussion - we will have at least split it on
106 changes related to different language issues, we will also have to
107 find a way for documenting the revision discussion, probably we
108 may need a separate mailing list for it. But let's get started!
109
110 Sergey Rybin
111
112
113 .....
114
115 --------------------------------
116 -- AI-287 Boxes in aggregates --
117 --------------------------------
118 RM-06 4.3.1, 4.3.3
119
120 * Define the semantics of An_Array_Component_Association and
121   A_Record_Component_Association for the case if the argument association
122   contains a box:
123
124   - for An_Array_Component_Association and non-normalized
125     A_Record_Component_Association Asis.Expressions.Component_Expression
126     returns Nil_Element;
127
128   - for Is_Normalized A_Record_Component_Association, in case if the
129     corresponding record type contains for this component the default
130     expression, Asis.Expressions.Component_Expression returns this default
131     expression, and Asis.Expressions.Is_Defaulted_Association returns True for
132     this A_Record_Component_Association, otherwise
133     Asis.Expressions.Component_Expression returns Nil_Element
134
135 ****************************************************************
136
137
Note: See TracBrowser for help on using the browser.