@@ -19,11 +19,14 @@ import org.eclipse.emf.common.util.BasicEList
19
19
import com.regnosys.rosetta.rosetta.interpreter.RosettaInterpreterValue
20
20
import com.regnosys.rosetta.rosetta.interpreter.InterpreterVisitor
21
21
22
+ import com.regnosys.rosetta.rosetta.RosettaInterpreterBaseEnvironment
23
+
22
24
23
25
interface RosettaExpression {
24
26
// Whether the expression was generated
25
27
boolean generated
26
28
op RosettaInterpreterValue accept(InterpreterVisitor v)
29
+ op RosettaInterpreterValue accept(InterpreterVisitor v, RosettaInterpreterBaseEnvironment env)
27
30
}
28
31
29
32
/**
@@ -59,6 +62,9 @@ class RosettaBooleanLiteral extends RosettaLiteral {
59
62
op RosettaInterpreterValue accept(InterpreterVisitor v) {
60
63
v.interp(this)
61
64
}
65
+ op RosettaInterpreterValue accept(InterpreterVisitor v, RosettaInterpreterBaseEnvironment nv) {
66
+ v.interp(this,nv)
67
+ }
62
68
}
63
69
64
70
class RosettaStringLiteral extends RosettaLiteral {
@@ -73,6 +79,9 @@ class RosettaStringLiteral extends RosettaLiteral {
73
79
op RosettaInterpreterValue accept(InterpreterVisitor v) {
74
80
v.interp(this)
75
81
}
82
+ op RosettaInterpreterValue accept(InterpreterVisitor v, RosettaInterpreterBaseEnvironment nv) {
83
+ v.interp(this,nv)
84
+ }
76
85
}
77
86
78
87
class RosettaNumberLiteral extends RosettaLiteral {
@@ -87,6 +96,9 @@ class RosettaNumberLiteral extends RosettaLiteral {
87
96
op RosettaInterpreterValue accept(InterpreterVisitor v) {
88
97
v.interp(this)
89
98
}
99
+ op RosettaInterpreterValue accept(InterpreterVisitor v, RosettaInterpreterBaseEnvironment nv) {
100
+ v.interp(this,nv)
101
+ }
90
102
}
91
103
92
104
class RosettaIntLiteral extends RosettaLiteral {
@@ -101,6 +113,9 @@ class RosettaIntLiteral extends RosettaLiteral {
101
113
op RosettaInterpreterValue accept(InterpreterVisitor v) {
102
114
v.interp(this)
103
115
}
116
+ op RosettaInterpreterValue accept(InterpreterVisitor v, RosettaInterpreterBaseEnvironment nv) {
117
+ v.interp(this,nv)
118
+ }
104
119
}
105
120
106
121
// Not supported - see issue https://github.com/finos/rune-dsl/issues/524
@@ -128,6 +143,9 @@ class ListLiteral extends RosettaExpression {
128
143
op RosettaInterpreterValue accept(InterpreterVisitor v) {
129
144
v.interp(this)
130
145
}
146
+ op RosettaInterpreterValue accept(InterpreterVisitor v, RosettaInterpreterBaseEnvironment nv) {
147
+ v.interp(this,nv)
148
+ }
131
149
}
132
150
133
151
/*
@@ -158,6 +176,10 @@ class RosettaSymbolReference extends RosettaReference {
158
176
}
159
177
return rawArgs
160
178
}
179
+
180
+ op RosettaInterpreterValue accept(InterpreterVisitor v, RosettaInterpreterBaseEnvironment nv) {
181
+ v.interp(this, nv)
182
+ }
161
183
}
162
184
163
185
class RosettaImplicitVariable extends RosettaReference, RosettaNamed {
@@ -178,6 +200,9 @@ class RosettaConditionalExpression extends RosettaExpression {
178
200
op RosettaInterpreterValue accept(InterpreterVisitor v) {
179
201
v.interp(this)
180
202
}
203
+ op RosettaInterpreterValue accept(InterpreterVisitor v, RosettaInterpreterBaseEnvironment nv) {
204
+ v.interp(this,nv)
205
+ }
181
206
}
182
207
183
208
class RosettaConstructorExpression extends RosettaExpression, RosettaTyped {
@@ -222,12 +247,22 @@ interface RosettaBinaryOperation extends RosettaOperation, HasGeneratedInput {
222
247
}
223
248
224
249
class ArithmeticOperation extends RosettaBinaryOperation {
250
+
251
+ op RosettaInterpreterValue accept(InterpreterVisitor v) {
252
+ v.interp(this)
253
+ }
254
+ op RosettaInterpreterValue accept(InterpreterVisitor v, RosettaInterpreterBaseEnvironment nv) {
255
+ v.interp(this,nv)
256
+ }
225
257
}
226
258
227
259
class LogicalOperation extends RosettaBinaryOperation {
228
260
op RosettaInterpreterValue accept(InterpreterVisitor v) {
229
261
v.interp(this)
230
262
}
263
+ op RosettaInterpreterValue accept(InterpreterVisitor v, RosettaInterpreterBaseEnvironment nv) {
264
+ v.interp(this,nv)
265
+ }
231
266
}
232
267
233
268
enum CardinalityModifier {
@@ -244,31 +279,44 @@ class EqualityOperation extends ModifiableBinaryOperation {
244
279
op RosettaInterpreterValue accept(InterpreterVisitor v) {
245
280
v.interp(this)
246
281
}
282
+ op RosettaInterpreterValue accept(InterpreterVisitor v, RosettaInterpreterBaseEnvironment nv) {
283
+ v.interp(this,nv)
284
+ }
247
285
}
248
286
249
287
class ComparisonOperation extends ModifiableBinaryOperation {
250
- op RosettaInterpreterValue accept(InterpreterVisitor v) {
251
- v.interp(this)
288
+ op RosettaInterpreterValue accept(InterpreterVisitor v, RosettaInterpreterBaseEnvironment nv ) {
289
+ v.interp(this,nv )
252
290
}
291
+
253
292
}
254
293
255
294
class RosettaContainsExpression extends RosettaBinaryOperation {
256
295
op RosettaInterpreterValue accept(InterpreterVisitor v) {
257
296
v.interp(this)
258
297
}
298
+ op RosettaInterpreterValue accept(InterpreterVisitor v, RosettaInterpreterBaseEnvironment nv) {
299
+ v.interp(this,nv)
300
+ }
259
301
}
260
302
261
303
class RosettaDisjointExpression extends RosettaBinaryOperation {
262
304
op RosettaInterpreterValue accept(InterpreterVisitor v) {
263
305
v.interp(this)
264
306
}
307
+ op RosettaInterpreterValue accept(InterpreterVisitor v, RosettaInterpreterBaseEnvironment nv) {
308
+ v.interp(this,nv)
309
+ }
265
310
}
266
311
267
312
class JoinOperation extends RosettaBinaryOperation {
268
313
boolean explicitSeparator
269
314
op RosettaInterpreterValue accept(InterpreterVisitor v) {
270
315
v.interp(this)
271
316
}
317
+ op RosettaInterpreterValue accept(InterpreterVisitor v, RosettaInterpreterBaseEnvironment nv) {
318
+ v.interp(this,nv)
319
+ }
272
320
}
273
321
274
322
/**
@@ -325,12 +373,18 @@ class RosettaExistsExpression extends RosettaUnaryOperation {
325
373
op RosettaInterpreterValue accept(InterpreterVisitor v) {
326
374
v.interp(this)
327
375
}
376
+ op RosettaInterpreterValue accept(InterpreterVisitor v, RosettaInterpreterBaseEnvironment nv) {
377
+ v.interp(this,nv)
378
+ }
328
379
}
329
380
330
381
class RosettaAbsentExpression extends RosettaUnaryOperation {
331
382
op RosettaInterpreterValue accept(InterpreterVisitor v) {
332
383
v.interp(this)
333
384
}
385
+ op RosettaInterpreterValue accept(InterpreterVisitor v, RosettaInterpreterBaseEnvironment nv) {
386
+ v.interp(this,nv)
387
+ }
334
388
}
335
389
336
390
class RosettaOnlyElement extends ListOperation {
@@ -340,30 +394,57 @@ class RosettaCountOperation extends RosettaUnaryOperation {
340
394
op RosettaInterpreterValue accept(InterpreterVisitor v) {
341
395
v.interp(this)
342
396
}
397
+ op RosettaInterpreterValue accept(InterpreterVisitor v, RosettaInterpreterBaseEnvironment nv) {
398
+ v.interp(this,nv)
399
+ }
343
400
}
344
401
345
402
class FlattenOperation extends ListOperation, CanHandleListOfLists {
346
403
}
347
404
348
405
class DistinctOperation extends ListOperation {
406
+ op RosettaInterpreterValue accept(InterpreterVisitor v) {
407
+ v.interp(this)
408
+ }
409
+ op RosettaInterpreterValue accept(InterpreterVisitor v, RosettaInterpreterBaseEnvironment nv) {
410
+ v.interp(this, nv)
411
+ }
349
412
}
350
413
351
414
class ReverseOperation extends ListOperation {
415
+ op RosettaInterpreterValue accept(InterpreterVisitor v) {
416
+ v.interp(this)
417
+ }
418
+ op RosettaInterpreterValue accept(InterpreterVisitor v, RosettaInterpreterBaseEnvironment nv) {
419
+ v.interp(this, nv)
420
+ }
352
421
}
353
422
354
423
class FirstOperation extends ListOperation {
355
424
op RosettaInterpreterValue accept(InterpreterVisitor v) {
356
425
v.interp(this)
357
426
}
427
+ op RosettaInterpreterValue accept(InterpreterVisitor v, RosettaInterpreterBaseEnvironment nv) {
428
+ v.interp(this,nv)
429
+ }
358
430
}
359
431
360
432
class LastOperation extends ListOperation {
361
433
op RosettaInterpreterValue accept(InterpreterVisitor v) {
362
434
v.interp(this)
363
435
}
436
+ op RosettaInterpreterValue accept(InterpreterVisitor v, RosettaInterpreterBaseEnvironment nv) {
437
+ v.interp(this,nv)
438
+ }
364
439
}
365
440
366
441
class SumOperation extends ListOperation {
442
+ op RosettaInterpreterValue accept(InterpreterVisitor v) {
443
+ v.interp(this)
444
+ }
445
+ op RosettaInterpreterValue accept(InterpreterVisitor v, RosettaInterpreterBaseEnvironment nv) {
446
+ v.interp(this, nv)
447
+ }
367
448
}
368
449
369
450
class AsKeyOperation extends RosettaUnaryOperation {
0 commit comments