Skip to main content
summaryrefslogtreecommitdiffstats
blob: a32dde92926e547874ab5ea7cde4dae6262595b4 (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
import  _source : 'SourceMM1.ecore#/'
import  _target : 'TargetMM1.ecore#/'
import 'Source2TargetLookup.ocl'
import 'Source2TargetDisambiguation.ocl'
package _source

context SRoot
def : ast() : _target::TRoot =
	_target::TRoot {
		ownedA = ownedX.ast() 
	}
context X
def : ast() : _target::A =
	if isA1()
	then _target::A1 {
		name = name, 
	ownsB = ownsY.oclAsType(Y1).ast() 
	}
	else
		if isA2()
		then _target::A2 {
			name = name, 
		ownsC = ownsY.oclAsType(Y2).ast() 
		}
		else
			if isA3()
			then _target::A3 {
				name = name, 
			ownsC = ownsY.oclAsType(Y2).ast() 
			}
			else
				invalid
			endif
		endif
	endif
context Y1
def : ast() : _target::B =
	_target::B {
		name = name, 
	ownsD = ownsZ.ast() 
	}
context Y2
def : ast() : _target::C =
	_target::C {
		name = name, 
	ownsD = ownsZ.ast() 
	}
context Z
def : ast() : _target::D =
	if parentIsY1()
	then _target::D {
		toA = toY.oclAsType(_'source'::Y1).ast().toA1, 
	refsB = if refers = null then null else ast().lookupB(refers) endif 
	}
	else
		if parentIsY2()
		then _target::D {
			toA = toY.oclAsType(_'source'::Y2).ast().toA2, 
		refsC = if refers = null then null else ast().lookupC(refers) endif 
		}
		else
			invalid
		endif
	endif
endpackage

Back to the top