Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: c6d592a52d4124147e5eec0d1328cda6ac6237a9 (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
<?xml version="1.0" encoding="UTF-8"?>
<merge:options 
  indent="  "  
  braceStyle="matching"  
  redirect="Gen"
  block="\s*@\s*generated\s*NOT\s*(?:\n\r?|\r\n?)"
  noImport="\s*//\s*import\s+([\w.*]*)\s*;\s*(?:\n\r?|\r\n?)"
  xmlns:merge="http://www.eclipse.org/org/eclipse/emf/codegen/jmerge/Options">

<!-- Tabbed Standard

  indent="&#x9;"  
  braceStyle="standard"  

-->

  <!-- this accepts both new and old style markup. -->

  <merge:dictionaryPattern
    name="modelMembers" 
    select="Member/getComment" 
    match="@\s*(model)"/>

  <merge:dictionaryPattern
    name="generatedUnmodifiableMembers" 
    select="Member/getComment" 
    match="@\s*(gen)erated\s*(This field/method[^(?:\n\r?|\r\n?)]*)*(?:\n\r?|\r\n?)"/>

  <merge:dictionaryPattern
    name="generatedModifiableMembers" 
    select="Member/getComment" 
    match="@\s*generated\s*(modifiable)\s*(?:\n\r?|\r\n?)"/>

  <!-- This is like the above, but for backward compatibility -->
  <merge:dictionaryPattern
    name="generatedLastGenMembers" 
    select="Member/getComment" 
    match="@\s*(lastgen).*(?:\n\r?|\r\n?)"/>

  <merge:dictionaryPattern
    name="orderedMembers" 
    select="Member/getComment" 
    match="@\s*(ordered)\s*(?:\n\r?|\r\n?)"/>

  <!-- Only push Annotations for the Members marked by gen-->
  <merge:push targetParentMarkup="^gen$" select="Annotation"/>

  <merge:pull 
    sourceMarkup="^modifiable$"
    sourceGet="Member/getComment"
    sourceTransfer="(\s*&lt;!--\s*begin-user-doc.*?end-user-doc\s*-->\s*)(?:\n\r?|\r\n?)"
    targetMarkup="^modifiable$"
    targetPut="Member/setComment"/>
  <merge:pull 
    sourceMarkup="^gen$"
    sourceGet="Member/getComment"
    sourceTransfer="(\s*&lt;!--\s*begin-user-doc.*?end-user-doc\s*-->\s*)(?:\n\r?|\r\n?)"
    targetMarkup="^gen$"
    targetPut="Member/setComment"/>
  <merge:pull 
    sourceGet="Member/getFlags"
    targetMarkup="^gen$"
    equals="Member/getName"
    targetPut="Member/setFlags"/>

  <merge:pull 
    sourceMarkup="^gen$"
    sourceGet="AbstractType/getComment"
    sourceTransfer="(\s*&lt;!--\s*begin-user-doc.*?end-user-doc\s*-->\s*)(?:\n\r?|\r\n?)"
    targetMarkup="^modifiable$"
    targetPut="AbstractType/setComment"/>

  <merge:pull 
    sourceGet="Type/getTypeParameters"
    targetMarkup="^lastgen$|^gen$|^modifiable$|^model$"
    targetPut="Type/setTypeParameters"/>
  <merge:pull 
    sourceGet="Type/getSuperclass"
    targetMarkup="^lastgen$|^gen$|^modifiable$|^model$"
    targetPut="Type/setSuperclass"/>
  <merge:pull 
    sourceGet="Type/getSuperInterfaces"
    sourceTransfer="(\s*@\s*extends|\s*@\s*implements)(.*?)(?:&lt;!--|(?:\n\r?|\r\n?))"
    targetMarkup="^lastgen$|^gen$|^modifiable$|^model$"
    targetPut="Type/addSuperInterface"/>

  <merge:pull 
    sourceGet="Enum/getSuperInterfaces"
    sourceTransfer="(\s*@\s*extends|\s*@\s*implements)(.*?)(?:&lt;!--|(?:\n\r?|\r\n?))"
    targetMarkup="^lastgen$|^gen$|^modifiable$|^model$"
    targetPut="Enum/addSuperInterface"/>

  <merge:pull 
    sourceGet="EnumConstant/getArguments"
    targetMarkup="^lastgen$|^gen$|^modifiable$|^model$"
    targetPut="EnumConstant/setArguments"/>
  <merge:pull 
    sourceGet="EnumConstant/getBody"
    targetMarkup="^lastgen$|^gen$|^modifiable$|^model$$"
    targetPut="EnumConstant/setBody"/>

  <merge:pull 
    sourceGet="AnnotationTypeMember/getType"
    targetMarkup="^gen$"
    targetPut="AnnotationTypeMember/setType"/>
  <merge:pull 
    sourceGet="AnnotationTypeMember/getDefaultValue"
    targetMarkup="^gen$"
    targetPut="AnnotationTypeMember/setDefaultValue"/>

  <merge:pull 
    sourceGet="Initializer/getBody"
    targetMarkup="^gen$"
    targetPut="Initializer/setBody"/>

  <merge:pull 
    sourceGet="Field/getType"
    targetMarkup="^gen$"
    targetPut="Field/setType"/>
  <merge:pull 
    sourceGet="Field/getInitializer"
    targetMarkup="^gen$"
    targetPut="Field/setInitializer"/>

  <merge:pull 
    sourceGet="Method/getTypeParameters"
    targetMarkup="^gen$"
    targetPut="Method/setTypeParameters"/>
  <merge:pull 
    sourceGet="Method/getReturnType"
    targetMarkup="^gen$|^model$"
    targetPut="Method/setReturnType"/>
  <merge:pull 
    sourceGet="Method/getParameters"
    targetMarkup="^gen$"
    targetPut="Method/setParameters"/>
  <merge:pull 
    sourceGet="Method/getBody"
    targetMarkup="^gen$"
    targetPut="Method/setBody"/>
  <merge:pull 
    sourceGet="Method/getExceptions"
    targetMarkup="^gen$"
    targetPut="Method/addException"/>

  <merge:sweep markup="^gen$" select="Member"/>
  <merge:sweep markup="^org.eclipse.emf.ecore.EMetaObject$" select="Import"/>
  <merge:sweep markup="^org.eclipse.emf.ecore.impl.EMetaObjectImpl$" select="Import"/>
  <merge:sweep markup="^org.eclipse.emf.ecore.util.EObjectCompositeEList$" select="Import"/>
  <merge:sweep markup="^org.eclipse.emf.ecore.util.EObjectCompositeWithInverseEList$" select="Import"/>
  <merge:sweep markup="^org.eclipse.emf.common.util.AbstractEnumerator$" select="Import"/>

  <merge:sort markup="^ordered$" select="Field"/>
  <merge:sort markup="^ordered$" select="EnumConstant"/>

<!-- Basic Rules

    <merge:pull 
      sourceGet="CompilationUnit/getHeader"
      targetPut="CompilationUnit/setHeader"/>

    <merge:pull 
      sourceGet="Package/getName"
      targetPut="Package/setName"/>

    <merge:pull 
      sourceGet="Member/getFlags"
      targetPut="Member/setFlags"/>
    <merge:pull 
      sourceGet="Member/getComment"
      targetPut="Member/setComment"/>

    <merge:pull 
      sourceGet="Type/getSuperclass"
      targetPut="Type/setSuperclass"/>
    <merge:pull 
      sourceGet="Type/getSuperInterfaces"
      targetPut="Type/addSuperInterface"/>

    <merge:pull 
      sourceGet="Initializer/getBody"
      targetPut="Initializer/setBody"/>

    <merge:pull 
      sourceGet="Field/getType"
      targetPut="Field/setType"/>
    <merge:pull 
      sourceGet="Field/getInitializer"
      targetPut="Field/setInitializer"/>

    <merge:pull 
      sourceGet="Method/getBody"
      targetPut="Method/setBody"/>
    <merge:pull 
      sourceGet="Method/getReturnType"
      targetPut="Method/setReturnType"/>
    <merge:pull 
      sourceGet="Method/getExceptions"
      targetPut="Method/addException"/>
-->

<!-- Push Enum Constants only for generated Enums -->
<!-- 
  <merge:push targetParentMarkup="^gen$" select="EnumConstant"/>
-->

<!-- Push Annotation Type Members only for generated Annotation Types -->
<!--
  <merge:push targetParentMarkup="^gen$" select="AnnotationTypeMember"/>
-->

<!-- Sets the content of annotations if the parent is marked with gen --> 
<!--
    <merge:pull 
      sourceGet="Annotation/getContents"
      targetParentMarkup="^gen$"
      targetPut="Annotation/setContents"/>
-->      

<!-- Remove annotations of generated target nodes if the annotation is not in the source -->
<!--
  <merge:sweep parentMarkup="^gen$" select="Annotation"/>
-->    

<!-- 
    <merge:pull 
      sourceMarkup="^modifiable$"
      sourceGet="Member/getComment"
      targetMarkup="^gen$"
      targetPut="Member/setComment"/>
-->

</merge:options>

Back to the top