Skip to content

Commit 463f996

Browse files
authored
Merge pull request #320 from rubenporras/master
Support Case Sensitive and Insensitive fragments
2 parents e3e35b8 + 974edb3 commit 463f996

File tree

9 files changed

+159
-15
lines changed

9 files changed

+159
-15
lines changed

com.avaloq.tools.ddk.typesystem/model/TypeModel.ecore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
<details key="documentation" value="The reason for this class is technical and, in general, one should use the interface INamedElement instead&#xD;&#xA;of this class. This class is defined in the model because Xtext needs to find an instantiable class for&#xD;&#xA;INamedElement during the first phase of linking."/>
1818
</eAnnotations>
1919
</eClassifiers>
20+
<eClassifiers xsi:type="ecore:EClass" name="ICaseSensitiveNamedElement" abstract="true"
21+
interface="true"/>
2022
<eClassifiers xsi:type="ecore:EClass" name="INamedType" abstract="true" interface="true"
2123
eSuperTypes="#//INamedElement #//IType"/>
2224
<eClassifiers xsi:type="ecore:EClass" name="NamedType" eSuperTypes="#//NamedElement #//INamedType">

com.avaloq.tools.ddk.typesystem/model/TypeModel.genmodel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
<genOperations ecoreOperation="TypeModel.ecore#//OverrideDeclaration/isOverride"/>
2323
</genClasses>
2424
<genClasses ecoreClass="TypeModel.ecore#//NamedElement"/>
25+
<genClasses image="false" ecoreClass="TypeModel.ecore#//ICaseSensitiveNamedElement"/>
2526
<genClasses image="false" ecoreClass="TypeModel.ecore#//INamedType"/>
2627
<genClasses ecoreClass="TypeModel.ecore#//NamedType"/>
2728
<genClasses image="false" ecoreClass="TypeModel.ecore#//IFormalParameter">

com.avaloq.tools.ddk.typesystem/plugin.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,4 @@ _UI_Procedure_eparameters_feature = Eparameters
3434
_UI_OverrideDeclaration_type = Override Declaration
3535
_UI_ICallable_type = ICallable
3636
_UI_Callable_type = Callable
37+
_UI_ICaseSensitiveNamedElement_type = ICase Sensitive Named Element
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/**
2+
*/
3+
package com.avaloq.tools.ddk.typesystem.typemodel;
4+
5+
import org.eclipse.emf.ecore.EObject;
6+
7+
/**
8+
* <!-- begin-user-doc -->
9+
* A representation of the model object '<em><b>ICase Sensitive Named Element</b></em>'.
10+
* <!-- end-user-doc -->
11+
*
12+
*
13+
* @see com.avaloq.tools.ddk.typesystem.typemodel.TypeModelPackage#getICaseSensitiveNamedElement()
14+
* @model interface="true" abstract="true"
15+
* @generated
16+
*/
17+
public interface ICaseSensitiveNamedElement extends EObject
18+
{
19+
} // ICaseSensitiveNamedElement

com.avaloq.tools.ddk.typesystem/src-gen/com/avaloq/tools/ddk/typesystem/typemodel/TypeModelPackage.java

Lines changed: 52 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,25 @@ public interface TypeModelPackage extends EPackage
149149
*/
150150
int NAMED_ELEMENT_FEATURE_COUNT = INAMED_ELEMENT_FEATURE_COUNT + 0;
151151

152+
/**
153+
* The meta object id for the '{@link com.avaloq.tools.ddk.typesystem.typemodel.ICaseSensitiveNamedElement <em>ICase Sensitive Named Element</em>}' class.
154+
* <!-- begin-user-doc -->
155+
* <!-- end-user-doc -->
156+
* @see com.avaloq.tools.ddk.typesystem.typemodel.ICaseSensitiveNamedElement
157+
* @see com.avaloq.tools.ddk.typesystem.typemodel.impl.TypeModelPackageImpl#getICaseSensitiveNamedElement()
158+
* @generated
159+
*/
160+
int ICASE_SENSITIVE_NAMED_ELEMENT = 5;
161+
162+
/**
163+
* The number of structural features of the '<em>ICase Sensitive Named Element</em>' class.
164+
* <!-- begin-user-doc -->
165+
* <!-- end-user-doc -->
166+
* @generated
167+
* @ordered
168+
*/
169+
int ICASE_SENSITIVE_NAMED_ELEMENT_FEATURE_COUNT = 0;
170+
152171
/**
153172
* The meta object id for the '{@link com.avaloq.tools.ddk.typesystem.typemodel.INamedType <em>INamed Type</em>}' class.
154173
* <!-- begin-user-doc -->
@@ -157,7 +176,7 @@ public interface TypeModelPackage extends EPackage
157176
* @see com.avaloq.tools.ddk.typesystem.typemodel.impl.TypeModelPackageImpl#getINamedType()
158177
* @generated
159178
*/
160-
int INAMED_TYPE = 5;
179+
int INAMED_TYPE = 6;
161180

