eclipse plugin: The cardinality operations should be available...
...on every WMLExpression
This commit is contained in:
parent
14f2e6a649
commit
3edabb3e68
9 changed files with 151 additions and 110 deletions
|
@ -24,26 +24,6 @@
|
|||
defaultValueLiteral=""/>
|
||||
</eClassifiers>
|
||||
<eClassifiers xsi:type="ecore:EClass" name="WMLKey" eSuperTypes="platform:/resource/org.wesnoth/src-gen/org/wesnoth/WML.ecore#//WMLExpression">
|
||||
<eOperations name="is_Required" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean">
|
||||
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
|
||||
<details key="body" value="return _Cardinality == '1';"/>
|
||||
</eAnnotations>
|
||||
</eOperations>
|
||||
<eOperations name="is_Forbidden" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean">
|
||||
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
|
||||
<details key="body" value="return _Cardinality == '-';"/>
|
||||
</eAnnotations>
|
||||
</eOperations>
|
||||
<eOperations name="is_Optional" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean">
|
||||
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
|
||||
<details key="body" value="return _Cardinality == '?';"/>
|
||||
</eAnnotations>
|
||||
</eOperations>
|
||||
<eOperations name="is_Repeatable" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean">
|
||||
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
|
||||
<details key="body" value="return _Cardinality == '*';"/>
|
||||
</eAnnotations>
|
||||
</eOperations>
|
||||
<eStructuralFeatures xsi:type="ecore:EReference" name="value" upperBound="-1"
|
||||
eType="ecore:EClass platform:/resource/org.wesnoth/src-gen/org/wesnoth/WML.ecore#//WMLKeyValue"
|
||||
containment="true"/>
|
||||
|
@ -92,6 +72,26 @@
|
|||
</eClassifiers>
|
||||
<eClassifiers xsi:type="ecore:EClass" name="WMLRootExpression" eSuperTypes="platform:/resource/org.wesnoth/src-gen/org/wesnoth/WML.ecore#//WMLExpression"/>
|
||||
<eClassifiers xsi:type="ecore:EClass" name="WMLExpression" eSuperTypes="platform:/resource/org.wesnoth/src-gen/org/wesnoth/WML.ecore#//WMLValuedExpression">
|
||||
<eOperations name="is_Required" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean">
|
||||
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
|
||||
<details key="body" value="return _Cardinality == '1';"/>
|
||||
</eAnnotations>
|
||||
</eOperations>
|
||||
<eOperations name="is_Forbidden" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean">
|
||||
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
|
||||
<details key="body" value="return _Cardinality == '-';"/>
|
||||
</eAnnotations>
|
||||
</eOperations>
|
||||
<eOperations name="is_Optional" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean">
|
||||
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
|
||||
<details key="body" value="return _Cardinality == '?';"/>
|
||||
</eAnnotations>
|
||||
</eOperations>
|
||||
<eOperations name="is_Repeatable" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean">
|
||||
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
|
||||
<details key="body" value="return _Cardinality == '*';"/>
|
||||
</eAnnotations>
|
||||
</eOperations>
|
||||
<eOperations name="isWMLTag" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean">
|
||||
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
|
||||
<details key="body" value="return ( this instanceof WMLTag );"/>
|
||||
|
|
|
@ -25,10 +25,6 @@
|
|||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute platform:/resource/org.wesnoth/src-gen/org/wesnoth/WML.ecore#//WMLKey/_Enum"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute platform:/resource/org.wesnoth/src-gen/org/wesnoth/WML.ecore#//WMLKey/_Translatable"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute platform:/resource/org.wesnoth/src-gen/org/wesnoth/WML.ecore#//WMLKey/_DataType"/>
|
||||
<genOperations ecoreOperation="platform:/resource/org.wesnoth/src-gen/org/wesnoth/WML.ecore#//WMLKey/is_Required"/>
|
||||
<genOperations ecoreOperation="platform:/resource/org.wesnoth/src-gen/org/wesnoth/WML.ecore#//WMLKey/is_Forbidden"/>
|
||||
<genOperations ecoreOperation="platform:/resource/org.wesnoth/src-gen/org/wesnoth/WML.ecore#//WMLKey/is_Optional"/>
|
||||
<genOperations ecoreOperation="platform:/resource/org.wesnoth/src-gen/org/wesnoth/WML.ecore#//WMLKey/is_Repeatable"/>
|
||||
</genClasses>
|
||||
<genClasses ecoreClass="platform:/resource/org.wesnoth/src-gen/org/wesnoth/WML.ecore#//WMLKeyValue"/>
|
||||
<genClasses ecoreClass="platform:/resource/org.wesnoth/src-gen/org/wesnoth/WML.ecore#//WMLMacroCall">
|
||||
|
@ -54,6 +50,10 @@
|
|||
<genClasses ecoreClass="platform:/resource/org.wesnoth/src-gen/org/wesnoth/WML.ecore#//WMLExpression">
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute platform:/resource/org.wesnoth/src-gen/org/wesnoth/WML.ecore#//WMLExpression/name"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute platform:/resource/org.wesnoth/src-gen/org/wesnoth/WML.ecore#//WMLExpression/_Cardinality"/>
|
||||
<genOperations ecoreOperation="platform:/resource/org.wesnoth/src-gen/org/wesnoth/WML.ecore#//WMLExpression/is_Required"/>
|
||||
<genOperations ecoreOperation="platform:/resource/org.wesnoth/src-gen/org/wesnoth/WML.ecore#//WMLExpression/is_Forbidden"/>
|
||||
<genOperations ecoreOperation="platform:/resource/org.wesnoth/src-gen/org/wesnoth/WML.ecore#//WMLExpression/is_Optional"/>
|
||||
<genOperations ecoreOperation="platform:/resource/org.wesnoth/src-gen/org/wesnoth/WML.ecore#//WMLExpression/is_Repeatable"/>
|
||||
<genOperations ecoreOperation="platform:/resource/org.wesnoth/src-gen/org/wesnoth/WML.ecore#//WMLExpression/isWMLTag"/>
|
||||
<genOperations ecoreOperation="platform:/resource/org.wesnoth/src-gen/org/wesnoth/WML.ecore#//WMLExpression/asWMLTag"/>
|
||||
<genOperations ecoreOperation="platform:/resource/org.wesnoth/src-gen/org/wesnoth/WML.ecore#//WMLExpression/isWMLKey"/>
|
||||
|
|
|
@ -80,6 +80,38 @@ public interface WMLExpression extends WMLValuedExpression
|
|||
*/
|
||||
void set_Cardinality(char value);
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @model annotation="http://www.eclipse.org/emf/2002/GenModel body='return _Cardinality == \'1\';'"
|
||||
* @generated
|
||||
*/
|
||||
boolean is_Required();
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @model annotation="http://www.eclipse.org/emf/2002/GenModel body='return _Cardinality == \'-\';'"
|
||||
* @generated
|
||||
*/
|
||||
boolean is_Forbidden();
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @model annotation="http://www.eclipse.org/emf/2002/GenModel body='return _Cardinality == \'?\';'"
|
||||
* @generated
|
||||
*/
|
||||
boolean is_Optional();
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @model annotation="http://www.eclipse.org/emf/2002/GenModel body='return _Cardinality == \'*\';'"
|
||||
* @generated
|
||||
*/
|
||||
boolean is_Repeatable();
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
|
|
|
@ -154,36 +154,4 @@ public interface WMLKey extends WMLExpression
|
|||
*/
|
||||
void set_DataType(String value);
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @model annotation="http://www.eclipse.org/emf/2002/GenModel body='return _Cardinality == \'1\';'"
|
||||
* @generated
|
||||
*/
|
||||
boolean is_Required();
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @model annotation="http://www.eclipse.org/emf/2002/GenModel body='return _Cardinality == \'-\';'"
|
||||
* @generated
|
||||
*/
|
||||
boolean is_Forbidden();
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @model annotation="http://www.eclipse.org/emf/2002/GenModel body='return _Cardinality == \'?\';'"
|
||||
* @generated
|
||||
*/
|
||||
boolean is_Optional();
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @model annotation="http://www.eclipse.org/emf/2002/GenModel body='return _Cardinality == \'*\';'"
|
||||
* @generated
|
||||
*/
|
||||
boolean is_Repeatable();
|
||||
|
||||
} // WMLKey
|
||||
|
|
|
@ -140,6 +140,46 @@ public class WMLExpressionImpl extends WMLValuedExpressionImpl implements WMLExp
|
|||
eNotify(new ENotificationImpl(this, Notification.SET, WmlPackage.WML_EXPRESSION__CARDINALITY, old_Cardinality, _Cardinality));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public boolean is_Required()
|
||||
{
|
||||
return _Cardinality == '1';
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public boolean is_Forbidden()
|
||||
{
|
||||
return _Cardinality == '-';
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public boolean is_Optional()
|
||||
{
|
||||
return _Cardinality == '?';
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public boolean is_Repeatable()
|
||||
{
|
||||
return _Cardinality == '*';
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
|
|
|
@ -261,46 +261,6 @@ public class WMLKeyImpl extends WMLExpressionImpl implements WMLKey
|
|||
eNotify(new ENotificationImpl(this, Notification.SET, WmlPackage.WML_KEY__DATA_TYPE, old_DataType, _DataType));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public boolean is_Required()
|
||||
{
|
||||
return _Cardinality == '1';
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public boolean is_Forbidden()
|
||||
{
|
||||
return _Cardinality == '-';
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public boolean is_Optional()
|
||||
{
|
||||
return _Cardinality == '?';
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public boolean is_Repeatable()
|
||||
{
|
||||
return _Cardinality == '*';
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
|
|
|
@ -266,6 +266,46 @@ public class WMLMacroCallImpl extends WMLKeyValueImpl implements WMLMacroCall
|
|||
return parameters;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public boolean is_Required()
|
||||
{
|
||||
return _Cardinality == '1';
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public boolean is_Forbidden()
|
||||
{
|
||||
return _Cardinality == '-';
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public boolean is_Optional()
|
||||
{
|
||||
return _Cardinality == '?';
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public boolean is_Repeatable()
|
||||
{
|
||||
return _Cardinality == '*';
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
|
|
|
@ -734,14 +734,6 @@ public class WmlPackageImpl extends EPackageImpl implements WmlPackage
|
|||
initEAttribute(getWMLKey__Translatable(), ecorePackage.getEBoolean(), "_Translatable", "false", 0, 1, WMLKey.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
initEAttribute(getWMLKey__DataType(), ecorePackage.getEString(), "_DataType", "", 0, 1, WMLKey.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
|
||||
addEOperation(wmlKeyEClass, ecorePackage.getEBoolean(), "is_Required", 0, 1, IS_UNIQUE, IS_ORDERED);
|
||||
|
||||
addEOperation(wmlKeyEClass, ecorePackage.getEBoolean(), "is_Forbidden", 0, 1, IS_UNIQUE, IS_ORDERED);
|
||||
|
||||
addEOperation(wmlKeyEClass, ecorePackage.getEBoolean(), "is_Optional", 0, 1, IS_UNIQUE, IS_ORDERED);
|
||||
|
||||
addEOperation(wmlKeyEClass, ecorePackage.getEBoolean(), "is_Repeatable", 0, 1, IS_UNIQUE, IS_ORDERED);
|
||||
|
||||
initEClass(wmlKeyValueEClass, WMLKeyValue.class, "WMLKeyValue", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
|
||||
|
||||
initEClass(wmlMacroCallEClass, WMLMacroCall.class, "WMLMacroCall", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
|
||||
|
@ -770,6 +762,14 @@ public class WmlPackageImpl extends EPackageImpl implements WmlPackage
|
|||
initEAttribute(getWMLExpression_Name(), ecorePackage.getEString(), "name", "", 0, 1, WMLExpression.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
initEAttribute(getWMLExpression__Cardinality(), ecorePackage.getEChar(), "_Cardinality", " ", 0, 1, WMLExpression.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
|
||||
addEOperation(wmlExpressionEClass, ecorePackage.getEBoolean(), "is_Required", 0, 1, IS_UNIQUE, IS_ORDERED);
|
||||
|
||||
addEOperation(wmlExpressionEClass, ecorePackage.getEBoolean(), "is_Forbidden", 0, 1, IS_UNIQUE, IS_ORDERED);
|
||||
|
||||
addEOperation(wmlExpressionEClass, ecorePackage.getEBoolean(), "is_Optional", 0, 1, IS_UNIQUE, IS_ORDERED);
|
||||
|
||||
addEOperation(wmlExpressionEClass, ecorePackage.getEBoolean(), "is_Repeatable", 0, 1, IS_UNIQUE, IS_ORDERED);
|
||||
|
||||
addEOperation(wmlExpressionEClass, ecorePackage.getEBoolean(), "isWMLTag", 0, 1, IS_UNIQUE, IS_ORDERED);
|
||||
|
||||
addEOperation(wmlExpressionEClass, this.getWMLTag(), "asWMLTag", 0, 1, IS_UNIQUE, IS_ORDERED);
|
||||
|
|
|
@ -16,6 +16,12 @@ process( EClass this ):
|
|||
// enrich the grammar elements with schema-specific attributes
|
||||
if name == "WMLExpression" then {
|
||||
createAttribute( "_Cardinality", "EChar", " " ) ->
|
||||
|
||||
createCardinalityOperation( "is_Required", '1' ) ->
|
||||
createCardinalityOperation( "is_Forbidden", '-' ) ->
|
||||
createCardinalityOperation( "is_Optional", '?' ) ->
|
||||
createCardinalityOperation( "is_Repeatable", '*' ) ->
|
||||
|
||||
createOperation( "isWMLTag", "return ( this instanceof WMLTag );", "EBoolean" ) ->
|
||||
createOperation( "asWMLTag", "if ( !( this instanceof WMLTag ) ) return null; return ( WMLTag ) this;", "WMLTag" ) ->
|
||||
createOperation( "isWMLKey", "return ( this instanceof WMLKey );", "EBoolean" ) ->
|
||||
|
@ -27,12 +33,7 @@ process( EClass this ):
|
|||
} else if name == "WMLKey" then {
|
||||
createAttribute( "_Enum", "EBoolean", "false" ) ->
|
||||
createAttribute( "_Translatable", "EBoolean", "false" ) ->
|
||||
createAttribute( "_DataType", "EString", "" ) ->
|
||||
|
||||
createCardinalityOperation( "is_Required", '1' ) ->
|
||||
createCardinalityOperation( "is_Forbidden", '-' ) ->
|
||||
createCardinalityOperation( "is_Optional", '?' ) ->
|
||||
createCardinalityOperation( "is_Repeatable", '*' )
|
||||
createAttribute( "_DataType", "EString", "" )
|
||||
};
|
||||
|
||||
process( EStructuralFeature this ):
|
||||
|
|
Loading…
Add table
Reference in a new issue