use of org.yakindu.base.expressions.expressions.Expression in project statecharts by Yakindu.
the class PropertyDefinitionImpl method basicSetInitialValue.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetInitialValue(Expression newInitialValue, NotificationChain msgs) {
Expression oldInitialValue = initialValue;
initialValue = newInitialValue;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, SGenPackage.PROPERTY_DEFINITION__INITIAL_VALUE, oldInitialValue, newInitialValue);
if (msgs == null)
msgs = notification;
else
msgs.add(notification);
}
return msgs;
}
use of org.yakindu.base.expressions.expressions.Expression in project statecharts by Yakindu.
the class ExecutionImpl method basicSetStatement.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetStatement(Expression newStatement, NotificationChain msgs) {
Expression oldStatement = statement;
statement = newStatement;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, SexecPackage.EXECUTION__STATEMENT, oldStatement, newStatement);
if (msgs == null)
msgs = notification;
else
msgs.add(notification);
}
return msgs;
}
use of org.yakindu.base.expressions.expressions.Expression in project statecharts by Yakindu.
the class StatechartObjectViewerFilter method select.
@Override
public boolean select(Viewer viewer, Object parentElement, Object element) {
if (element instanceof DomainNavigatorItem) {
DomainNavigatorItem navigatorItem = (DomainNavigatorItem) element;
EObject modelElement = navigatorItem.getEObject();
if (modelElement instanceof Diagram) {
return false;
}
if (modelElement instanceof Trigger) {
return false;
}
if (modelElement instanceof InternalScope || modelElement instanceof InterfaceScope) {
return true;
}
if (modelElement instanceof Scope) {
return false;
}
if (modelElement instanceof LocalReaction) {
return false;
}
if (modelElement instanceof ReactionEffect) {
return false;
}
if (modelElement instanceof Expression) {
return false;
}
}
return true;
}
use of org.yakindu.base.expressions.expressions.Expression in project statecharts by Yakindu.
the class ModelSequencerStateReactionTest method testMultipleRegularEventTriggerCondition.
/**
* Multiple trigger events of a ReactionTrigger will be converted to a
* condition that consists of a ElementReferenceExpressions connected by
* LogicalOrExpressions.
*
* e1, e1 -> e1 || e2
*/
@Test
public void testMultipleRegularEventTriggerCondition() {
EventDefinition e1 = _createEventDefinition("e1", null);
EventDefinition e2 = _createEventDefinition("e2", null);
ReactionTrigger tr1 = _createReactionTrigger(null);
_createRegularEventSpec(e1, tr1);
_createRegularEventSpec(e2, tr1);
Expression s = behaviorMapping.buildCondition(tr1);
assertTrue(s instanceof LogicalOrExpression);
assertClass(ElementReferenceExpression.class, ((LogicalOrExpression) s).getLeftOperand());
assertClass(ElementReferenceExpression.class, ((LogicalOrExpression) s).getRightOperand());
}
use of org.yakindu.base.expressions.expressions.Expression in project statecharts by Yakindu.
the class Assert method assertAssignment.
public static void assertAssignment(Step step, String variableName, AssignmentOperator operator, String value) {
assertClass(Execution.class, step);
Execution exec = (Execution) step;
assertTrue(exec.getStatement() instanceof AssignmentExpression);
AssignmentExpression assignment = (AssignmentExpression) exec.getStatement();
assertEquals(operator, assignment.getOperator());
Expression varRef = assignment.getVarRef();
if (varRef instanceof ElementReferenceExpression) {
ElementReferenceExpression elementRef = (ElementReferenceExpression) varRef;
assertEquals(variableName, ((NamedElement) elementRef.getReference()).getName());
} else if (varRef instanceof FeatureCall) {
FeatureCall call = (FeatureCall) varRef;
assertEquals(variableName, ((NamedElement) call.getFeature()).getName());
}
assertExpressionEquals(value, assignment.getExpression());
}
Aggregations