summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsefftinge2008-02-29 09:24:40 (EST)
committersefftinge2008-02-29 09:24:40 (EST)
commita88b99b80b30252293638f62bdcf295ad3136235 (patch)
treee5e130ba0622b9ee6f17fefb5b80faaebaeefd5d
parent2de864c18014b37720d25777b52bcd0cc0c9ef63 (diff)
downloadorg.eclipse.xpand-a88b99b80b30252293638f62bdcf295ad3136235.zip
org.eclipse.xpand-a88b99b80b30252293638f62bdcf295ad3136235.tar.gz
org.eclipse.xpand-a88b99b80b30252293638f62bdcf295ad3136235.tar.bz2
static typesystem (first draft)
-rw-r--r--plugins/org.eclipse.xpand3/src/org/eclipse/xand3/analyzation/typesystem/ConcreteTypeArgument.java24
-rw-r--r--plugins/org.eclipse.xpand3/src/org/eclipse/xand3/analyzation/typesystem/DeclaredType.java22
-rw-r--r--plugins/org.eclipse.xpand3/src/org/eclipse/xand3/analyzation/typesystem/DeclaredTypeParameter.java20
-rw-r--r--plugins/org.eclipse.xpand3/src/org/eclipse/xand3/analyzation/typesystem/Feature.java24
-rw-r--r--plugins/org.eclipse.xpand3/src/org/eclipse/xand3/analyzation/typesystem/NamedElement.java24
-rw-r--r--plugins/org.eclipse.xpand3/src/org/eclipse/xand3/analyzation/typesystem/Operation.java24
-rw-r--r--plugins/org.eclipse.xpand3/src/org/eclipse/xand3/analyzation/typesystem/Property.java24
-rw-r--r--plugins/org.eclipse.xpand3/src/org/eclipse/xand3/analyzation/typesystem/Type.java29
-rw-r--r--plugins/org.eclipse.xpand3/src/org/eclipse/xand3/analyzation/typesystem/TypeArgument.java19
-rw-r--r--plugins/org.eclipse.xpand3/src/org/eclipse/xand3/analyzation/typesystem/WildcardTypeArgument.java32
10 files changed, 242 insertions, 0 deletions
diff --git a/plugins/org.eclipse.xpand3/src/org/eclipse/xand3/analyzation/typesystem/ConcreteTypeArgument.java b/plugins/org.eclipse.xpand3/src/org/eclipse/xand3/analyzation/typesystem/ConcreteTypeArgument.java
new file mode 100644
index 0000000..07f45aa
--- /dev/null
+++ b/plugins/org.eclipse.xpand3/src/org/eclipse/xand3/analyzation/typesystem/ConcreteTypeArgument.java
@@ -0,0 +1,24 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2002-2007 itemis AG and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * itemis AG - Initial API and implementation
+ *
+ * </copyright>
+ *
+ */
+package org.eclipse.xand3.analyzation.typesystem;
+
+/**
+ * @author Sven Efftinge
+ *
+ */
+public interface ConcreteTypeArgument extends TypeArgument{
+ Type[] getType();
+}
diff --git a/plugins/org.eclipse.xpand3/src/org/eclipse/xand3/analyzation/typesystem/DeclaredType.java b/plugins/org.eclipse.xpand3/src/org/eclipse/xand3/analyzation/typesystem/DeclaredType.java
new file mode 100644
index 0000000..41d7ae1
--- /dev/null
+++ b/plugins/org.eclipse.xpand3/src/org/eclipse/xand3/analyzation/typesystem/DeclaredType.java
@@ -0,0 +1,22 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2002-2007 itemis AG and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * itemis AG - Initial API and implementation
+ *
+ * </copyright>
+ *
+ */
+package org.eclipse.xand3.analyzation.typesystem;
+
+public interface DeclaredType extends NamedElement {
+ DeclaredType[] getSuperTypes();
+ DeclaredTypeParameter[] getTypeParameters();
+ Type createInstance(TypeArgument... args);
+}
diff --git a/plugins/org.eclipse.xpand3/src/org/eclipse/xand3/analyzation/typesystem/DeclaredTypeParameter.java b/plugins/org.eclipse.xpand3/src/org/eclipse/xand3/analyzation/typesystem/DeclaredTypeParameter.java
new file mode 100644
index 0000000..eefa950
--- /dev/null
+++ b/plugins/org.eclipse.xpand3/src/org/eclipse/xand3/analyzation/typesystem/DeclaredTypeParameter.java
@@ -0,0 +1,20 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2002-2007 itemis AG and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * itemis AG - Initial API and implementation
+ *
+ * </copyright>
+ *
+ */
+package org.eclipse.xand3.analyzation.typesystem;
+
+public interface DeclaredTypeParameter extends NamedElement {
+ DeclaredType[] getUpperBounds();
+}
diff --git a/plugins/org.eclipse.xpand3/src/org/eclipse/xand3/analyzation/typesystem/Feature.java b/plugins/org.eclipse.xpand3/src/org/eclipse/xand3/analyzation/typesystem/Feature.java
new file mode 100644
index 0000000..25e5a0b
--- /dev/null
+++ b/plugins/org.eclipse.xpand3/src/org/eclipse/xand3/analyzation/typesystem/Feature.java
@@ -0,0 +1,24 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2002-2007 itemis AG and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * itemis AG - Initial API and implementation
+ *
+ * </copyright>
+ *
+ */
+package org.eclipse.xand3.analyzation.typesystem;
+
+/**
+ * @author Sven Efftinge
+ *
+ */
+public interface Feature {
+
+}
diff --git a/plugins/org.eclipse.xpand3/src/org/eclipse/xand3/analyzation/typesystem/NamedElement.java b/plugins/org.eclipse.xpand3/src/org/eclipse/xand3/analyzation/typesystem/NamedElement.java
new file mode 100644
index 0000000..0c78007
--- /dev/null
+++ b/plugins/org.eclipse.xpand3/src/org/eclipse/xand3/analyzation/typesystem/NamedElement.java
@@ -0,0 +1,24 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2002-2007 itemis AG and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * itemis AG - Initial API and implementation
+ *
+ * </copyright>
+ *
+ */
+package org.eclipse.xand3.analyzation.typesystem;
+
+/**
+ * @author Sven Efftinge
+ *
+ */
+public interface NamedElement {
+ String getName();
+}
diff --git a/plugins/org.eclipse.xpand3/src/org/eclipse/xand3/analyzation/typesystem/Operation.java b/plugins/org.eclipse.xpand3/src/org/eclipse/xand3/analyzation/typesystem/Operation.java
new file mode 100644
index 0000000..0db349c
--- /dev/null
+++ b/plugins/org.eclipse.xpand3/src/org/eclipse/xand3/analyzation/typesystem/Operation.java
@@ -0,0 +1,24 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2002-2007 itemis AG and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * itemis AG - Initial API and implementation
+ *
+ * </copyright>
+ *
+ */
+package org.eclipse.xand3.analyzation.typesystem;
+
+/**
+ * @author Sven Efftinge
+ *
+ */
+public interface Operation {
+
+}
diff --git a/plugins/org.eclipse.xpand3/src/org/eclipse/xand3/analyzation/typesystem/Property.java b/plugins/org.eclipse.xpand3/src/org/eclipse/xand3/analyzation/typesystem/Property.java
new file mode 100644
index 0000000..712e716
--- /dev/null
+++ b/plugins/org.eclipse.xpand3/src/org/eclipse/xand3/analyzation/typesystem/Property.java
@@ -0,0 +1,24 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2002-2007 itemis AG and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * itemis AG - Initial API and implementation
+ *
+ * </copyright>
+ *
+ */
+package org.eclipse.xand3.analyzation.typesystem;
+
+/**
+ * @author Sven Efftinge
+ *
+ */
+public interface Property {
+
+}
diff --git a/plugins/org.eclipse.xpand3/src/org/eclipse/xand3/analyzation/typesystem/Type.java b/plugins/org.eclipse.xpand3/src/org/eclipse/xand3/analyzation/typesystem/Type.java
new file mode 100644
index 0000000..b4265f3
--- /dev/null
+++ b/plugins/org.eclipse.xpand3/src/org/eclipse/xand3/analyzation/typesystem/Type.java
@@ -0,0 +1,29 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2002-2007 itemis AG and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * itemis AG - Initial API and implementation
+ *
+ * </copyright>
+ *
+ */
+package org.eclipse.xand3.analyzation.typesystem;
+
+public interface Type extends NamedElement {
+ Type[] getSuperTypes();
+
+ Feature[] getFeatures();
+ Property[] getProperties();
+ Operation[] getOperations();
+
+ /**
+ * @return returns either the {@link DeclaredType} this type is a bound instance of or this, if the originally declared type wasn't unbound
+ */
+ DeclaredType getDeclaredType();
+}
diff --git a/plugins/org.eclipse.xpand3/src/org/eclipse/xand3/analyzation/typesystem/TypeArgument.java b/plugins/org.eclipse.xpand3/src/org/eclipse/xand3/analyzation/typesystem/TypeArgument.java
new file mode 100644
index 0000000..6482eb6
--- /dev/null
+++ b/plugins/org.eclipse.xpand3/src/org/eclipse/xand3/analyzation/typesystem/TypeArgument.java
@@ -0,0 +1,19 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2002-2007 itemis AG and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * itemis AG - Initial API and implementation
+ *
+ * </copyright>
+ *
+ */
+package org.eclipse.xand3.analyzation.typesystem;
+
+public interface TypeArgument {
+}
diff --git a/plugins/org.eclipse.xpand3/src/org/eclipse/xand3/analyzation/typesystem/WildcardTypeArgument.java b/plugins/org.eclipse.xpand3/src/org/eclipse/xand3/analyzation/typesystem/WildcardTypeArgument.java
new file mode 100644
index 0000000..5afbe82
--- /dev/null
+++ b/plugins/org.eclipse.xpand3/src/org/eclipse/xand3/analyzation/typesystem/WildcardTypeArgument.java
@@ -0,0 +1,32 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2002-2007 itemis AG and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * itemis AG - Initial API and implementation
+ *
+ * </copyright>
+ *
+ */
+package org.eclipse.xand3.analyzation.typesystem;
+
+/**
+ * @author Sven Efftinge
+ *
+ */
+public interface WildcardTypeArgument extends TypeArgument {
+ /**
+ * @return the lower bound type (specified using e.g. <* super MyType>)
+ */
+ Type getLowerBound();
+
+ /**
+ * @return the upper bounds (specified using e.g. <* extends Comparable,Serializable>)
+ */
+ Type[] getUpperBounds();
+}