Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 845c679c2752b5ed4368a679c61923373f20afc8 (plain) (blame)
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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
/**
 */
package org.eclipse.papyrus.uml.alf;

import java.math.BigInteger;
import java.util.Map;

import org.eclipse.emf.common.util.DiagnosticChain;
import org.eclipse.emf.common.util.EList;

/**
 * <!-- begin-user-doc -->
 * A representation of the model object '<em><b>Tuple</b></em>'.
 * <!-- end-user-doc -->
 *
 * <!-- begin-model-doc -->
 * A list of expressions used to provide the arguments for an invocation.
 * <!-- end-model-doc -->
 *
 * <p>
 * The following features are supported:
 * </p>
 * <ul>
 *   <li>{@link org.eclipse.papyrus.uml.alf.Tuple#getInput <em>Input</em>}</li>
 *   <li>{@link org.eclipse.papyrus.uml.alf.Tuple#getInvocation <em>Invocation</em>}</li>
 *   <li>{@link org.eclipse.papyrus.uml.alf.Tuple#getOutput <em>Output</em>}</li>
 * </ul>
 *
 * @see org.eclipse.papyrus.uml.alf.AlfPackage#getTuple()
 * @model abstract="true"
 * @generated
 */
public interface Tuple extends SyntaxElement {
	/**
	 * Returns the value of the '<em><b>Input</b></em>' reference list.
	 * The list contents are of type {@link org.eclipse.papyrus.uml.alf.InputNamedExpression}.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * <!-- begin-model-doc -->
	 * The argument expressions from this tuple, matched to the input parameters
	 * (direction in and inout) of the invocation. An empty sequence construction
	 * expression is included for any input parameter that is not explicitly
	 * matched in the tuple.
	 * <!-- end-model-doc -->
	 * @return the value of the '<em>Input</em>' reference list.
	 * @see org.eclipse.papyrus.uml.alf.AlfPackage#getTuple_Input()
	 * @model transient="true" volatile="true" derived="true" ordered="false"
	 *        annotation="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot derivation='self.inputCached()'"
	 * @generated
	 */
	EList<InputNamedExpression> getInput();

	/**
	 * Returns the value of the '<em><b>Invocation</b></em>' container reference.
	 * It is bidirectional and its opposite is '{@link org.eclipse.papyrus.uml.alf.InvocationExpression#getTuple <em>Tuple</em>}'.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * <!-- begin-model-doc -->
	 * The invocation expression of which this tuple is a part.
	 * <!-- end-model-doc -->
	 * @return the value of the '<em>Invocation</em>' container reference.
	 * @see #setInvocation(InvocationExpression)
	 * @see org.eclipse.papyrus.uml.alf.AlfPackage#getTuple_Invocation()
	 * @see org.eclipse.papyrus.uml.alf.InvocationExpression#getTuple
	 * @model opposite="tuple" required="true" transient="false"
	 * @generated
	 */
	InvocationExpression getInvocation();

	/**
	 * Sets the value of the '{@link org.eclipse.papyrus.uml.alf.Tuple#getInvocation <em>Invocation</em>}' container reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @param value the new value of the '<em>Invocation</em>' container reference.
	 * @see #getInvocation()
	 * @generated
	 */
	void setInvocation(InvocationExpression value);