162181
/**
163182
* The number of structural features of the '<em>INamed Type</em>' class.
@@ -176,7 +195,7 @@ public interface TypeModelPackage extends EPackage
176195
* @see com.avaloq.tools.ddk.typesystem.typemodel.impl.TypeModelPackageImpl#getNamedType()
177196
* @generated
178197
*/
179-
int NAMED_TYPE = 6;
198+
int NAMED_TYPE = 7;
180199

181200
/**
182201
* The number of structural features of the '<em>Named Type</em>' class.
@@ -195,7 +214,7 @@ public interface TypeModelPackage extends EPackage
195214
* @see com.avaloq.tools.ddk.typesystem.typemodel.impl.TypeModelPackageImpl#getIFormalParameter()
196215
* @generated
197216
*/
198-
int IFORMAL_PARAMETER = 7;
217+
int IFORMAL_PARAMETER = 8;
199218

200219
/**
201220
* The number of structural features of the '<em>IFormal Parameter</em>' class.
@@ -214,7 +233,7 @@ public interface TypeModelPackage extends EPackage
214233
* @see com.avaloq.tools.ddk.typesystem.typemodel.impl.TypeModelPackageImpl#getIActualParameter()
215234
* @generated
216235
*/
217-
int IACTUAL_PARAMETER = 8;
236+
int IACTUAL_PARAMETER = 9;
218237

219238
/**
220239
* The number of structural features of the '<em>IActual Parameter</em>' class.
@@ -233,7 +252,7 @@ public interface TypeModelPackage extends EPackage
233252
* @see com.avaloq.tools.ddk.typesystem.typemodel.impl.TypeModelPackageImpl#getINamedActualParameter()
234253
* @generated
235254
*/
236-
int INAMED_ACTUAL_PARAMETER = 9;
255+
int INAMED_ACTUAL_PARAMETER = 10;
237256

238257
/**
239258
* The number of structural features of the '<em>INamed Actual Parameter</em>' class.
@@ -252,7 +271,7 @@ public interface TypeModelPackage extends EPackage
252271
* @see com.avaloq.tools.ddk.typesystem.typemodel.impl.TypeModelPackageImpl#getICallable()
253272
* @generated
254273
*/
255-
int ICALLABLE = 16;
274+
int ICALLABLE = 17;
256275

257276
/**
258277
* The number of structural features of the '<em>ICallable</em>' class.
@@ -271,7 +290,7 @@ public interface TypeModelPackage extends EPackage
271290
* @see com.avaloq.tools.ddk.typesystem.typemodel.impl.TypeModelPackageImpl#getISubprogram()
272291
* @generated
273292
*/
274-
int ISUBPROGRAM = 10;
293+
int ISUBPROGRAM = 11;
275294

276295
/**
277296
* The number of structural features of the '<em>ISubprogram</em>' class.
@@ -290,7 +309,7 @@ public interface TypeModelPackage extends EPackage
290309
* @see com.avaloq.tools.ddk.typesystem.typemodel.impl.TypeModelPackageImpl#getIProcedure()
291310
* @generated
292311
*/
293-
int IPROCEDURE = 11;
312+
int IPROCEDURE = 12;
294313

295314
/**
296315
* The number of structural features of the '<em>IProcedure</em>' class.
@@ -309,7 +328,7 @@ public interface TypeModelPackage extends EPackage
309328
* @see com.avaloq.tools.ddk.typesystem.typemodel.impl.TypeModelPackageImpl#getIFunction()
310329
* @generated
311330
*/
312-
int IFUNCTION = 12;
331+
int IFUNCTION = 13;
313332

314333
/**
315334
* The number of structural features of the '<em>IFunction</em>' class.
@@ -328,7 +347,7 @@ public interface TypeModelPackage extends EPackage
328347
* @see com.avaloq.tools.ddk.typesystem.typemodel.impl.TypeModelPackageImpl#getIFormalParameterList()
329348
* @generated
330349
*/
331-
int IFORMAL_PARAMETER_LIST = 13;
350+
int IFORMAL_PARAMETER_LIST = 14;
332351

333352
/**
334353
* The number of structural features of the '<em>IFormal Parameter List</em>' class.
@@ -347,7 +366,7 @@ public interface TypeModelPackage extends EPackage
347366
* @see com.avaloq.tools.ddk.typesystem.typemodel.impl.TypeModelPackageImpl#getNamedFormalParameter()
348367
* @generated
349368
*/
350-
int NAMED_FORMAL_PARAMETER = 14;
369+
int NAMED_FORMAL_PARAMETER = 15;
351370

