Browse Source

removed scopes plugin, added abstract attribute to Type class

Andreas Mülder 11 years ago
parent
commit
1f74f4531a

+ 1 - 0
plugins/org.yakindu.base.types/model/types.ecore

@@ -9,6 +9,7 @@
     <eStructuralFeatures xsi:type="ecore:EReference" name="constraint" upperBound="-1"
         eType="#//TypeConstraint" containment="true"/>
     <eStructuralFeatures xsi:type="ecore:EAttribute" name="scheme" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+    <eStructuralFeatures xsi:type="ecore:EAttribute" name="abstract" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
   </eClassifiers>
   <eClassifiers xsi:type="ecore:EClass" name="Feature" abstract="true" eSuperTypes="#//TypedElement base.ecore#//NamedElement">
     <eStructuralFeatures xsi:type="ecore:EReference" name="owningType" eType="#//ComplexType"

+ 27 - 0
plugins/org.yakindu.base.types/src-gen/org/yakindu/base/types/Type.java

@@ -18,6 +18,7 @@ import org.eclipse.emf.common.util.EList;
  * <ul>
  *   <li>{@link org.yakindu.base.types.Type#getConstraint <em>Constraint</em>}</li>
  *   <li>{@link org.yakindu.base.types.Type#getScheme <em>Scheme</em>}</li>
+ *   <li>{@link org.yakindu.base.types.Type#isAbstract <em>Abstract</em>}</li>
  * </ul>
  * </p>
  *
@@ -69,4 +70,30 @@ public interface Type extends PackageMember {
 	 */
 	void setScheme(String value);
 
+	/**
+	 * Returns the value of the '<em><b>Abstract</b></em>' attribute.
+	 * <!-- begin-user-doc -->
+	 * <p>
+	 * If the meaning of the '<em>Abstract</em>' attribute isn't clear,
+	 * there really should be more of a description here...
+	 * </p>
+	 * <!-- end-user-doc -->
+	 * @return the value of the '<em>Abstract</em>' attribute.
+	 * @see #setAbstract(boolean)
+	 * @see org.yakindu.base.types.TypesPackage#getType_Abstract()
+	 * @model
+	 * @generated
+	 */
+	boolean isAbstract();
+
+	/**
+	 * Sets the value of the '{@link org.yakindu.base.types.Type#isAbstract <em>Abstract</em>}' attribute.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @param value the new value of the '<em>Abstract</em>' attribute.
+	 * @see #isAbstract()
+	 * @generated
+	 */
+	void setAbstract(boolean value);
+
 } // Type

+ 74 - 1
plugins/org.yakindu.base.types/src-gen/org/yakindu/base/types/TypesPackage.java

@@ -212,6 +212,15 @@ public interface TypesPackage extends EPackage {
 	 */
 	int TYPE__SCHEME = PACKAGE_MEMBER_FEATURE_COUNT + 1;
 
+	/**
+	 * The feature id for the '<em><b>Abstract</b></em>' attribute.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 * @ordered
+	 */
+	int TYPE__ABSTRACT = PACKAGE_MEMBER_FEATURE_COUNT + 2;
+
 	/**
 	 * The number of structural features of the '<em>Type</em>' class.
 	 * <!-- begin-user-doc -->
@@ -219,7 +228,7 @@ public interface TypesPackage extends EPackage {
 	 * @generated
 	 * @ordered
 	 */
-	int TYPE_FEATURE_COUNT = PACKAGE_MEMBER_FEATURE_COUNT + 2;
+	int TYPE_FEATURE_COUNT = PACKAGE_MEMBER_FEATURE_COUNT + 3;
 
 	/**
 	 * The feature id for the '<em><b>Type</b></em>' reference.
@@ -541,6 +550,15 @@ public interface TypesPackage extends EPackage {
 	 */
 	int PRIMITIVE_TYPE__SCHEME = TYPE__SCHEME;
 
+	/**
+	 * The feature id for the '<em><b>Abstract</b></em>' attribute.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 * @ordered
+	 */
+	int PRIMITIVE_TYPE__ABSTRACT = TYPE__ABSTRACT;
+
 	/**
 	 * The feature id for the '<em><b>Base Type</b></em>' reference.
 	 * <!-- begin-user-doc -->
@@ -586,6 +604,15 @@ public interface TypesPackage extends EPackage {
 	 */
 	int ENUMERATION_TYPE__SCHEME = PRIMITIVE_TYPE__SCHEME;
 
+	/**
+	 * The feature id for the '<em><b>Abstract</b></em>' attribute.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 * @ordered
+	 */
+	int ENUMERATION_TYPE__ABSTRACT = PRIMITIVE_TYPE__ABSTRACT;
+
 	/**
 	 * The feature id for the '<em><b>Base Type</b></em>' reference.
 	 * <!-- begin-user-doc -->
@@ -650,6 +677,15 @@ public interface TypesPackage extends EPackage {
 	 */
 	int PARAMETERIZED_TYPE__SCHEME = TYPE__SCHEME;
 
+	/**
+	 * The feature id for the '<em><b>Abstract</b></em>' attribute.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 * @ordered
+	 */
+	int PARAMETERIZED_TYPE__ABSTRACT = TYPE__ABSTRACT;
+
 	/**
 	 * The feature id for the '<em><b>Parameter</b></em>' containment reference list.
 	 * <!-- begin-user-doc -->
@@ -705,6 +741,15 @@ public interface TypesPackage extends EPackage {
 	 */
 	int COMPLEX_TYPE__SCHEME = PARAMETERIZED_TYPE__SCHEME;
 
+	/**
+	 * The feature id for the '<em><b>Abstract</b></em>' attribute.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 * @ordered
+	 */
+	int COMPLEX_TYPE__ABSTRACT = PARAMETERIZED_TYPE__ABSTRACT;
+
 	/**
 	 * The feature id for the '<em><b>Parameter</b></em>' containment reference list.
 	 * <!-- begin-user-doc -->
@@ -853,6 +898,15 @@ public interface TypesPackage extends EPackage {
 	 */
 	int TYPE_PARAMETER__SCHEME = TYPE__SCHEME;
 
+	/**
+	 * The feature id for the '<em><b>Abstract</b></em>' attribute.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 * @ordered
+	 */
+	int TYPE_PARAMETER__ABSTRACT = TYPE__ABSTRACT;
+
 	/**
 	 * The feature id for the '<em><b>Bound</b></em>' reference.
 	 * <!-- begin-user-doc -->
@@ -970,6 +1024,17 @@ public interface TypesPackage extends EPackage {
 	 */
 	EAttribute getType_Scheme();
 
+	/**
+	 * Returns the meta object for the attribute '{@link org.yakindu.base.types.Type#isAbstract <em>Abstract</em>}'.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @return the meta object for the attribute '<em>Abstract</em>'.
+	 * @see org.yakindu.base.types.Type#isAbstract()
+	 * @see #getType()
+	 * @generated
+	 */
+	EAttribute getType_Abstract();
+
 	/**
 	 * Returns the meta object for class '{@link org.yakindu.base.types.Feature <em>Feature</em>}'.
 	 * <!-- begin-user-doc -->
@@ -1362,6 +1427,14 @@ public interface TypesPackage extends EPackage {
 		 */
 		EAttribute TYPE__SCHEME = eINSTANCE.getType_Scheme();
 
+		/**
+		 * The meta object literal for the '<em><b>Abstract</b></em>' attribute feature.
+		 * <!-- begin-user-doc -->
+		 * <!-- end-user-doc -->
+		 * @generated
+		 */
+		EAttribute TYPE__ABSTRACT = eINSTANCE.getType_Abstract();
+
 		/**
 		 * The meta object literal for the '{@link org.yakindu.base.types.impl.FeatureImpl <em>Feature</em>}' class.
 		 * <!-- begin-user-doc -->

+ 52 - 0
plugins/org.yakindu.base.types/src-gen/org/yakindu/base/types/impl/TypeImpl.java

@@ -29,6 +29,7 @@ import org.yakindu.base.types.TypesPackage;
  * <ul>
  *   <li>{@link org.yakindu.base.types.impl.TypeImpl#getConstraint <em>Constraint</em>}</li>
  *   <li>{@link org.yakindu.base.types.impl.TypeImpl#getScheme <em>Scheme</em>}</li>
+ *   <li>{@link org.yakindu.base.types.impl.TypeImpl#isAbstract <em>Abstract</em>}</li>
  * </ul>
  * </p>
  *
@@ -64,6 +65,26 @@ public abstract class TypeImpl extends PackageMemberImpl implements Type {
 	 */
 	protected String scheme = SCHEME_EDEFAULT;
 
+	/**
+	 * The default value of the '{@link #isAbstract() <em>Abstract</em>}' attribute.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @see #isAbstract()
+	 * @generated
+	 * @ordered
+	 */
+	protected static final boolean ABSTRACT_EDEFAULT = false;
+
+	/**
+	 * The cached value of the '{@link #isAbstract() <em>Abstract</em>}' attribute.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @see #isAbstract()
+	 * @generated
+	 * @ordered
+	 */
+	protected boolean abstract_ = ABSTRACT_EDEFAULT;
+
 	/**
 	 * <!-- begin-user-doc -->
 	 * <!-- end-user-doc -->
@@ -116,6 +137,27 @@ public abstract class TypeImpl extends PackageMemberImpl implements Type {
 			eNotify(new ENotificationImpl(this, Notification.SET, TypesPackage.TYPE__SCHEME, oldScheme, scheme));
 	}
 
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public boolean isAbstract() {
+		return abstract_;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public void setAbstract(boolean newAbstract) {
+		boolean oldAbstract = abstract_;
+		abstract_ = newAbstract;
+		if (eNotificationRequired())
+			eNotify(new ENotificationImpl(this, Notification.SET, TypesPackage.TYPE__ABSTRACT, oldAbstract, abstract_));
+	}
+
 	/**
 	 * <!-- begin-user-doc -->
 	 * <!-- end-user-doc -->
@@ -142,6 +184,8 @@ public abstract class TypeImpl extends PackageMemberImpl implements Type {
 				return getConstraint();
 			case TypesPackage.TYPE__SCHEME:
 				return getScheme();
+			case TypesPackage.TYPE__ABSTRACT:
+				return isAbstract();
 		}
 		return super.eGet(featureID, resolve, coreType);
 	}
@@ -162,6 +206,9 @@ public abstract class TypeImpl extends PackageMemberImpl implements Type {
 			case TypesPackage.TYPE__SCHEME:
 				setScheme((String)newValue);
 				return;
+			case TypesPackage.TYPE__ABSTRACT:
+				setAbstract((Boolean)newValue);
+				return;
 		}
 		super.eSet(featureID, newValue);
 	}
@@ -180,6 +227,9 @@ public abstract class TypeImpl extends PackageMemberImpl implements Type {
 			case TypesPackage.TYPE__SCHEME:
 				setScheme(SCHEME_EDEFAULT);
 				return;
+			case TypesPackage.TYPE__ABSTRACT:
+				setAbstract(ABSTRACT_EDEFAULT);
+				return;
 		}
 		super.eUnset(featureID);
 	}
@@ -196,6 +246,8 @@ public abstract class TypeImpl extends PackageMemberImpl implements Type {
 				return constraint != null && !constraint.isEmpty();
 			case TypesPackage.TYPE__SCHEME:
 				return SCHEME_EDEFAULT == null ? scheme != null : !SCHEME_EDEFAULT.equals(scheme);
+			case TypesPackage.TYPE__ABSTRACT:
+				return abstract_ != ABSTRACT_EDEFAULT;
 		}
 		return super.eIsSet(featureID);
 	}

+ 11 - 0
plugins/org.yakindu.base.types/src-gen/org/yakindu/base/types/impl/TypesPackageImpl.java

@@ -252,6 +252,15 @@ public class TypesPackageImpl extends EPackageImpl implements TypesPackage {
 		return (EAttribute)typeEClass.getEStructuralFeatures().get(1);
 	}
 
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public EAttribute getType_Abstract() {
+		return (EAttribute)typeEClass.getEStructuralFeatures().get(2);
+	}
+
 	/**
 	 * <!-- begin-user-doc --> <!-- end-user-doc -->
 	 * @generated
@@ -544,6 +553,7 @@ public class TypesPackageImpl extends EPackageImpl implements TypesPackage {
 		typeEClass = createEClass(TYPE);
 		createEReference(typeEClass, TYPE__CONSTRAINT);
 		createEAttribute(typeEClass, TYPE__SCHEME);
+		createEAttribute(typeEClass, TYPE__ABSTRACT);
 
 		featureEClass = createEClass(FEATURE);
 		createEReference(featureEClass, FEATURE__OWNING_TYPE);
@@ -647,6 +657,7 @@ public class TypesPackageImpl extends EPackageImpl implements TypesPackage {
 		initEClass(typeEClass, Type.class, "Type", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
 		initEReference(getType_Constraint(), this.getTypeConstraint(), null, "constraint", null, 0, -1, Type.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
 		initEAttribute(getType_Scheme(), ecorePackage.getEString(), "scheme", null, 0, 1, Type.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+		initEAttribute(getType_Abstract(), ecorePackage.getEBoolean(), "abstract", null, 0, 1, Type.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
 
 		initEClass(featureEClass, Feature.class, "Feature", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
 		initEReference(getFeature_OwningType(), this.getComplexType(), this.getComplexType_Features(), "owningType", null, 0, 1, Feature.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

+ 1 - 2
plugins/org.yakindu.base.types/src/org/yakindu/base/types/typesystem/DefaultTypeSystem.java

@@ -44,11 +44,10 @@ public class DefaultTypeSystem extends AbstractTypeSystem {
 		declareSuperType(getType(INTEGER), getType(REAL));
 	}
 
-	public Type declarePrimitive(String name) {
+	protected Type declarePrimitive(String name) {
 		PrimitiveType primitive = TypesFactory.eINSTANCE.createPrimitiveType();
 		primitive.setName(name);
 		declareType(primitive, name);
 		return primitive;
-
 	}
 }

+ 0 - 1
releng/org.yakindu.base.releng/pom.xml

@@ -377,7 +377,6 @@
 
 		<module>../org.yakindu.base.types</module>
 		<module>../org.yakindu.base.types.edit</module>
-		<module>../org.yakindu.base.types.scope</module>
 
 		<module>../org.yakindu.base.expressions</module>
 		<module>../org.yakindu.base.expressions.edit</module>