	/**
	 * Returns the value of the '<em><b>Output</b></em>' reference list.
	 * The list contents are of type {@link org.eclipse.papyrus.uml.alf.OutputNamedExpression}.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * <!-- begin-model-doc -->
	 * The argument expressions from this tuple, matched to the output parameters
	 * (direction inout and out) of the invocation. An empty sequence construction
	 * expression is included for any output parameter that is not explicitly
	 * matched in the tuple.
	 * <!-- end-model-doc -->
	 * @return the value of the '<em>Output</em>' reference list.
	 * @see org.eclipse.papyrus.uml.alf.AlfPackage#getTuple_Output()
	 * @model transient="true" volatile="true" derived="true" ordered="false"
	 *        annotation="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot derivation='self.outputCached()'"
	 * @generated
	 */
	EList<OutputNamedExpression> getOutput();

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @model required="true"
	 * @generated
	 */
	BigInteger size();

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @model ordered="false"
	 * @generated
	 */
	EList<InputNamedExpression> inputCached();

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @model ordered="false"
	 *        annotation="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot body='self.inputFor(self.invocation.parameter)'"
	 * @generated
	 */
	EList<InputNamedExpression> input();

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @model ordered="false" parametersMany="true"
	 * @generated
	 */
	EList<InputNamedExpression> inputFor(EList<ElementReference> parameters);

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @model ordered="false"
	 * @generated
	 */
	EList<OutputNamedExpression> outputCached();

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @model ordered="false"
	 *        annotation="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot body='self.outputFor(self.invocation.parameter)'"
	 * @generated
	 */
	EList<OutputNamedExpression> output();

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @model ordered="false" parametersMany="true"
	 * @generated
	 */
	EList<OutputNamedExpression> outputFor(EList<ElementReference> parameters);

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @model ordered="false" elementRequired="true"
	 *        annotation="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot body='\n--        let assignmentsBefore = self.assignmentsBefore() in\n--          if not element.oclIsKindOf(NameExpression) then assignmentsBefore\n--          else\n--            let outputs : Set = self.output->select(expression = element) in\n--              if outputs->isEmpty() then assignmentsBefore\n--              else self.updateFor(assignmentsBefore, \n--                outputs->any(true).oclAsType(OutputNamedExpression)\n--              )\n--              endif\n--          endif\n          self.assignmentsBefore()'"
	 * @generated
	 */
	EList<AssignedSource> assignmentsBefore(SyntaxElement element);

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @model ordered="false"
	 *        annotation="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot body='\n        let assignments1 = self.updateAll(\n          self.assignmentsBefore(),\n          self.input.expression->union(self.output.expression).newAssignments()->asSet()\n        ) in\n        let assignments2 = self.output->iterate(\n          output, assignments : Set(AssignedSource) = assignments1 |\n          self.updateFor(assignments, output)\n        ) in\n          self.updateAll(\n            assignments2,\n            self.output->reject(leftHandSide = null)->\n              collect(output : OutputNamedExpression | \n                assignments2->select(name = output.leftHandSide.assignedName())\n              )->\n              reject(isParallelLocalName).copy(self.invocation, null)->asSet()\n           )'"
	 * @generated
	 */
	EList<AssignedSource> assignmentsAfter();

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @model ordered="false"
	 *        annotation="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot body='\n        let assignmentsBefore = self.assignmentsBefore() in\n          self.assignmentsAfter()->select(isNew(assignmentsBefore()))'"
	 * @generated
	 */
	EList<AssignedSource> newAssignments();

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @model ordered="false" assignmentsMany="true" assignmentsOrdered="false" outputRequired="true"
	 *        annotation="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot body='\n        let parameter = self.invocation.parameterNamed(output.name) in\n          if parameter = null or parameter.direction() <> \'out\' then \n            assignments\n          else\n            let lhs = output.leftHandSide in\n              if lhs = null or lhs.localName() = null or lhs.index() <> null or \n                assignments->exists(name = lhs.localName()) then \n                assignments\n              else\n                AssignedSource{\n                  name = lhs.localName(),\n                  source = self,\n                  type = parameter.type(),\n                  lower = 0,\n                  upper = if parameter.upper() = 1 then 1 else -1 endif\n                }.update(assignments)\n              endif\n          endif'"
	 * @generated
	 */
	EList<AssignedSource> updateFor(EList<AssignedSource> assignments, OutputNamedExpression output);

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * <!-- begin-model-doc -->
	 * A tuple has the same number of inputs as its invocation has input
	 * parameters. For each input parameter, the tuple has a corresponding input
	 * with the same name as the parameter and an expression that is the
	 * matching argument from the tuple, or an empty sequence construction
	 * expression if there is no matching argument.
	 * <!-- end-model-doc -->
	 * @model
	 * @generated
	 */
	boolean tupleInputDerivation(DiagnosticChain diagnostics, Map<Object, Object> context);

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * <!-- begin-model-doc -->
	 * A tuple has the same number of outputs as its invocation has output
	 * parameters. For each output parameter, the tuple has a corresponding
	 * output with the same name as the parameter and an expression that is the
	 * matching argument from the tuple, or an empty sequence construction
	 * expression if there is no matching argument.
	 * <!-- end-model-doc -->
	 * @model
	 * @generated
	 */
	boolean tupleOutputDerivation(DiagnosticChain diagnostics, Map<Object, Object> context);

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * <!-- begin-model-doc -->
	 * An input parameter may only have a null argument if it has a multiplicity
	 * lower bound of 0.
	 * <!-- end-model-doc -->
	 * @model annotation="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot body='\n        self.input->forAll(\n          expression.isNull() implies \n            self.invocation.parameterNamed(name).lower() = 0\n        )'"
	 * @generated
	 */
	boolean tupleNullInputs(DiagnosticChain diagnostics, Map<Object, Object> context);

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * <!-- begin-model-doc -->
	 * An output parameter may only have a null argument if it is an out parameter.
	 * <!-- end-model-doc -->
	 * @model annotation="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot body='\n        self.output->forAll(\n          expression.isNull() implies \n            self.invocation.parameterNamed(name).direction() = \'out\'\n        )'"
	 * @generated
	 */
	boolean tupleOutputs(DiagnosticChain diagnostics, Map<Object, Object> context);

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * <!-- begin-model-doc -->
	 * The assignments before each expression in a tuple are the same as the
	 * assignments before the tuple, except in the case of a name expression
	 * that defines a new local name, in which case the assigned source for the
	 * new name is included in the assignments before the name expression. (Note
	 * that the assigned source for a new name is included before the name
	 * expression so that the nameExpressionResolution constraint is not
	 * violated.) The assignments before the tuple are the same as the
	 * assignments after the feature reference of the invocation of the tuple,
	 * if the invocation has one, or otherwise the assignments before the
	 * invocation.
	 * 
	 * CHANGE: An assignment before is NOT given to a name expression that
	 * that defines a local name. Instead the nameExpressionResolution
	 * constraint has been modified. (This avoids a potential infinite recursion
	 * in InvocationExpression::bindTemplateImplicitArguments().)
	 * 
	 * (See also the InvocationExpression::assignmentsBefore(element) operation.)
	 * <!-- end-model-doc -->
	 * @model
	 * @generated
	 */
	boolean tupleAssignmentsBefore(DiagnosticChain diagnostics, Map<Object, Object> context);

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * <!-- begin-model-doc -->
	 * A name may be assigned in at most one argument expression of a tuple.
	 * <!-- end-model-doc -->
	 * @model annotation="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot body='\n        self.input.expression->union(self.output.expression).\n          newAssignments()->isUnique(name)'"
	 * @generated
	 */
	boolean tupleAssignmentsAfter(DiagnosticChain diagnostics, Map<Object, Object> context);

} // Tuple

Back to the top