352371
/**
353372
* The number of structural features of the '<em>Named Formal Parameter</em>' class.
@@ -366,7 +385,7 @@ public interface TypeModelPackage extends EPackage
366385
* @see com.avaloq.tools.ddk.typesystem.typemodel.impl.TypeModelPackageImpl#getINamedFormalParameter()
367386
* @generated
368387
*/
369-
int INAMED_FORMAL_PARAMETER = 15;
388+
int INAMED_FORMAL_PARAMETER = 16;
370389

371390
/**
372391
* The number of structural features of the '<em>INamed Formal Parameter</em>' class.
@@ -385,7 +404,7 @@ public interface TypeModelPackage extends EPackage
385404
* @see com.avaloq.tools.ddk.typesystem.typemodel.impl.TypeModelPackageImpl#getCallable()
386405
* @generated
387406
*/
388-
int CALLABLE = 17;
407+
int CALLABLE = 18;
389408

390409
/**
391410
* The number of structural features of the '<em>Callable</em>' class.
@@ -447,6 +466,16 @@ public interface TypeModelPackage extends EPackage
447466
*/
448467
EClass getNamedElement();
449468

469+
/**
470+
* Returns the meta object for class '{@link com.avaloq.tools.ddk.typesystem.typemodel.ICaseSensitiveNamedElement <em>ICase Sensitive Named Element</em>}'.
471+
* <!-- begin-user-doc -->
472+
* <!-- end-user-doc -->
473+
* @return the meta object for class '<em>ICase Sensitive Named Element</em>'.
474+
* @see com.avaloq.tools.ddk.typesystem.typemodel.ICaseSensitiveNamedElement
475+
* @generated
476+
*/
477+
EClass getICaseSensitiveNamedElement();
478+
450479
/**
451480
* Returns the meta object for class '{@link com.avaloq.tools.ddk.typesystem.typemodel.INamedType <em>INamed Type</em>}'.
452481
* <!-- begin-user-doc -->
@@ -651,6 +680,16 @@ interface Literals
651680
*/
652681
EClass NAMED_ELEMENT = eINSTANCE.getNamedElement();
653682

683+
/**
684+
* The meta object literal for the '{@link com.avaloq.tools.ddk.typesystem.typemodel.ICaseSensitiveNamedElement <em>ICase Sensitive Named Element</em>}' class.
685+
* <!-- begin-user-doc -->
686+
* <!-- end-user-doc -->
687+
* @see com.avaloq.tools.ddk.typesystem.typemodel.ICaseSensitiveNamedElement
688+
* @see com.avaloq.tools.ddk.typesystem.typemodel.impl.TypeModelPackageImpl#getICaseSensitiveNamedElement()
689+
* @generated
690+
*/
691+
EClass ICASE_SENSITIVE_NAMED_ELEMENT = eINSTANCE.getICaseSensitiveNamedElement();
692+
654693
/**
655694
* The meta object literal for the '{@link com.avaloq.tools.ddk.typesystem.typemodel.INamedType <em>INamed Type</em>}' class.
656695
* <!-- begin-user-doc -->

com.avaloq.tools.ddk.typesystem/src-gen/com/avaloq/tools/ddk/typesystem/typemodel/impl/TypeModelPackageImpl.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import com.avaloq.tools.ddk.typesystem.typemodel.Callable;
66
import com.avaloq.tools.ddk.typesystem.typemodel.IActualParameter;
77
import com.avaloq.tools.ddk.typesystem.typemodel.ICallable;
8+
import com.avaloq.tools.ddk.typesystem.typemodel.ICaseSensitiveNamedElement;
89
import com.avaloq.tools.ddk.typesystem.typemodel.IExpression;
910
import com.avaloq.tools.ddk.typesystem.typemodel.IFormalParameter;
1011
import com.avaloq.tools.ddk.typesystem.typemodel.IFunction;
@@ -70,6 +71,13 @@ public class TypeModelPackageImpl extends EPackageImpl implements TypeModelPacka
7071
*/
7172
private EClass namedElementEClass = null;
7273

