Andreas Mülder пре 14 година
родитељ
комит
a07c7808ec

+ 1 - 1
plugins/org.yakindu.sct.model.sgraph/model/emf/sgraph.ecore

@@ -94,7 +94,7 @@
   <eClassifiers xsi:type="ecore:EClass" name="State" eSuperTypes="#//SpecificationElement #//ReactiveElement #//ScopedElement #//RegularState #//CompositeElement">
     <eAnnotations source="InjectMembers"/>
     <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
-      <details key="constraints" value="NameIsNotEmpty NameIsValidJavaIdentifier"/>
+      <details key="constraints" value="NameIsNotEmpty"/>
     </eAnnotations>
     <eStructuralFeatures xsi:type="ecore:EAttribute" name="orthogonal" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"
         changeable="false" volatile="true" transient="true" derived="true"/>

+ 14 - 7
plugins/org.yakindu.sct.model.sgraph/model/emf/sgraph.genmodel

@@ -12,6 +12,10 @@
       <genEnumLiterals ecoreEnumLiteral="sgraph.ecore#//EntryKind/shallowHistory"/>
       <genEnumLiterals ecoreEnumLiteral="sgraph.ecore#//EntryKind/deepHistory"/>
     </genEnums>
+    <genEnums typeSafeEnumCompatible="false" ecoreEnum="sgraph.ecore#//ChoiceKind">
+      <genEnumLiterals ecoreEnumLiteral="sgraph.ecore#//ChoiceKind/dynamic"/>
+      <genEnumLiterals ecoreEnumLiteral="sgraph.ecore#//ChoiceKind/static"/>
+    </genEnums>
     <genClasses image="false" ecoreClass="sgraph.ecore#//Pseudostate"/>
     <genClasses image="false" ecoreClass="sgraph.ecore#//Vertex">
       <genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference sgraph.ecore#//Vertex/parentRegion"/>
@@ -24,6 +28,7 @@
     <genClasses ecoreClass="sgraph.ecore#//Region">
       <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference sgraph.ecore#//Region/vertices"/>
       <genFeatures createChild="false" ecoreFeature="ecore:EAttribute sgraph.ecore#//Region/priority"/>
+      <genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference sgraph.ecore#//Region/composite"/>
     </genClasses>
     <genClasses ecoreClass="sgraph.ecore#//Transition">
       <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference sgraph.ecore#//Transition/target"/>
@@ -33,17 +38,17 @@
     <genClasses ecoreClass="sgraph.ecore#//FinalState"/>
     <genClasses image="false" ecoreClass="sgraph.ecore#//Variable"/>
     <genClasses ecoreClass="sgraph.ecore#//Event"/>
-    <genClasses ecoreClass="sgraph.ecore#//Choice"/>
-    <genClasses ecoreClass="sgraph.ecore#//Statechart">
-      <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference sgraph.ecore#//Statechart/regions"/>
+    <genClasses ecoreClass="sgraph.ecore#//Choice">
+      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute sgraph.ecore#//Choice/kind"/>
     </genClasses>
+    <genClasses ecoreClass="sgraph.ecore#//Statechart"/>
     <genClasses ecoreClass="sgraph.ecore#//Entry">
       <genFeatures createChild="false" ecoreFeature="ecore:EAttribute sgraph.ecore#//Entry/kind"/>
     </genClasses>
     <genClasses image="false" ecoreClass="sgraph.ecore#//Trigger"/>
     <genClasses image="false" ecoreClass="sgraph.ecore#//Effect"/>
-    <genClasses image="false" ecoreClass="sgraph.ecore#//ExpressionElement">
-      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute sgraph.ecore#//ExpressionElement/expression"/>
+    <genClasses image="false" ecoreClass="sgraph.ecore#//SpecificationElement">
+      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute sgraph.ecore#//SpecificationElement/specification"/>
     </genClasses>
     <genClasses image="false" ecoreClass="sgraph.ecore#//Declaration"/>
     <genClasses image="false" ecoreClass="sgraph.ecore#//Reaction">
@@ -66,16 +71,18 @@
     </genClasses>
     <genClasses ecoreClass="sgraph.ecore#//Synchronization"/>
     <genClasses ecoreClass="sgraph.ecore#//State">
-      <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference sgraph.ecore#//State/subRegions"/>
       <genFeatures property="Readonly" createChild="false" ecoreFeature="ecore:EAttribute sgraph.ecore#//State/orthogonal"/>
       <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference sgraph.ecore#//State/substatechart"/>
       <genFeatures createChild="false" ecoreFeature="ecore:EAttribute sgraph.ecore#//State/substatechartId"/>
