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.Expressions; 47with AMF.UML.Named_Elements; 48with AMF.UML.Namespaces; 49with AMF.UML.Packages.Collections; 50with AMF.UML.Parameterable_Elements; 51with AMF.UML.String_Expressions; 52with AMF.UML.Template_Parameters; 53with AMF.UML.Types; 54with AMF.UML.Value_Specifications.Collections; 55with AMF.Visitors; 56 57package AMF.Internals.UML_Expressions is 58 59 type UML_Expression_Proxy is 60 limited new AMF.Internals.UML_Packageable_Elements.UML_Packageable_Element_Proxy 61 and AMF.UML.Expressions.UML_Expression with null record; 62 63 overriding function Get_Operand 64 (Self : not null access constant UML_Expression_Proxy) 65 return AMF.UML.Value_Specifications.Collections.Ordered_Set_Of_UML_Value_Specification; 66 -- Getter of Expression::operand. 67 -- 68 -- Specifies a sequence of operands. 69 70 overriding function Get_Symbol 71 (Self : not null access constant UML_Expression_Proxy) 72 return AMF.Optional_String; 73 -- Getter of Expression::symbol. 74 -- 75 -- The symbol associated with the node in the expression tree. 76 77 overriding procedure Set_Symbol 78 (Self : not null access UML_Expression_Proxy; 79 To : AMF.Optional_String); 80 -- Setter of Expression::symbol. 81 -- 82 -- The symbol associated with the node in the expression tree. 83 84 overriding function Get_Type 85 (Self : not null access constant UML_Expression_Proxy) 86 return AMF.UML.Types.UML_Type_Access; 87 -- Getter of TypedElement::type. 88 -- 89 -- The type of the TypedElement. 90 -- This information is derived from the return result for this Operation. 91 92 overriding procedure Set_Type 93 (Self : not null access UML_Expression_Proxy; 94 To : AMF.UML.Types.UML_Type_Access); 95 -- Setter of TypedElement::type. 96 -- 97 -- The type of the TypedElement. 98 -- This information is derived from the return result for this Operation. 99 100 overriding function Get_Client_Dependency 101 (Self : not null access constant UML_Expression_Proxy) 102 return AMF.UML.Dependencies.Collections.Set_Of_UML_Dependency; 103 -- Getter of NamedElement::clientDependency. 104 -- 105 -- Indicates the dependencies that reference the client. 106 107 overriding function Get_Name_Expression 108 (Self : not null access constant UML_Expression_Proxy) 109 return AMF.UML.String_Expressions.UML_String_Expression_Access; 110 -- Getter of NamedElement::nameExpression. 111 -- 112 -- The string expression used to define the name of this named element. 113 114 overriding procedure Set_Name_Expression 115 (Self : not null access UML_Expression_Proxy; 116 To : AMF.UML.String_Expressions.UML_String_Expression_Access); 117 -- Setter of NamedElement::nameExpression. 118 -- 119 -- The string expression used to define the name of this named element. 120 121 overriding function Get_Namespace 122 (Self : not null access constant UML_Expression_Proxy) 123 return AMF.UML.Namespaces.UML_Namespace_Access; 124 -- Getter of NamedElement::namespace. 125 -- 126 -- Specifies the namespace that owns the NamedElement. 127 128 overriding function Get_Qualified_Name 129 (Self : not null access constant UML_Expression_Proxy) 130 return AMF.Optional_String; 131 -- Getter of NamedElement::qualifiedName. 132 -- 133 -- A name which allows the NamedElement to be identified within a 134 -- hierarchy of nested Namespaces. It is constructed from the names of the 135 -- containing namespaces starting at the root of the hierarchy and ending 136 -- with the name of the NamedElement itself. 137 138 overriding function Get_Owning_Template_Parameter 139 (Self : not null access constant UML_Expression_Proxy) 140 return AMF.UML.Template_Parameters.UML_Template_Parameter_Access; 141 -- Getter of ParameterableElement::owningTemplateParameter. 142 -- 143 -- The formal template parameter that owns this element. 144 145 overriding procedure Set_Owning_Template_Parameter 146 (Self : not null access UML_Expression_Proxy; 147 To : AMF.UML.Template_Parameters.UML_Template_Parameter_Access); 148 -- Setter of ParameterableElement::owningTemplateParameter. 149 -- 150 -- The formal template parameter that owns this element. 151 152 overriding function Get_Template_Parameter 153 (Self : not null access constant UML_Expression_Proxy) 154 return AMF.UML.Template_Parameters.UML_Template_Parameter_Access; 155 -- Getter of ParameterableElement::templateParameter. 156 -- 157 -- The template parameter that exposes this element as a formal parameter. 158 159 overriding procedure Set_Template_Parameter 160 (Self : not null access UML_Expression_Proxy; 161 To : AMF.UML.Template_Parameters.UML_Template_Parameter_Access); 162 -- Setter of ParameterableElement::templateParameter. 163 -- 164 -- The template parameter that exposes this element as a formal parameter. 165 166 overriding function Boolean_Value 167 (Self : not null access constant UML_Expression_Proxy) 168 return AMF.Optional_Boolean; 169 -- Operation ValueSpecification::booleanValue. 170 -- 171 -- The query booleanValue() gives a single Boolean value when one can be 172 -- computed. 173 174 overriding function Integer_Value 175 (Self : not null access constant UML_Expression_Proxy) 176 return AMF.Optional_Integer; 177 -- Operation ValueSpecification::integerValue. 178 -- 179 -- The query integerValue() gives a single Integer value when one can be 180 -- computed. 181 182 overriding function Is_Compatible_With 183 (Self : not null access constant UML_Expression_Proxy; 184 P : AMF.UML.Parameterable_Elements.UML_Parameterable_Element_Access) 185 return Boolean; 186 -- Operation ValueSpecification::isCompatibleWith. 187 -- 188 -- The query isCompatibleWith() determines if this parameterable element 189 -- is compatible with the specified parameterable element. By default 190 -- parameterable element P is compatible with parameterable element Q if 191 -- the kind of P is the same or a subtype as the kind of Q. In addition, 192 -- for ValueSpecification, the type must be conformant with the type of 193 -- the specified parameterable element. 194 195 overriding function Is_Computable 196 (Self : not null access constant UML_Expression_Proxy) 197 return Boolean; 198 -- Operation ValueSpecification::isComputable. 199 -- 200 -- The query isComputable() determines whether a value specification can 201 -- be computed in a model. This operation cannot be fully defined in OCL. 202 -- A conforming implementation is expected to deliver true for this 203 -- operation for all value specifications that it can compute, and to 204 -- compute all of those for which the operation is true. A conforming 205 -- implementation is expected to be able to compute the value of all 206 -- literals. 207 208 overriding function Is_Null 209 (Self : not null access constant UML_Expression_Proxy) 210 return Boolean; 211 -- Operation ValueSpecification::isNull. 212 -- 213 -- The query isNull() returns true when it can be computed that the value 214 -- is null. 215 216 overriding function Real_Value 217 (Self : not null access constant UML_Expression_Proxy) 218 return AMF.Optional_Real; 219 -- Operation ValueSpecification::realValue. 220 -- 221 -- The query realValue() gives a single Real value when one can be 222 -- computed. 223 224 overriding function String_Value 225 (Self : not null access constant UML_Expression_Proxy) 226 return AMF.Optional_String; 227 -- Operation ValueSpecification::stringValue. 228 -- 229 -- The query stringValue() gives a single String value when one can be 230 -- computed. 231 232 overriding function Unlimited_Value 233 (Self : not null access constant UML_Expression_Proxy) 234 return AMF.Optional_Unlimited_Natural; 235 -- Operation ValueSpecification::unlimitedValue. 236 -- 237 -- The query unlimitedValue() gives a single UnlimitedNatural value when 238 -- one can be computed. 239 240 overriding function All_Owning_Packages 241 (Self : not null access constant UML_Expression_Proxy) 242 return AMF.UML.Packages.Collections.Set_Of_UML_Package; 243 -- Operation NamedElement::allOwningPackages. 244 -- 245 -- The query allOwningPackages() returns all the directly or indirectly 246 -- owning packages. 247 248 overriding function Is_Distinguishable_From 249 (Self : not null access constant UML_Expression_Proxy; 250 N : AMF.UML.Named_Elements.UML_Named_Element_Access; 251 Ns : AMF.UML.Namespaces.UML_Namespace_Access) 252 return Boolean; 253 -- Operation NamedElement::isDistinguishableFrom. 254 -- 255 -- The query isDistinguishableFrom() determines whether two NamedElements 256 -- may logically co-exist within a Namespace. By default, two named 257 -- elements are distinguishable if (a) they have unrelated types or (b) 258 -- they have related types but different names. 259 260 overriding function Namespace 261 (Self : not null access constant UML_Expression_Proxy) 262 return AMF.UML.Namespaces.UML_Namespace_Access; 263 -- Operation NamedElement::namespace. 264 -- 265 -- Missing derivation for NamedElement::/namespace : Namespace 266 267 overriding function Is_Template_Parameter 268 (Self : not null access constant UML_Expression_Proxy) 269 return Boolean; 270 -- Operation ParameterableElement::isTemplateParameter. 271 -- 272 -- The query isTemplateParameter() determines if this parameterable 273 -- element is exposed as a formal template parameter. 274 275 overriding procedure Enter_Element 276 (Self : not null access constant UML_Expression_Proxy; 277 Visitor : in out AMF.Visitors.Abstract_Visitor'Class; 278 Control : in out AMF.Visitors.Traverse_Control); 279 -- Dispatch call to corresponding subprogram of visitor interface. 280 281 overriding procedure Leave_Element 282 (Self : not null access constant UML_Expression_Proxy; 283 Visitor : in out AMF.Visitors.Abstract_Visitor'Class; 284 Control : in out AMF.Visitors.Traverse_Control); 285 -- Dispatch call to corresponding subprogram of visitor interface. 286 287 overriding procedure Visit_Element 288 (Self : not null access constant UML_Expression_Proxy; 289 Iterator : in out AMF.Visitors.Abstract_Iterator'Class; 290 Visitor : in out AMF.Visitors.Abstract_Visitor'Class; 291 Control : in out AMF.Visitors.Traverse_Control); 292 -- Dispatch call to corresponding subprogram of iterator interface. 293 294end AMF.Internals.UML_Expressions; 295