summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsefftinge2008-03-04 06:00:30 (EST)
committer sefftinge2008-03-04 06:00:30 (EST)
commit3fb99a748300be0b5774d0a9011b59b4f1404691 (patch)
treeaa3662e435896e335c3de075ca29ca38bc74bd7e
parentb97e76a1eecf75230484a4479190d1e57b40f158 (diff)
downloadorg.eclipse.xpand-3fb99a748300be0b5774d0a9011b59b4f1404691.zip
org.eclipse.xpand-3fb99a748300be0b5774d0a9011b59b4f1404691.tar.gz
org.eclipse.xpand-3fb99a748300be0b5774d0a9011b59b4f1404691.tar.bz2
reference to BackendType introduced
-rw-r--r--plugins/org.eclipse.xpand3/META-INF/MANIFEST.MF3
-rw-r--r--plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/staticTypesystem/StaticTypesystemPackage.java35
-rw-r--r--plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/staticTypesystem/declaration/DeclarationPackage.java33
-rw-r--r--plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/staticTypesystem/declaration/DeclaredType.java30
-rw-r--r--plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/staticTypesystem/declaration/impl/DeclarationPackageImpl.java14
-rw-r--r--plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/staticTypesystem/declaration/impl/DeclaredTypeImpl.java73
-rw-r--r--plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/staticTypesystem/impl/StaticTypesystemFactoryImpl.java52
-rw-r--r--plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/staticTypesystem/impl/StaticTypesystemPackageImpl.java26
-rw-r--r--plugins/org.eclipse.xpand3/src/org/eclipse/xand3/analyzation/typesystem/builtin/BuiltinDeclarationsContributor.java16
-rw-r--r--plugins/org.eclipse.xpand3/src/static_typesystem.ecore3
10 files changed, 268 insertions, 17 deletions
diff --git a/plugins/org.eclipse.xpand3/META-INF/MANIFEST.MF b/plugins/org.eclipse.xpand3/META-INF/MANIFEST.MF
index fd31ff8..e4b6efa 100644
--- a/plugins/org.eclipse.xpand3/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.xpand3/META-INF/MANIFEST.MF
@@ -10,7 +10,8 @@ Bundle-RequiredExecutionEnvironment: J2SE-1.5
Require-Bundle: org.antlr.patched;bundle-version="3.0.0",
org.eclipse.core.runtime,
org.eclipse.emf.ecore;visibility:=reexport,
- org.junit
+ org.junit,
+ org.eclipse.xtend.backend;bundle-version="0.7.0"
Export-Package: org.eclipse.xpand3,
org.eclipse.xpand3.declaration,
org.eclipse.xpand3.declaration.impl,
diff --git a/plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/staticTypesystem/StaticTypesystemPackage.java b/plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/staticTypesystem/StaticTypesystemPackage.java
index b989411..f1d1a21 100644
--- a/plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/staticTypesystem/StaticTypesystemPackage.java
+++ b/plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/staticTypesystem/StaticTypesystemPackage.java
@@ -2,12 +2,13 @@
* <copyright>
* </copyright>
*
- * $Id: StaticTypesystemPackage.java,v 1.1 2008/03/04 10:53:03 sefftinge Exp $
+ * $Id: StaticTypesystemPackage.java,v 1.2 2008/03/04 11:00:30 sefftinge Exp $
*/
package org.eclipse.xpand3.staticTypesystem;
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EDataType;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;
@@ -267,6 +268,17 @@ public interface StaticTypesystemPackage extends EPackage {
/**
+ * The meta object id for the '<em>Backend Type</em>' data type.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.xtend.backend.common.BackendType
+ * @see org.eclipse.xpand3.staticTypesystem.impl.StaticTypesystemPackageImpl#getBackendType()
+ * @generated
+ */
+ int BACKEND_TYPE = 7;
+
+
+ /**
* Returns the meta object for class '{@link org.eclipse.xpand3.staticTypesystem.AbstractNamedElement <em>Abstract Named Element</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -425,6 +437,17 @@ public interface StaticTypesystemPackage extends EPackage {
EReference getFunctionType_ActualTypeArguments();
/**
+ * Returns the meta object for data type '{@link org.eclipse.xtend.backend.common.BackendType <em>Backend Type</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for data type '<em>Backend Type</em>'.
+ * @see org.eclipse.xtend.backend.common.BackendType
+ * @model instanceClass="org.eclipse.xtend.backend.common.BackendType"
+ * @generated
+ */
+ EDataType getBackendType();
+
+ /**
* Returns the factory that creates the instances of the model.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -580,6 +603,16 @@ public interface StaticTypesystemPackage extends EPackage {
*/
EReference FUNCTION_TYPE__ACTUAL_TYPE_ARGUMENTS = eINSTANCE.getFunctionType_ActualTypeArguments();
+ /**
+ * The meta object literal for the '<em>Backend Type</em>' data type.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.xtend.backend.common.BackendType
+ * @see org.eclipse.xpand3.staticTypesystem.impl.StaticTypesystemPackageImpl#getBackendType()
+ * @generated
+ */
+ EDataType BACKEND_TYPE = eINSTANCE.getBackendType();
+
}
} //StaticTypesystemPackage
diff --git a/plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/staticTypesystem/declaration/DeclarationPackage.java b/plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/staticTypesystem/declaration/DeclarationPackage.java
index d1badfe..dacf6bc 100644
--- a/plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/staticTypesystem/declaration/DeclarationPackage.java
+++ b/plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/staticTypesystem/declaration/DeclarationPackage.java
@@ -2,10 +2,11 @@
* <copyright>
* </copyright>
*
- * $Id: DeclarationPackage.java,v 1.1 2008/03/04 10:52:59 sefftinge Exp $
+ * $Id: DeclarationPackage.java,v 1.2 2008/03/04 11:00:30 sefftinge Exp $
*/
package org.eclipse.xpand3.staticTypesystem.declaration;
+import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;
@@ -116,13 +117,22 @@ public interface DeclarationPackage extends EPackage {
int DECLARED_TYPE__DECLARED_TYPE_PARAMETERS = StaticTypesystemPackage.ABSTRACT_NAMED_ELEMENT_FEATURE_COUNT + 3;
/**
+ * The feature id for the '<em><b>Backend Type</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int DECLARED_TYPE__BACKEND_TYPE = StaticTypesystemPackage.ABSTRACT_NAMED_ELEMENT_FEATURE_COUNT + 4;
+
+ /**
* The number of structural features of the '<em>Declared Type</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- int DECLARED_TYPE_FEATURE_COUNT = StaticTypesystemPackage.ABSTRACT_NAMED_ELEMENT_FEATURE_COUNT + 4;
+ int DECLARED_TYPE_FEATURE_COUNT = StaticTypesystemPackage.ABSTRACT_NAMED_ELEMENT_FEATURE_COUNT + 5;
/**
* The meta object id for the '{@link org.eclipse.xpand3.staticTypesystem.declaration.impl.DeclaredOperationImpl <em>Declared Operation</em>}' class.
@@ -402,6 +412,17 @@ public interface DeclarationPackage extends EPackage {
EReference getDeclaredType_DeclaredTypeParameters();
/**
+ * Returns the meta object for the attribute '{@link org.eclipse.xpand3.staticTypesystem.declaration.DeclaredType#getBackendType <em>Backend Type</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Backend Type</em>'.
+ * @see org.eclipse.xpand3.staticTypesystem.declaration.DeclaredType#getBackendType()
+ * @see #getDeclaredType()
+ * @generated
+ */
+ EAttribute getDeclaredType_BackendType();
+
+ /**
* Returns the meta object for class '{@link org.eclipse.xpand3.staticTypesystem.declaration.DeclaredOperation <em>Declared Operation</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -592,6 +613,14 @@ public interface DeclarationPackage extends EPackage {
EReference DECLARED_TYPE__DECLARED_TYPE_PARAMETERS = eINSTANCE.getDeclaredType_DeclaredTypeParameters();
/**
+ * The meta object literal for the '<em><b>Backend Type</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute DECLARED_TYPE__BACKEND_TYPE = eINSTANCE.getDeclaredType_BackendType();
+
+ /**
* The meta object literal for the '{@link org.eclipse.xpand3.staticTypesystem.declaration.impl.DeclaredOperationImpl <em>Declared Operation</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
diff --git a/plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/staticTypesystem/declaration/DeclaredType.java b/plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/staticTypesystem/declaration/DeclaredType.java
index 438e73e..6753def 100644
--- a/plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/staticTypesystem/declaration/DeclaredType.java
+++ b/plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/staticTypesystem/declaration/DeclaredType.java
@@ -2,13 +2,14 @@
* <copyright>
* </copyright>
*
- * $Id: DeclaredType.java,v 1.1 2008/03/04 10:52:58 sefftinge Exp $
+ * $Id: DeclaredType.java,v 1.2 2008/03/04 11:00:30 sefftinge Exp $
*/
package org.eclipse.xpand3.staticTypesystem.declaration;
import org.eclipse.emf.common.util.EList;
import org.eclipse.xpand3.staticTypesystem.AbstractNamedElement;
+import org.eclipse.xtend.backend.common.BackendType;
/**
* <!-- begin-user-doc -->
@@ -22,6 +23,7 @@ import org.eclipse.xpand3.staticTypesystem.AbstractNamedElement;
* <li>{@link org.eclipse.xpand3.staticTypesystem.declaration.DeclaredType#getProperties <em>Properties</em>}</li>
* <li>{@link org.eclipse.xpand3.staticTypesystem.declaration.DeclaredType#getOperations <em>Operations</em>}</li>
* <li>{@link org.eclipse.xpand3.staticTypesystem.declaration.DeclaredType#getDeclaredTypeParameters <em>Declared Type Parameters</em>}</li>
+ * <li>{@link org.eclipse.xpand3.staticTypesystem.declaration.DeclaredType#getBackendType <em>Backend Type</em>}</li>
* </ul>
* </p>
*
@@ -96,4 +98,30 @@ public interface DeclaredType extends AbstractNamedElement {
*/
EList<DeclaredTypeParameter> getDeclaredTypeParameters();
+ /**
+ * Returns the value of the '<em><b>Backend Type</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Backend Type</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Backend Type</em>' attribute.
+ * @see #setBackendType(BackendType)
+ * @see org.eclipse.xpand3.staticTypesystem.declaration.DeclarationPackage#getDeclaredType_BackendType()
+ * @model dataType="org.eclipse.xpand3.staticTypesystem.BackendType" required="true"
+ * @generated
+ */
+ BackendType getBackendType();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.xpand3.staticTypesystem.declaration.DeclaredType#getBackendType <em>Backend Type</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Backend Type</em>' attribute.
+ * @see #getBackendType()
+ * @generated
+ */
+ void setBackendType(BackendType value);
+
} // DeclaredType
diff --git a/plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/staticTypesystem/declaration/impl/DeclarationPackageImpl.java b/plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/staticTypesystem/declaration/impl/DeclarationPackageImpl.java
index 15c372b..f6a6fe9 100644
--- a/plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/staticTypesystem/declaration/impl/DeclarationPackageImpl.java
+++ b/plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/staticTypesystem/declaration/impl/DeclarationPackageImpl.java
@@ -2,10 +2,11 @@
* <copyright>
* </copyright>
*
- * $Id: DeclarationPackageImpl.java,v 1.1 2008/03/04 10:53:02 sefftinge Exp $
+ * $Id: DeclarationPackageImpl.java,v 1.2 2008/03/04 11:00:31 sefftinge Exp $
*/
package org.eclipse.xpand3.staticTypesystem.declaration.impl;
+import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;
@@ -205,6 +206,15 @@ public class DeclarationPackageImpl extends EPackageImpl implements DeclarationP
* <!-- end-user-doc -->
* @generated
*/
+ public EAttribute getDeclaredType_BackendType() {
+ return (EAttribute)declaredTypeEClass.getEStructuralFeatures().get(4);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
public EClass getDeclaredOperation() {
return declaredOperationEClass;
}
@@ -341,6 +351,7 @@ public class DeclarationPackageImpl extends EPackageImpl implements DeclarationP
createEReference(declaredTypeEClass, DECLARED_TYPE__PROPERTIES);
createEReference(declaredTypeEClass, DECLARED_TYPE__OPERATIONS);
createEReference(declaredTypeEClass, DECLARED_TYPE__DECLARED_TYPE_PARAMETERS);
+ createEAttribute(declaredTypeEClass, DECLARED_TYPE__BACKEND_TYPE);
declaredOperationEClass = createEClass(DECLARED_OPERATION);
createEReference(declaredOperationEClass, DECLARED_OPERATION__DECLARED_PARAMETERS);
@@ -406,6 +417,7 @@ public class DeclarationPackageImpl extends EPackageImpl implements DeclarationP
initEReference(getDeclaredType_Properties(), this.getDeclaredProperty(), null, "properties", null, 0, -1, DeclaredType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getDeclaredType_Operations(), this.getDeclaredOperation(), this.getDeclaredOperation_DeclaringType(), "operations", null, 0, -1, DeclaredType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getDeclaredType_DeclaredTypeParameters(), this.getDeclaredTypeParameter(), null, "declaredTypeParameters", null, 0, -1, DeclaredType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getDeclaredType_BackendType(), theStaticTypesystemPackage.getBackendType(), "backendType", null, 1, 1, DeclaredType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(declaredOperationEClass, DeclaredOperation.class, "DeclaredOperation", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getDeclaredOperation_DeclaredParameters(), this.getDeclaredParameter(), null, "declaredParameters", null, 0, -1, DeclaredOperation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
diff --git a/plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/staticTypesystem/declaration/impl/DeclaredTypeImpl.java b/plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/staticTypesystem/declaration/impl/DeclaredTypeImpl.java
index 06c9d99..90289ef 100644
--- a/plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/staticTypesystem/declaration/impl/DeclaredTypeImpl.java
+++ b/plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/staticTypesystem/declaration/impl/DeclaredTypeImpl.java
@@ -2,12 +2,13 @@
* <copyright>
* </copyright>
*
- * $Id: DeclaredTypeImpl.java,v 1.1 2008/03/04 10:53:02 sefftinge Exp $
+ * $Id: DeclaredTypeImpl.java,v 1.2 2008/03/04 11:00:31 sefftinge Exp $
*/
package org.eclipse.xpand3.staticTypesystem.declaration.impl;
import java.util.Collection;
+import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.util.EList;
@@ -15,6 +16,7 @@ import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList;
import org.eclipse.emf.ecore.util.InternalEList;
@@ -27,6 +29,7 @@ import org.eclipse.xpand3.staticTypesystem.declaration.DeclaredType;
import org.eclipse.xpand3.staticTypesystem.declaration.DeclaredTypeParameter;
import org.eclipse.xpand3.staticTypesystem.impl.AbstractNamedElementImpl;
+import org.eclipse.xtend.backend.common.BackendType;
/**
* <!-- begin-user-doc -->
@@ -39,6 +42,7 @@ import org.eclipse.xpand3.staticTypesystem.impl.AbstractNamedElementImpl;
* <li>{@link org.eclipse.xpand3.staticTypesystem.declaration.impl.DeclaredTypeImpl#getProperties <em>Properties</em>}</li>
* <li>{@link org.eclipse.xpand3.staticTypesystem.declaration.impl.DeclaredTypeImpl#getOperations <em>Operations</em>}</li>
* <li>{@link org.eclipse.xpand3.staticTypesystem.declaration.impl.DeclaredTypeImpl#getDeclaredTypeParameters <em>Declared Type Parameters</em>}</li>
+ * <li>{@link org.eclipse.xpand3.staticTypesystem.declaration.impl.DeclaredTypeImpl#getBackendType <em>Backend Type</em>}</li>
* </ul>
* </p>
*
@@ -86,6 +90,26 @@ public class DeclaredTypeImpl extends AbstractNamedElementImpl implements Declar
protected EList<DeclaredTypeParameter> declaredTypeParameters;
/**
+ * The default value of the '{@link #getBackendType() <em>Backend Type</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getBackendType()
+ * @generated
+ * @ordered
+ */
+ protected static final BackendType BACKEND_TYPE_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getBackendType() <em>Backend Type</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getBackendType()
+ * @generated
+ * @ordered
+ */
+ protected BackendType backendType = BACKEND_TYPE_EDEFAULT;
+
+ /**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
@@ -157,6 +181,27 @@ public class DeclaredTypeImpl extends AbstractNamedElementImpl implements Declar
* <!-- end-user-doc -->
* @generated
*/
+ public BackendType getBackendType() {
+ return backendType;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setBackendType(BackendType newBackendType) {
+ BackendType oldBackendType = backendType;
+ backendType = newBackendType;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, DeclarationPackage.DECLARED_TYPE__BACKEND_TYPE, oldBackendType, backendType));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
@SuppressWarnings("unchecked")
@Override
public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
@@ -203,6 +248,8 @@ public class DeclaredTypeImpl extends AbstractNamedElementImpl implements Declar
return getOperations();
case DeclarationPackage.DECLARED_TYPE__DECLARED_TYPE_PARAMETERS:
return getDeclaredTypeParameters();
+ case DeclarationPackage.DECLARED_TYPE__BACKEND_TYPE:
+ return getBackendType();
}
return super.eGet(featureID, resolve, coreType);
}
@@ -232,6 +279,9 @@ public class DeclaredTypeImpl extends AbstractNamedElementImpl implements Declar
getDeclaredTypeParameters().clear();
getDeclaredTypeParameters().addAll((Collection<? extends DeclaredTypeParameter>)newValue);
return;
+ case DeclarationPackage.DECLARED_TYPE__BACKEND_TYPE:
+ setBackendType((BackendType)newValue);
+ return;
}
super.eSet(featureID, newValue);
}
@@ -256,6 +306,9 @@ public class DeclaredTypeImpl extends AbstractNamedElementImpl implements Declar
case DeclarationPackage.DECLARED_TYPE__DECLARED_TYPE_PARAMETERS:
getDeclaredTypeParameters().clear();
return;
+ case DeclarationPackage.DECLARED_TYPE__BACKEND_TYPE:
+ setBackendType(BACKEND_TYPE_EDEFAULT);
+ return;
}
super.eUnset(featureID);
}
@@ -276,8 +329,26 @@ public class DeclaredTypeImpl extends AbstractNamedElementImpl implements Declar
return operations != null && !operations.isEmpty();
case DeclarationPackage.DECLARED_TYPE__DECLARED_TYPE_PARAMETERS:
return declaredTypeParameters != null && !declaredTypeParameters.isEmpty();
+ case DeclarationPackage.DECLARED_TYPE__BACKEND_TYPE:
+ return BACKEND_TYPE_EDEFAULT == null ? backendType != null : !BACKEND_TYPE_EDEFAULT.equals(backendType);
}
return super.eIsSet(featureID);
}
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy()) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (backendType: ");
+ result.append(backendType);
+ result.append(')');
+ return result.toString();
+ }
+
} //DeclaredTypeImpl
diff --git a/plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/staticTypesystem/impl/StaticTypesystemFactoryImpl.java b/plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/staticTypesystem/impl/StaticTypesystemFactoryImpl.java
index 0f42602..e4ae03c 100644
--- a/plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/staticTypesystem/impl/StaticTypesystemFactoryImpl.java
+++ b/plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/staticTypesystem/impl/StaticTypesystemFactoryImpl.java
@@ -2,11 +2,12 @@
* <copyright>
* </copyright>
*
- * $Id: StaticTypesystemFactoryImpl.java,v 1.1 2008/03/04 10:53:02 sefftinge Exp $
+ * $Id: StaticTypesystemFactoryImpl.java,v 1.2 2008/03/04 11:00:31 sefftinge Exp $
*/
package org.eclipse.xpand3.staticTypesystem.impl;
import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EDataType;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;
@@ -15,6 +16,7 @@ import org.eclipse.emf.ecore.impl.EFactoryImpl;
import org.eclipse.emf.ecore.plugin.EcorePlugin;
import org.eclipse.xpand3.staticTypesystem.*;
+import org.eclipse.xtend.backend.common.BackendType;
/**
* <!-- begin-user-doc -->
@@ -75,6 +77,36 @@ public class StaticTypesystemFactoryImpl extends EFactoryImpl implements StaticT
* <!-- end-user-doc -->
* @generated
*/
+ @Override
+ public Object createFromString(EDataType eDataType, String initialValue) {
+ switch (eDataType.getClassifierID()) {
+ case StaticTypesystemPackage.BACKEND_TYPE:
+ return createBackendTypeFromString(eDataType, initialValue);
+ default:
+ throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String convertToString(EDataType eDataType, Object instanceValue) {
+ switch (eDataType.getClassifierID()) {
+ case StaticTypesystemPackage.BACKEND_TYPE:
+ return convertBackendTypeToString(eDataType, instanceValue);
+ default:
+ throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
public Type createType() {
TypeImpl type = new TypeImpl();
return type;
@@ -125,6 +157,24 @@ public class StaticTypesystemFactoryImpl extends EFactoryImpl implements StaticT
* <!-- end-user-doc -->
* @generated
*/
+ public BackendType createBackendTypeFromString(EDataType eDataType, String initialValue) {
+ return (BackendType)super.createFromString(eDataType, initialValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String convertBackendTypeToString(EDataType eDataType, Object instanceValue) {
+ return super.convertToString(eDataType, instanceValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
public StaticTypesystemPackage getStaticTypesystemPackage() {
return (StaticTypesystemPackage)getEPackage();
}
diff --git a/plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/staticTypesystem/impl/StaticTypesystemPackageImpl.java b/plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/staticTypesystem/impl/StaticTypesystemPackageImpl.java
index a2d1626..0722a4d 100644
--- a/plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/staticTypesystem/impl/StaticTypesystemPackageImpl.java
+++ b/plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/staticTypesystem/impl/StaticTypesystemPackageImpl.java
@@ -2,12 +2,13 @@
* <copyright>
* </copyright>
*
- * $Id: StaticTypesystemPackageImpl.java,v 1.1 2008/03/04 10:53:01 sefftinge Exp $
+ * $Id: StaticTypesystemPackageImpl.java,v 1.2 2008/03/04 11:00:31 sefftinge Exp $
*/
package org.eclipse.xpand3.staticTypesystem.impl;
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EDataType;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;
@@ -26,6 +27,7 @@ import org.eclipse.xpand3.staticTypesystem.WildcardType;
import org.eclipse.xpand3.staticTypesystem.declaration.DeclarationPackage;
import org.eclipse.xpand3.staticTypesystem.declaration.impl.DeclarationPackageImpl;
+import org.eclipse.xtend.backend.common.BackendType;
/**
* <!-- begin-user-doc -->
@@ -84,6 +86,13 @@ public class StaticTypesystemPackageImpl extends EPackageImpl implements StaticT
private EClass functionTypeEClass = null;
/**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EDataType backendTypeEDataType = null;
+
+ /**
* Creates an instance of the model <b>Package</b>, registered with
* {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
* package URI value.
@@ -296,6 +305,15 @@ public class StaticTypesystemPackageImpl extends EPackageImpl implements StaticT
* <!-- end-user-doc -->
* @generated
*/
+ public EDataType getBackendType() {
+ return backendTypeEDataType;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
public StaticTypesystemFactory getStaticTypesystemFactory() {
return (StaticTypesystemFactory)getEFactoryInstance();
}
@@ -340,6 +358,9 @@ public class StaticTypesystemPackageImpl extends EPackageImpl implements StaticT
functionTypeEClass = createEClass(FUNCTION_TYPE);
createEReference(functionTypeEClass, FUNCTION_TYPE__DECLARED_FUNCTION);
createEReference(functionTypeEClass, FUNCTION_TYPE__ACTUAL_TYPE_ARGUMENTS);
+
+ // Create data types
+ backendTypeEDataType = createEDataType(BACKEND_TYPE);
}
/**
@@ -405,6 +426,9 @@ public class StaticTypesystemPackageImpl extends EPackageImpl implements StaticT
initEReference(getFunctionType_DeclaredFunction(), theDeclarationPackage.getDeclaredFunction(), null, "declaredFunction", null, 1, 1, FunctionType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getFunctionType_ActualTypeArguments(), this.getAbstractTypeReference(), null, "actualTypeArguments", null, 0, -1, FunctionType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ // Initialize data types
+ initEDataType(backendTypeEDataType, BackendType.class, "BackendType", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS);
+
// Create resource
createResource(eNS_URI);
}
diff --git a/plugins/org.eclipse.xpand3/src/org/eclipse/xand3/analyzation/typesystem/builtin/BuiltinDeclarationsContributor.java b/plugins/org.eclipse.xpand3/src/org/eclipse/xand3/analyzation/typesystem/builtin/BuiltinDeclarationsContributor.java
index ce0dc25..b07e07e 100644
--- a/plugins/org.eclipse.xpand3/src/org/eclipse/xand3/analyzation/typesystem/builtin/BuiltinDeclarationsContributor.java
+++ b/plugins/org.eclipse.xpand3/src/org/eclipse/xand3/analyzation/typesystem/builtin/BuiltinDeclarationsContributor.java
@@ -15,13 +15,12 @@
*/
package org.eclipse.xand3.analyzation.typesystem.builtin;
-import java.util.HashMap;
-import java.util.Map;
import java.util.Set;
import org.eclipse.xand3.analyzation.typesystem.DeclarationsContributor;
import org.eclipse.xpand3.staticTypesystem.declaration.DeclaredFunction;
import org.eclipse.xpand3.staticTypesystem.declaration.DeclaredType;
+import org.eclipse.xtend.backend.common.BackendTypesystem;
/**
* @author Sven Efftinge
@@ -29,13 +28,15 @@ import org.eclipse.xpand3.staticTypesystem.declaration.DeclaredType;
*/
public class BuiltinDeclarationsContributor implements DeclarationsContributor {
-// private BackendTypesystem backendTypesystem = null;
+ private BackendTypesystem backendTypesystem = null;
- private Map<String, DeclaredType> types = new HashMap<String, DeclaredType>();
- {
-
+ /**
+ *
+ */
+ public BuiltinDeclarationsContributor(BackendTypesystem backendTypesystem) {
+ this.backendTypesystem = backendTypesystem;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.xand3.analyzation.typesystem.DeclarationsContributor#functionsForName(java.lang.String)
*/
@@ -48,7 +49,6 @@ public class BuiltinDeclarationsContributor implements DeclarationsContributor {
* @see org.eclipse.xand3.analyzation.typesystem.DeclarationsContributor#typeForName(java.lang.String)
*/
public DeclaredType typeForName(String name) {
-
return null;
}
diff --git a/plugins/org.eclipse.xpand3/src/static_typesystem.ecore b/plugins/org.eclipse.xpand3/src/static_typesystem.ecore
index c3867d1..d754094 100644
--- a/plugins/org.eclipse.xpand3/src/static_typesystem.ecore
+++ b/plugins/org.eclipse.xpand3/src/static_typesystem.ecore
@@ -30,6 +30,7 @@
<eStructuralFeatures xsi:type="ecore:EReference" name="actualTypeArguments" upperBound="-1"
eType="#//AbstractTypeReference"/>
</eClassifiers>
+ <eClassifiers xsi:type="ecore:EDataType" name="BackendType" instanceClassName="org.eclipse.xtend.backend.common.BackendType"/>
<eSubpackages name="declaration" nsURI="http://www.eclipse.org/m2t/xpand3/staticTypesystem/declaration"
nsPrefix="declaration">
<eClassifiers xsi:type="ecore:EClass" name="DeclaredType" eSuperTypes="#//AbstractNamedElement">
@@ -41,6 +42,8 @@
eType="#//declaration/DeclaredOperation" containment="true" eOpposite="#//declaration/DeclaredOperation/declaringType"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="declaredTypeParameters"
upperBound="-1" eType="#//declaration/DeclaredTypeParameter" containment="true"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="backendType" lowerBound="1"
+ eType="#//BackendType"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="DeclaredOperation" eSuperTypes="#//AbstractNamedElement">
<eStructuralFeatures xsi:type="ecore:EReference" name="declaredParameters" upperBound="-1"