-      <genFeatures property="Readonly" createChild="false" ecoreFeature="ecore:EAttribute sgraph.ecore#//State/submachine"/>
+      <genFeatures property="Readonly" createChild="false" ecoreFeature="ecore:EAttribute sgraph.ecore#//State/subchart"/>
       <genFeatures createChild="false" ecoreFeature="ecore:EAttribute sgraph.ecore#//State/simple"/>
       <genFeatures property="Readonly" createChild="false" ecoreFeature="ecore:EAttribute sgraph.ecore#//State/composite"/>
       <genFeatures property="Readonly" createChild="false" ecoreFeature="ecore:EAttribute sgraph.ecore#//State/leaf"/>
     </genClasses>
     <genClasses ecoreClass="sgraph.ecore#//Statement"/>
     <genClasses ecoreClass="sgraph.ecore#//RegularState"/>
+    <genClasses image="false" ecoreClass="sgraph.ecore#//CompositeElement">
+      <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference sgraph.ecore#//CompositeElement/regions"/>
+    </genClasses>
   </genPackages>
 </genmodel:GenModel>

+ 1 - 1
plugins/org.yakindu.sct.model.sgraph/src/org/yakindu/sct/model/sgraph/State.java

@@ -30,7 +30,7 @@ package org.yakindu.sct.model.sgraph;
  * </p>
  *
  * @see org.yakindu.sct.model.sgraph.SGraphPackage#getState()
- * @model annotation="http://www.eclipse.org/emf/2002/Ecore constraints='NameIsNotEmpty NameIsValidJavaIdentifier'"
+ * @model annotation="http://www.eclipse.org/emf/2002/Ecore constraints='NameIsNotEmpty'"
  * @generated
  */
 public interface State extends SpecificationElement, ReactiveElement, ScopedElement, RegularState, CompositeElement {

+ 1 - 1
plugins/org.yakindu.sct.model.sgraph/src/org/yakindu/sct/model/sgraph/impl/sgraph.ecore

@@ -93,7 +93,7 @@
   <eClassifiers xsi:type="ecore:EClass" name="State" eSuperTypes="#//SpecificationElement #//ReactiveElement #//ScopedElement #//RegularState #//CompositeElement">
     <eAnnotations source="InjectMembers"/>
     <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
-      <details key="constraints" value="NameIsNotEmpty NameIsValidJavaIdentifier"/>
+      <details key="constraints" value="NameIsNotEmpty"/>
     </eAnnotations>
     <eStructuralFeatures xsi:type="ecore:EAttribute" name="orthogonal" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"
         changeable="false" volatile="true" transient="true" derived="true"/>

+ 0 - 25
plugins/org.yakindu.sct.model.sgraph/src/org/yakindu/sct/model/sgraph/util/SGraphValidator.java

@@ -57,7 +57,6 @@ import org.yakindu.sct.model.sgraph.Vertex;
 public class SGraphValidator extends EObjectValidator {
 
 	public static final String ISSUE_STATE_WITHOUT_NAME = "A state must have a name.";
-	public static final String ISSUE_STATE_NAME_IDENTIFIER = "The state name must be a valid identifier.";
 	public static final String ISSUE_NODE_NOT_REACHABLE = "Node is not reachable due to missing incoming transition.";
 	public static final String ISSUE_FINAL_STATE_OUTGOING_TRANSITION = "A final state should have no outgoing transition.";
 	public static final String ISSUE_STATE_WITHOUT_OUTGOING_TRANSITION = "A state should have at least one outgoing transition.";
@@ -393,7 +392,6 @@ public class SGraphValidator extends EObjectValidator {
 		if (result || diagnostics != null) result &= validateVertex_IncomingTransitionCount(state, diagnostics, context);
 		if (result || diagnostics != null) result &= validateVertex_OutgoingTransitionCount(state, diagnostics, context);
 		if (result || diagnostics != null) result &= validateState_NameIsNotEmpty(state, diagnostics, context);
-		if (result || diagnostics != null) result &= validateState_NameIsValidJavaIdentifier(state, diagnostics, context);
 		return result;
 	}
 
@@ -412,29 +410,6 @@ public class SGraphValidator extends EObjectValidator {
 		return true;
 	}
 
-	/**
-	 * Validates the NameIsValidJavaIdentifier constraint of '<em>State</em>'.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated NOT
-	 */
-	public boolean validateState_NameIsValidJavaIdentifier(State state,
-			DiagnosticChain diagnostics, Map<Object, Object> context) {
-		if (state.getName() == null || state.getName().trim().length() == 0) {
-			return true;
-		}
-		char[] c = state.getName().toCharArray();
-		if (!Character.isJavaIdentifierStart(c[0])) {
-			return error(state, diagnostics, ISSUE_STATE_NAME_IDENTIFIER);
-		}
-		for (int i = 1; i < c.length; i++) {
-			if (!Character.isJavaIdentifierPart(c[i])) {
-				return error(state, diagnostics, ISSUE_STATE_NAME_IDENTIFIER);
-			}
-		}
-		return true;
-	}
-
 	/**
 	 * <!-- begin-user-doc --> <!-- end-user-doc -->
 	 * @generated