/
UML2Profiles.atl
executable file
·60 lines (51 loc) · 2.06 KB
/
UML2Profiles.atl
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
-- @atlcompiler emftvm
-- @nsURI UML2=http://www.eclipse.org/uml2/3.0.0/UML
-- $Id$
-- Applies all necessary profiles.
module UML2Profiles;
create OUT : UML2 from IN : UML2, ACCESSORS : UML2;
uses "lib::UML2";
uses UML2Copy;
-- ======================================================================
-- model-specific helpers begin
-- ======================================================================
helper def : accessorsProfile : UML2!"uml::Profile" = 'Accessors'.profile().debug('accessorsProfile');
-- ======================================================================
-- model-specific helpers end
-- ======================================================================
-- ======================================================================
-- transformation rules begin
-- ======================================================================
rule Model {
from s : UML2!"uml::Model" in IN
to t : UML2!"uml::Model" (
__xmiID__ <- s.__xmiID__,
name <- s.name.debug('Model'),
visibility <- s.visibility,
viewpoint <- s.viewpoint,
eAnnotations <- s.eAnnotations,
ownedComment <- s.ownedComment,
clientDependency <- s.clientDependency,
nameExpression <- s.nameExpression,
elementImport <- s.elementImport,
packageImport <- s.packageImport,
ownedRule <- s.ownedRule,
templateParameter <- s.templateParameter,
templateBinding <- s.templateBinding,
ownedTemplateSignature <- s.ownedTemplateSignature,
packageMerge <- s.packageMerge,
packagedElement <- s.packagedElement,
profileApplication <- s.profileApplication)
}
rule ModelProfile extends Model {
from s : UML2!"uml::Model" in IN (
not s.includesProfile(thisModule.accessorsProfile))
to t : UML2!"uml::Model" (
name <- s.name.debug('ModelProfile'))
do {
t.applyProfile(thisModule.accessorsProfile);
}
}
-- ======================================================================
-- transformation rules end
-- ======================================================================