blob: 583fb8795244e8eee1856fafaa6540d7f5dfcfd0 (
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
|
/**
* <copyright>
*
* Copyright (c) 2013 Willink Transformations, University of York and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v20.html
*
* Contributors:
* Adolfo Sanchez-Barbudo Herrera (University of York) - initial API and implementation
*
* </copyright>
*
*
*/
module GenerateQVToCSModels
import org.eclipse.ocl.examples.build.utilities.*
import org.eclipse.ocl.examples.build.xtend.*
import org.eclipse.emf.mwe.utils.*
import org.eclipse.emf.mwe.utils.*
import org.eclipse.emf.ecore.resource.impl.*
/**
* Generate the Concrete Syntax Models used by the Xtext editors.
*/
var platformURI = ".."
/*
* Base/Essential OCL Xtext models related configuration variables
*/
var oclXtextBaseProjectName = "org.eclipse.ocl.xtext.base"
var oclXtextBaseGenModelProjectPath = "model/BaseCS.genmodel"
var essentialOclXtextProjectName = "org.eclipse.ocl.xtext.essentialocl"
var essentialOclXtextGenModelProjectPath = "model/EssentialOCLCS.genmodel"
/*
* ImperativeOCL Xtext models related configuration variables
*/
var imperativeOclXtextProjectName = "org.eclipse.qvto.examples.xtext.imperativeocl"
var imperativeOclXtextGenModelProjectPath = "model/ImperativeOCLCS.genmodel"
/*
* QVTOperational Xtext models related configuration variables
*/
var qvtOperationalXtextProjectName = "org.eclipse.qvto.examples.xtext.qvtoperational"
var qvtOperationalXtextGenModelProjectPath = "model/QVTOperationalCS.genmodel"
Workflow {
bean = ResourceSetImpl : resourceSet {}
bean = StandaloneSetup { resourceSet = resourceSet
platformUri = platformURI // Common path from which...
scanClassPath = true // ... a scan finds all classes
uriMap = Mapping {
from = "platform:/plugin/org.eclipse.ocl.examples.build/"
to = "platform:/resource/org.eclipse.ocl.examples.build/"
}
}
bean = EcoreGenModelSetup { resourceSet = resourceSet }
// component = DerivedVisitorPatternWeaver {
// resourceSet = resourceSet
// in = imperativeOclXtextEcoreURI
// in = essentialOclXtextEcoreURI
// in = oclXtextBaseEcoreURI
// rootVisitorInterfaceName = oclXtextBaseVisitorName
// rootVisitorInterfaceQualifiedName = oclXtextBaseVisitorQualifiedName
// superVisitorInterfaceName = essentialOclXtextVisitorName
// superVisitorInterfaceQualifiedName = essentialOclXtextVisitorQualifiedName
// derivedVisitorInterfaceName = "${imperativeOclXtextProjectPrefix}Visitor"
// derivedVisitorInterfaceQualifiedName = "${imperativeOclXtextProjectName}.imperativeoclcs.util.${imperativeOclXtextProjectPrefix}Visitor"
// }
// component = DerivedVisitorPatternWeaver {
// resourceSet = resourceSet
// in = qvtOperationalXtextEcoreURI
// in = essentialOclXtextEcoreURI
// in = oclXtextBaseEcoreURI
// rootVisitorInterfaceName = oclXtextBaseVisitorName
// rootVisitorInterfaceQualifiedName = oclXtextBaseVisitorQualifiedName
// superVisitorInterfaceName = "${imperativeOclXtextProjectPrefix}Visitor"
// superVisitorInterfaceQualifiedName = "${imperativeOclXtextProjectName}.imperativeoclcs.util.${imperativeOclXtextProjectPrefix}Visitor"
// derivedVisitorInterfaceName = "${qvtOperationalXtextProjectPrefix}Visitor"
// derivedVisitorInterfaceQualifiedName = "${qvtOperationalXtextProjectName}.qvtoperationalcs.util.${qvtOperationalXtextProjectPrefix}Visitor"
// }
// component = GenerateModel { resourceSet = resourceSet skipOnErrors = true
// genModel = imperativeOclXtextGenModelPath
// clearResourceSet = false
// }
//
// component = GenerateModel { resourceSet = resourceSet skipOnErrors = true
// genModel = qvtOperationalXtextGenModelPath
// clearResourceSet = false
// }
// component = GenerateCS2ASVisitors { resourceSet = resourceSet
// genModelFile = imperativeOclXtextGenModelProjectPath // FIXME change this when changing from automatically generated MM to a manual one located in /model
// javaFolder = imperativeOclXtextModelJavaFolder
// projectName = imperativeOclXtextProjectName
// projectPrefix = imperativeOclXtextProjectPrefix
// superProjectName = imperativeOclXtextSuperProjectName
// superProjectPrefix = imperativeOclXtextSuperProjectPrefix
// superVisitorPackageName = essentialOclXtextVisitorPackage // FIXME if Essential OCL aligns with conventions
// superVisitorClassName = essentialOclXtextVisitorName // FIXME if Essential OCL aligns with conventions
// visitablePackageName = oclXtextBaseVisitablePackage
// visitableClassName = oclXtextBaseVisitableName
// }
component = @qvto.SubGenerateCSModel { resourceSet = resourceSet
projectName = imperativeOclXtextProjectName
superProjectName = essentialOclXtextProjectName
baseProjectName = oclXtextBaseProjectName
genModelFile = imperativeOclXtextGenModelProjectPath
superGenModelFile = essentialOclXtextGenModelProjectPath
baseGenModelFile = oclXtextBaseGenModelProjectPath
}
component = @qvto.SubGenerateCSModel { resourceSet = resourceSet
projectName = qvtOperationalXtextProjectName
superProjectName = imperativeOclXtextProjectName
baseProjectName = oclXtextBaseProjectName
genModelFile = qvtOperationalXtextGenModelProjectPath
superGenModelFile = imperativeOclXtextGenModelProjectPath
baseGenModelFile = oclXtextBaseGenModelProjectPath
}
// component = GenerateCS2ASVisitors { resourceSet = resourceSet
// javaFolder = qvtOperationalXtextModelJavaFolder
// projectName = qvtOperationalXtextProjectName
// projectPrefix = qvtOperationalXtextProjectPrefix
// superProjectName = qvtOperationalXtextSuperProjectName
// superProjectPrefix = qvtOperationalXtextSuperProjectPrefix
// visitablePackageName = oclXtextBaseVisitablePackage
// visitableClassName = oclXtextBaseVisitableName
// }
}
|