1------------------------------------------------------------------------------
2--                                                                          --
3--                            Matreshka Project                             --
4--                                                                          --
5--                          Ada Modeling Framework                          --
6--                                                                          --
7--                        Runtime Library Component                         --
8--                                                                          --
9------------------------------------------------------------------------------
10--                                                                          --
11-- Copyright © 2011-2012, Vadim Godunko <vgodunko@gmail.com>                --
12-- All rights reserved.                                                     --
13--                                                                          --
14-- Redistribution and use in source and binary forms, with or without       --
15-- modification, are permitted provided that the following conditions       --
16-- are met:                                                                 --
17--                                                                          --
18--  * Redistributions of source code must retain the above copyright        --
19--    notice, this list of conditions and the following disclaimer.         --
20--                                                                          --
21--  * Redistributions in binary form must reproduce the above copyright     --
22--    notice, this list of conditions and the following disclaimer in the   --
23--    documentation and/or other materials provided with the distribution.  --
24--                                                                          --
25--  * Neither the name of the Vadim Godunko, IE nor the names of its        --
26--    contributors may be used to endorse or promote products derived from  --
27--    this software without specific prior written permission.              --
28--                                                                          --
29-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS      --
30-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT        --
31-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR    --
32-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT     --
33-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,   --
34-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
35-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR   --
36-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF   --
37-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING     --
38-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS       --
39-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.             --
40--                                                                          --
41------------------------------------------------------------------------------
42--  $Revision: 2937 $ $Date: 2012-05-01 21:07:27 +0400 (Tue, 01 May 2012) $
43------------------------------------------------------------------------------
44with AMF.Internals.UML_Packageable_Elements;
45with AMF.UML.Dependencies.Collections;
46with AMF.UML.Named_Elements;
47with AMF.UML.Namespaces;
48with AMF.UML.Packages.Collections;
49with AMF.UML.Parameterable_Elements.Collections;
50with AMF.UML.String_Expressions.Collections;
51with AMF.UML.Template_Bindings.Collections;
52with AMF.UML.Template_Parameters;
53with AMF.UML.Template_Signatures;
54with AMF.UML.Types;
55with AMF.UML.Value_Specifications.Collections;
56with AMF.Visitors;
57
58package AMF.Internals.UML_String_Expressions is
59
60   type UML_String_Expression_Proxy is
61     limited new AMF.Internals.UML_Packageable_Elements.UML_Packageable_Element_Proxy
62       and AMF.UML.String_Expressions.UML_String_Expression with null record;
63
64   overriding function Get_Owning_Expression
65    (Self : not null access constant UML_String_Expression_Proxy)
66       return AMF.UML.String_Expressions.UML_String_Expression_Access;
67   --  Getter of StringExpression::owningExpression.
68   --
69   --  The string expression of which this expression is a substring.
70
71   overriding procedure Set_Owning_Expression
72    (Self : not null access UML_String_Expression_Proxy;
73     To   : AMF.UML.String_Expressions.UML_String_Expression_Access);
74   --  Setter of StringExpression::owningExpression.
75   --
76   --  The string expression of which this expression is a substring.
77
78   overriding function Get_Sub_Expression
79    (Self : not null access constant UML_String_Expression_Proxy)
80       return AMF.UML.String_Expressions.Collections.Set_Of_UML_String_Expression;
81   --  Getter of StringExpression::subExpression.
82   --
83   --  The StringExpressions that constitute this StringExpression.
84
85   overriding function Get_Operand
86    (Self : not null access constant UML_String_Expression_Proxy)
87       return AMF.UML.Value_Specifications.Collections.Ordered_Set_Of_UML_Value_Specification;
88   --  Getter of Expression::operand.
89   --
90   --  Specifies a sequence of operands.
91
92   overriding function Get_Symbol
93    (Self : not null access constant UML_String_Expression_Proxy)
94       return AMF.Optional_String;
95   --  Getter of Expression::symbol.
96   --
97   --  The symbol associated with the node in the expression tree.
98
99   overriding procedure Set_Symbol
100    (Self : not null access UML_String_Expression_Proxy;
101     To   : AMF.Optional_String);
102   --  Setter of Expression::symbol.
103   --
104   --  The symbol associated with the node in the expression tree.
105
106   overriding function Get_Type
107    (Self : not null access constant UML_String_Expression_Proxy)
108       return AMF.UML.Types.UML_Type_Access;
109   --  Getter of TypedElement::type.
110   --
111   --  The type of the TypedElement.
112   --  This information is derived from the return result for this Operation.
113
114   overriding procedure Set_Type
115    (Self : not null access UML_String_Expression_Proxy;
116     To   : AMF.UML.Types.UML_Type_Access);
117   --  Setter of TypedElement::type.
118   --
119   --  The type of the TypedElement.
120   --  This information is derived from the return result for this Operation.
121
122   overriding function Get_Client_Dependency
123    (Self : not null access constant UML_String_Expression_Proxy)
124       return AMF.UML.Dependencies.Collections.Set_Of_UML_Dependency;
125   --  Getter of NamedElement::clientDependency.
126   --
127   --  Indicates the dependencies that reference the client.
128
129   overriding function Get_Name_Expression
130    (Self : not null access constant UML_String_Expression_Proxy)
131       return AMF.UML.String_Expressions.UML_String_Expression_Access;
132   --  Getter of NamedElement::nameExpression.
133   --
134   --  The string expression used to define the name of this named element.
135
136   overriding procedure Set_Name_Expression
137    (Self : not null access UML_String_Expression_Proxy;
138     To   : AMF.UML.String_Expressions.UML_String_Expression_Access);
139   --  Setter of NamedElement::nameExpression.
140   --
141   --  The string expression used to define the name of this named element.
142
143   overriding function Get_Namespace
144    (Self : not null access constant UML_String_Expression_Proxy)
145       return AMF.UML.Namespaces.UML_Namespace_Access;
146   --  Getter of NamedElement::namespace.
147   --
148   --  Specifies the namespace that owns the NamedElement.
149
150   overriding function Get_Qualified_Name
151    (Self : not null access constant UML_String_Expression_Proxy)
152       return AMF.Optional_String;
153   --  Getter of NamedElement::qualifiedName.
154   --
155   --  A name which allows the NamedElement to be identified within a
156   --  hierarchy of nested Namespaces. It is constructed from the names of the
157   --  containing namespaces starting at the root of the hierarchy and ending
158   --  with the name of the NamedElement itself.
159
160   overriding function Get_Owning_Template_Parameter
161    (Self : not null access constant UML_String_Expression_Proxy)
162       return AMF.UML.Template_Parameters.UML_Template_Parameter_Access;
163   --  Getter of ParameterableElement::owningTemplateParameter.
164   --
165   --  The formal template parameter that owns this element.
166
167   overriding procedure Set_Owning_Template_Parameter
168    (Self : not null access UML_String_Expression_Proxy;
169     To   : AMF.UML.Template_Parameters.UML_Template_Parameter_Access);
170   --  Setter of ParameterableElement::owningTemplateParameter.
171   --
172   --  The formal template parameter that owns this element.
173
174   overriding function Get_Template_Parameter
175    (Self : not null access constant UML_String_Expression_Proxy)
176       return AMF.UML.Template_Parameters.UML_Template_Parameter_Access;
177   --  Getter of ParameterableElement::templateParameter.
178   --
179   --  The template parameter that exposes this element as a formal parameter.
180
181   overriding procedure Set_Template_Parameter
182    (Self : not null access UML_String_Expression_Proxy;
183     To   : AMF.UML.Template_Parameters.UML_Template_Parameter_Access);
184   --  Setter of ParameterableElement::templateParameter.
185   --
186   --  The template parameter that exposes this element as a formal parameter.
187
188   overriding function Get_Owned_Template_Signature
189    (Self : not null access constant UML_String_Expression_Proxy)
190       return AMF.UML.Template_Signatures.UML_Template_Signature_Access;
191   --  Getter of TemplateableElement::ownedTemplateSignature.
192   --
193   --  The optional template signature specifying the formal template
194   --  parameters.
195
196   overriding procedure Set_Owned_Template_Signature
197    (Self : not null access UML_String_Expression_Proxy;
198     To   : AMF.UML.Template_Signatures.UML_Template_Signature_Access);
199   --  Setter of TemplateableElement::ownedTemplateSignature.
200   --
201   --  The optional template signature specifying the formal template
202   --  parameters.
203
204   overriding function Get_Template_Binding
205    (Self : not null access constant UML_String_Expression_Proxy)
206       return AMF.UML.Template_Bindings.Collections.Set_Of_UML_Template_Binding;
207   --  Getter of TemplateableElement::templateBinding.
208   --
209   --  The optional bindings from this element to templates.
210
211   overriding function String_Value
212    (Self : not null access constant UML_String_Expression_Proxy)
213       return League.Strings.Universal_String;
214   --  Operation StringExpression::stringValue.
215   --
216   --  The query stringValue() returns the string that concatenates, in order,
217   --  all the component string literals of all the subexpressions that are
218   --  part of the StringExpression.
219
220   overriding function Boolean_Value
221    (Self : not null access constant UML_String_Expression_Proxy)
222       return AMF.Optional_Boolean;
223   --  Operation ValueSpecification::booleanValue.
224   --
225   --  The query booleanValue() gives a single Boolean value when one can be
226   --  computed.
227
228   overriding function Integer_Value
229    (Self : not null access constant UML_String_Expression_Proxy)
230       return AMF.Optional_Integer;
231   --  Operation ValueSpecification::integerValue.
232   --
233   --  The query integerValue() gives a single Integer value when one can be
234   --  computed.
235
236   overriding function Is_Compatible_With
237    (Self : not null access constant UML_String_Expression_Proxy;
238     P : AMF.UML.Parameterable_Elements.UML_Parameterable_Element_Access)
239       return Boolean;
240   --  Operation ValueSpecification::isCompatibleWith.
241   --
242   --  The query isCompatibleWith() determines if this parameterable element
243   --  is compatible with the specified parameterable element. By default
244   --  parameterable element P is compatible with parameterable element Q if
245   --  the kind of P is the same or a subtype as the kind of Q. In addition,
246   --  for ValueSpecification, the type must be conformant with the type of
247   --  the specified parameterable element.
248
249   overriding function Is_Computable
250    (Self : not null access constant UML_String_Expression_Proxy)
251       return Boolean;
252   --  Operation ValueSpecification::isComputable.
253   --
254   --  The query isComputable() determines whether a value specification can
255   --  be computed in a model. This operation cannot be fully defined in OCL.
256   --  A conforming implementation is expected to deliver true for this
257   --  operation for all value specifications that it can compute, and to
258   --  compute all of those for which the operation is true. A conforming
259   --  implementation is expected to be able to compute the value of all
260   --  literals.
261
262   overriding function Is_Null
263    (Self : not null access constant UML_String_Expression_Proxy)
264       return Boolean;
265   --  Operation ValueSpecification::isNull.
266   --
267   --  The query isNull() returns true when it can be computed that the value
268   --  is null.
269
270   overriding function Real_Value
271    (Self : not null access constant UML_String_Expression_Proxy)
272       return AMF.Optional_Real;
273   --  Operation ValueSpecification::realValue.
274   --
275   --  The query realValue() gives a single Real value when one can be
276   --  computed.
277
278   overriding function String_Value
279    (Self : not null access constant UML_String_Expression_Proxy)
280       return AMF.Optional_String;
281   --  Operation ValueSpecification::stringValue.
282   --
283   --  The query stringValue() gives a single String value when one can be
284   --  computed.
285
286   overriding function Unlimited_Value
287    (Self : not null access constant UML_String_Expression_Proxy)
288       return AMF.Optional_Unlimited_Natural;
289   --  Operation ValueSpecification::unlimitedValue.
290   --
291   --  The query unlimitedValue() gives a single UnlimitedNatural value when
292   --  one can be computed.
293
294   overriding function All_Owning_Packages
295    (Self : not null access constant UML_String_Expression_Proxy)
296       return AMF.UML.Packages.Collections.Set_Of_UML_Package;
297   --  Operation NamedElement::allOwningPackages.
298   --
299   --  The query allOwningPackages() returns all the directly or indirectly
300   --  owning packages.
301
302   overriding function Is_Distinguishable_From
303    (Self : not null access constant UML_String_Expression_Proxy;
304     N : AMF.UML.Named_Elements.UML_Named_Element_Access;
305     Ns : AMF.UML.Namespaces.UML_Namespace_Access)
306       return Boolean;
307   --  Operation NamedElement::isDistinguishableFrom.
308   --
309   --  The query isDistinguishableFrom() determines whether two NamedElements
310   --  may logically co-exist within a Namespace. By default, two named
311   --  elements are distinguishable if (a) they have unrelated types or (b)
312   --  they have related types but different names.
313
314   overriding function Namespace
315    (Self : not null access constant UML_String_Expression_Proxy)
316       return AMF.UML.Namespaces.UML_Namespace_Access;
317   --  Operation NamedElement::namespace.
318   --
319   --  Missing derivation for NamedElement::/namespace : Namespace
320
321   overriding function Is_Template_Parameter
322    (Self : not null access constant UML_String_Expression_Proxy)
323       return Boolean;
324   --  Operation ParameterableElement::isTemplateParameter.
325   --
326   --  The query isTemplateParameter() determines if this parameterable
327   --  element is exposed as a formal template parameter.
328
329   overriding function Is_Template
330    (Self : not null access constant UML_String_Expression_Proxy)
331       return Boolean;
332   --  Operation TemplateableElement::isTemplate.
333   --
334   --  The query isTemplate() returns whether this templateable element is
335   --  actually a template.
336
337   overriding function Parameterable_Elements
338    (Self : not null access constant UML_String_Expression_Proxy)
339       return AMF.UML.Parameterable_Elements.Collections.Set_Of_UML_Parameterable_Element;
340   --  Operation TemplateableElement::parameterableElements.
341   --
342   --  The query parameterableElements() returns the set of elements that may
343   --  be used as the parametered elements for a template parameter of this
344   --  templateable element. By default, this set includes all the owned
345   --  elements. Subclasses may override this operation if they choose to
346   --  restrict the set of parameterable elements.
347
348   overriding procedure Enter_Element
349    (Self    : not null access constant UML_String_Expression_Proxy;
350     Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
351     Control : in out AMF.Visitors.Traverse_Control);
352   --  Dispatch call to corresponding subprogram of visitor interface.
353
354   overriding procedure Leave_Element
355    (Self    : not null access constant UML_String_Expression_Proxy;
356     Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
357     Control : in out AMF.Visitors.Traverse_Control);
358   --  Dispatch call to corresponding subprogram of visitor interface.
359
360   overriding procedure Visit_Element
361    (Self     : not null access constant UML_String_Expression_Proxy;
362     Iterator : in out AMF.Visitors.Abstract_Iterator'Class;
363     Visitor  : in out AMF.Visitors.Abstract_Visitor'Class;
364     Control  : in out AMF.Visitors.Traverse_Control);
365   --  Dispatch call to corresponding subprogram of iterator interface.
366
367end AMF.Internals.UML_String_Expressions;
368