use of org.eclipse.xtext.example.arithmetics.arithmetics.Expression in project xtext-eclipse by eclipse.
the class DefinitionImpl method basicSetExpr.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetExpr(Expression newExpr, NotificationChain msgs) {
Expression oldExpr = expr;
expr = newExpr;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ArithmeticsPackage.DEFINITION__EXPR, oldExpr, newExpr);
if (msgs == null)
msgs = notification;
else
msgs.add(notification);
}
return msgs;
}
use of org.eclipse.xtext.example.arithmetics.arithmetics.Expression in project xtext-eclipse by eclipse.
the class DivImpl method basicSetRight.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetRight(Expression newRight, NotificationChain msgs) {
Expression oldRight = right;
right = newRight;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ArithmeticsPackage.DIV__RIGHT, oldRight, newRight);
if (msgs == null)
msgs = notification;
else
msgs.add(notification);
}
return msgs;
}
use of org.eclipse.xtext.example.arithmetics.arithmetics.Expression in project xtext-eclipse by eclipse.
the class CalculatorTest method check.
protected void check(final double expected, final String expression) throws Exception {
StringConcatenation _builder = new StringConcatenation();
_builder.append("module test ");
_builder.append(expression);
final org.eclipse.xtext.example.arithmetics.arithmetics.Module module = this.parseHelper.parse(_builder);
BigDecimal result = this.calculator.evaluate(IterableExtensions.<Expression>head(Iterables.<Expression>filter(IterableExtensions.<Statement>head(module.getStatements()).eContents(), Expression.class)));
Assert.assertEquals(expected, result.doubleValue(), 0.0001);
}
use of org.eclipse.xtext.example.arithmetics.arithmetics.Expression in project xtext-eclipse by eclipse.
the class EvaluationImpl method basicSetExpression.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetExpression(Expression newExpression, NotificationChain msgs) {
Expression oldExpression = expression;
expression = newExpression;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ArithmeticsPackage.EVALUATION__EXPRESSION, oldExpression, newExpression);
if (msgs == null)
msgs = notification;
else
msgs.add(notification);
}
return msgs;
}
use of org.eclipse.xtext.example.arithmetics.arithmetics.Expression in project xtext-eclipse by eclipse.
the class PlusImpl method basicSetRight.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetRight(Expression newRight, NotificationChain msgs) {
Expression oldRight = right;
right = newRight;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ArithmeticsPackage.PLUS__RIGHT, oldRight, newRight);
if (msgs == null)
msgs = notification;
else
msgs.add(notification);
}
return msgs;
}
Aggregations