summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjkohnlein2008-03-10 04:25:34 (EDT)
committer jkohnlein2008-03-10 04:25:34 (EDT)
commitbc0bc6f1cc927f2f151b27c6ecf3345f8e90a78d (patch)
tree635cb4c1034dd5088fae04c0f3f520e9fadc49c9
parent5543fc3f3d78d816f5b347ed047885163678265b (diff)
downloadorg.eclipse.xpand-bc0bc6f1cc927f2f151b27c6ecf3345f8e90a78d.zip
org.eclipse.xpand-bc0bc6f1cc927f2f151b27c6ecf3345f8e90a78d.tar.gz
org.eclipse.xpand-bc0bc6f1cc927f2f151b27c6ecf3345f8e90a78d.tar.bz2
-Added binary operation
-Fixed test
-rw-r--r--plugins/org.eclipse.xpand3.parser/src/org/eclipse/xpand3/parser/node2ast/Node2AstTransformer.java4
-rw-r--r--plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/expression/BinaryOperation.java108
-rw-r--r--plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/expression/BooleanOperation.java89
-rw-r--r--plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/expression/ExpressionFactory.java11
-rw-r--r--plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/expression/ExpressionPackage.java234
-rw-r--r--plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/expression/impl/BinaryOperationImpl.java313
-rw-r--r--plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/expression/impl/BooleanOperationImpl.java265
-rw-r--r--plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/expression/impl/ExpressionFactoryImpl.java13
-rw-r--r--plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/expression/impl/ExpressionPackageImpl.java92
-rw-r--r--plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/expression/util/ExpressionAdapterFactory.java20
-rw-r--r--plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/expression/util/ExpressionSwitch.java26
-rw-r--r--plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/expression/validation/BinaryOperationValidator.java25
-rw-r--r--plugins/org.eclipse.xpand3/src/xpand3.ecore17
-rw-r--r--plugins/org.eclipse.xpand3/text/description.txt59
-rw-r--r--tests/org.eclipse.xpand3.parser.tests/src/org/eclipse/xpand3/parser/node2ast/ParseStuff.java14
-rw-r--r--tests/org.eclipse.xpand3.parser.tests/src/org/eclipse/xpand3/parser/node2ast/TreetestInterpreterTest.java2
-rw-r--r--tests/org.eclipse.xpand3.parser.tests/src/org/eclipse/xpand3/parser/node2ast/test.ttst2
17 files changed, 779 insertions, 515 deletions
diff --git a/plugins/org.eclipse.xpand3.parser/src/org/eclipse/xpand3/parser/node2ast/Node2AstTransformer.java b/plugins/org.eclipse.xpand3.parser/src/org/eclipse/xpand3/parser/node2ast/Node2AstTransformer.java
index c16c1d0..f7e6213 100644
--- a/plugins/org.eclipse.xpand3.parser/src/org/eclipse/xpand3/parser/node2ast/Node2AstTransformer.java
+++ b/plugins/org.eclipse.xpand3.parser/src/org/eclipse/xpand3/parser/node2ast/Node2AstTransformer.java
@@ -11,7 +11,7 @@ import org.eclipse.xpand3.Xpand3Factory;
import org.eclipse.xpand3.declaration.DeclarationFactory;
import org.eclipse.xpand3.declaration.Extension;
import org.eclipse.xpand3.expression.AbstractExpression;
-import org.eclipse.xpand3.expression.BooleanOperation;
+import org.eclipse.xpand3.expression.BinaryOperation;
import org.eclipse.xpand3.expression.ExpressionFactory;
import org.eclipse.xpand3.expression.FeatureCall;
import org.eclipse.xpand3.expression.OperationCall;
@@ -173,7 +173,7 @@ public class Node2AstTransformer extends Xpand3nodeSwitch<SyntaxElement> {
@Override
public SyntaxElement caseRelationalExpressionNode(
RelationalExpressionNode ren) {
- BooleanOperation bo = expressionFactory.createBooleanOperation();
+ BinaryOperation bo = expressionFactory.createBinaryOperation();
bo.setLeft((AbstractExpression) doSwitch(ren.getLeftOperand()));
bo.setOperator(createIdentifier((LeafNode) ren.getOperator()
.getChildren().get(0)));
diff --git a/plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/expression/BinaryOperation.java b/plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/expression/BinaryOperation.java
new file mode 100644
index 0000000..36343be
--- /dev/null
+++ b/plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/expression/BinaryOperation.java
@@ -0,0 +1,108 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id: BinaryOperation.java,v 1.1 2008/03/10 08:25:35 jkohnlein Exp $
+ */
+package org.eclipse.xpand3.expression;
+
+import org.eclipse.xpand3.Identifier;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Binary Operation</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.xpand3.expression.BinaryOperation#getLeft <em>Left</em>}</li>
+ * <li>{@link org.eclipse.xpand3.expression.BinaryOperation#getRight <em>Right</em>}</li>
+ * <li>{@link org.eclipse.xpand3.expression.BinaryOperation#getOperator <em>Operator</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.xpand3.expression.ExpressionPackage#getBinaryOperation()
+ * @model
+ * @generated
+ */
+public interface BinaryOperation extends AbstractExpression {
+ /**
+ * Returns the value of the '<em><b>Left</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Left</em>' containment reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Left</em>' containment reference.
+ * @see #setLeft(AbstractExpression)
+ * @see org.eclipse.xpand3.expression.ExpressionPackage#getBinaryOperation_Left()
+ * @model containment="true"
+ * @generated
+ */
+ AbstractExpression getLeft();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.xpand3.expression.BinaryOperation#getLeft <em>Left</em>}' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Left</em>' containment reference.
+ * @see #getLeft()
+ * @generated
+ */
+ void setLeft(AbstractExpression value);
+
+ /**
+ * Returns the value of the '<em><b>Right</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Right</em>' containment reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Right</em>' containment reference.
+ * @see #setRight(AbstractExpression)
+ * @see org.eclipse.xpand3.expression.ExpressionPackage#getBinaryOperation_Right()
+ * @model containment="true"
+ * @generated
+ */
+ AbstractExpression getRight();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.xpand3.expression.BinaryOperation#getRight <em>Right</em>}' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Right</em>' containment reference.
+ * @see #getRight()
+ * @generated
+ */
+ void setRight(AbstractExpression value);
+
+ /**
+ * Returns the value of the '<em><b>Operator</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Operator</em>' containment reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Operator</em>' containment reference.
+ * @see #setOperator(Identifier)
+ * @see org.eclipse.xpand3.expression.ExpressionPackage#getBinaryOperation_Operator()
+ * @model containment="true"
+ * @generated
+ */
+ Identifier getOperator();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.xpand3.expression.BinaryOperation#getOperator <em>Operator</em>}' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Operator</em>' containment reference.
+ * @see #getOperator()
+ * @generated
+ */
+ void setOperator(Identifier value);
+
+} // BinaryOperation
diff --git a/plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/expression/BooleanOperation.java b/plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/expression/BooleanOperation.java
index 9fc3658..e120a04 100644
--- a/plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/expression/BooleanOperation.java
+++ b/plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/expression/BooleanOperation.java
@@ -2,7 +2,7 @@
* <copyright>
* </copyright>
*
- * $Id: BooleanOperation.java,v 1.2 2008/03/07 11:10:31 jkohnlein Exp $
+ * $Id: BooleanOperation.java,v 1.3 2008/03/10 08:25:35 jkohnlein Exp $
*/
package org.eclipse.xpand3.expression;
@@ -13,96 +13,11 @@ import org.eclipse.xpand3.Identifier;
* A representation of the model object '<em><b>Boolean Operation</b></em>'.
* <!-- end-user-doc -->
*
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.xpand3.expression.BooleanOperation#getLeft <em>Left</em>}</li>
- * <li>{@link org.eclipse.xpand3.expression.BooleanOperation#getRight <em>Right</em>}</li>
- * <li>{@link org.eclipse.xpand3.expression.BooleanOperation#getOperator <em>Operator</em>}</li>
- * </ul>
- * </p>
*
* @see org.eclipse.xpand3.expression.ExpressionPackage#getBooleanOperation()
* @model
* @generated
*/
-public interface BooleanOperation extends AbstractExpression {
- /**
- * Returns the value of the '<em><b>Left</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Left</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Left</em>' containment reference.
- * @see #setLeft(AbstractExpression)
- * @see org.eclipse.xpand3.expression.ExpressionPackage#getBooleanOperation_Left()
- * @model containment="true"
- * @generated
- */
- AbstractExpression getLeft();
-
- /**
- * Sets the value of the '{@link org.eclipse.xpand3.expression.BooleanOperation#getLeft <em>Left</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Left</em>' containment reference.
- * @see #getLeft()
- * @generated
- */
- void setLeft(AbstractExpression value);
-
- /**
- * Returns the value of the '<em><b>Right</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Right</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Right</em>' containment reference.
- * @see #setRight(AbstractExpression)
- * @see org.eclipse.xpand3.expression.ExpressionPackage#getBooleanOperation_Right()
- * @model containment="true"
- * @generated
- */
- AbstractExpression getRight();
-
- /**
- * Sets the value of the '{@link org.eclipse.xpand3.expression.BooleanOperation#getRight <em>Right</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Right</em>' containment reference.
- * @see #getRight()
- * @generated
- */
- void setRight(AbstractExpression value);
-
- /**
- * Returns the value of the '<em><b>Operator</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Operator</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Operator</em>' containment reference.
- * @see #setOperator(Identifier)
- * @see org.eclipse.xpand3.expression.ExpressionPackage#getBooleanOperation_Operator()
- * @model containment="true"
- * @generated
- */
- Identifier getOperator();
-
- /**
- * Sets the value of the '{@link org.eclipse.xpand3.expression.BooleanOperation#getOperator <em>Operator</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Operator</em>' containment reference.
- * @see #getOperator()
- * @generated
- */
- void setOperator(Identifier value);
+public interface BooleanOperation extends BinaryOperation {
} // BooleanOperation
diff --git a/plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/expression/ExpressionFactory.java b/plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/expression/ExpressionFactory.java
index 1c87adc..7474960 100644
--- a/plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/expression/ExpressionFactory.java
+++ b/plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/expression/ExpressionFactory.java
@@ -2,7 +2,7 @@
* <copyright>
* </copyright>
*
- * $Id: ExpressionFactory.java,v 1.2 2008/03/07 11:10:31 jkohnlein Exp $
+ * $Id: ExpressionFactory.java,v 1.3 2008/03/10 08:25:34 jkohnlein Exp $
*/
package org.eclipse.xpand3.expression;
@@ -197,6 +197,15 @@ public interface ExpressionFactory extends EFactory {
Case createCase();
/**
+ * Returns a new object of class '<em>Binary Operation</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Binary Operation</em>'.
+ * @generated
+ */
+ BinaryOperation createBinaryOperation();
+
+ /**
* Returns the package supported by this factory.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
diff --git a/plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/expression/ExpressionPackage.java b/plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/expression/ExpressionPackage.java
index 6aaafec..2195864 100644
--- a/plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/expression/ExpressionPackage.java
+++ b/plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/expression/ExpressionPackage.java
@@ -2,7 +2,7 @@
* <copyright>
* </copyright>
*
- * $Id: ExpressionPackage.java,v 1.2 2008/03/07 11:10:31 jkohnlein Exp $
+ * $Id: ExpressionPackage.java,v 1.3 2008/03/10 08:25:35 jkohnlein Exp $
*/
package org.eclipse.xpand3.expression;
@@ -116,6 +116,88 @@ public interface ExpressionPackage extends EPackage {
int ABSTRACT_EXPRESSION_FEATURE_COUNT = Xpand3Package.SYNTAX_ELEMENT_FEATURE_COUNT + 0;
/**
+ * The meta object id for the '{@link org.eclipse.xpand3.expression.impl.BinaryOperationImpl <em>Binary Operation</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.xpand3.expression.impl.BinaryOperationImpl
+ * @see org.eclipse.xpand3.expression.impl.ExpressionPackageImpl#getBinaryOperation()
+ * @generated
+ */
+ int BINARY_OPERATION = 21;
+
+ /**
+ * The feature id for the '<em><b>Line</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int BINARY_OPERATION__LINE = ABSTRACT_EXPRESSION__LINE;
+
+ /**
+ * The feature id for the '<em><b>Start</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int BINARY_OPERATION__START = ABSTRACT_EXPRESSION__START;
+
+ /**
+ * The feature id for the '<em><b>End</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int BINARY_OPERATION__END = ABSTRACT_EXPRESSION__END;
+
+ /**
+ * The feature id for the '<em><b>File Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int BINARY_OPERATION__FILE_NAME = ABSTRACT_EXPRESSION__FILE_NAME;
+
+ /**
+ * The feature id for the '<em><b>Left</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int BINARY_OPERATION__LEFT = ABSTRACT_EXPRESSION_FEATURE_COUNT + 0;
+
+ /**
+ * The feature id for the '<em><b>Right</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int BINARY_OPERATION__RIGHT = ABSTRACT_EXPRESSION_FEATURE_COUNT + 1;
+
+ /**
+ * The feature id for the '<em><b>Operator</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int BINARY_OPERATION__OPERATOR = ABSTRACT_EXPRESSION_FEATURE_COUNT + 2;
+
+ /**
+ * The number of structural features of the '<em>Binary Operation</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int BINARY_OPERATION_FEATURE_COUNT = ABSTRACT_EXPRESSION_FEATURE_COUNT + 3;
+
+ /**
* The meta object id for the '{@link org.eclipse.xpand3.expression.impl.BooleanOperationImpl <em>Boolean Operation</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -132,7 +214,7 @@ public interface ExpressionPackage extends EPackage {
* @generated
* @ordered
*/
- int BOOLEAN_OPERATION__LINE = ABSTRACT_EXPRESSION__LINE;
+ int BOOLEAN_OPERATION__LINE = BINARY_OPERATION__LINE;
/**
* The feature id for the '<em><b>Start</b></em>' attribute.
@@ -141,7 +223,7 @@ public interface ExpressionPackage extends EPackage {
* @generated
* @ordered
*/
- int BOOLEAN_OPERATION__START = ABSTRACT_EXPRESSION__START;
+ int BOOLEAN_OPERATION__START = BINARY_OPERATION__START;
/**
* The feature id for the '<em><b>End</b></em>' attribute.
@@ -150,7 +232,7 @@ public interface ExpressionPackage extends EPackage {
* @generated
* @ordered
*/
- int BOOLEAN_OPERATION__END = ABSTRACT_EXPRESSION__END;
+ int BOOLEAN_OPERATION__END = BINARY_OPERATION__END;
/**
* The feature id for the '<em><b>File Name</b></em>' attribute.
@@ -159,7 +241,7 @@ public interface ExpressionPackage extends EPackage {
* @generated
* @ordered
*/
- int BOOLEAN_OPERATION__FILE_NAME = ABSTRACT_EXPRESSION__FILE_NAME;
+ int BOOLEAN_OPERATION__FILE_NAME = BINARY_OPERATION__FILE_NAME;
/**
* The feature id for the '<em><b>Left</b></em>' containment reference.
@@ -168,7 +250,7 @@ public interface ExpressionPackage extends EPackage {
* @generated
* @ordered
*/
- int BOOLEAN_OPERATION__LEFT = ABSTRACT_EXPRESSION_FEATURE_COUNT + 0;
+ int BOOLEAN_OPERATION__LEFT = BINARY_OPERATION__LEFT;
/**
* The feature id for the '<em><b>Right</b></em>' containment reference.
@@ -177,7 +259,7 @@ public interface ExpressionPackage extends EPackage {
* @generated
* @ordered
*/
- int BOOLEAN_OPERATION__RIGHT = ABSTRACT_EXPRESSION_FEATURE_COUNT + 1;
+ int BOOLEAN_OPERATION__RIGHT = BINARY_OPERATION__RIGHT;
/**
* The feature id for the '<em><b>Operator</b></em>' containment reference.
@@ -186,7 +268,7 @@ public interface ExpressionPackage extends EPackage {
* @generated
* @ordered
*/
- int BOOLEAN_OPERATION__OPERATOR = ABSTRACT_EXPRESSION_FEATURE_COUNT + 2;
+ int BOOLEAN_OPERATION__OPERATOR = BINARY_OPERATION__OPERATOR;
/**
* The number of structural features of the '<em>Boolean Operation</em>' class.
@@ -195,7 +277,7 @@ public interface ExpressionPackage extends EPackage {
* @generated
* @ordered
*/
- int BOOLEAN_OPERATION_FEATURE_COUNT = ABSTRACT_EXPRESSION_FEATURE_COUNT + 3;
+ int BOOLEAN_OPERATION_FEATURE_COUNT = BINARY_OPERATION_FEATURE_COUNT + 0;
/**
* The meta object id for the '{@link org.eclipse.xpand3.expression.impl.CastImpl <em>Cast</em>}' class.
@@ -1588,39 +1670,6 @@ public interface ExpressionPackage extends EPackage {
EClass getBooleanOperation();
/**
- * Returns the meta object for the containment reference '{@link org.eclipse.xpand3.expression.BooleanOperation#getLeft <em>Left</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Left</em>'.
- * @see org.eclipse.xpand3.expression.BooleanOperation#getLeft()
- * @see #getBooleanOperation()
- * @generated
- */
- EReference getBooleanOperation_Left();
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.xpand3.expression.BooleanOperation#getRight <em>Right</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Right</em>'.
- * @see org.eclipse.xpand3.expression.BooleanOperation#getRight()
- * @see #getBooleanOperation()
- * @generated
- */
- EReference getBooleanOperation_Right();
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.xpand3.expression.BooleanOperation#getOperator <em>Operator</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Operator</em>'.
- * @see org.eclipse.xpand3.expression.BooleanOperation#getOperator()
- * @see #getBooleanOperation()
- * @generated
- */
- EReference getBooleanOperation_Operator();
-
- /**
* Returns the meta object for class '{@link org.eclipse.xpand3.expression.Cast <em>Cast</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -2086,6 +2135,49 @@ public interface ExpressionPackage extends EPackage {
EReference getCase_ThenPart();
/**
+ * Returns the meta object for class '{@link org.eclipse.xpand3.expression.BinaryOperation <em>Binary Operation</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Binary Operation</em>'.
+ * @see org.eclipse.xpand3.expression.BinaryOperation
+ * @generated
+ */
+ EClass getBinaryOperation();
+
+ /**
+ * Returns the meta object for the containment reference '{@link org.eclipse.xpand3.expression.BinaryOperation#getLeft <em>Left</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the containment reference '<em>Left</em>'.
+ * @see org.eclipse.xpand3.expression.BinaryOperation#getLeft()
+ * @see #getBinaryOperation()
+ * @generated
+ */
+ EReference getBinaryOperation_Left();
+
+ /**
+ * Returns the meta object for the containment reference '{@link org.eclipse.xpand3.expression.BinaryOperation#getRight <em>Right</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the containment reference '<em>Right</em>'.
+ * @see org.eclipse.xpand3.expression.BinaryOperation#getRight()
+ * @see #getBinaryOperation()
+ * @generated
+ */
+ EReference getBinaryOperation_Right();
+
+ /**
+ * Returns the meta object for the containment reference '{@link org.eclipse.xpand3.expression.BinaryOperation#getOperator <em>Operator</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the containment reference '<em>Operator</em>'.
+ * @see org.eclipse.xpand3.expression.BinaryOperation#getOperator()
+ * @see #getBinaryOperation()
+ * @generated
+ */
+ EReference getBinaryOperation_Operator();
+
+ /**
* Returns the factory that creates the instances of the model.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -2128,30 +2220,6 @@ public interface ExpressionPackage extends EPackage {
EClass BOOLEAN_OPERATION = eINSTANCE.getBooleanOperation();
/**
- * The meta object literal for the '<em><b>Left</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EReference BOOLEAN_OPERATION__LEFT = eINSTANCE.getBooleanOperation_Left();
-
- /**
- * The meta object literal for the '<em><b>Right</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EReference BOOLEAN_OPERATION__RIGHT = eINSTANCE.getBooleanOperation_Right();
-
- /**
- * The meta object literal for the '<em><b>Operator</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EReference BOOLEAN_OPERATION__OPERATOR = eINSTANCE.getBooleanOperation_Operator();
-
- /**
* The meta object literal for the '{@link org.eclipse.xpand3.expression.impl.CastImpl <em>Cast</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -2541,6 +2609,40 @@ public interface ExpressionPackage extends EPackage {
*/
EReference CASE__THEN_PART = eINSTANCE.getCase_ThenPart();
+ /**
+ * The meta object literal for the '{@link org.eclipse.xpand3.expression.impl.BinaryOperationImpl <em>Binary Operation</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.xpand3.expression.impl.BinaryOperationImpl
+ * @see org.eclipse.xpand3.expression.impl.ExpressionPackageImpl#getBinaryOperation()
+ * @generated
+ */
+ EClass BINARY_OPERATION = eINSTANCE.getBinaryOperation();
+
+ /**
+ * The meta object literal for the '<em><b>Left</b></em>' containment reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference BINARY_OPERATION__LEFT = eINSTANCE.getBinaryOperation_Left();
+
+ /**
+ * The meta object literal for the '<em><b>Right</b></em>' containment reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference BINARY_OPERATION__RIGHT = eINSTANCE.getBinaryOperation_Right();
+
+ /**
+ * The meta object literal for the '<em><b>Operator</b></em>' containment reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference BINARY_OPERATION__OPERATOR = eINSTANCE.getBinaryOperation_Operator();
+
}
} //ExpressionPackage
diff --git a/plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/expression/impl/BinaryOperationImpl.java b/plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/expression/impl/BinaryOperationImpl.java
new file mode 100644
index 0000000..8eb8674
--- /dev/null
+++ b/plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/expression/impl/BinaryOperationImpl.java
@@ -0,0 +1,313 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id: BinaryOperationImpl.java,v 1.1 2008/03/10 08:25:34 jkohnlein Exp $
+ */
+package org.eclipse.xpand3.expression.impl;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.NotificationChain;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+
+import org.eclipse.xpand3.Identifier;
+
+import org.eclipse.xpand3.expression.AbstractExpression;
+import org.eclipse.xpand3.expression.BinaryOperation;
+import org.eclipse.xpand3.expression.ExpressionPackage;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Binary Operation</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.xpand3.expression.impl.BinaryOperationImpl#getLeft <em>Left</em>}</li>
+ * <li>{@link org.eclipse.xpand3.expression.impl.BinaryOperationImpl#getRight <em>Right</em>}</li>
+ * <li>{@link org.eclipse.xpand3.expression.impl.BinaryOperationImpl#getOperator <em>Operator</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class BinaryOperationImpl extends AbstractExpressionImpl implements BinaryOperation {
+ /**
+ * The cached value of the '{@link #getLeft() <em>Left</em>}' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getLeft()
+ * @generated
+ * @ordered
+ */
+ protected AbstractExpression left;
+
+ /**
+ * The cached value of the '{@link #getRight() <em>Right</em>}' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getRight()
+ * @generated
+ * @ordered
+ */
+ protected AbstractExpression right;
+
+ /**
+ * The cached value of the '{@link #getOperator() <em>Operator</em>}' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getOperator()
+ * @generated
+ * @ordered
+ */
+ protected Identifier operator;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected BinaryOperationImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return ExpressionPackage.Literals.BINARY_OPERATION;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public AbstractExpression getLeft() {
+ return left;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NotificationChain basicSetLeft(AbstractExpression newLeft, NotificationChain msgs) {
+ AbstractExpression oldLeft = left;
+ left = newLeft;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ExpressionPackage.BINARY_OPERATION__LEFT, oldLeft, newLeft);
+ if (msgs == null) msgs = notification; else msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setLeft(AbstractExpression newLeft) {
+ if (newLeft != left) {
+ NotificationChain msgs = null;
+ if (left != null)
+ msgs = ((InternalEObject)left).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ExpressionPackage.BINARY_OPERATION__LEFT, null, msgs);
+ if (newLeft != null)
+ msgs = ((InternalEObject)newLeft).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ExpressionPackage.BINARY_OPERATION__LEFT, null, msgs);
+ msgs = basicSetLeft(newLeft, msgs);
+ if (msgs != null) msgs.dispatch();
+ }
+ else if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, ExpressionPackage.BINARY_OPERATION__LEFT, newLeft, newLeft));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public AbstractExpression getRight() {
+ return right;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NotificationChain basicSetRight(AbstractExpression newRight, NotificationChain msgs) {
+ AbstractExpression oldRight = right;
+ right = newRight;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ExpressionPackage.BINARY_OPERATION__RIGHT, oldRight, newRight);
+ if (msgs == null) msgs = notification; else msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setRight(AbstractExpression newRight) {
+ if (newRight != right) {
+ NotificationChain msgs = null;
+ if (right != null)
+ msgs = ((InternalEObject)right).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ExpressionPackage.BINARY_OPERATION__RIGHT, null, msgs);
+ if (newRight != null)
+ msgs = ((InternalEObject)newRight).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ExpressionPackage.BINARY_OPERATION__RIGHT, null, msgs);
+ msgs = basicSetRight(newRight, msgs);
+ if (msgs != null) msgs.dispatch();
+ }
+ else if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, ExpressionPackage.BINARY_OPERATION__RIGHT, newRight, newRight));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Identifier getOperator() {
+ return operator;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NotificationChain basicSetOperator(Identifier newOperator, NotificationChain msgs) {
+ Identifier oldOperator = operator;
+ operator = newOperator;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ExpressionPackage.BINARY_OPERATION__OPERATOR, oldOperator, newOperator);
+ if (msgs == null) msgs = notification; else msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setOperator(Identifier newOperator) {
+ if (newOperator != operator) {
+ NotificationChain msgs = null;
+ if (operator != null)
+ msgs = ((InternalEObject)operator).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ExpressionPackage.BINARY_OPERATION__OPERATOR, null, msgs);
+ if (newOperator != null)
+ msgs = ((InternalEObject)newOperator).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ExpressionPackage.BINARY_OPERATION__OPERATOR, null, msgs);
+ msgs = basicSetOperator(newOperator, msgs);
+ if (msgs != null) msgs.dispatch();
+ }
+ else if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, ExpressionPackage.BINARY_OPERATION__OPERATOR, newOperator, newOperator));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case ExpressionPackage.BINARY_OPERATION__LEFT:
+ return basicSetLeft(null, msgs);
+ case ExpressionPackage.BINARY_OPERATION__RIGHT:
+ return basicSetRight(null, msgs);
+ case ExpressionPackage.BINARY_OPERATION__OPERATOR:
+ return basicSetOperator(null, msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case ExpressionPackage.BINARY_OPERATION__LEFT:
+ return getLeft();
+ case ExpressionPackage.BINARY_OPERATION__RIGHT:
+ return getRight();
+ case ExpressionPackage.BINARY_OPERATION__OPERATOR:
+ return getOperator();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case ExpressionPackage.BINARY_OPERATION__LEFT:
+ setLeft((AbstractExpression)newValue);
+ return;
+ case ExpressionPackage.BINARY_OPERATION__RIGHT:
+ setRight((AbstractExpression)newValue);
+ return;
+ case ExpressionPackage.BINARY_OPERATION__OPERATOR:
+ setOperator((Identifier)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case ExpressionPackage.BINARY_OPERATION__LEFT:
+ setLeft((AbstractExpression)null);
+ return;
+ case ExpressionPackage.BINARY_OPERATION__RIGHT:
+ setRight((AbstractExpression)null);
+ return;
+ case ExpressionPackage.BINARY_OPERATION__OPERATOR:
+ setOperator((Identifier)null);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case ExpressionPackage.BINARY_OPERATION__LEFT:
+ return left != null;
+ case ExpressionPackage.BINARY_OPERATION__RIGHT:
+ return right != null;
+ case ExpressionPackage.BINARY_OPERATION__OPERATOR:
+ return operator != null;
+ }
+ return super.eIsSet(featureID);
+ }
+
+} //BinaryOperationImpl
diff --git a/plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/expression/impl/BooleanOperationImpl.java b/plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/expression/impl/BooleanOperationImpl.java
index f2b4357..6343d1c 100644
--- a/plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/expression/impl/BooleanOperationImpl.java
+++ b/plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/expression/impl/BooleanOperationImpl.java
@@ -2,7 +2,7 @@
* <copyright>
* </copyright>
*
- * $Id: BooleanOperationImpl.java,v 1.2 2008/03/07 11:10:35 jkohnlein Exp $
+ * $Id: BooleanOperationImpl.java,v 1.3 2008/03/10 08:25:34 jkohnlein Exp $
*/
package org.eclipse.xpand3.expression.impl;
@@ -25,47 +25,11 @@ import org.eclipse.xpand3.expression.ExpressionPackage;
* An implementation of the model object '<em><b>Boolean Operation</b></em>'.
* <!-- end-user-doc -->
* <p>
- * The following features are implemented:
- * <ul>
- * <li>{@link org.eclipse.xpand3.expression.impl.BooleanOperationImpl#getLeft <em>Left</em>}</li>
- * <li>{@link org.eclipse.xpand3.expression.impl.BooleanOperationImpl#getRight <em>Right</em>}</li>
- * <li>{@link org.eclipse.xpand3.expression.impl.BooleanOperationImpl#getOperator <em>Operator</em>}</li>
- * </ul>
* </p>
*
* @generated
*/
-public class BooleanOperationImpl extends AbstractExpressionImpl implements BooleanOperation {
- /**
- * The cached value of the '{@link #getLeft() <em>Left</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getLeft()
- * @generated
- * @ordered
- */
- protected AbstractExpression left;
-
- /**
- * The cached value of the '{@link #getRight() <em>Right</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getRight()
- * @generated
- * @ordered
- */
- protected AbstractExpression right;
-
- /**
- * The cached value of the '{@link #getOperator() <em>Operator</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getOperator()
- * @generated
- * @ordered
- */
- protected Identifier operator;
-
+public class BooleanOperationImpl extends BinaryOperationImpl implements BooleanOperation {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -85,229 +49,4 @@ public class BooleanOperationImpl extends AbstractExpressionImpl implements Bool
return ExpressionPackage.Literals.BOOLEAN_OPERATION;
}
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public AbstractExpression getLeft() {
- return left;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetLeft(AbstractExpression newLeft, NotificationChain msgs) {
- AbstractExpression oldLeft = left;
- left = newLeft;
- if (eNotificationRequired()) {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ExpressionPackage.BOOLEAN_OPERATION__LEFT, oldLeft, newLeft);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setLeft(AbstractExpression newLeft) {
- if (newLeft != left) {
- NotificationChain msgs = null;
- if (left != null)
- msgs = ((InternalEObject)left).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ExpressionPackage.BOOLEAN_OPERATION__LEFT, null, msgs);
- if (newLeft != null)
- msgs = ((InternalEObject)newLeft).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ExpressionPackage.BOOLEAN_OPERATION__LEFT, null, msgs);
- msgs = basicSetLeft(newLeft, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, ExpressionPackage.BOOLEAN_OPERATION__LEFT, newLeft, newLeft));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public AbstractExpression getRight() {
- return right;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetRight(AbstractExpression newRight, NotificationChain msgs) {
- AbstractExpression oldRight = right;
- right = newRight;
- if (eNotificationRequired()) {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ExpressionPackage.BOOLEAN_OPERATION__RIGHT, oldRight, newRight);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setRight(AbstractExpression newRight) {
- if (newRight != right) {
- NotificationChain msgs = null;
- if (right != null)
- msgs = ((InternalEObject)right).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ExpressionPackage.BOOLEAN_OPERATION__RIGHT, null, msgs);
- if (newRight != null)
- msgs = ((InternalEObject)newRight).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ExpressionPackage.BOOLEAN_OPERATION__RIGHT, null, msgs);
- msgs = basicSetRight(newRight, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, ExpressionPackage.BOOLEAN_OPERATION__RIGHT, newRight, newRight));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public Identifier getOperator() {
- return operator;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetOperator(Identifier newOperator, NotificationChain msgs) {
- Identifier oldOperator = operator;
- operator = newOperator;
- if (eNotificationRequired()) {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ExpressionPackage.BOOLEAN_OPERATION__OPERATOR, oldOperator, newOperator);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setOperator(Identifier newOperator) {
- if (newOperator != operator) {
- NotificationChain msgs = null;
- if (operator != null)
- msgs = ((InternalEObject)operator).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ExpressionPackage.BOOLEAN_OPERATION__OPERATOR, null, msgs);
- if (newOperator != null)
- msgs = ((InternalEObject)newOperator).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ExpressionPackage.BOOLEAN_OPERATION__OPERATOR, null, msgs);
- msgs = basicSetOperator(newOperator, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, ExpressionPackage.BOOLEAN_OPERATION__OPERATOR, newOperator, newOperator));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
- switch (featureID) {
- case ExpressionPackage.BOOLEAN_OPERATION__LEFT:
- return basicSetLeft(null, msgs);
- case ExpressionPackage.BOOLEAN_OPERATION__RIGHT:
- return basicSetRight(null, msgs);
- case ExpressionPackage.BOOLEAN_OPERATION__OPERATOR:
- return basicSetOperator(null, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType) {
- switch (featureID) {
- case ExpressionPackage.BOOLEAN_OPERATION__LEFT:
- return getLeft();
- case ExpressionPackage.BOOLEAN_OPERATION__RIGHT:
- return getRight();
- case ExpressionPackage.BOOLEAN_OPERATION__OPERATOR:
- return getOperator();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue) {
- switch (featureID) {
- case ExpressionPackage.BOOLEAN_OPERATION__LEFT:
- setLeft((AbstractExpression)newValue);
- return;
- case ExpressionPackage.BOOLEAN_OPERATION__RIGHT:
- setRight((AbstractExpression)newValue);
- return;
- case ExpressionPackage.BOOLEAN_OPERATION__OPERATOR:
- setOperator((Identifier)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID) {
- switch (featureID) {
- case ExpressionPackage.BOOLEAN_OPERATION__LEFT:
- setLeft((AbstractExpression)null);
- return;
- case ExpressionPackage.BOOLEAN_OPERATION__RIGHT:
- setRight((AbstractExpression)null);
- return;
- case ExpressionPackage.BOOLEAN_OPERATION__OPERATOR:
- setOperator((Identifier)null);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID) {
- switch (featureID) {
- case ExpressionPackage.BOOLEAN_OPERATION__LEFT:
- return left != null;
- case ExpressionPackage.BOOLEAN_OPERATION__RIGHT:
- return right != null;
- case ExpressionPackage.BOOLEAN_OPERATION__OPERATOR:
- return operator != null;
- }
- return super.eIsSet(featureID);
- }
-
} //BooleanOperationImpl
diff --git a/plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/expression/impl/ExpressionFactoryImpl.java b/plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/expression/impl/ExpressionFactoryImpl.java
index af6acc6..4d83a92 100644
--- a/plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/expression/impl/ExpressionFactoryImpl.java
+++ b/plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/expression/impl/ExpressionFactoryImpl.java
@@ -2,7 +2,7 @@
* <copyright>
* </copyright>
*
- * $Id: ExpressionFactoryImpl.java,v 1.2 2008/03/07 11:10:36 jkohnlein Exp $
+ * $Id: ExpressionFactoryImpl.java,v 1.3 2008/03/10 08:25:34 jkohnlein Exp $
*/
package org.eclipse.xpand3.expression.impl;
@@ -79,6 +79,7 @@ public class ExpressionFactoryImpl extends EFactoryImpl implements ExpressionFac
case ExpressionPackage.STRING_LITERAL: return createStringLiteral();
case ExpressionPackage.SWITCH_EXPRESSION: return createSwitchExpression();
case ExpressionPackage.CASE: return createCase();
+ case ExpressionPackage.BINARY_OPERATION: return createBinaryOperation();
default:
throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
}
@@ -279,6 +280,16 @@ public class ExpressionFactoryImpl extends EFactoryImpl implements ExpressionFac
* <!-- end-user-doc -->
* @generated
*/
+ public BinaryOperation createBinaryOperation() {
+ BinaryOperationImpl binaryOperation = new BinaryOperationImpl();
+ return binaryOperation;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
public ExpressionPackage getExpressionPackage() {
return (ExpressionPackage)getEPackage();
}
diff --git a/plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/expression/impl/ExpressionPackageImpl.java b/plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/expression/impl/ExpressionPackageImpl.java
index 0699d61..9c5f76c 100644
--- a/plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/expression/impl/ExpressionPackageImpl.java
+++ b/plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/expression/impl/ExpressionPackageImpl.java
@@ -2,7 +2,7 @@
* <copyright>
* </copyright>
*
- * $Id: ExpressionPackageImpl.java,v 1.2 2008/03/07 11:10:35 jkohnlein Exp $
+ * $Id: ExpressionPackageImpl.java,v 1.3 2008/03/10 08:25:34 jkohnlein Exp $
*/
package org.eclipse.xpand3.expression.impl;
@@ -19,6 +19,7 @@ import org.eclipse.xpand3.declaration.DeclarationPackage;
import org.eclipse.xpand3.declaration.impl.DeclarationPackageImpl;
import org.eclipse.xpand3.expression.AbstractExpression;
+import org.eclipse.xpand3.expression.BinaryOperation;
import org.eclipse.xpand3.expression.BooleanLiteral;
import org.eclipse.xpand3.expression.BooleanOperation;
import org.eclipse.xpand3.expression.Case;
@@ -203,6 +204,13 @@ public class ExpressionPackageImpl extends EPackageImpl implements ExpressionPac
private EClass caseEClass = null;
/**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass binaryOperationEClass = 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.
@@ -304,33 +312,6 @@ public class ExpressionPackageImpl extends EPackageImpl implements ExpressionPac
* <!-- end-user-doc -->
* @generated
*/
- public EReference getBooleanOperation_Left() {
- return (EReference)booleanOperationEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EReference getBooleanOperation_Right() {
- return (EReference)booleanOperationEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EReference getBooleanOperation_Operator() {
- return (EReference)booleanOperationEClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
public EClass getCast() {
return castEClass;
}
@@ -727,6 +708,42 @@ public class ExpressionPackageImpl extends EPackageImpl implements ExpressionPac
* <!-- end-user-doc -->
* @generated
*/
+ public EClass getBinaryOperation() {
+ return binaryOperationEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getBinaryOperation_Left() {
+ return (EReference)binaryOperationEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getBinaryOperation_Right() {
+ return (EReference)binaryOperationEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getBinaryOperation_Operator() {
+ return (EReference)binaryOperationEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
public ExpressionFactory getExpressionFactory() {
return (ExpressionFactory)getEFactoryInstance();
}
@@ -753,9 +770,6 @@ public class ExpressionPackageImpl extends EPackageImpl implements ExpressionPac
abstractExpressionEClass = createEClass(ABSTRACT_EXPRESSION);
booleanOperationEClass = createEClass(BOOLEAN_OPERATION);
- createEReference(booleanOperationEClass, BOOLEAN_OPERATION__LEFT);
- createEReference(booleanOperationEClass, BOOLEAN_OPERATION__RIGHT);
- createEReference(booleanOperationEClass, BOOLEAN_OPERATION__OPERATOR);
castEClass = createEClass(CAST);
createEReference(castEClass, CAST__TYPE);
@@ -819,6 +833,11 @@ public class ExpressionPackageImpl extends EPackageImpl implements ExpressionPac
caseEClass = createEClass(CASE);
createEReference(caseEClass, CASE__CONDITION);
createEReference(caseEClass, CASE__THEN_PART);
+
+ binaryOperationEClass = createEClass(BINARY_OPERATION);
+ createEReference(binaryOperationEClass, BINARY_OPERATION__LEFT);
+ createEReference(binaryOperationEClass, BINARY_OPERATION__RIGHT);
+ createEReference(binaryOperationEClass, BINARY_OPERATION__OPERATOR);
}
/**
@@ -853,7 +872,7 @@ public class ExpressionPackageImpl extends EPackageImpl implements ExpressionPac
// Add supertypes to classes
abstractExpressionEClass.getESuperTypes().add(theXpand3Package.getSyntaxElement());
- booleanOperationEClass.getESuperTypes().add(this.getAbstractExpression());
+ booleanOperationEClass.getESuperTypes().add(this.getBinaryOperation());
castEClass.getESuperTypes().add(this.getAbstractExpression());
chainExpressionEClass.getESuperTypes().add(this.getAbstractExpression());
constructorCallExpressionEClass.getESuperTypes().add(this.getAbstractExpression());
@@ -873,14 +892,12 @@ public class ExpressionPackageImpl extends EPackageImpl implements ExpressionPac
stringLiteralEClass.getESuperTypes().add(this.getLiteral());
switchExpressionEClass.getESuperTypes().add(this.getAbstractExpression());
caseEClass.getESuperTypes().add(theXpand3Package.getSyntaxElement());
+ binaryOperationEClass.getESuperTypes().add(this.getAbstractExpression());
// Initialize classes and features; add operations and parameters
initEClass(abstractExpressionEClass, AbstractExpression.class, "AbstractExpression", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEClass(booleanOperationEClass, BooleanOperation.class, "BooleanOperation", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getBooleanOperation_Left(), this.getAbstractExpression(), null, "left", null, 0, 1, BooleanOperation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getBooleanOperation_Right(), this.getAbstractExpression(), null, "right", null, 0, 1, BooleanOperation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getBooleanOperation_Operator(), theXpand3Package.getIdentifier(), null, "operator", null, 0, 1, BooleanOperation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(castEClass, Cast.class, "Cast", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getCast_Type(), theXpand3Package.getIdentifier(), null, "type", null, 0, 1, Cast.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
@@ -944,6 +961,11 @@ public class ExpressionPackageImpl extends EPackageImpl implements ExpressionPac
initEClass(caseEClass, Case.class, "Case", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getCase_Condition(), this.getAbstractExpression(), null, "condition", null, 0, 1, Case.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getCase_ThenPart(), this.getAbstractExpression(), null, "thenPart", null, 0, 1, Case.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(binaryOperationEClass, BinaryOperation.class, "BinaryOperation", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEReference(getBinaryOperation_Left(), this.getAbstractExpression(), null, "left", null, 0, 1, BinaryOperation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getBinaryOperation_Right(), this.getAbstractExpression(), null, "right", null, 0, 1, BinaryOperation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getBinaryOperation_Operator(), theXpand3Package.getIdentifier(), null, "operator", null, 0, 1, BinaryOperation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
}
} //ExpressionPackageImpl
diff --git a/plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/expression/util/ExpressionAdapterFactory.java b/plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/expression/util/ExpressionAdapterFactory.java
index 3eb873e..2a1d634 100644
--- a/plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/expression/util/ExpressionAdapterFactory.java
+++ b/plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/expression/util/ExpressionAdapterFactory.java
@@ -2,7 +2,7 @@
* <copyright>
* </copyright>
*
- * $Id: ExpressionAdapterFactory.java,v 1.2 2008/03/07 11:10:58 jkohnlein Exp $
+ * $Id: ExpressionAdapterFactory.java,v 1.3 2008/03/10 08:25:35 jkohnlein Exp $
*/
package org.eclipse.xpand3.expression.util;
@@ -158,6 +158,10 @@ public class ExpressionAdapterFactory extends AdapterFactoryImpl {
return createCaseAdapter();
}
@Override
+ public Adapter caseBinaryOperation(BinaryOperation object) {
+ return createBinaryOperationAdapter();
+ }
+ @Override
public Adapter caseSyntaxElement(SyntaxElement object) {
return createSyntaxElementAdapter();
}
@@ -476,6 +480,20 @@ public class ExpressionAdapterFactory extends AdapterFactoryImpl {
}
/**
+ * Creates a new adapter for an object of class '{@link org.eclipse.xpand3.expression.BinaryOperation <em>Binary Operation</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see org.eclipse.xpand3.expression.BinaryOperation
+ * @generated
+ */
+ public Adapter createBinaryOperationAdapter() {
+ return null;
+ }
+
+ /**
* Creates a new adapter for an object of class '{@link org.eclipse.xpand3.SyntaxElement <em>Syntax Element</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
diff --git a/plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/expression/util/ExpressionSwitch.java b/plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/expression/util/ExpressionSwitch.java
index 8108ff0..c0cc744 100644
--- a/plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/expression/util/ExpressionSwitch.java
+++ b/plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/expression/util/ExpressionSwitch.java
@@ -2,7 +2,7 @@
* <copyright>
* </copyright>
*
- * $Id: ExpressionSwitch.java,v 1.2 2008/03/07 11:10:58 jkohnlein Exp $
+ * $Id: ExpressionSwitch.java,v 1.3 2008/03/10 08:25:35 jkohnlein Exp $
*/
package org.eclipse.xpand3.expression.util;
@@ -99,6 +99,7 @@ public class ExpressionSwitch<T> {
case ExpressionPackage.BOOLEAN_OPERATION: {
BooleanOperation booleanOperation = (BooleanOperation)theEObject;
T result = caseBooleanOperation(booleanOperation);
+ if (result == null) result = caseBinaryOperation(booleanOperation);
if (result == null) result = caseAbstractExpression(booleanOperation);
if (result == null) result = caseSyntaxElement(booleanOperation);
if (result == null) result = defaultCase(theEObject);
@@ -263,6 +264,14 @@ public class ExpressionSwitch<T> {
if (result == null) result = defaultCase(theEObject);
return result;
}
+ case ExpressionPackage.BINARY_OPERATION: {
+ BinaryOperation binaryOperation = (BinaryOperation)theEObject;
+ T result = caseBinaryOperation(binaryOperation);
+ if (result == null) result = caseAbstractExpression(binaryOperation);
+ if (result == null) result = caseSyntaxElement(binaryOperation);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
default: return defaultCase(theEObject);
}
}
@@ -583,6 +592,21 @@ public class ExpressionSwitch<T> {
}
/**
+ * Returns the result of interpreting the object as an instance of '<em>Binary Operation</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Binary Operation</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseBinaryOperation(BinaryOperation object) {
+ return null;
+ }
+
+ /**
* Returns the result of interpreting the object as an instance of '<em>Syntax Element</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
diff --git a/plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/expression/validation/BinaryOperationValidator.java b/plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/expression/validation/BinaryOperationValidator.java
new file mode 100644
index 0000000..ac80f39
--- /dev/null
+++ b/plugins/org.eclipse.xpand3/emf-gen/org/eclipse/xpand3/expression/validation/BinaryOperationValidator.java
@@ -0,0 +1,25 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id: BinaryOperationValidator.java,v 1.1 2008/03/10 08:25:36 jkohnlein Exp $
+ */
+package org.eclipse.xpand3.expression.validation;
+
+import org.eclipse.xpand3.Identifier;
+
+import org.eclipse.xpand3.expression.AbstractExpression;
+
+/**
+ * A sample validator interface for {@link org.eclipse.xpand3.expression.BinaryOperation}.
+ * This doesn't really do anything, and it's not a real EMF artifact.
+ * It was generated by the org.eclipse.emf.examples.generator.validator plug-in to illustrate how EMF's code generator can be extended.
+ * This can be disabled with -vmargs -Dorg.eclipse.emf.examples.generator.validator=false.
+ */
+public interface BinaryOperationValidator {
+ boolean validate();
+
+ boolean validateLeft(AbstractExpression value);
+ boolean validateRight(AbstractExpression value);
+ boolean validateOperator(Identifier value);
+}
diff --git a/plugins/org.eclipse.xpand3/src/xpand3.ecore b/plugins/org.eclipse.xpand3/src/xpand3.ecore
index 3c57db2..cf1896a 100644
--- a/plugins/org.eclipse.xpand3/src/xpand3.ecore
+++ b/plugins/org.eclipse.xpand3/src/xpand3.ecore
@@ -33,14 +33,7 @@
nsPrefix="expression">
<eClassifiers xsi:type="ecore:EClass" name="AbstractExpression" abstract="true"
eSuperTypes="#//SyntaxElement"/>
- <eClassifiers xsi:type="ecore:EClass" name="BooleanOperation" eSuperTypes="#//expression/AbstractExpression">
- <eStructuralFeatures xsi:type="ecore:EReference" name="left" eType="#//expression/AbstractExpression"
- containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="right" eType="#//expression/AbstractExpression"
- containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="operator" eType="#//Identifier"
- containment="true"/>
- </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="BooleanOperation" eSuperTypes="#//expression/BinaryOperation"/>
<eClassifiers xsi:type="ecore:EClass" name="Cast" eSuperTypes="#//expression/AbstractExpression">
<eStructuralFeatures xsi:type="ecore:EReference" name="type" eType="#//Identifier"
containment="true"/>
@@ -124,6 +117,14 @@
<eStructuralFeatures xsi:type="ecore:EReference" name="thenPart" eType="#//expression/AbstractExpression"
containment="true"/>
</eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="BinaryOperation" eSuperTypes="#//expression/AbstractExpression">
+ <eStructuralFeatures xsi:type="ecore:EReference" name="left" eType="#//expression/AbstractExpression"
+ containment="true"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="right" eType="#//expression/AbstractExpression"
+ containment="true"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="operator" eType="#//Identifier"
+ containment="true"/>
+ </eClassifiers>
</eSubpackages>
<eSubpackages name="statement" nsURI="http://www.eclipse.org/m2t/xpand/xpand3/statement"
nsPrefix="statement">
diff --git a/plugins/org.eclipse.xpand3/text/description.txt b/plugins/org.eclipse.xpand3/text/description.txt
index a5e1d27..45ea99a 100644
--- a/plugins/org.eclipse.xpand3/text/description.txt
+++ b/plugins/org.eclipse.xpand3/text/description.txt
@@ -1,52 +1,29 @@
-Model Static_typesystem
+Model Xpand3
This model description is not a real EMF artifact. It was generated by the
org.eclipse.emf.examples.generator.validator plug-in to illustrate how EMF's
code generator can be extended.
This can be disabled with -vmargs -Dorg.eclipse.emf.examples.generator.validator=false.
-Package staticTypesystem <http://www.eclipse.org/m2t/xpand3/staticTypesystem>
+Package xpand3 <http://www.eclipse.org/m2t/xpand/xpand3>
- Class AbstractNamedElement
- Attribute name : EString
+ Class SyntaxElement
+ Attribute line : EInt
+ Attribute start : EInt
+ Attribute end : EInt
+ Attribute fileName : EString
- Class AbstractTypeReference
+ Class File -> SyntaxElement
+ Reference imports : ImportStatement<<0..*>>
+ Reference declarations : AbstractDeclaration<<1..*>>
- Class Type -> AbstractTypeReference
- Reference declaredType : DeclaredType<<1..1>>
- Reference actualTypeArguments : AbstractTypeReference<<0..*>>
+ Class ImportStatement -> SyntaxElement
+ Reference importedId : Identifier
+ Attribute exported : EBoolean
- Class TypeVariable -> AbstractTypeReference
- Reference declaredTypeParameter : DeclaredTypeParameter<<1..1>>
+ Class Identifier -> SyntaxElement
+ Attribute value : EString
- Class VoidType -> AbstractTypeReference
-
- Class WildcardType -> AbstractTypeReference
- Reference lowerBounds : AbstractTypeReference<<0..*>>
- Reference upperBounds : AbstractTypeReference<<0..*>>
-
- Class FunctionType -> AbstractTypeReference
- Reference declaredFunction : DeclaredFunction<<1..1>>
- Reference actualTypeArguments : AbstractTypeReference<<0..*>>
-
- Class DeclaredType -> AbstractNamedElement
- Reference staticProperties : DeclaredStaticProperty<<0..*>>
- Reference properties : DeclaredProperty<<0..*>>
- Reference declaredTypeParameters : DeclaredTypeParameter<<0..*>>
-
- Class DeclaredFunction -> AbstractNamedElement
- Reference declaredParameters : DeclaredParameter<<0..*>>
- Reference declaredTypeParameters : DeclaredTypeParameter<<0..*>>
- Reference returnType : AbstractTypeReference
-
- Class DeclaredProperty -> AbstractNamedElement
- Reference type : AbstractTypeReference<<1..1>>
-
- Class DeclaredStaticProperty -> AbstractNamedElement
- Reference type : Type<<1..1>>
-
- Class DeclaredTypeParameter -> AbstractNamedElement
- Reference upperBounds : AbstractTypeReference<<0..*>>
-
- Class DeclaredParameter -> AbstractNamedElement
- Reference type : AbstractTypeReference<<1..1>>
+ Class DeclaredParameter -> SyntaxElement
+ Reference name : Identifier
+ Reference type : Identifier
diff --git a/tests/org.eclipse.xpand3.parser.tests/src/org/eclipse/xpand3/parser/node2ast/ParseStuff.java b/tests/org.eclipse.xpand3.parser.tests/src/org/eclipse/xpand3/parser/node2ast/ParseStuff.java
index 719a49f..7c34a3d 100644
--- a/tests/org.eclipse.xpand3.parser.tests/src/org/eclipse/xpand3/parser/node2ast/ParseStuff.java
+++ b/tests/org.eclipse.xpand3.parser.tests/src/org/eclipse/xpand3/parser/node2ast/ParseStuff.java
@@ -18,13 +18,13 @@ public class ParseStuff {
* @throws RecognitionException
*/
public static void main(String[] args) throws RecognitionException {
- useNodeParser = false;
- checkFor(1);
- checkFor(10);
- checkFor(100);
- checkFor(1000);
- checkFor(5000);
- checkFor(50000);
+ // useNodeParser = false;
+ // checkFor(1);
+ // checkFor(10);
+ // checkFor(100);
+ // checkFor(1000);
+ // checkFor(5000);
+ // checkFor(50000);
useNodeParser = true;
checkFor(1);
checkFor(10);
diff --git a/tests/org.eclipse.xpand3.parser.tests/src/org/eclipse/xpand3/parser/node2ast/TreetestInterpreterTest.java b/tests/org.eclipse.xpand3.parser.tests/src/org/eclipse/xpand3/parser/node2ast/TreetestInterpreterTest.java
index f32983b..a1347c3 100644
--- a/tests/org.eclipse.xpand3.parser.tests/src/org/eclipse/xpand3/parser/node2ast/TreetestInterpreterTest.java
+++ b/tests/org.eclipse.xpand3.parser.tests/src/org/eclipse/xpand3/parser/node2ast/TreetestInterpreterTest.java
@@ -43,7 +43,7 @@ public class TreetestInterpreterTest extends TestCase {
}
public void testTree() throws RecognitionException {
- test("org/eclipse/xpand3/parser/node2ast/test.tree");
+ test("org/eclipse/xpand3/parser/node2ast/test.ttst");
}
private void test(String testFileName) throws RecognitionException {
diff --git a/tests/org.eclipse.xpand3.parser.tests/src/org/eclipse/xpand3/parser/node2ast/test.ttst b/tests/org.eclipse.xpand3.parser.tests/src/org/eclipse/xpand3/parser/node2ast/test.ttst
index b3c4bb4..b3b175a 100644
--- a/tests/org.eclipse.xpand3.parser.tests/src/org/eclipse/xpand3/parser/node2ast/test.ttst
+++ b/tests/org.eclipse.xpand3.parser.tests/src/org/eclipse/xpand3/parser/node2ast/test.ttst
@@ -15,7 +15,7 @@ expected
name=Identifier(value='that')
type=Identifier(value='Object')
}]
- body=BooleanOperation{
+ body=BinaryOperation{
left=OperationCall {
name=Identifier(value="toString")
target=FeatureCall {