74+
/**
75+
* <!-- begin-user-doc -->
76+
* <!-- end-user-doc -->
77+
* @generated
78+
*/
79+
private EClass iCaseSensitiveNamedElementEClass = null;
80+
7381
/**
7482
* <!-- begin-user-doc -->
7583
* <!-- end-user-doc -->
@@ -274,6 +282,16 @@ public EClass getNamedElement()
274282
return namedElementEClass;
275283
}
276284

285+
/**
286+
* <!-- begin-user-doc -->
287+
* <!-- end-user-doc -->
288+
* @generated
289+
*/
290+
public EClass getICaseSensitiveNamedElement()
291+
{
292+
return iCaseSensitiveNamedElementEClass;
293+
}
294+
277295
/**
278296
* <!-- begin-user-doc -->
279297
* <!-- end-user-doc -->
@@ -444,6 +462,8 @@ public void createPackageContents()
444462

445463
namedElementEClass = createEClass(NAMED_ELEMENT);
446464

465+
iCaseSensitiveNamedElementEClass = createEClass(ICASE_SENSITIVE_NAMED_ELEMENT);
466+
447467
iNamedTypeEClass = createEClass(INAMED_TYPE);
448468

449469
namedTypeEClass = createEClass(NAMED_TYPE);
@@ -535,6 +555,8 @@ public void initializePackageContents()
535555

536556
initEClass(namedElementEClass, NamedElement.class, "NamedElement", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
537557

558+
initEClass(iCaseSensitiveNamedElementEClass, ICaseSensitiveNamedElement.class, "ICaseSensitiveNamedElement", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
559+
538560
initEClass(iNamedTypeEClass, INamedType.class, "INamedType", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
539561

540562
initEClass(namedTypeEClass, NamedType.class, "NamedType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);

com.avaloq.tools.ddk.typesystem/src-gen/com/avaloq/tools/ddk/typesystem/typemodel/util/TypeModelAdapterFactory.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,11 @@ public Adapter caseNamedElement(NamedElement object)
100100
return createNamedElementAdapter();
101101
}
102102
@Override
103+
public Adapter caseICaseSensitiveNamedElement(ICaseSensitiveNamedElement object)
104+
{
105+
return createICaseSensitiveNamedElementAdapter();
106+
}
107+
@Override
103108
public Adapter caseINamedType(INamedType object)
104109
{
105110
return createINamedTypeAdapter();
@@ -261,6 +266,21 @@ public Adapter createNamedElementAdapter()
261266
return null;
262267
}
263268

269+
/**
270+
* Creates a new adapter for an object of class '{@link com.avaloq.tools.ddk.typesystem.typemodel.ICaseSensitiveNamedElement <em>ICase Sensitive Named Element</em>}'.
271+
* <!-- begin-user-doc -->
272+
* This default implementation returns null so that we can easily ignore cases;
273+
* it's useful to ignore a case when inheritance will catch all the cases anyway.
274+
* <!-- end-user-doc -->
275+
* @return the new adapter.
276+
* @see com.avaloq.tools.ddk.typesystem.typemodel.ICaseSensitiveNamedElement
277+
* @generated
278+
*/
279+
public Adapter createICaseSensitiveNamedElementAdapter()
280+
{
281+
return null;
282+
}
283+
264284
/**
265285
* Creates a new adapter for an object of class '{@link com.avaloq.tools.ddk.typesystem.typemodel.INamedType <em>INamed Type</em>}'.
266286
* <!-- begin-user-doc -->

com.avaloq.tools.ddk.typesystem/src-gen/com/avaloq/tools/ddk/typesystem/typemodel/util/TypeModelSwitch.java

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,13 @@ protected T doSwitch(int classifierID, EObject theEObject)
109109
if (result == null) result = defaultCase(theEObject);
110110
return result;
111111
}
112+
case TypeModelPackage.ICASE_SENSITIVE_NAMED_ELEMENT:
113+
{
114+
ICaseSensitiveNamedElement iCaseSensitiveNamedElement = (ICaseSensitiveNamedElement)theEObject;
115+
T result = caseICaseSensitiveNamedElement(iCaseSensitiveNamedElement);
116+
if (result == null) result = defaultCase(theEObject);
117+
return result;
118+
}
112119
case TypeModelPackage.INAMED_TYPE:
113120
{
114121
INamedType iNamedType = (INamedType)theEObject;
@@ -309,6 +316,22 @@ public T caseNamedElement(NamedElement object)
309316
return null;
310317
}
311318

319+
/**
320+
* Returns the result of interpreting the object as an instance of '<em>ICase Sensitive Named Element</em>'.
321+
* <!-- begin-user-doc -->
322+
* This implementation returns null;
323+
* returning a non-null result will terminate the switch.
324+
* <!-- end-user-doc -->
325+
* @param object the target of the switch.
326+
* @return the result of interpreting the object as an instance of '<em>ICase Sensitive Named Element</em>'.
327+
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
328+
* @generated
329+
*/
330+
public T caseICaseSensitiveNamedElement(ICaseSensitiveNamedElement object)
331+
{
332+
return null;
333+
}
334+
312335
/**
313336
* Returns the result of interpreting the object as an instance of '<em>INamed Type</em>'.
314337
* <!-- begin-user-doc -->

0 commit comments

Comments
 (0)