diff --git a/plugins/fr.obeo.dsl.arduino.design/src/fr/obeo/dsl/arduino/design/services/ArduinoServices.java b/plugins/fr.obeo.dsl.arduino.design/src/fr/obeo/dsl/arduino/design/services/ArduinoServices.java
index 8663c07..5bf8838 100644
--- a/plugins/fr.obeo.dsl.arduino.design/src/fr/obeo/dsl/arduino/design/services/ArduinoServices.java
+++ b/plugins/fr.obeo.dsl.arduino.design/src/fr/obeo/dsl/arduino/design/services/ArduinoServices.java
@@ -44,6 +44,7 @@
import fr.obeo.dsl.arduino.Constant;
import fr.obeo.dsl.arduino.Control;
import fr.obeo.dsl.arduino.DigitalPin;
+import fr.obeo.dsl.arduino.Expression;
import fr.obeo.dsl.arduino.Function;
import fr.obeo.dsl.arduino.FunctionCall;
import fr.obeo.dsl.arduino.Hardware;
@@ -63,7 +64,6 @@
import fr.obeo.dsl.arduino.Set;
import fr.obeo.dsl.arduino.Sketch;
import fr.obeo.dsl.arduino.Status;
-import fr.obeo.dsl.arduino.Value;
import fr.obeo.dsl.arduino.Variable;
import fr.obeo.dsl.arduino.While;
@@ -312,18 +312,18 @@ public String computeLevelLabel(fr.obeo.dsl.arduino.Level level) {
String label = level.getModule().getName();
if (level.getLevel() != null) {
label += "=";
- Value value = level.getLevel();
+ Expression value = level.getLevel();
label += computeLabel(value);
}
return label;
}
- public String computeLabel(Value value) {
+ public String computeLabel(Expression value) {
if (value instanceof Variable) {
return ((Variable) value).getName();
}
if (value instanceof Constant) {
- return value.getValue();
+ return ((Constant) value).getValue();
}
if (value instanceof Sensor) {
return ((Sensor) value).getModule().getName();
@@ -482,27 +482,26 @@ public OperatorKind getOperator(String operator) {
return null;
}
- public Value getValue(Sketch sketch, String value) {
+ public Expression getExpression(Sketch sketch, String expression) {
for (Instruction instruction : sketch.getInstructions()) {
- if (instruction instanceof Value
- && value.equals(((Value) instruction).getValue())) {
- return (Value) instruction;
+ if (instruction instanceof Constant
+ && expression.equals(((Constant) instruction).getValue())) {
+ return (Constant) instruction;
}
if (instruction instanceof Variable
- && value.equals(((Variable) instruction).getName())) {
- return (Value) instruction;
+ && expression.equals(((Variable) instruction).getName())) {
+ return (Expression) instruction;
}
}
- if (isInteger(value)) {
+ if (isInteger(expression)) {
fr.obeo.dsl.arduino.Constant constant = ArduinoFactory.eINSTANCE
.createConstant();
- constant.setValue(value);
+ constant.setValue(expression);
sketch.getInstructions().add(constant);
return constant;
}
Variable var = ArduinoFactory.eINSTANCE.createVariable();
- var.setName(value);
- var.setValue("0");
+ var.setName(expression);
sketch.getInstructions().add(var);
return var;
}
@@ -525,54 +524,54 @@ public void editLabel(While instruction, Sketch sketch, String left,
instruction.setCondition(condition);
}
- Value oldLeft = condition.getLeft();
- Value oldRight = condition.getRight();
+ Expression oldLeft = condition.getLeft();
+ Expression oldRight = condition.getRight();
- condition.setLeft(getValue(sketch, left));
+ condition.setLeft(getExpression(sketch, left));
condition.setOperator(getOperator(operator));
- condition.setRight(getValue(sketch, right));
+ condition.setRight(getExpression(sketch, right));
- deleteUnusedValue(sketch, oldLeft);
- deleteUnusedValue(sketch, oldRight);
+ deleteUnusedExpression(sketch, oldLeft);
+ deleteUnusedExpression(sketch, oldRight);
}
public void editLabel(Set instruction, Sketch sketch, String variable,
String value) {
- Value oldVariable = instruction.getVariable();
- Value oldValue = instruction.getValue();
- instruction.setVariable((Variable) getValue(sketch, variable));
- instruction.setValue(getValue(sketch, value));
+ Expression oldVariable = instruction.getVariable();
+ Expression oldValue = instruction.getValue();
+ instruction.setVariable((Variable) getExpression(sketch, variable));
+ instruction.setValue(getExpression(sketch, value));
// Clean unused values
- deleteUnusedValue(sketch, oldVariable);
- deleteUnusedValue(sketch, oldValue);
+ deleteUnusedExpression(sketch, oldVariable);
+ deleteUnusedExpression(sketch, oldValue);
}
- public void editLabel(Value value, String newValue) {
+ public void editLabel(Expression value, String newValue) {
}
- public void deleteUnusedValues(Sketch sketch) {
+ public void deleteUnusedExpressions(Sketch sketch) {
ImmutableList instructions = ImmutableList.copyOf(sketch
.getInstructions());
for (Instruction instruction : instructions) {
- if (instruction instanceof Value) {
- deleteUnusedValue(sketch, (Value) instruction);
+ if (instruction instanceof Expression) {
+ deleteUnusedExpression(sketch, (Expression) instruction);
}
}
}
- private void deleteUnusedValue(Sketch sketch, Value value) {
- if (value != null && isNotUsedAnymore(sketch, value)) {
- EcoreUtil.delete(value);
+ private void deleteUnusedExpression(Sketch sketch, Expression expression) {
+ if (expression != null && isNotUsedAnymore(sketch, expression)) {
+ EcoreUtil.delete(expression);
}
}
- private boolean isNotUsedAnymore(Sketch sketch, Value value) {
- ResourceSet resourceSet = value.eResource().getResourceSet();
+ private boolean isNotUsedAnymore(Sketch sketch, Expression expression) {
+ ResourceSet resourceSet = expression.eResource().getResourceSet();
ECrossReferenceAdapter adapter = new ECrossReferenceAdapter();
resourceSet.eAdapters().add(adapter);
- Collection refs = adapter.getInverseReferences(value, true);
+ Collection refs = adapter.getInverseReferences(expression, true);
return refs.size() == 1;
}
@@ -581,8 +580,8 @@ public List getVariables(EObject container) {
if (container instanceof Set) {
variables.add(((Set) container).getVariable());
} else if (container instanceof MathOperator) {
- Value left = ((MathOperator) container).getLeft();
- Value right = ((MathOperator) container).getRight();
+ Expression left = ((MathOperator) container).getLeft();
+ Expression right = ((MathOperator) container).getRight();
if (left instanceof Variable) {
variables.add((Variable) left);
}
@@ -596,13 +595,13 @@ public List getVariables(EObject container) {
public List getNumericalOperators(EObject container) {
List operators = Lists.newArrayList();
if (container instanceof Set) {
- Value value = ((Set) container).getValue();
+ Expression value = ((Set) container).getValue();
if (value instanceof NumericalOperator) {
operators.add((NumericalOperator) value);
}
} else if (container instanceof MathOperator) {
- Value left = ((MathOperator) container).getLeft();
- Value right = ((MathOperator) container).getRight();
+ Expression left = ((MathOperator) container).getLeft();
+ Expression right = ((MathOperator) container).getRight();
if (left instanceof NumericalOperator) {
operators.add((NumericalOperator) left);
}
@@ -702,13 +701,13 @@ public List getBooleanOperators(EObject container) {
public List getConstants(EObject container) {
List constants = Lists.newArrayList();
if (container instanceof Set) {
- Value value = ((Set) container).getValue();
+ Expression value = ((Set) container).getValue();
if (value instanceof Constant) {
constants.add((Constant) value);
}
} else if (container instanceof MathOperator) {
- Value left = ((MathOperator) container).getLeft();
- Value right = ((MathOperator) container).getRight();
+ Expression left = ((MathOperator) container).getLeft();
+ Expression right = ((MathOperator) container).getRight();
if (left instanceof Constant) {
constants.add((Constant) left);
}
@@ -851,12 +850,12 @@ public String getImage(ModuleInstruction instruction) {
+ instruction.getModule().getImage();
}
- public void updateValue(Level level, String newValue) {
- newValue = newValue.trim();
+ public void updateExpression(Level level, String newExpression) {
+ newExpression = newExpression.trim();
Sketch sketch = getSketch(level);
- Value value = getValue(sketch, newValue);
+ Expression value = getExpression(sketch, newExpression);
level.setLevel(value);
- deleteUnusedValues(sketch);
+ deleteUnusedExpressions(sketch);
}
public void addVariable(Instruction container, Variable variable) {
@@ -865,7 +864,7 @@ public void addVariable(Instruction container, Variable variable) {
} else if (container instanceof Set) {
((Set) container).setVariable(variable);
}
- deleteUnusedValues(getSketch(variable));
+ deleteUnusedExpressions(getSketch(variable));
}
public void addValue(Instruction container, Constant value) {
@@ -874,12 +873,12 @@ public void addValue(Instruction container, Constant value) {
} else if (container instanceof Set) {
((Set) container).setValue(value);
}
- deleteUnusedValues(getSketch(value));
+ deleteUnusedExpressions(getSketch(value));
}
- private void addMathOperatorValue(MathOperator container, Value value) {
- Value left = container.getLeft();
- Value right = container.getRight();
+ private void addMathOperatorValue(MathOperator container, Expression value) {
+ Expression left = container.getLeft();
+ Expression right = container.getRight();
if (left == null && right == null) {
container.setLeft(value);
@@ -890,30 +889,30 @@ private void addMathOperatorValue(MathOperator container, Value value) {
} else if (left != null && right != null) {
container.setLeft(value);
}
- deleteUnusedValues(getSketch(value));
+ deleteUnusedExpressions(getSketch(value));
}
- public void updateValue(Instruction container, Value newValue,
- Value oldValue) {
+ public void updateExpression(Instruction container, Expression newExpression,
+ Expression oldExpression) {
if (container instanceof Set) {
- if (newValue instanceof Variable) {
- ((Set) container).setVariable((Variable) newValue);
+ if (newExpression instanceof Variable) {
+ ((Set) container).setVariable((Variable) newExpression);
} else {
- ((Set) container).setValue(newValue);
+ ((Set) container).setValue(newExpression);
}
} else if (container instanceof MathOperator) {
- Value left = ((MathOperator) container).getLeft();
- Value right = ((MathOperator) container).getRight();
- if (oldValue.equals(left)) {
- ((MathOperator) container).setLeft(newValue);
- } else if (oldValue.equals(right)) {
- ((MathOperator) container).setRight(newValue);
+ Expression left = ((MathOperator) container).getLeft();
+ Expression right = ((MathOperator) container).getRight();
+ if (oldExpression.equals(left)) {
+ ((MathOperator) container).setLeft(newExpression);
+ } else if (oldExpression.equals(right)) {
+ ((MathOperator) container).setRight(newExpression);
}
} else if (container instanceof Level) {
- ((Level) container).setLevel(newValue);
+ ((Level) container).setLevel(newExpression);
}
- deleteUnusedValues(getSketch(container));
+ deleteUnusedExpressions(getSketch(container));
}
public void openHardwareDiagram(Hardware hardware) {
diff --git a/plugins/fr.obeo.dsl.arduino.edit/plugin.properties b/plugins/fr.obeo.dsl.arduino.edit/plugin.properties
index e6f4825..e449fcc 100644
--- a/plugins/fr.obeo.dsl.arduino.edit/plugin.properties
+++ b/plugins/fr.obeo.dsl.arduino.edit/plugin.properties
@@ -164,3 +164,6 @@ _UI_ParameterDefinition_name_feature = Name
_UI_ParameterCall_type = Parameter Call
_UI_ParameterCall_definition_feature = Definition
_UI_Parameter_definition_feature = Definition
+_UI_Expression_type = Expression
+_UI_Constant_value_feature = Value
+_UI_Library_music_literal = music
diff --git a/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/AnalogPinItemProvider.java b/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/AnalogPinItemProvider.java
index f45d7a4..033b12f 100644
--- a/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/AnalogPinItemProvider.java
+++ b/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/AnalogPinItemProvider.java
@@ -33,13 +33,7 @@
* @generated
*/
public class AnalogPinItemProvider
- extends PinItemProvider
- implements
- IEditingDomainItemProvider,
- IStructuredItemContentProvider,
- ITreeItemContentProvider,
- IItemLabelProvider,
- IItemPropertySource {
+ extends PinItemProvider {
/**
* This constructs an instance from a factory and a notifier.
*
diff --git a/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/BooleanOperatorItemProvider.java b/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/BooleanOperatorItemProvider.java
index afe7987..6bd7ec6 100644
--- a/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/BooleanOperatorItemProvider.java
+++ b/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/BooleanOperatorItemProvider.java
@@ -13,6 +13,7 @@
import fr.obeo.dsl.arduino.BooleanOperator;
+import fr.obeo.dsl.arduino.OperatorKind;
import java.util.Collection;
import java.util.List;
@@ -33,13 +34,7 @@
* @generated
*/
public class BooleanOperatorItemProvider
- extends MathOperatorItemProvider
- implements
- IEditingDomainItemProvider,
- IStructuredItemContentProvider,
- ITreeItemContentProvider,
- IItemLabelProvider,
- IItemPropertySource {
+ extends MathOperatorItemProvider {
/**
* This constructs an instance from a factory and a notifier.
*
@@ -84,7 +79,8 @@ public Object getImage(Object object) {
*/
@Override
public String getText(Object object) {
- String label = ((BooleanOperator)object).getValue();
+ OperatorKind labelValue = ((BooleanOperator)object).getOperator();
+ String label = labelValue == null ? null : labelValue.toString();
return label == null || label.length() == 0 ?
getString("_UI_BooleanOperator_type") :
getString("_UI_BooleanOperator_type") + " " + label;
diff --git a/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/ConstantItemProvider.java b/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/ConstantItemProvider.java
index a5f5491..d9ace72 100644
--- a/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/ConstantItemProvider.java
+++ b/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/ConstantItemProvider.java
@@ -11,6 +11,7 @@
package fr.obeo.dsl.arduino.provider;
+import fr.obeo.dsl.arduino.ArduinoPackage;
import fr.obeo.dsl.arduino.Constant;
import java.util.Collection;
@@ -19,12 +20,15 @@
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.IItemPropertySource;
import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ViewerNotification;
/**
* This is the item provider adapter for a {@link fr.obeo.dsl.arduino.Constant} object.
@@ -33,13 +37,7 @@
* @generated
*/
public class ConstantItemProvider
- extends ValueItemProvider
- implements
- IEditingDomainItemProvider,
- IStructuredItemContentProvider,
- ITreeItemContentProvider,
- IItemLabelProvider,
- IItemPropertySource {
+ extends ExpressionItemProvider {
/**
* This constructs an instance from a factory and a notifier.
*
@@ -61,10 +59,33 @@ public List getPropertyDescriptors(Object object) {
if (itemPropertyDescriptors == null) {
super.getPropertyDescriptors(object);
+ addValuePropertyDescriptor(object);
}
return itemPropertyDescriptors;
}
+ /**
+ * This adds a property descriptor for the Value feature.
+ *
+ *
+ * @generated
+ */
+ protected void addValuePropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_Constant_value_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_Constant_value_feature", "_UI_Constant_type"),
+ ArduinoPackage.Literals.CONSTANT__VALUE,
+ true,
+ false,
+ false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
+ null,
+ null));
+ }
+
/**
* This returns Constant.gif.
*
@@ -100,6 +121,12 @@ public String getText(Object object) {
@Override
public void notifyChanged(Notification notification) {
updateChildren(notification);
+
+ switch (notification.getFeatureID(Constant.class)) {
+ case ArduinoPackage.CONSTANT__VALUE:
+ fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
+ return;
+ }
super.notifyChanged(notification);
}
diff --git a/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/ControlItemProvider.java b/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/ControlItemProvider.java
index 4c785fb..55e7013 100644
--- a/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/ControlItemProvider.java
+++ b/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/ControlItemProvider.java
@@ -38,13 +38,7 @@
* @generated
*/
public class ControlItemProvider
- extends InstructionItemProvider
- implements
- IEditingDomainItemProvider,
- IStructuredItemContentProvider,
- ITreeItemContentProvider,
- IItemLabelProvider,
- IItemPropertySource {
+ extends InstructionItemProvider {
/**
* This constructs an instance from a factory and a notifier.
*
diff --git a/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/DelayItemProvider.java b/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/DelayItemProvider.java
index e2a0ebb..a13ccb7 100644
--- a/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/DelayItemProvider.java
+++ b/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/DelayItemProvider.java
@@ -38,13 +38,7 @@
* @generated
*/
public class DelayItemProvider
- extends UtilitiesItemProvider
- implements
- IEditingDomainItemProvider,
- IStructuredItemContentProvider,
- ITreeItemContentProvider,
- IItemLabelProvider,
- IItemPropertySource {
+ extends UtilitiesItemProvider {
/**
* This constructs an instance from a factory and a notifier.
*
diff --git a/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/DigitalPinItemProvider.java b/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/DigitalPinItemProvider.java
index f985b7b..ce41cc9 100644
--- a/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/DigitalPinItemProvider.java
+++ b/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/DigitalPinItemProvider.java
@@ -33,13 +33,7 @@
* @generated
*/
public class DigitalPinItemProvider
- extends PinItemProvider
- implements
- IEditingDomainItemProvider,
- IStructuredItemContentProvider,
- ITreeItemContentProvider,
- IItemLabelProvider,
- IItemPropertySource {
+ extends PinItemProvider {
/**
* This constructs an instance from a factory and a notifier.
*
diff --git a/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/ValueItemProvider.java b/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/ExpressionItemProvider.java
similarity index 62%
rename from plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/ValueItemProvider.java
rename to plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/ExpressionItemProvider.java
index fcf8e65..3f62447 100644
--- a/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/ValueItemProvider.java
+++ b/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/ExpressionItemProvider.java
@@ -12,7 +12,6 @@
import fr.obeo.dsl.arduino.ArduinoPackage;
-import fr.obeo.dsl.arduino.Value;
import java.util.Collection;
import java.util.List;
@@ -21,36 +20,22 @@
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
-import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
-import org.eclipse.emf.edit.provider.IItemLabelProvider;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
-import org.eclipse.emf.edit.provider.IItemPropertySource;
-import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
-import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
-import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
-import org.eclipse.emf.edit.provider.ViewerNotification;
/**
- * This is the item provider adapter for a {@link fr.obeo.dsl.arduino.Value} object.
+ * This is the item provider adapter for a {@link fr.obeo.dsl.arduino.Expression} object.
*
*
* @generated
*/
-public class ValueItemProvider
- extends InstructionItemProvider
- implements
- IEditingDomainItemProvider,
- IStructuredItemContentProvider,
- ITreeItemContentProvider,
- IItemLabelProvider,
- IItemPropertySource {
+public class ExpressionItemProvider extends InstructionItemProvider {
/**
* This constructs an instance from a factory and a notifier.
*
*
* @generated
*/
- public ValueItemProvider(AdapterFactory adapterFactory) {
+ public ExpressionItemProvider(AdapterFactory adapterFactory) {
super(adapterFactory);
}
@@ -66,7 +51,6 @@ public List getPropertyDescriptors(Object object) {
super.getPropertyDescriptors(object);
addDefinitionPropertyDescriptor(object);
- addValuePropertyDescriptor(object);
}
return itemPropertyDescriptors;
}
@@ -93,28 +77,6 @@ protected void addDefinitionPropertyDescriptor(Object object) {
null));
}
- /**
- * This adds a property descriptor for the Value feature.
- *
- *
- * @generated
- */
- protected void addValuePropertyDescriptor(Object object) {
- itemPropertyDescriptors.add
- (createItemPropertyDescriptor
- (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
- getResourceLocator(),
- getString("_UI_Value_value_feature"),
- getString("_UI_PropertyDescriptor_description", "_UI_Value_value_feature", "_UI_Value_type"),
- ArduinoPackage.Literals.VALUE__VALUE,
- true,
- false,
- false,
- ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
- null,
- null));
- }
-
/**
* This returns the label text for the adapted class.
*
@@ -123,11 +85,9 @@ protected void addValuePropertyDescriptor(Object object) {
*/
@Override
public String getText(Object object) {
- String label = ((Value)object).getValue();
- return label == null || label.length() == 0 ?
- getString("_UI_Value_type") :
- getString("_UI_Value_type") + " " + label;
+ return getString("_UI_Expression_type");
}
+
/**
* This handles model notifications by calling {@link #updateChildren} to update any cached
@@ -139,12 +99,6 @@ public String getText(Object object) {
@Override
public void notifyChanged(Notification notification) {
updateChildren(notification);
-
- switch (notification.getFeatureID(Value.class)) {
- case ArduinoPackage.VALUE__VALUE:
- fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
- return;
- }
super.notifyChanged(notification);
}
diff --git a/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/FunctionCallItemProvider.java b/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/FunctionCallItemProvider.java
index f7990d5..aa513ae 100644
--- a/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/FunctionCallItemProvider.java
+++ b/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/FunctionCallItemProvider.java
@@ -34,13 +34,7 @@
* @generated
*/
public class FunctionCallItemProvider
- extends InstructionItemProvider
- implements
- IEditingDomainItemProvider,
- IStructuredItemContentProvider,
- ITreeItemContentProvider,
- IItemLabelProvider,
- IItemPropertySource {
+ extends InstructionItemProvider {
/**
* This constructs an instance from a factory and a notifier.
*
diff --git a/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/HardwareItemProvider.java b/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/HardwareItemProvider.java
index b73b723..ad20bd0 100644
--- a/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/HardwareItemProvider.java
+++ b/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/HardwareItemProvider.java
@@ -39,13 +39,7 @@
* @generated
*/
public class HardwareItemProvider
- extends NamedElementItemProvider
- implements
- IEditingDomainItemProvider,
- IStructuredItemContentProvider,
- ITreeItemContentProvider,
- IItemLabelProvider,
- IItemPropertySource {
+ extends NamedElementItemProvider {
/**
* This constructs an instance from a factory and a notifier.
*
diff --git a/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/IOItemProvider.java b/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/IOItemProvider.java
index c871a31..009005f 100644
--- a/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/IOItemProvider.java
+++ b/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/IOItemProvider.java
@@ -31,13 +31,7 @@
* @generated
*/
public class IOItemProvider
- extends InstructionItemProvider
- implements
- IEditingDomainItemProvider,
- IStructuredItemContentProvider,
- ITreeItemContentProvider,
- IItemLabelProvider,
- IItemPropertySource {
+ extends InstructionItemProvider {
/**
* This constructs an instance from a factory and a notifier.
*
diff --git a/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/IfItemProvider.java b/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/IfItemProvider.java
index 01cfa09..8f25795 100644
--- a/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/IfItemProvider.java
+++ b/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/IfItemProvider.java
@@ -34,13 +34,7 @@
* @generated
*/
public class IfItemProvider
- extends ControlItemProvider
- implements
- IEditingDomainItemProvider,
- IStructuredItemContentProvider,
- ITreeItemContentProvider,
- IItemLabelProvider,
- IItemPropertySource {
+ extends ControlItemProvider {
/**
* This constructs an instance from a factory and a notifier.
*
diff --git a/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/InputModuleItemProvider.java b/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/InputModuleItemProvider.java
index 7967caf..7237b2e 100644
--- a/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/InputModuleItemProvider.java
+++ b/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/InputModuleItemProvider.java
@@ -33,13 +33,7 @@
* @generated
*/
public class InputModuleItemProvider
- extends ModuleItemProvider
- implements
- IEditingDomainItemProvider,
- IStructuredItemContentProvider,
- ITreeItemContentProvider,
- IItemLabelProvider,
- IItemPropertySource {
+ extends ModuleItemProvider {
/**
* This constructs an instance from a factory and a notifier.
*
diff --git a/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/LevelItemProvider.java b/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/LevelItemProvider.java
index f562506..22dfaa8 100644
--- a/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/LevelItemProvider.java
+++ b/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/LevelItemProvider.java
@@ -34,13 +34,7 @@
* @generated
*/
public class LevelItemProvider
- extends ModuleInstructionItemProvider
- implements
- IEditingDomainItemProvider,
- IStructuredItemContentProvider,
- ITreeItemContentProvider,
- IItemLabelProvider,
- IItemPropertySource {
+ extends ModuleInstructionItemProvider {
/**
* This constructs an instance from a factory and a notifier.
*
diff --git a/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/MathOperatorItemProvider.java b/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/MathOperatorItemProvider.java
index 02af012..95a6e66 100644
--- a/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/MathOperatorItemProvider.java
+++ b/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/MathOperatorItemProvider.java
@@ -14,6 +14,7 @@
import fr.obeo.dsl.arduino.ArduinoPackage;
import fr.obeo.dsl.arduino.MathOperator;
+import fr.obeo.dsl.arduino.OperatorKind;
import java.util.Collection;
import java.util.List;
@@ -37,13 +38,7 @@
* @generated
*/
public class MathOperatorItemProvider
- extends ValueItemProvider
- implements
- IEditingDomainItemProvider,
- IStructuredItemContentProvider,
- ITreeItemContentProvider,
- IItemLabelProvider,
- IItemPropertySource {
+ extends ExpressionItemProvider {
/**
* This constructs an instance from a factory and a notifier.
*
@@ -146,7 +141,8 @@ protected void addOperatorPropertyDescriptor(Object object) {
*/
@Override
public String getText(Object object) {
- String label = ((MathOperator)object).getValue();
+ OperatorKind labelValue = ((MathOperator)object).getOperator();
+ String label = labelValue == null ? null : labelValue.toString();
return label == null || label.length() == 0 ?
getString("_UI_MathOperator_type") :
getString("_UI_MathOperator_type") + " " + label;
diff --git a/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/ModuleInstructionItemProvider.java b/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/ModuleInstructionItemProvider.java
index 295a783..28119a0 100644
--- a/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/ModuleInstructionItemProvider.java
+++ b/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/ModuleInstructionItemProvider.java
@@ -34,13 +34,7 @@
* @generated
*/
public class ModuleInstructionItemProvider
- extends InstructionItemProvider
- implements
- IEditingDomainItemProvider,
- IStructuredItemContentProvider,
- ITreeItemContentProvider,
- IItemLabelProvider,
- IItemPropertySource {
+ extends InstructionItemProvider {
/**
* This constructs an instance from a factory and a notifier.
*
diff --git a/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/ModuleItemProvider.java b/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/ModuleItemProvider.java
index 2d4dc13..b6d56df 100644
--- a/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/ModuleItemProvider.java
+++ b/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/ModuleItemProvider.java
@@ -37,13 +37,7 @@
* @generated
*/
public class ModuleItemProvider
- extends NamedElementItemProvider
- implements
- IEditingDomainItemProvider,
- IStructuredItemContentProvider,
- ITreeItemContentProvider,
- IItemLabelProvider,
- IItemPropertySource {
+ extends NamedElementItemProvider {
/**
* This constructs an instance from a factory and a notifier.
*
diff --git a/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/NumericalOperatorItemProvider.java b/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/NumericalOperatorItemProvider.java
index c153b0e..aab2ac0 100644
--- a/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/NumericalOperatorItemProvider.java
+++ b/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/NumericalOperatorItemProvider.java
@@ -13,6 +13,7 @@
import fr.obeo.dsl.arduino.NumericalOperator;
+import fr.obeo.dsl.arduino.OperatorKind;
import java.util.Collection;
import java.util.List;
@@ -33,13 +34,7 @@
* @generated
*/
public class NumericalOperatorItemProvider
- extends MathOperatorItemProvider
- implements
- IEditingDomainItemProvider,
- IStructuredItemContentProvider,
- ITreeItemContentProvider,
- IItemLabelProvider,
- IItemPropertySource {
+ extends MathOperatorItemProvider {
/**
* This constructs an instance from a factory and a notifier.
*
@@ -84,7 +79,8 @@ public Object getImage(Object object) {
*/
@Override
public String getText(Object object) {
- String label = ((NumericalOperator)object).getValue();
+ OperatorKind labelValue = ((NumericalOperator)object).getOperator();
+ String label = labelValue == null ? null : labelValue.toString();
return label == null || label.length() == 0 ?
getString("_UI_NumericalOperator_type") :
getString("_UI_NumericalOperator_type") + " " + label;
diff --git a/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/OutputModuleItemProvider.java b/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/OutputModuleItemProvider.java
index 8282a5e..b05d525 100644
--- a/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/OutputModuleItemProvider.java
+++ b/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/OutputModuleItemProvider.java
@@ -33,13 +33,7 @@
* @generated
*/
public class OutputModuleItemProvider
- extends ModuleItemProvider
- implements
- IEditingDomainItemProvider,
- IStructuredItemContentProvider,
- ITreeItemContentProvider,
- IItemLabelProvider,
- IItemPropertySource {
+ extends ModuleItemProvider {
/**
* This constructs an instance from a factory and a notifier.
*
diff --git a/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/ParameterCallItemProvider.java b/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/ParameterCallItemProvider.java
index 9cb34b2..f006cdd 100644
--- a/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/ParameterCallItemProvider.java
+++ b/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/ParameterCallItemProvider.java
@@ -34,13 +34,7 @@
* @generated
*/
public class ParameterCallItemProvider
- extends InstructionItemProvider
- implements
- IEditingDomainItemProvider,
- IStructuredItemContentProvider,
- ITreeItemContentProvider,
- IItemLabelProvider,
- IItemPropertySource {
+ extends InstructionItemProvider {
/**
* This constructs an instance from a factory and a notifier.
*
diff --git a/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/PlatformItemProvider.java b/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/PlatformItemProvider.java
index 4432f7e..9d8e5d5 100644
--- a/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/PlatformItemProvider.java
+++ b/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/PlatformItemProvider.java
@@ -40,13 +40,7 @@
* @generated
*/
public class PlatformItemProvider
- extends NamedElementItemProvider
- implements
- IEditingDomainItemProvider,
- IStructuredItemContentProvider,
- ITreeItemContentProvider,
- IItemLabelProvider,
- IItemPropertySource {
+ extends NamedElementItemProvider {
/**
* This constructs an instance from a factory and a notifier.
*
diff --git a/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/RepeatItemProvider.java b/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/RepeatItemProvider.java
index 5d0de02..907418e 100644
--- a/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/RepeatItemProvider.java
+++ b/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/RepeatItemProvider.java
@@ -37,13 +37,7 @@
* @generated
*/
public class RepeatItemProvider
- extends ControlItemProvider
- implements
- IEditingDomainItemProvider,
- IStructuredItemContentProvider,
- ITreeItemContentProvider,
- IItemLabelProvider,
- IItemPropertySource {
+ extends ControlItemProvider {
/**
* This constructs an instance from a factory and a notifier.
*
diff --git a/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/SensorItemProvider.java b/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/SensorItemProvider.java
index 9b3cd01..e28dd27 100644
--- a/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/SensorItemProvider.java
+++ b/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/SensorItemProvider.java
@@ -12,6 +12,7 @@
import fr.obeo.dsl.arduino.ArduinoPackage;
+import fr.obeo.dsl.arduino.OperatorKind;
import fr.obeo.dsl.arduino.Sensor;
import java.util.Collection;
@@ -37,13 +38,7 @@
* @generated
*/
public class SensorItemProvider
- extends ModuleInstructionItemProvider
- implements
- IEditingDomainItemProvider,
- IStructuredItemContentProvider,
- ITreeItemContentProvider,
- IItemLabelProvider,
- IItemPropertySource {
+ extends ModuleInstructionItemProvider {
/**
* This constructs an instance from a factory and a notifier.
*
@@ -65,7 +60,6 @@ public List getPropertyDescriptors(Object object) {
if (itemPropertyDescriptors == null) {
super.getPropertyDescriptors(object);
- addValuePropertyDescriptor(object);
addLeftPropertyDescriptor(object);
addRightPropertyDescriptor(object);
addOperatorPropertyDescriptor(object);
@@ -74,28 +68,6 @@ public List getPropertyDescriptors(Object object) {
return itemPropertyDescriptors;
}
- /**
- * This adds a property descriptor for the Value feature.
- *
- *
- * @generated
- */
- protected void addValuePropertyDescriptor(Object object) {
- itemPropertyDescriptors.add
- (createItemPropertyDescriptor
- (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
- getResourceLocator(),
- getString("_UI_Value_value_feature"),
- getString("_UI_PropertyDescriptor_description", "_UI_Value_value_feature", "_UI_Value_type"),
- ArduinoPackage.Literals.VALUE__VALUE,
- true,
- false,
- false,
- ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
- null,
- null));
- }
-
/**
* This adds a property descriptor for the Left feature.
*
@@ -203,7 +175,8 @@ public Object getImage(Object object) {
*/
@Override
public String getText(Object object) {
- String label = ((Sensor)object).getValue();
+ OperatorKind labelValue = ((Sensor)object).getOperator();
+ String label = labelValue == null ? null : labelValue.toString();
return label == null || label.length() == 0 ?
getString("_UI_Sensor_type") :
getString("_UI_Sensor_type") + " " + label;
@@ -221,7 +194,6 @@ public void notifyChanged(Notification notification) {
updateChildren(notification);
switch (notification.getFeatureID(Sensor.class)) {
- case ArduinoPackage.SENSOR__VALUE:
case ArduinoPackage.SENSOR__OPERATOR:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
return;
diff --git a/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/SetItemProvider.java b/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/SetItemProvider.java
index 01d9656..fc0918b 100644
--- a/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/SetItemProvider.java
+++ b/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/SetItemProvider.java
@@ -34,13 +34,7 @@
* @generated
*/
public class SetItemProvider
- extends InstructionItemProvider
- implements
- IEditingDomainItemProvider,
- IStructuredItemContentProvider,
- ITreeItemContentProvider,
- IItemLabelProvider,
- IItemPropertySource {
+ extends InstructionItemProvider {
/**
* This constructs an instance from a factory and a notifier.
*
diff --git a/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/SketchItemProvider.java b/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/SketchItemProvider.java
index 40831b7..6a5a825 100644
--- a/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/SketchItemProvider.java
+++ b/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/SketchItemProvider.java
@@ -39,13 +39,7 @@
* @generated
*/
public class SketchItemProvider
- extends NamedElementItemProvider
- implements
- IEditingDomainItemProvider,
- IStructuredItemContentProvider,
- ITreeItemContentProvider,
- IItemLabelProvider,
- IItemPropertySource {
+ extends NamedElementItemProvider {
/**
* This constructs an instance from a factory and a notifier.
*
diff --git a/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/StatusItemProvider.java b/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/StatusItemProvider.java
index c8218c5..a5bfcf0 100644
--- a/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/StatusItemProvider.java
+++ b/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/StatusItemProvider.java
@@ -37,13 +37,7 @@
* @generated
*/
public class StatusItemProvider
- extends ModuleInstructionItemProvider
- implements
- IEditingDomainItemProvider,
- IStructuredItemContentProvider,
- ITreeItemContentProvider,
- IItemLabelProvider,
- IItemPropertySource {
+ extends ModuleInstructionItemProvider {
/**
* This constructs an instance from a factory and a notifier.
*
@@ -65,35 +59,12 @@ public List getPropertyDescriptors(Object object) {
if (itemPropertyDescriptors == null) {
super.getPropertyDescriptors(object);
- addValuePropertyDescriptor(object);
addStatusPropertyDescriptor(object);
addSensorPropertyDescriptor(object);
}
return itemPropertyDescriptors;
}
- /**
- * This adds a property descriptor for the Value feature.
- *
- *
- * @generated
- */
- protected void addValuePropertyDescriptor(Object object) {
- itemPropertyDescriptors.add
- (createItemPropertyDescriptor
- (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
- getResourceLocator(),
- getString("_UI_Value_value_feature"),
- getString("_UI_PropertyDescriptor_description", "_UI_Value_value_feature", "_UI_Value_type"),
- ArduinoPackage.Literals.VALUE__VALUE,
- true,
- false,
- false,
- ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
- null,
- null));
- }
-
/**
* This adds a property descriptor for the Status feature.
*
@@ -157,10 +128,8 @@ public Object getImage(Object object) {
*/
@Override
public String getText(Object object) {
- String label = ((Status)object).getValue();
- return label == null || label.length() == 0 ?
- getString("_UI_Status_type") :
- getString("_UI_Status_type") + " " + label;
+ Status status = (Status)object;
+ return getString("_UI_Status_type") + " " + status.isStatus();
}
/**
@@ -175,7 +144,6 @@ public void notifyChanged(Notification notification) {
updateChildren(notification);
switch (notification.getFeatureID(Status.class)) {
- case ArduinoPackage.STATUS__VALUE:
case ArduinoPackage.STATUS__STATUS:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
return;
diff --git a/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/UtilitiesItemProvider.java b/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/UtilitiesItemProvider.java
index e9b83fb..dae24db 100644
--- a/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/UtilitiesItemProvider.java
+++ b/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/UtilitiesItemProvider.java
@@ -34,13 +34,7 @@
* @generated
*/
public class UtilitiesItemProvider
- extends InstructionItemProvider
- implements
- IEditingDomainItemProvider,
- IStructuredItemContentProvider,
- ITreeItemContentProvider,
- IItemLabelProvider,
- IItemPropertySource {
+ extends InstructionItemProvider {
/**
* This constructs an instance from a factory and a notifier.
*
diff --git a/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/VariableItemProvider.java b/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/VariableItemProvider.java
index f716932..32b8541 100644
--- a/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/VariableItemProvider.java
+++ b/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/VariableItemProvider.java
@@ -37,13 +37,7 @@
* @generated
*/
public class VariableItemProvider
- extends ValueItemProvider
- implements
- IEditingDomainItemProvider,
- IStructuredItemContentProvider,
- ITreeItemContentProvider,
- IItemLabelProvider,
- IItemPropertySource {
+ extends ExpressionItemProvider {
/**
* This constructs an instance from a factory and a notifier.
*
diff --git a/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/WhileItemProvider.java b/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/WhileItemProvider.java
index 4d55586..f7ce56d 100644
--- a/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/WhileItemProvider.java
+++ b/plugins/fr.obeo.dsl.arduino.edit/src/fr/obeo/dsl/arduino/provider/WhileItemProvider.java
@@ -34,13 +34,7 @@
* @generated
*/
public class WhileItemProvider
- extends ControlItemProvider
- implements
- IEditingDomainItemProvider,
- IStructuredItemContentProvider,
- ITreeItemContentProvider,
- IItemLabelProvider,
- IItemPropertySource {
+ extends ControlItemProvider {
/**
* This constructs an instance from a factory and a notifier.
*
diff --git a/plugins/fr.obeo.dsl.arduino.gen/src/fr/obeo/dsl/arduino/gen/main/ArduinoGenServices.java b/plugins/fr.obeo.dsl.arduino.gen/src/fr/obeo/dsl/arduino/gen/main/ArduinoGenServices.java
index 5cb037e..a7beaef 100644
--- a/plugins/fr.obeo.dsl.arduino.gen/src/fr/obeo/dsl/arduino/gen/main/ArduinoGenServices.java
+++ b/plugins/fr.obeo.dsl.arduino.gen/src/fr/obeo/dsl/arduino/gen/main/ArduinoGenServices.java
@@ -13,13 +13,13 @@
import java.util.Iterator;
import fr.obeo.dsl.arduino.Constant;
+import fr.obeo.dsl.arduino.Expression;
import fr.obeo.dsl.arduino.Instruction;
import fr.obeo.dsl.arduino.MathOperator;
import fr.obeo.dsl.arduino.OperatorKind;
import fr.obeo.dsl.arduino.Repeat;
import fr.obeo.dsl.arduino.Sensor;
import fr.obeo.dsl.arduino.Sketch;
-import fr.obeo.dsl.arduino.Value;
import fr.obeo.dsl.arduino.Variable;
public class ArduinoGenServices {
@@ -37,12 +37,12 @@ public int getRepeatInstructionIndex(Sketch sketch, Repeat repeat) {
return 0;
}
- public String getValue(Value value) {
+ public String getValue(Expression value) {
if (value instanceof Variable) {
return ((Variable) value).getName();
}
if (value instanceof Constant) {
- return value.getValue();
+ return ((Constant) value).getValue();
}
if (value instanceof MathOperator) {
return "(" + getValue(((MathOperator) value).getLeft())
diff --git a/plugins/fr.obeo.dsl.arduino.gen/src/fr/obeo/dsl/arduino/gen/main/Generate.java b/plugins/fr.obeo.dsl.arduino.gen/src/fr/obeo/dsl/arduino/gen/main/Generate.java
index c85b598..4faa99a 100644
--- a/plugins/fr.obeo.dsl.arduino.gen/src/fr/obeo/dsl/arduino/gen/main/Generate.java
+++ b/plugins/fr.obeo.dsl.arduino.gen/src/fr/obeo/dsl/arduino/gen/main/Generate.java
@@ -67,8 +67,8 @@ public class Generate extends AbstractAcceleoGenerator {
* @generated
*/
public Generate() {
- // Empty implementation
- }
+ // Empty implementation
+ }
/**
* This allows clients to instantiates a generator with all required
@@ -91,8 +91,8 @@ public Generate() {
*/
public Generate(URI modelURI, File targetFolder,
List extends Object> arguments) throws IOException {
- initialize(modelURI, targetFolder, arguments);
- }
+ initialize(modelURI, targetFolder, arguments);
+ }
/**
* This allows clients to instantiates a generator with all required
@@ -115,8 +115,8 @@ public Generate(URI modelURI, File targetFolder,
*/
public Generate(EObject model, File targetFolder,
List extends Object> arguments) throws IOException {
- initialize(model, targetFolder, arguments);
- }
+ initialize(model, targetFolder, arguments);
+ }
/**
* This can be used to launch the generation from a standalone application.
@@ -126,55 +126,50 @@ public Generate(EObject model, File targetFolder,
* @generated
*/
public static void main(String[] args) {
- try {
- if (args.length < 2) {
- System.out.println("Arguments not valid : {model, folder}.");
- } else {
- URI modelURI = URI.createFileURI(args[0]);
- File folder = new File(args[1]);
-
- List arguments = new ArrayList();
-
- /*
- * If you want to change the content of this method, do NOT
- * forget to change the "@generated" tag in the Javadoc of this
- * method to "@generated NOT". Without this new tag, any
- * compilation of the Acceleo module with the main template that
- * has caused the creation of this class will revert your
- * modifications.
- */
-
- /*
- * Add in this list all the arguments used by the starting point
- * of the generation If your main template is called on an
- * element of your model and a String, you can add in
- * "arguments" this "String" attribute.
- */
-
- Generate generator = new Generate(modelURI, folder, arguments);
-
- /*
- * Add the properties from the launch arguments. If you want to
- * programmatically add new properties, add them in
- * "propertiesFiles" You can add the absolute path of a
- * properties files, or even a project relative path. If you
- * want to add another "protocol" for your properties files,
- * please override "getPropertiesLoaderService(AcceleoService)"
- * in order to return a new property loader. The behavior of the
- * properties loader service is explained in the Acceleo
- * documentation (Help -> Help Contents).
- */
-
- for (int i = 2; i < args.length; i++) {
- generator.addPropertiesFile(args[i]);
- }
-
- generator.doGenerate(new BasicMonitor());
- }
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
+ try {
+ if (args.length < 2) {
+ System.out.println("Arguments not valid : {model, folder}.");
+ } else {
+ URI modelURI = URI.createFileURI(args[0]);
+ File folder = new File(args[1]);
+
+ List arguments = new ArrayList();
+
+ /*
+ * If you want to change the content of this method, do NOT forget to change the "@generated"
+ * tag in the Javadoc of this method to "@generated NOT". Without this new tag, any compilation
+ * of the Acceleo module with the main template that has caused the creation of this class will
+ * revert your modifications.
+ */
+
+ /*
+ * Add in this list all the arguments used by the starting point of the generation
+ * If your main template is called on an element of your model and a String, you can
+ * add in "arguments" this "String" attribute.
+ */
+
+ Generate generator = new Generate(modelURI, folder, arguments);
+
+ /*
+ * Add the properties from the launch arguments.
+ * If you want to programmatically add new properties, add them in "propertiesFiles"
+ * You can add the absolute path of a properties files, or even a project relative path.
+ * If you want to add another "protocol" for your properties files, please override
+ * "getPropertiesLoaderService(AcceleoService)" in order to return a new property loader.
+ * The behavior of the properties loader service is explained in the Acceleo documentation
+ * (Help -> Help Contents).
+ */
+
+ for (int i = 2; i < args.length; i++) {
+ generator.addPropertiesFile(args[i]);
+ }
+
+ generator.doGenerate(new BasicMonitor());
+ }
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
/**
* Launches the generation described by this instance.
@@ -188,37 +183,32 @@ public static void main(String[] args) {
*/
@Override
public void doGenerate(Monitor monitor) throws IOException {
- /*
- * TODO if you wish to change the generation as a whole, override this.
- * The default behavior should be sufficient in most cases. If you want
- * to change the content of this method, do NOT forget to change the
- * "@generated" tag in the Javadoc of this method to "@generated NOT".
- * Without this new tag, any compilation of the Acceleo module with the
- * main template that has caused the creation of this class will revert
- * your modifications. If you encounter a problem with an unresolved
- * proxy during the generation, you can remove the comments in the
- * following instructions to check for problems. Please note that those
- * instructions may have a significant impact on the performances.
- */
-
- // org.eclipse.emf.ecore.util.EcoreUtil.resolveAll(model);
-
- /*
- * If you want to check for potential errors in your models before the
- * launch of the generation, you use the code below.
- */
-
- // if (model != null && model.eResource() != null) {
- // List errors =
- // model.eResource().getErrors();
- // for (org.eclipse.emf.ecore.resource.Resource.Diagnostic diagnostic :
- // errors) {
- // System.err.println(diagnostic.toString());
- // }
- // }
-
- super.doGenerate(monitor);
- }
+ /*
+ * TODO if you wish to change the generation as a whole, override this. The default behavior should
+ * be sufficient in most cases. If you want to change the content of this method, do NOT forget to
+ * change the "@generated" tag in the Javadoc of this method to "@generated NOT". Without this new tag,
+ * any compilation of the Acceleo module with the main template that has caused the creation of this
+ * class will revert your modifications. If you encounter a problem with an unresolved proxy during the
+ * generation, you can remove the comments in the following instructions to check for problems. Please
+ * note that those instructions may have a significant impact on the performances.
+ */
+
+ //org.eclipse.emf.ecore.util.EcoreUtil.resolveAll(model);
+
+ /*
+ * If you want to check for potential errors in your models before the launch of the generation, you
+ * use the code below.
+ */
+
+ //if (model != null && model.eResource() != null) {
+ // List errors = model.eResource().getErrors();
+ // for (org.eclipse.emf.ecore.resource.Resource.Diagnostic diagnostic : errors) {
+ // System.err.println(diagnostic.toString());
+ // }
+ //}
+
+ super.doGenerate(monitor);
+ }
/**
* If this generator needs to listen to text generation events, listeners
@@ -230,18 +220,15 @@ public void doGenerate(Monitor monitor) throws IOException {
*/
@Override
public List getGenerationListeners() {
- List listeners = super
- .getGenerationListeners();
- /*
- * TODO if you need to listen to generation event, add listeners to the
- * list here. If you want to change the content of this method, do NOT
- * forget to change the "@generated" tag in the Javadoc of this method
- * to "@generated NOT". Without this new tag, any compilation of the
- * Acceleo module with the main template that has caused the creation of
- * this class will revert your modifications.
- */
- return listeners;
- }
+ List listeners = super.getGenerationListeners();
+ /*
+ * TODO if you need to listen to generation event, add listeners to the list here. If you want to change
+ * the content of this method, do NOT forget to change the "@generated" tag in the Javadoc of this method
+ * to "@generated NOT". Without this new tag, any compilation of the Acceleo module with the main template
+ * that has caused the creation of this class will revert your modifications.
+ */
+ return listeners;
+ }
/**
* If you need to change the way files are generated, this is your entry
@@ -272,8 +259,8 @@ public List getGenerationListeners() {
*/
@Override
public IAcceleoGenerationStrategy getGenerationStrategy() {
- return super.getGenerationStrategy();
- }
+ return super.getGenerationStrategy();
+ }
/**
* This will be called in order to find and load the module that will be
@@ -285,8 +272,8 @@ public IAcceleoGenerationStrategy getGenerationStrategy() {
*/
@Override
public String getModuleName() {
- return MODULE_FILE_NAME;
- }
+ return MODULE_FILE_NAME;
+ }
/**
* If the module(s) called by this launcher require properties files, return
@@ -301,50 +288,42 @@ public String getModuleName() {
*/
@Override
public List getProperties() {
- /*
- * If you want to change the content of this method, do NOT forget to
- * change the "@generated" tag in the Javadoc of this method to
- * "@generated NOT". Without this new tag, any compilation of the
- * Acceleo module with the main template that has caused the creation of
- * this class will revert your modifications.
- */
-
- /*
- * TODO if your generation module requires access to properties files,
- * add their qualified path to the list here.
- *
- * Properties files can be located in an Eclipse plug-in or in the file
- * system (all Acceleo projects are Eclipse plug-in). In order to use
- * properties files located in an Eclipse plugin, you need to add the
- * path of the properties files to the "propertiesFiles" list:
- *
- * final String prefix = "platform:/plugin/"; final String pluginName =
- * "org.eclipse.acceleo.module.sample"; final String packagePath =
- * "/org/eclipse/acceleo/module/sample/properties/"; final String
- * fileName = "default.properties"; propertiesFiles.add(prefix +
- * pluginName + packagePath + fileName);
- *
- * With this mechanism, you can load properties files from your plugin
- * or from another plugin.
- *
- * You may want to load properties files from the file system, for that
- * you need to add the absolute path of the file:
- *
- * propertiesFiles.add("C:\Users\MyName\MyFile.properties");
- *
- * If you want to let your users add properties files located in the
- * same folder as the model:
- *
- * if (EMFPlugin.IS_ECLIPSE_RUNNING && model != null &&
- * model.eResource() != null) {
- * propertiesFiles.addAll(AcceleoEngineUtils
- * .getPropertiesFilesNearModel(model.eResource())); }
- *
- * To learn more about Properties Files, have a look at the Acceleo
- * documentation (Help -> Help Contents).
- */
- return propertiesFiles;
- }
+ /*
+ * If you want to change the content of this method, do NOT forget to change the "@generated"
+ * tag in the Javadoc of this method to "@generated NOT". Without this new tag, any compilation
+ * of the Acceleo module with the main template that has caused the creation of this class will
+ * revert your modifications.
+ */
+
+ /*
+ * TODO if your generation module requires access to properties files, add their qualified path to the list here.
+ *
+ * Properties files can be located in an Eclipse plug-in or in the file system (all Acceleo projects are Eclipse
+ * plug-in). In order to use properties files located in an Eclipse plugin, you need to add the path of the properties
+ * files to the "propertiesFiles" list:
+ *
+ * final String prefix = "platform:/plugin/";
+ * final String pluginName = "org.eclipse.acceleo.module.sample";
+ * final String packagePath = "/org/eclipse/acceleo/module/sample/properties/";
+ * final String fileName = "default.properties";
+ * propertiesFiles.add(prefix + pluginName + packagePath + fileName);
+ *
+ * With this mechanism, you can load properties files from your plugin or from another plugin.
+ *
+ * You may want to load properties files from the file system, for that you need to add the absolute path of the file:
+ *
+ * propertiesFiles.add("C:\Users\MyName\MyFile.properties");
+ *
+ * If you want to let your users add properties files located in the same folder as the model:
+ *
+ * if (EMFPlugin.IS_ECLIPSE_RUNNING && model != null && model.eResource() != null) {
+ * propertiesFiles.addAll(AcceleoEngineUtils.getPropertiesFilesNearModel(model.eResource()));
+ * }
+ *
+ * To learn more about Properties Files, have a look at the Acceleo documentation (Help -> Help Contents).
+ */
+ return propertiesFiles;
+ }
/**
* Adds a properties file in the list of properties files.
@@ -356,8 +335,8 @@ public List getProperties() {
*/
@Override
public void addPropertiesFile(String propertiesFile) {
- this.propertiesFiles.add(propertiesFile);
- }
+ this.propertiesFiles.add(propertiesFile);
+ }
/**
* This will be used to get the list of templates that are to be launched by
@@ -369,8 +348,8 @@ public void addPropertiesFile(String propertiesFile) {
*/
@Override
public String[] getTemplateNames() {
- return TEMPLATE_NAMES;
- }
+ return TEMPLATE_NAMES;
+ }
/**
* This can be used to update the resource set's package registry with all
@@ -382,47 +361,40 @@ public String[] getTemplateNames() {
*/
@Override
public void registerPackages(ResourceSet resourceSet) {
- super.registerPackages(resourceSet);
-
- /*
- * If you want to change the content of this method, do NOT forget to
- * change the "@generated" tag in the Javadoc of this method to
- * "@generated NOT". Without this new tag, any compilation of the
- * Acceleo module with the main template that has caused the creation of
- * this class will revert your modifications.
- */
-
- /*
- * If you need additional package registrations, you can register them
- * here. The following line (in comment) is an example of the package
- * registration for UML.
- *
- * You can use the method "isInWorkspace(Class c)" to check if the
- * package that you are about to register is in the workspace.
- *
- * To register a package properly, please follow the following
- * conventions:
- *
- * If the package is located in another plug-in, already installed in
- * Eclipse. The following content should have been generated at the
- * beginning of this method. Do not register the package using this
- * mechanism if the metamodel is located in the workspace.
- *
- * if (!isInWorkspace(UMLPackage.class)) { // The normal package
- * registration if your metamodel is in a plugin.
- * resourceSet.getPackageRegistry().put(UMLPackage.eNS_URI,
- * UMLPackage.eINSTANCE); }
- *
- * If the package is located in another project in your workspace, the
- * plugin containing the package has not been register by EMF and
- * Acceleo should register it automatically. If you want to use the
- * generator in stand alone, the regular registration (seen a couple
- * lines before) is needed.
- *
- * To learn more about Package Registration, have a look at the Acceleo
- * documentation (Help -> Help Contents).
- */
- }
+ super.registerPackages(resourceSet);
+
+ /*
+ * If you want to change the content of this method, do NOT forget to change the "@generated"
+ * tag in the Javadoc of this method to "@generated NOT". Without this new tag, any compilation
+ * of the Acceleo module with the main template that has caused the creation of this class will
+ * revert your modifications.
+ */
+
+ /*
+ * If you need additional package registrations, you can register them here. The following line
+ * (in comment) is an example of the package registration for UML.
+ *
+ * You can use the method "isInWorkspace(Class c)" to check if the package that you are about to
+ * register is in the workspace.
+ *
+ * To register a package properly, please follow the following conventions:
+ *
+ * If the package is located in another plug-in, already installed in Eclipse. The following content should
+ * have been generated at the beginning of this method. Do not register the package using this mechanism if
+ * the metamodel is located in the workspace.
+ *
+ * if (!isInWorkspace(UMLPackage.class)) {
+ * // The normal package registration if your metamodel is in a plugin.
+ * resourceSet.getPackageRegistry().put(UMLPackage.eNS_URI, UMLPackage.eINSTANCE);
+ * }
+ *
+ * If the package is located in another project in your workspace, the plugin containing the package has not
+ * been register by EMF and Acceleo should register it automatically. If you want to use the generator in
+ * stand alone, the regular registration (seen a couple lines before) is needed.
+ *
+ * To learn more about Package Registration, have a look at the Acceleo documentation (Help -> Help Contents).
+ */
+ }
/**
* This can be used to update the resource set's resource factory registry
@@ -434,29 +406,24 @@ public void registerPackages(ResourceSet resourceSet) {
*/
@Override
public void registerResourceFactories(ResourceSet resourceSet) {
- super.registerResourceFactories(resourceSet);
- /*
- * If you want to change the content of this method, do NOT forget to
- * change the "@generated" tag in the Javadoc of this method to
- * "@generated NOT". Without this new tag, any compilation of the
- * Acceleo module with the main template that has caused the creation of
- * this class will revert your modifications.
- */
-
- /*
- * TODO If you need additional resource factories registrations, you can
- * register them here. the following line (in comment) is an example of
- * the resource factory registration for UML.
- *
- * If you want to use the generator in stand alone, the resource factory
- * registration will be required.
- *
- * To learn more about the registration of Resource Factories, have a
- * look at the Acceleo documentation (Help -> Help Contents).
- */
-
- // resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put(UMLResource.FILE_EXTENSION,
- // UMLResource.Factory.INSTANCE);
- }
+ super.registerResourceFactories(resourceSet);
+ /*
+ * If you want to change the content of this method, do NOT forget to change the "@generated"
+ * tag in the Javadoc of this method to "@generated NOT". Without this new tag, any compilation
+ * of the Acceleo module with the main template that has caused the creation of this class will
+ * revert your modifications.
+ */
+
+ /*
+ * TODO If you need additional resource factories registrations, you can register them here. the following line
+ * (in comment) is an example of the resource factory registration for UML.
+ *
+ * If you want to use the generator in stand alone, the resource factory registration will be required.
+ *
+ * To learn more about the registration of Resource Factories, have a look at the Acceleo documentation (Help -> Help Contents).
+ */
+
+ // resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put(UMLResource.FILE_EXTENSION, UMLResource.Factory.INSTANCE);
+ }
}
diff --git a/plugins/fr.obeo.dsl.arduino.gen/src/fr/obeo/dsl/arduino/gen/main/arduinoservices.mtl b/plugins/fr.obeo.dsl.arduino.gen/src/fr/obeo/dsl/arduino/gen/main/arduinoservices.mtl
index 3f366a4..3bac3ff 100644
--- a/plugins/fr.obeo.dsl.arduino.gen/src/fr/obeo/dsl/arduino/gen/main/arduinoservices.mtl
+++ b/plugins/fr.obeo.dsl.arduino.gen/src/fr/obeo/dsl/arduino/gen/main/arduinoservices.mtl
@@ -9,6 +9,6 @@
= invoke('fr.obeo.dsl.arduino.gen.main.ArduinoGenServices', 'getOperator(fr.obeo.dsl.arduino.OperatorKind)', Sequence{arg0})
/]
-[query public getValue(arg0 : Value) : String
- = invoke('fr.obeo.dsl.arduino.gen.main.ArduinoGenServices', 'getValue(fr.obeo.dsl.arduino.Value)', Sequence{arg0})
+[query public getValue(arg0 : Expression) : String
+ = invoke('fr.obeo.dsl.arduino.gen.main.ArduinoGenServices', 'getValue(fr.obeo.dsl.arduino.Expression)', Sequence{arg0})
/]
\ No newline at end of file
diff --git a/plugins/fr.obeo.dsl.arduino.gen/tasks/generate.xml b/plugins/fr.obeo.dsl.arduino.gen/tasks/generate.xml
index 5e69be1..fa47dc5 100644
--- a/plugins/fr.obeo.dsl.arduino.gen/tasks/generate.xml
+++ b/plugins/fr.obeo.dsl.arduino.gen/tasks/generate.xml
@@ -1,37 +1,38 @@
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/plugins/fr.obeo.dsl.arduino/model/arduino.ecore b/plugins/fr.obeo.dsl.arduino/model/arduino.ecore
index 06e959b..9f81a90 100644
--- a/plugins/fr.obeo.dsl.arduino/model/arduino.ecore
+++ b/plugins/fr.obeo.dsl.arduino/model/arduino.ecore
@@ -50,13 +50,13 @@
-
+
-
+
-
-
-
+
+
+
@@ -124,20 +124,20 @@
-
+
-
+
-
+
+
-
diff --git a/plugins/fr.obeo.dsl.arduino/src/fr/obeo/dsl/arduino/ArduinoPackage.java b/plugins/fr.obeo.dsl.arduino/src/fr/obeo/dsl/arduino/ArduinoPackage.java
index 8de228f..1e29361 100644
--- a/plugins/fr.obeo.dsl.arduino/src/fr/obeo/dsl/arduino/ArduinoPackage.java
+++ b/plugins/fr.obeo.dsl.arduino/src/fr/obeo/dsl/arduino/ArduinoPackage.java
@@ -616,15 +616,6 @@ public interface ArduinoPackage extends EPackage {
*/
int STATUS__MODULE = MODULE_INSTRUCTION__MODULE;
- /**
- * The feature id for the 'Value' attribute.
- *
- *
- * @generated
- * @ordered
- */
- int STATUS__VALUE = MODULE_INSTRUCTION_FEATURE_COUNT + 0;
-
/**
* The feature id for the 'Status' attribute.
*
@@ -632,7 +623,7 @@ public interface ArduinoPackage extends EPackage {
* @generated
* @ordered
*/
- int STATUS__STATUS = MODULE_INSTRUCTION_FEATURE_COUNT + 1;
+ int STATUS__STATUS = MODULE_INSTRUCTION_FEATURE_COUNT + 0;
/**
* The feature id for the 'Sensor' reference.
@@ -641,7 +632,7 @@ public interface ArduinoPackage extends EPackage {
* @generated
* @ordered
*/
- int STATUS__SENSOR = MODULE_INSTRUCTION_FEATURE_COUNT + 2;
+ int STATUS__SENSOR = MODULE_INSTRUCTION_FEATURE_COUNT + 1;
/**
* The number of structural features of the 'Status' class.
@@ -650,7 +641,7 @@ public interface ArduinoPackage extends EPackage {
* @generated
* @ordered
*/
- int STATUS_FEATURE_COUNT = MODULE_INSTRUCTION_FEATURE_COUNT + 3;
+ int STATUS_FEATURE_COUNT = MODULE_INSTRUCTION_FEATURE_COUNT + 2;
/**
* The meta object id for the '{@link fr.obeo.dsl.arduino.impl.LevelImpl Level}' class.
@@ -1175,15 +1166,6 @@ public interface ArduinoPackage extends EPackage {
*/
int SENSOR__MODULE = MODULE_INSTRUCTION__MODULE;
- /**
- * The feature id for the 'Value' attribute.
- *
- *
- * @generated
- * @ordered
- */
- int SENSOR__VALUE = MODULE_INSTRUCTION_FEATURE_COUNT + 0;
-
/**
* The feature id for the 'Left' reference.
*
@@ -1191,7 +1173,7 @@ public interface ArduinoPackage extends EPackage {
* @generated
* @ordered
*/
- int SENSOR__LEFT = MODULE_INSTRUCTION_FEATURE_COUNT + 1;
+ int SENSOR__LEFT = MODULE_INSTRUCTION_FEATURE_COUNT + 0;
/**
* The feature id for the 'Right' reference.
@@ -1200,7 +1182,7 @@ public interface ArduinoPackage extends EPackage {
* @generated
* @ordered
*/
- int SENSOR__RIGHT = MODULE_INSTRUCTION_FEATURE_COUNT + 2;
+ int SENSOR__RIGHT = MODULE_INSTRUCTION_FEATURE_COUNT + 1;
/**
* The feature id for the 'Operator' attribute.
@@ -1209,7 +1191,7 @@ public interface ArduinoPackage extends EPackage {
* @generated
* @ordered
*/
- int SENSOR__OPERATOR = MODULE_INSTRUCTION_FEATURE_COUNT + 3;
+ int SENSOR__OPERATOR = MODULE_INSTRUCTION_FEATURE_COUNT + 2;
/**
* The feature id for the 'Status' reference list.
@@ -1218,7 +1200,7 @@ public interface ArduinoPackage extends EPackage {
* @generated
* @ordered
*/
- int SENSOR__STATUS = MODULE_INSTRUCTION_FEATURE_COUNT + 4;
+ int SENSOR__STATUS = MODULE_INSTRUCTION_FEATURE_COUNT + 3;
/**
* The number of structural features of the 'Sensor' class.
@@ -1227,7 +1209,7 @@ public interface ArduinoPackage extends EPackage {
* @generated
* @ordered
*/
- int SENSOR_FEATURE_COUNT = MODULE_INSTRUCTION_FEATURE_COUNT + 5;
+ int SENSOR_FEATURE_COUNT = MODULE_INSTRUCTION_FEATURE_COUNT + 4;
/**
* The meta object id for the '{@link fr.obeo.dsl.arduino.impl.WhileImpl While}' class.
@@ -1285,14 +1267,14 @@ public interface ArduinoPackage extends EPackage {
int WHILE_FEATURE_COUNT = CONTROL_FEATURE_COUNT + 1;
/**
- * The meta object id for the '{@link fr.obeo.dsl.arduino.impl.ValueImpl Value}' class.
+ * The meta object id for the '{@link fr.obeo.dsl.arduino.impl.ExpressionImpl Expression}' class.
*
*
- * @see fr.obeo.dsl.arduino.impl.ValueImpl
- * @see fr.obeo.dsl.arduino.impl.ArduinoPackageImpl#getValue()
+ * @see fr.obeo.dsl.arduino.impl.ExpressionImpl
+ * @see fr.obeo.dsl.arduino.impl.ArduinoPackageImpl#getExpression()
* @generated
*/
- int VALUE = 28;
+ int EXPRESSION = 28;
/**
* The feature id for the 'Previous' reference.
@@ -1301,7 +1283,7 @@ public interface ArduinoPackage extends EPackage {
* @generated
* @ordered
*/
- int VALUE__PREVIOUS = INSTRUCTION__PREVIOUS;
+ int EXPRESSION__PREVIOUS = INSTRUCTION__PREVIOUS;
/**
* The feature id for the 'Next' reference.
@@ -1310,7 +1292,7 @@ public interface ArduinoPackage extends EPackage {
* @generated
* @ordered
*/
- int VALUE__NEXT = INSTRUCTION__NEXT;
+ int EXPRESSION__NEXT = INSTRUCTION__NEXT;
/**
* The feature id for the 'Definition' reference.
@@ -1319,25 +1301,16 @@ public interface ArduinoPackage extends EPackage {
* @generated
* @ordered
*/
- int VALUE__DEFINITION = INSTRUCTION_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the 'Value' attribute.
- *
- *
- * @generated
- * @ordered
- */
- int VALUE__VALUE = INSTRUCTION_FEATURE_COUNT + 1;
+ int EXPRESSION__DEFINITION = INSTRUCTION_FEATURE_COUNT + 0;
/**
- * The number of structural features of the 'Value' class.
+ * The number of structural features of the 'Expression' class.
*
*
* @generated
* @ordered
*/
- int VALUE_FEATURE_COUNT = INSTRUCTION_FEATURE_COUNT + 2;
+ int EXPRESSION_FEATURE_COUNT = INSTRUCTION_FEATURE_COUNT + 1;
/**
* The meta object id for the '{@link fr.obeo.dsl.arduino.impl.MathOperatorImpl Math Operator}' class.
@@ -1356,7 +1329,7 @@ public interface ArduinoPackage extends EPackage {
* @generated
* @ordered
*/
- int MATH_OPERATOR__PREVIOUS = VALUE__PREVIOUS;
+ int MATH_OPERATOR__PREVIOUS = EXPRESSION__PREVIOUS;
/**
* The feature id for the 'Next' reference.
@@ -1365,7 +1338,7 @@ public interface ArduinoPackage extends EPackage {
* @generated
* @ordered
*/
- int MATH_OPERATOR__NEXT = VALUE__NEXT;
+ int MATH_OPERATOR__NEXT = EXPRESSION__NEXT;
/**
* The feature id for the 'Definition' reference.
@@ -1374,16 +1347,7 @@ public interface ArduinoPackage extends EPackage {
* @generated
* @ordered
*/
- int MATH_OPERATOR__DEFINITION = VALUE__DEFINITION;
-
- /**
- * The feature id for the 'Value' attribute.
- *
- *
- * @generated
- * @ordered
- */
- int MATH_OPERATOR__VALUE = VALUE__VALUE;
+ int MATH_OPERATOR__DEFINITION = EXPRESSION__DEFINITION;
/**
* The feature id for the 'Left' reference.
@@ -1392,7 +1356,7 @@ public interface ArduinoPackage extends EPackage {
* @generated
* @ordered
*/
- int MATH_OPERATOR__LEFT = VALUE_FEATURE_COUNT + 0;
+ int MATH_OPERATOR__LEFT = EXPRESSION_FEATURE_COUNT + 0;
/**
* The feature id for the 'Right' reference.
@@ -1401,7 +1365,7 @@ public interface ArduinoPackage extends EPackage {
* @generated
* @ordered
*/
- int MATH_OPERATOR__RIGHT = VALUE_FEATURE_COUNT + 1;
+ int MATH_OPERATOR__RIGHT = EXPRESSION_FEATURE_COUNT + 1;
/**
* The feature id for the 'Operator' attribute.
@@ -1410,7 +1374,7 @@ public interface ArduinoPackage extends EPackage {
* @generated
* @ordered
*/
- int MATH_OPERATOR__OPERATOR = VALUE_FEATURE_COUNT + 2;
+ int MATH_OPERATOR__OPERATOR = EXPRESSION_FEATURE_COUNT + 2;
/**
* The number of structural features of the 'Math Operator' class.
@@ -1419,7 +1383,7 @@ public interface ArduinoPackage extends EPackage {
* @generated
* @ordered
*/
- int MATH_OPERATOR_FEATURE_COUNT = VALUE_FEATURE_COUNT + 3;
+ int MATH_OPERATOR_FEATURE_COUNT = EXPRESSION_FEATURE_COUNT + 3;
/**
* The meta object id for the '{@link fr.obeo.dsl.arduino.impl.VariableImpl Variable}' class.
@@ -1438,7 +1402,7 @@ public interface ArduinoPackage extends EPackage {
* @generated
* @ordered
*/
- int VARIABLE__PREVIOUS = VALUE__PREVIOUS;
+ int VARIABLE__PREVIOUS = EXPRESSION__PREVIOUS;
/**
* The feature id for the 'Next' reference.
@@ -1447,7 +1411,7 @@ public interface ArduinoPackage extends EPackage {
* @generated
* @ordered
*/
- int VARIABLE__NEXT = VALUE__NEXT;
+ int VARIABLE__NEXT = EXPRESSION__NEXT;
/**
* The feature id for the 'Definition' reference.
@@ -1456,16 +1420,7 @@ public interface ArduinoPackage extends EPackage {
* @generated
* @ordered
*/
- int VARIABLE__DEFINITION = VALUE__DEFINITION;
-
- /**
- * The feature id for the 'Value' attribute.
- *
- *
- * @generated
- * @ordered
- */
- int VARIABLE__VALUE = VALUE__VALUE;
+ int VARIABLE__DEFINITION = EXPRESSION__DEFINITION;
/**
* The feature id for the 'Name' attribute.
@@ -1474,7 +1429,7 @@ public interface ArduinoPackage extends EPackage {
* @generated
* @ordered
*/
- int VARIABLE__NAME = VALUE_FEATURE_COUNT + 0;
+ int VARIABLE__NAME = EXPRESSION_FEATURE_COUNT + 0;
/**
* The number of structural features of the 'Variable' class.
@@ -1483,7 +1438,7 @@ public interface ArduinoPackage extends EPackage {
* @generated
* @ordered
*/
- int VARIABLE_FEATURE_COUNT = VALUE_FEATURE_COUNT + 1;
+ int VARIABLE_FEATURE_COUNT = EXPRESSION_FEATURE_COUNT + 1;
/**
* The meta object id for the '{@link fr.obeo.dsl.arduino.impl.SetImpl Set}' class.
@@ -1577,15 +1532,6 @@ public interface ArduinoPackage extends EPackage {
*/
int NUMERICAL_OPERATOR__DEFINITION = MATH_OPERATOR__DEFINITION;
- /**
- * The feature id for the 'Value' attribute.
- *
- *
- * @generated
- * @ordered
- */
- int NUMERICAL_OPERATOR__VALUE = MATH_OPERATOR__VALUE;
-
/**
* The feature id for the 'Left' reference.
*
@@ -1659,15 +1605,6 @@ public interface ArduinoPackage extends EPackage {
*/
int BOOLEAN_OPERATOR__DEFINITION = MATH_OPERATOR__DEFINITION;
- /**
- * The feature id for the 'Value' attribute.
- *
- *
- * @generated
- * @ordered
- */
- int BOOLEAN_OPERATOR__VALUE = MATH_OPERATOR__VALUE;
-
/**
* The feature id for the 'Left' reference.
*
@@ -1721,7 +1658,7 @@ public interface ArduinoPackage extends EPackage {
* @generated
* @ordered
*/
- int CONSTANT__PREVIOUS = VALUE__PREVIOUS;
+ int CONSTANT__PREVIOUS = EXPRESSION__PREVIOUS;
/**
* The feature id for the 'Next' reference.
@@ -1730,7 +1667,7 @@ public interface ArduinoPackage extends EPackage {
* @generated
* @ordered
*/
- int CONSTANT__NEXT = VALUE__NEXT;
+ int CONSTANT__NEXT = EXPRESSION__NEXT;
/**
* The feature id for the 'Definition' reference.
@@ -1739,7 +1676,7 @@ public interface ArduinoPackage extends EPackage {
* @generated
* @ordered
*/
- int CONSTANT__DEFINITION = VALUE__DEFINITION;
+ int CONSTANT__DEFINITION = EXPRESSION__DEFINITION;
/**
* The feature id for the 'Value' attribute.
@@ -1748,7 +1685,7 @@ public interface ArduinoPackage extends EPackage {
* @generated
* @ordered
*/
- int CONSTANT__VALUE = VALUE__VALUE;
+ int CONSTANT__VALUE = EXPRESSION_FEATURE_COUNT + 0;
/**
* The number of structural features of the 'Constant' class.
@@ -1757,7 +1694,7 @@ public interface ArduinoPackage extends EPackage {
* @generated
* @ordered
*/
- int CONSTANT_FEATURE_COUNT = VALUE_FEATURE_COUNT + 0;
+ int CONSTANT_FEATURE_COUNT = EXPRESSION_FEATURE_COUNT + 1;
/**
* The meta object id for the '{@link fr.obeo.dsl.arduino.impl.IfImpl If}' class.
@@ -2787,35 +2724,35 @@ public interface ArduinoPackage extends EPackage {
EClass getBooleanOperator();
/**
- * Returns the meta object for class '{@link fr.obeo.dsl.arduino.Value Value}'.
+ * Returns the meta object for class '{@link fr.obeo.dsl.arduino.Expression Expression}'.
*
*
- * @return the meta object for class 'Value'.
- * @see fr.obeo.dsl.arduino.Value
+ * @return the meta object for class 'Expression'.
+ * @see fr.obeo.dsl.arduino.Expression
* @generated
*/
- EClass getValue();
+ EClass getExpression();
/**
- * Returns the meta object for the attribute '{@link fr.obeo.dsl.arduino.Value#getValue Value}'.
+ * Returns the meta object for class '{@link fr.obeo.dsl.arduino.Constant Constant}'.
*
*
- * @return the meta object for the attribute 'Value'.
- * @see fr.obeo.dsl.arduino.Value#getValue()
- * @see #getValue()
+ * @return the meta object for class 'Constant'.
+ * @see fr.obeo.dsl.arduino.Constant
* @generated
*/
- EAttribute getValue_Value();
+ EClass getConstant();
/**
- * Returns the meta object for class '{@link fr.obeo.dsl.arduino.Constant Constant}'.
+ * Returns the meta object for the attribute '{@link fr.obeo.dsl.arduino.Constant#getValue Value}'.
*
*
- * @return the meta object for class 'Constant'.
- * @see fr.obeo.dsl.arduino.Constant
+ * @return the meta object for the attribute 'Value'.
+ * @see fr.obeo.dsl.arduino.Constant#getValue()
+ * @see #getConstant()
* @generated
*/
- EClass getConstant();
+ EAttribute getConstant_Value();
/**
* Returns the meta object for class '{@link fr.obeo.dsl.arduino.If If}'.
@@ -3652,32 +3589,32 @@ interface Literals {
EClass BOOLEAN_OPERATOR = eINSTANCE.getBooleanOperator();
/**
- * The meta object literal for the '{@link fr.obeo.dsl.arduino.impl.ValueImpl Value}' class.
+ * The meta object literal for the '{@link fr.obeo.dsl.arduino.impl.ExpressionImpl Expression}' class.
*
*
- * @see fr.obeo.dsl.arduino.impl.ValueImpl
- * @see fr.obeo.dsl.arduino.impl.ArduinoPackageImpl#getValue()
+ * @see fr.obeo.dsl.arduino.impl.ExpressionImpl
+ * @see fr.obeo.dsl.arduino.impl.ArduinoPackageImpl#getExpression()
* @generated
*/
- EClass VALUE = eINSTANCE.getValue();
+ EClass EXPRESSION = eINSTANCE.getExpression();
/**
- * The meta object literal for the 'Value' attribute feature.
+ * The meta object literal for the '{@link fr.obeo.dsl.arduino.impl.ConstantImpl Constant}' class.
*
*
+ * @see fr.obeo.dsl.arduino.impl.ConstantImpl
+ * @see fr.obeo.dsl.arduino.impl.ArduinoPackageImpl#getConstant()
* @generated
*/
- EAttribute VALUE__VALUE = eINSTANCE.getValue_Value();
+ EClass CONSTANT = eINSTANCE.getConstant();
/**
- * The meta object literal for the '{@link fr.obeo.dsl.arduino.impl.ConstantImpl Constant}' class.
+ * The meta object literal for the 'Value' attribute feature.
*
*
- * @see fr.obeo.dsl.arduino.impl.ConstantImpl
- * @see fr.obeo.dsl.arduino.impl.ArduinoPackageImpl#getConstant()
* @generated
*/
- EClass CONSTANT = eINSTANCE.getConstant();
+ EAttribute CONSTANT__VALUE = eINSTANCE.getConstant_Value();
/**
* The meta object literal for the '{@link fr.obeo.dsl.arduino.impl.IfImpl If}' class.
diff --git a/plugins/fr.obeo.dsl.arduino/src/fr/obeo/dsl/arduino/Constant.java b/plugins/fr.obeo.dsl.arduino/src/fr/obeo/dsl/arduino/Constant.java
index 6d0475e..8fb74f5 100644
--- a/plugins/fr.obeo.dsl.arduino/src/fr/obeo/dsl/arduino/Constant.java
+++ b/plugins/fr.obeo.dsl.arduino/src/fr/obeo/dsl/arduino/Constant.java
@@ -16,10 +16,42 @@
* A representation of the model object 'Constant'.
*
*
+ *
+ * The following features are supported:
+ *
+ * - {@link fr.obeo.dsl.arduino.Constant#getValue Value}
+ *
+ *
*
* @see fr.obeo.dsl.arduino.ArduinoPackage#getConstant()
* @model
* @generated
*/
-public interface Constant extends Value {
+public interface Constant extends Expression {
+
+ /**
+ * Returns the value of the 'Value' attribute.
+ *
+ *
+ * If the meaning of the 'Value' attribute isn't clear,
+ * there really should be more of a description here...
+ *
+ *
+ * @return the value of the 'Value' attribute.
+ * @see #setValue(String)
+ * @see fr.obeo.dsl.arduino.ArduinoPackage#getConstant_Value()
+ * @model
+ * @generated
+ */
+ String getValue();
+
+ /**
+ * Sets the value of the '{@link fr.obeo.dsl.arduino.Constant#getValue Value}' attribute.
+ *
+ *
+ * @param value the new value of the 'Value' attribute.
+ * @see #getValue()
+ * @generated
+ */
+ void setValue(String value);
} // Constant
diff --git a/plugins/fr.obeo.dsl.arduino/src/fr/obeo/dsl/arduino/Expression.java b/plugins/fr.obeo.dsl.arduino/src/fr/obeo/dsl/arduino/Expression.java
new file mode 100644
index 0000000..a7afdc0
--- /dev/null
+++ b/plugins/fr.obeo.dsl.arduino/src/fr/obeo/dsl/arduino/Expression.java
@@ -0,0 +1,25 @@
+/**
+ * Copyright (c) 2013 Obeo.
+ * 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:
+ * Obeo - initial API and implementation
+ */
+package fr.obeo.dsl.arduino;
+
+
+/**
+ *
+ * A representation of the model object 'Expression'.
+ *
+ *
+ *
+ * @see fr.obeo.dsl.arduino.ArduinoPackage#getExpression()
+ * @model abstract="true"
+ * @generated
+ */
+public interface Expression extends Instruction, Parameter {
+} // Expression
diff --git a/plugins/fr.obeo.dsl.arduino/src/fr/obeo/dsl/arduino/Level.java b/plugins/fr.obeo.dsl.arduino/src/fr/obeo/dsl/arduino/Level.java
index 5fc7574..db33eee 100644
--- a/plugins/fr.obeo.dsl.arduino/src/fr/obeo/dsl/arduino/Level.java
+++ b/plugins/fr.obeo.dsl.arduino/src/fr/obeo/dsl/arduino/Level.java
@@ -37,12 +37,12 @@ public interface Level extends ModuleInstruction {
*
*
* @return the value of the 'Level' reference.
- * @see #setLevel(Value)
+ * @see #setLevel(Expression)
* @see fr.obeo.dsl.arduino.ArduinoPackage#getLevel_Level()
* @model required="true"
* @generated
*/
- Value getLevel();
+ Expression getLevel();
/**
* Sets the value of the '{@link fr.obeo.dsl.arduino.Level#getLevel Level}' reference.
@@ -52,6 +52,6 @@ public interface Level extends ModuleInstruction {
* @see #getLevel()
* @generated
*/
- void setLevel(Value value);
+ void setLevel(Expression value);
} // Level
diff --git a/plugins/fr.obeo.dsl.arduino/src/fr/obeo/dsl/arduino/MathOperator.java b/plugins/fr.obeo.dsl.arduino/src/fr/obeo/dsl/arduino/MathOperator.java
index 10b74f9..7f59b2e 100644
--- a/plugins/fr.obeo.dsl.arduino/src/fr/obeo/dsl/arduino/MathOperator.java
+++ b/plugins/fr.obeo.dsl.arduino/src/fr/obeo/dsl/arduino/MathOperator.java
@@ -29,7 +29,7 @@
* @model abstract="true"
* @generated
*/
-public interface MathOperator extends Value, Instruction {
+public interface MathOperator extends Expression, Instruction {
/**
* Returns the value of the 'Left' reference.
*
@@ -39,12 +39,12 @@ public interface MathOperator extends Value, Instruction {
*
*
* @return the value of the 'Left' reference.
- * @see #setLeft(Value)
+ * @see #setLeft(Expression)
* @see fr.obeo.dsl.arduino.ArduinoPackage#getMathOperator_Left()
* @model required="true"
* @generated
*/
- Value getLeft();
+ Expression getLeft();
/**
* Sets the value of the '{@link fr.obeo.dsl.arduino.MathOperator#getLeft Left}' reference.
@@ -54,7 +54,7 @@ public interface MathOperator extends Value, Instruction {
* @see #getLeft()
* @generated
*/
- void setLeft(Value value);
+ void setLeft(Expression value);
/**
* Returns the value of the 'Right' reference.
@@ -65,12 +65,12 @@ public interface MathOperator extends Value, Instruction {
*
*
* @return the value of the 'Right' reference.
- * @see #setRight(Value)
+ * @see #setRight(Expression)
* @see fr.obeo.dsl.arduino.ArduinoPackage#getMathOperator_Right()
* @model
* @generated
*/
- Value getRight();
+ Expression getRight();
/**
* Sets the value of the '{@link fr.obeo.dsl.arduino.MathOperator#getRight Right}' reference.
@@ -80,7 +80,7 @@ public interface MathOperator extends Value, Instruction {
* @see #getRight()
* @generated
*/
- void setRight(Value value);
+ void setRight(Expression value);
/**
* Returns the value of the 'Operator' attribute.
diff --git a/plugins/fr.obeo.dsl.arduino/src/fr/obeo/dsl/arduino/Set.java b/plugins/fr.obeo.dsl.arduino/src/fr/obeo/dsl/arduino/Set.java
index 030854a..061d359 100644
--- a/plugins/fr.obeo.dsl.arduino/src/fr/obeo/dsl/arduino/Set.java
+++ b/plugins/fr.obeo.dsl.arduino/src/fr/obeo/dsl/arduino/Set.java
@@ -64,12 +64,12 @@ public interface Set extends Instruction {
*
*
* @return the value of the 'Value' reference.
- * @see #setValue(Value)
+ * @see #setValue(Expression)
* @see fr.obeo.dsl.arduino.ArduinoPackage#getSet_Value()
* @model required="true"
* @generated
*/
- Value getValue();
+ Expression getValue();
/**
* Sets the value of the '{@link fr.obeo.dsl.arduino.Set#getValue Value}' reference.
@@ -79,6 +79,6 @@ public interface Set extends Instruction {
* @see #getValue()
* @generated
*/
- void setValue(Value value);
+ void setValue(Expression value);
} // Set
diff --git a/plugins/fr.obeo.dsl.arduino/src/fr/obeo/dsl/arduino/Status.java b/plugins/fr.obeo.dsl.arduino/src/fr/obeo/dsl/arduino/Status.java
index 138e112..77dc0cd 100644
--- a/plugins/fr.obeo.dsl.arduino/src/fr/obeo/dsl/arduino/Status.java
+++ b/plugins/fr.obeo.dsl.arduino/src/fr/obeo/dsl/arduino/Status.java
@@ -28,7 +28,7 @@
* @model
* @generated
*/
-public interface Status extends ModuleInstruction, Value {
+public interface Status extends ModuleInstruction, Expression {
/**
* Returns the value of the 'Status' attribute.
*
diff --git a/plugins/fr.obeo.dsl.arduino/src/fr/obeo/dsl/arduino/Value.java b/plugins/fr.obeo.dsl.arduino/src/fr/obeo/dsl/arduino/Value.java
deleted file mode 100644
index 8178656..0000000
--- a/plugins/fr.obeo.dsl.arduino/src/fr/obeo/dsl/arduino/Value.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/**
- * Copyright (c) 2013 Obeo.
- * 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:
- * Obeo - initial API and implementation
- */
-package fr.obeo.dsl.arduino;
-
-
-/**
- *
- * A representation of the model object 'Value'.
- *
- *
- *
- * The following features are supported:
- *
- * - {@link fr.obeo.dsl.arduino.Value#getValue Value}
- *
- *
- *
- * @see fr.obeo.dsl.arduino.ArduinoPackage#getValue()
- * @model abstract="true"
- * @generated
- */
-public interface Value extends Instruction, Parameter {
- /**
- * Returns the value of the 'Value' attribute.
- *
- *
- * If the meaning of the 'Value' attribute isn't clear,
- * there really should be more of a description here...
- *
- *
- * @return the value of the 'Value' attribute.
- * @see #setValue(String)
- * @see fr.obeo.dsl.arduino.ArduinoPackage#getValue_Value()
- * @model
- * @generated
- */
- String getValue();
-
- /**
- * Sets the value of the '{@link fr.obeo.dsl.arduino.Value#getValue Value}' attribute.
- *
- *
- * @param value the new value of the 'Value' attribute.
- * @see #getValue()
- * @generated
- */
- void setValue(String value);
-
-} // Value
diff --git a/plugins/fr.obeo.dsl.arduino/src/fr/obeo/dsl/arduino/Variable.java b/plugins/fr.obeo.dsl.arduino/src/fr/obeo/dsl/arduino/Variable.java
index 92b0e9a..c090a53 100644
--- a/plugins/fr.obeo.dsl.arduino/src/fr/obeo/dsl/arduino/Variable.java
+++ b/plugins/fr.obeo.dsl.arduino/src/fr/obeo/dsl/arduino/Variable.java
@@ -27,7 +27,7 @@
* @model
* @generated
*/
-public interface Variable extends Value, Instruction {
+public interface Variable extends Expression, Instruction {
/**
* Returns the value of the 'Name' attribute.
*
diff --git a/plugins/fr.obeo.dsl.arduino/src/fr/obeo/dsl/arduino/impl/ArduinoPackageImpl.java b/plugins/fr.obeo.dsl.arduino/src/fr/obeo/dsl/arduino/impl/ArduinoPackageImpl.java
index 92301dd..e229287 100644
--- a/plugins/fr.obeo.dsl.arduino/src/fr/obeo/dsl/arduino/impl/ArduinoPackageImpl.java
+++ b/plugins/fr.obeo.dsl.arduino/src/fr/obeo/dsl/arduino/impl/ArduinoPackageImpl.java
@@ -10,6 +10,13 @@
*/
package fr.obeo.dsl.arduino.impl;
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EEnum;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.impl.EPackageImpl;
+
import fr.obeo.dsl.arduino.AnalogPin;
import fr.obeo.dsl.arduino.ArduinoFactory;
import fr.obeo.dsl.arduino.ArduinoPackage;
@@ -19,6 +26,7 @@
import fr.obeo.dsl.arduino.Control;
import fr.obeo.dsl.arduino.Delay;
import fr.obeo.dsl.arduino.DigitalPin;
+import fr.obeo.dsl.arduino.Expression;
import fr.obeo.dsl.arduino.Function;
import fr.obeo.dsl.arduino.FunctionCall;
import fr.obeo.dsl.arduino.Hardware;
@@ -49,18 +57,9 @@
import fr.obeo.dsl.arduino.Status;
import fr.obeo.dsl.arduino.Time;
import fr.obeo.dsl.arduino.Utilities;
-import fr.obeo.dsl.arduino.Value;
import fr.obeo.dsl.arduino.Variable;
import fr.obeo.dsl.arduino.While;
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EEnum;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.EReference;
-
-import org.eclipse.emf.ecore.impl.EPackageImpl;
-
/**
*
* An implementation of the model Package.
@@ -269,7 +268,7 @@ public class ArduinoPackageImpl extends EPackageImpl implements ArduinoPackage {
*
* @generated
*/
- private EClass valueEClass = null;
+ private EClass expressionEClass = null;
/**
*
@@ -1024,8 +1023,8 @@ public EClass getBooleanOperator() {
*
* @generated
*/
- public EClass getValue() {
- return valueEClass;
+ public EClass getExpression() {
+ return expressionEClass;
}
/**
@@ -1033,8 +1032,8 @@ public EClass getValue() {
*
* @generated
*/
- public EAttribute getValue_Value() {
- return (EAttribute)valueEClass.getEStructuralFeatures().get(0);
+ public EClass getConstant() {
+ return constantEClass;
}
/**
@@ -1042,8 +1041,8 @@ public EAttribute getValue_Value() {
*
* @generated
*/
- public EClass getConstant() {
- return constantEClass;
+ public EAttribute getConstant_Value() {
+ return (EAttribute)constantEClass.getEStructuralFeatures().get(0);
}
/**
@@ -1358,10 +1357,10 @@ public void createPackageContents() {
booleanOperatorEClass = createEClass(BOOLEAN_OPERATOR);
- valueEClass = createEClass(VALUE);
- createEAttribute(valueEClass, VALUE__VALUE);
+ expressionEClass = createEClass(EXPRESSION);
constantEClass = createEClass(CONSTANT);
+ createEAttribute(constantEClass, CONSTANT__VALUE);
ifEClass = createEClass(IF);
createEReference(ifEClass, IF__CONDITION);
@@ -1429,7 +1428,7 @@ public void initializePackageContents() {
sketchEClass.getESuperTypes().add(this.getNamedElement());
sketchEClass.getESuperTypes().add(this.getInstruction());
statusEClass.getESuperTypes().add(this.getModuleInstruction());
- statusEClass.getESuperTypes().add(this.getValue());
+ statusEClass.getESuperTypes().add(this.getExpression());
levelEClass.getESuperTypes().add(this.getModuleInstruction());
moduleInstructionEClass.getESuperTypes().add(this.getInstruction());
moduleInstructionEClass.getESuperTypes().add(this.getParameter());
@@ -1444,16 +1443,16 @@ public void initializePackageContents() {
sensorEClass.getESuperTypes().add(this.getModuleInstruction());
sensorEClass.getESuperTypes().add(this.getBooleanOperator());
whileEClass.getESuperTypes().add(this.getControl());
- mathOperatorEClass.getESuperTypes().add(this.getValue());
+ mathOperatorEClass.getESuperTypes().add(this.getExpression());
mathOperatorEClass.getESuperTypes().add(this.getInstruction());
- variableEClass.getESuperTypes().add(this.getValue());
+ variableEClass.getESuperTypes().add(this.getExpression());
variableEClass.getESuperTypes().add(this.getInstruction());
setEClass.getESuperTypes().add(this.getInstruction());
numericalOperatorEClass.getESuperTypes().add(this.getMathOperator());
booleanOperatorEClass.getESuperTypes().add(this.getMathOperator());
- valueEClass.getESuperTypes().add(this.getInstruction());
- valueEClass.getESuperTypes().add(this.getParameter());
- constantEClass.getESuperTypes().add(this.getValue());
+ expressionEClass.getESuperTypes().add(this.getInstruction());
+ expressionEClass.getESuperTypes().add(this.getParameter());
+ constantEClass.getESuperTypes().add(this.getExpression());
ifEClass.getESuperTypes().add(this.getControl());
functionCallEClass.getESuperTypes().add(this.getInstruction());
parameterCallEClass.getESuperTypes().add(this.getInstruction());
@@ -1502,7 +1501,7 @@ public void initializePackageContents() {
initEReference(getStatus_Sensor(), this.getSensor(), this.getSensor_Status(), "sensor", null, 0, 1, Status.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(levelEClass, Level.class, "Level", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getLevel_Level(), this.getValue(), null, "level", null, 1, 1, Level.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getLevel_Level(), this.getExpression(), null, "level", null, 1, 1, Level.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(moduleInstructionEClass, ModuleInstruction.class, "ModuleInstruction", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getModuleInstruction_Module(), this.getModule(), null, "module", null, 1, 1, ModuleInstruction.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
@@ -1539,8 +1538,8 @@ public void initializePackageContents() {
initEReference(getWhile_Condition(), this.getBooleanOperator(), null, "condition", null, 1, 1, While.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(mathOperatorEClass, MathOperator.class, "MathOperator", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getMathOperator_Left(), this.getValue(), null, "left", null, 1, 1, MathOperator.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getMathOperator_Right(), this.getValue(), null, "right", null, 0, 1, MathOperator.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getMathOperator_Left(), this.getExpression(), null, "left", null, 1, 1, MathOperator.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getMathOperator_Right(), this.getExpression(), null, "right", null, 0, 1, MathOperator.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getMathOperator_Operator(), this.getOperatorKind(), "operator", null, 0, 1, MathOperator.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(variableEClass, Variable.class, "Variable", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
@@ -1548,16 +1547,16 @@ public void initializePackageContents() {
initEClass(setEClass, Set.class, "Set", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getSet_Variable(), this.getVariable(), null, "variable", null, 1, 1, Set.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getSet_Value(), this.getValue(), null, "value", null, 1, 1, Set.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getSet_Value(), this.getExpression(), null, "value", null, 1, 1, Set.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(numericalOperatorEClass, NumericalOperator.class, "NumericalOperator", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEClass(booleanOperatorEClass, BooleanOperator.class, "BooleanOperator", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEClass(valueEClass, Value.class, "Value", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getValue_Value(), ecorePackage.getEString(), "value", null, 0, 1, Value.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEClass(expressionEClass, Expression.class, "Expression", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEClass(constantEClass, Constant.class, "Constant", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getConstant_Value(), ecorePackage.getEString(), "value", null, 0, 1, Constant.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(ifEClass, If.class, "If", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getIf_Condition(), this.getBooleanOperator(), null, "condition", null, 1, 1, If.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
diff --git a/plugins/fr.obeo.dsl.arduino/src/fr/obeo/dsl/arduino/impl/ConstantImpl.java b/plugins/fr.obeo.dsl.arduino/src/fr/obeo/dsl/arduino/impl/ConstantImpl.java
index 86e25f9..2804fd7 100644
--- a/plugins/fr.obeo.dsl.arduino/src/fr/obeo/dsl/arduino/impl/ConstantImpl.java
+++ b/plugins/fr.obeo.dsl.arduino/src/fr/obeo/dsl/arduino/impl/ConstantImpl.java
@@ -13,18 +13,43 @@
import fr.obeo.dsl.arduino.ArduinoPackage;
import fr.obeo.dsl.arduino.Constant;
+import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
/**
*
* An implementation of the model object 'Constant'.
*
*
+ * The following features are implemented:
+ *
+ * - {@link fr.obeo.dsl.arduino.impl.ConstantImpl#getValue Value}
+ *
*
*
* @generated
*/
-public class ConstantImpl extends ValueImpl implements Constant {
+public class ConstantImpl extends ExpressionImpl implements Constant {
+ /**
+ * The default value of the '{@link #getValue() Value}' attribute.
+ *
+ *
+ * @see #getValue()
+ * @generated
+ * @ordered
+ */
+ protected static final String VALUE_EDEFAULT = null;
+ /**
+ * The cached value of the '{@link #getValue() Value}' attribute.
+ *
+ *
+ * @see #getValue()
+ * @generated
+ * @ordered
+ */
+ protected String value = VALUE_EDEFAULT;
+
/**
*
*
@@ -44,4 +69,99 @@ protected EClass eStaticClass() {
return ArduinoPackage.Literals.CONSTANT;
}
+ /**
+ *
+ *
+ * @generated
+ */
+ public String getValue() {
+ return value;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public void setValue(String newValue) {
+ String oldValue = value;
+ value = newValue;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, ArduinoPackage.CONSTANT__VALUE, oldValue, value));
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case ArduinoPackage.CONSTANT__VALUE:
+ return getValue();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case ArduinoPackage.CONSTANT__VALUE:
+ setValue((String)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case ArduinoPackage.CONSTANT__VALUE:
+ setValue(VALUE_EDEFAULT);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case ArduinoPackage.CONSTANT__VALUE:
+ return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT.equals(value);
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy()) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (value: ");
+ result.append(value);
+ result.append(')');
+ return result.toString();
+ }
+
} //ConstantImpl
diff --git a/plugins/fr.obeo.dsl.arduino/src/fr/obeo/dsl/arduino/impl/ValueImpl.java b/plugins/fr.obeo.dsl.arduino/src/fr/obeo/dsl/arduino/impl/ExpressionImpl.java
similarity index 63%
rename from plugins/fr.obeo.dsl.arduino/src/fr/obeo/dsl/arduino/impl/ValueImpl.java
rename to plugins/fr.obeo.dsl.arduino/src/fr/obeo/dsl/arduino/impl/ExpressionImpl.java
index e9b2c08..316f715 100644
--- a/plugins/fr.obeo.dsl.arduino/src/fr/obeo/dsl/arduino/impl/ValueImpl.java
+++ b/plugins/fr.obeo.dsl.arduino/src/fr/obeo/dsl/arduino/impl/ExpressionImpl.java
@@ -11,9 +11,9 @@
package fr.obeo.dsl.arduino.impl;
import fr.obeo.dsl.arduino.ArduinoPackage;
+import fr.obeo.dsl.arduino.Expression;
import fr.obeo.dsl.arduino.Parameter;
import fr.obeo.dsl.arduino.ParameterDefinition;
-import fr.obeo.dsl.arduino.Value;
import org.eclipse.emf.common.notify.Notification;
@@ -24,19 +24,18 @@
/**
*
- * An implementation of the model object 'Value'.
+ * An implementation of the model object 'Expression'.
*
*
* The following features are implemented:
*
- * - {@link fr.obeo.dsl.arduino.impl.ValueImpl#getDefinition Definition}
- * - {@link fr.obeo.dsl.arduino.impl.ValueImpl#getValue Value}
+ * - {@link fr.obeo.dsl.arduino.impl.ExpressionImpl#getDefinition Definition}
*
*
*
* @generated
*/
-public abstract class ValueImpl extends InstructionImpl implements Value {
+public abstract class ExpressionImpl extends InstructionImpl implements Expression {
/**
* The cached value of the '{@link #getDefinition() Definition}' reference.
*
@@ -47,32 +46,12 @@ public abstract class ValueImpl extends InstructionImpl implements Value {
*/
protected ParameterDefinition definition;
- /**
- * The default value of the '{@link #getValue() Value}' attribute.
- *
- *
- * @see #getValue()
- * @generated
- * @ordered
- */
- protected static final String VALUE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getValue() Value}' attribute.
- *
- *
- * @see #getValue()
- * @generated
- * @ordered
- */
- protected String value = VALUE_EDEFAULT;
-
/**
*
*
* @generated
*/
- protected ValueImpl() {
+ protected ExpressionImpl() {
super();
}
@@ -83,7 +62,7 @@ protected ValueImpl() {
*/
@Override
protected EClass eStaticClass() {
- return ArduinoPackage.Literals.VALUE;
+ return ArduinoPackage.Literals.EXPRESSION;
}
/**
@@ -97,7 +76,7 @@ public ParameterDefinition getDefinition() {
definition = (ParameterDefinition)eResolveProxy(oldDefinition);
if (definition != oldDefinition) {
if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.RESOLVE, ArduinoPackage.VALUE__DEFINITION, oldDefinition, definition));
+ eNotify(new ENotificationImpl(this, Notification.RESOLVE, ArduinoPackage.EXPRESSION__DEFINITION, oldDefinition, definition));
}
}
return definition;
@@ -121,28 +100,7 @@ public void setDefinition(ParameterDefinition newDefinition) {
ParameterDefinition oldDefinition = definition;
definition = newDefinition;
if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, ArduinoPackage.VALUE__DEFINITION, oldDefinition, definition));
- }
-
- /**
- *
- *
- * @generated
- */
- public String getValue() {
- return value;
- }
-
- /**
- *
- *
- * @generated
- */
- public void setValue(String newValue) {
- String oldValue = value;
- value = newValue;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, ArduinoPackage.VALUE__VALUE, oldValue, value));
+ eNotify(new ENotificationImpl(this, Notification.SET, ArduinoPackage.EXPRESSION__DEFINITION, oldDefinition, definition));
}
/**
@@ -153,11 +111,9 @@ public void setValue(String newValue) {
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
- case ArduinoPackage.VALUE__DEFINITION:
+ case ArduinoPackage.EXPRESSION__DEFINITION:
if (resolve) return getDefinition();
return basicGetDefinition();
- case ArduinoPackage.VALUE__VALUE:
- return getValue();
}
return super.eGet(featureID, resolve, coreType);
}
@@ -170,12 +126,9 @@ public Object eGet(int featureID, boolean resolve, boolean coreType) {
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
- case ArduinoPackage.VALUE__DEFINITION:
+ case ArduinoPackage.EXPRESSION__DEFINITION:
setDefinition((ParameterDefinition)newValue);
return;
- case ArduinoPackage.VALUE__VALUE:
- setValue((String)newValue);
- return;
}
super.eSet(featureID, newValue);
}
@@ -188,12 +141,9 @@ public void eSet(int featureID, Object newValue) {
@Override
public void eUnset(int featureID) {
switch (featureID) {
- case ArduinoPackage.VALUE__DEFINITION:
+ case ArduinoPackage.EXPRESSION__DEFINITION:
setDefinition((ParameterDefinition)null);
return;
- case ArduinoPackage.VALUE__VALUE:
- setValue(VALUE_EDEFAULT);
- return;
}
super.eUnset(featureID);
}
@@ -206,10 +156,8 @@ public void eUnset(int featureID) {
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
- case ArduinoPackage.VALUE__DEFINITION:
+ case ArduinoPackage.EXPRESSION__DEFINITION:
return definition != null;
- case ArduinoPackage.VALUE__VALUE:
- return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT.equals(value);
}
return super.eIsSet(featureID);
}
@@ -223,7 +171,7 @@ public boolean eIsSet(int featureID) {
public int eBaseStructuralFeatureID(int derivedFeatureID, Class> baseClass) {
if (baseClass == Parameter.class) {
switch (derivedFeatureID) {
- case ArduinoPackage.VALUE__DEFINITION: return ArduinoPackage.PARAMETER__DEFINITION;
+ case ArduinoPackage.EXPRESSION__DEFINITION: return ArduinoPackage.PARAMETER__DEFINITION;
default: return -1;
}
}
@@ -239,27 +187,11 @@ public int eBaseStructuralFeatureID(int derivedFeatureID, Class> baseClass) {
public int eDerivedStructuralFeatureID(int baseFeatureID, Class> baseClass) {
if (baseClass == Parameter.class) {
switch (baseFeatureID) {
- case ArduinoPackage.PARAMETER__DEFINITION: return ArduinoPackage.VALUE__DEFINITION;
+ case ArduinoPackage.PARAMETER__DEFINITION: return ArduinoPackage.EXPRESSION__DEFINITION;
default: return -1;
}
}
return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
}
- /**
- *
- *
- * @generated
- */
- @Override
- public String toString() {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (value: ");
- result.append(value);
- result.append(')');
- return result.toString();
- }
-
-} //ValueImpl
+} //ExpressionImpl
diff --git a/plugins/fr.obeo.dsl.arduino/src/fr/obeo/dsl/arduino/impl/LevelImpl.java b/plugins/fr.obeo.dsl.arduino/src/fr/obeo/dsl/arduino/impl/LevelImpl.java
index 0a554aa..91a87e9 100644
--- a/plugins/fr.obeo.dsl.arduino/src/fr/obeo/dsl/arduino/impl/LevelImpl.java
+++ b/plugins/fr.obeo.dsl.arduino/src/fr/obeo/dsl/arduino/impl/LevelImpl.java
@@ -10,17 +10,15 @@
*/
package fr.obeo.dsl.arduino.impl;
-import fr.obeo.dsl.arduino.ArduinoPackage;
-import fr.obeo.dsl.arduino.Level;
-import fr.obeo.dsl.arduino.Value;
-
import org.eclipse.emf.common.notify.Notification;
-
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
-
import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import fr.obeo.dsl.arduino.ArduinoPackage;
+import fr.obeo.dsl.arduino.Expression;
+import fr.obeo.dsl.arduino.Level;
+
/**
*
* An implementation of the model object 'Level'.
@@ -43,7 +41,7 @@ public class LevelImpl extends ModuleInstructionImpl implements Level {
* @generated
* @ordered
*/
- protected Value level;
+ protected Expression level;
/**
*
@@ -69,10 +67,10 @@ protected EClass eStaticClass() {
*
* @generated
*/
- public Value getLevel() {
+ public Expression getLevel() {
if (level != null && level.eIsProxy()) {
InternalEObject oldLevel = (InternalEObject)level;
- level = (Value)eResolveProxy(oldLevel);
+ level = (Expression)eResolveProxy(oldLevel);
if (level != oldLevel) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, ArduinoPackage.LEVEL__LEVEL, oldLevel, level));
@@ -86,7 +84,7 @@ public Value getLevel() {
*
* @generated
*/
- public Value basicGetLevel() {
+ public Expression basicGetLevel() {
return level;
}
@@ -95,8 +93,8 @@ public Value basicGetLevel() {
*
* @generated
*/
- public void setLevel(Value newLevel) {
- Value oldLevel = level;
+ public void setLevel(Expression newLevel) {
+ Expression oldLevel = level;
level = newLevel;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ArduinoPackage.LEVEL__LEVEL, oldLevel, level));
@@ -126,7 +124,7 @@ public Object eGet(int featureID, boolean resolve, boolean coreType) {
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case ArduinoPackage.LEVEL__LEVEL:
- setLevel((Value)newValue);
+ setLevel((Expression)newValue);
return;
}
super.eSet(featureID, newValue);
@@ -141,7 +139,7 @@ public void eSet(int featureID, Object newValue) {
public void eUnset(int featureID) {
switch (featureID) {
case ArduinoPackage.LEVEL__LEVEL:
- setLevel((Value)null);
+ setLevel((Expression)null);
return;
}
super.eUnset(featureID);
diff --git a/plugins/fr.obeo.dsl.arduino/src/fr/obeo/dsl/arduino/impl/MathOperatorImpl.java b/plugins/fr.obeo.dsl.arduino/src/fr/obeo/dsl/arduino/impl/MathOperatorImpl.java
index 9e721c1..f55317b 100644
--- a/plugins/fr.obeo.dsl.arduino/src/fr/obeo/dsl/arduino/impl/MathOperatorImpl.java
+++ b/plugins/fr.obeo.dsl.arduino/src/fr/obeo/dsl/arduino/impl/MathOperatorImpl.java
@@ -10,18 +10,16 @@
*/
package fr.obeo.dsl.arduino.impl;
-import fr.obeo.dsl.arduino.ArduinoPackage;
-import fr.obeo.dsl.arduino.MathOperator;
-import fr.obeo.dsl.arduino.OperatorKind;
-import fr.obeo.dsl.arduino.Value;
-
import org.eclipse.emf.common.notify.Notification;
-
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
-
import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import fr.obeo.dsl.arduino.ArduinoPackage;
+import fr.obeo.dsl.arduino.Expression;
+import fr.obeo.dsl.arduino.MathOperator;
+import fr.obeo.dsl.arduino.OperatorKind;
+
/**
*
* An implementation of the model object 'Math Operator'.
@@ -37,7 +35,7 @@
*
* @generated
*/
-public abstract class MathOperatorImpl extends ValueImpl implements MathOperator {
+public abstract class MathOperatorImpl extends ExpressionImpl implements MathOperator {
/**
* The cached value of the '{@link #getLeft() Left}' reference.
*
@@ -46,7 +44,7 @@ public abstract class MathOperatorImpl extends ValueImpl implements MathOperator
* @generated
* @ordered
*/
- protected Value left;
+ protected Expression left;
/**
* The cached value of the '{@link #getRight() Right}' reference.
@@ -56,7 +54,7 @@ public abstract class MathOperatorImpl extends ValueImpl implements MathOperator
* @generated
* @ordered
*/
- protected Value right;
+ protected Expression right;
/**
* The default value of the '{@link #getOperator() Operator}' attribute.
@@ -102,10 +100,10 @@ protected EClass eStaticClass() {
*
* @generated
*/
- public Value getLeft() {
+ public Expression getLeft() {
if (left != null && left.eIsProxy()) {
InternalEObject oldLeft = (InternalEObject)left;
- left = (Value)eResolveProxy(oldLeft);
+ left = (Expression)eResolveProxy(oldLeft);
if (left != oldLeft) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, ArduinoPackage.MATH_OPERATOR__LEFT, oldLeft, left));
@@ -119,7 +117,7 @@ public Value getLeft() {
*
* @generated
*/
- public Value basicGetLeft() {
+ public Expression basicGetLeft() {
return left;
}
@@ -128,8 +126,8 @@ public Value basicGetLeft() {
*
* @generated
*/
- public void setLeft(Value newLeft) {
- Value oldLeft = left;
+ public void setLeft(Expression newLeft) {
+ Expression oldLeft = left;
left = newLeft;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ArduinoPackage.MATH_OPERATOR__LEFT, oldLeft, left));
@@ -140,10 +138,10 @@ public void setLeft(Value newLeft) {
*
* @generated
*/
- public Value getRight() {
+ public Expression getRight() {
if (right != null && right.eIsProxy()) {
InternalEObject oldRight = (InternalEObject)right;
- right = (Value)eResolveProxy(oldRight);
+ right = (Expression)eResolveProxy(oldRight);
if (right != oldRight) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, ArduinoPackage.MATH_OPERATOR__RIGHT, oldRight, right));
@@ -157,7 +155,7 @@ public Value getRight() {
*
* @generated
*/
- public Value basicGetRight() {
+ public Expression basicGetRight() {
return right;
}
@@ -166,8 +164,8 @@ public Value basicGetRight() {
*
* @generated
*/
- public void setRight(Value newRight) {
- Value oldRight = right;
+ public void setRight(Expression newRight) {
+ Expression oldRight = right;
right = newRight;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ArduinoPackage.MATH_OPERATOR__RIGHT, oldRight, right));
@@ -223,10 +221,10 @@ public Object eGet(int featureID, boolean resolve, boolean coreType) {
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case ArduinoPackage.MATH_OPERATOR__LEFT:
- setLeft((Value)newValue);
+ setLeft((Expression)newValue);
return;
case ArduinoPackage.MATH_OPERATOR__RIGHT:
- setRight((Value)newValue);
+ setRight((Expression)newValue);
return;
case ArduinoPackage.MATH_OPERATOR__OPERATOR:
setOperator((OperatorKind)newValue);
@@ -244,10 +242,10 @@ public void eSet(int featureID, Object newValue) {
public void eUnset(int featureID) {
switch (featureID) {
case ArduinoPackage.MATH_OPERATOR__LEFT:
- setLeft((Value)null);
+ setLeft((Expression)null);
return;
case ArduinoPackage.MATH_OPERATOR__RIGHT:
- setRight((Value)null);
+ setRight((Expression)null);
return;
case ArduinoPackage.MATH_OPERATOR__OPERATOR:
setOperator(OPERATOR_EDEFAULT);
diff --git a/plugins/fr.obeo.dsl.arduino/src/fr/obeo/dsl/arduino/impl/SensorImpl.java b/plugins/fr.obeo.dsl.arduino/src/fr/obeo/dsl/arduino/impl/SensorImpl.java
index 03a49cd..295de9e 100644
--- a/plugins/fr.obeo.dsl.arduino/src/fr/obeo/dsl/arduino/impl/SensorImpl.java
+++ b/plugins/fr.obeo.dsl.arduino/src/fr/obeo/dsl/arduino/impl/SensorImpl.java
@@ -10,29 +10,25 @@
*/
package fr.obeo.dsl.arduino.impl;
-import fr.obeo.dsl.arduino.ArduinoPackage;
-import fr.obeo.dsl.arduino.BooleanOperator;
-import fr.obeo.dsl.arduino.MathOperator;
-import fr.obeo.dsl.arduino.OperatorKind;
-import fr.obeo.dsl.arduino.Sensor;
-import fr.obeo.dsl.arduino.Status;
-import fr.obeo.dsl.arduino.Value;
-
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;
-
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.EObjectWithInverseResolvingEList;
import org.eclipse.emf.ecore.util.InternalEList;
+import fr.obeo.dsl.arduino.ArduinoPackage;
+import fr.obeo.dsl.arduino.BooleanOperator;
+import fr.obeo.dsl.arduino.Expression;
+import fr.obeo.dsl.arduino.MathOperator;
+import fr.obeo.dsl.arduino.OperatorKind;
+import fr.obeo.dsl.arduino.Sensor;
+import fr.obeo.dsl.arduino.Status;
+
/**
*
* An implementation of the model object 'Sensor'.
@@ -40,7 +36,6 @@
*
* The following features are implemented:
*