Search in sources :

Example 16 with AssignmentExpression

use of org.yakindu.base.expressions.expressions.AssignmentExpression in project statecharts by Yakindu.

the class StextTestFactory method _createVariableAssignment.

public static AssignmentExpression _createVariableAssignment(VariableDefinition v, AssignmentOperator op, Expression expression, ReactionEffect e) {
    AssignmentExpression assignment = ExpressionsFactory.eINSTANCE.createAssignmentExpression();
    assignment.setVarRef(_createElementReferenceExpression(v));
    assignment.setOperator(op);
    assignment.setExpression(expression);
    if (e != null)
        e.getActions().add(assignment);
    return assignment;
}
Also used : AssignmentExpression(org.yakindu.base.expressions.expressions.AssignmentExpression)

Example 17 with AssignmentExpression

use of org.yakindu.base.expressions.expressions.AssignmentExpression in project statecharts by Yakindu.

the class AssignmentExpressionItemProvider method getText.

/**
 * This returns the label text for the adapted class.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public String getText(Object object) {
    AssignmentOperator labelValue = ((AssignmentExpression) object).getOperator();
    String label = labelValue == null ? null : labelValue.toString();
    return label == null || label.length() == 0 ? getString("_UI_AssignmentExpression_type") : getString("_UI_AssignmentExpression_type") + " " + label;
}
Also used : AssignmentExpression(org.yakindu.base.expressions.expressions.AssignmentExpression) AssignmentOperator(org.yakindu.base.expressions.expressions.AssignmentOperator)

Aggregations

AssignmentExpression (org.yakindu.base.expressions.expressions.AssignmentExpression)17 Test (org.junit.Test)13 ExecutionFlow (org.yakindu.sct.model.sexec.ExecutionFlow)13 ExecutionState (org.yakindu.sct.model.sexec.ExecutionState)13 VariableDefinition (org.yakindu.sct.model.stext.stext.VariableDefinition)13 StextTestFactory._createVariableDefinition (org.yakindu.sct.model.stext.test.util.StextTestFactory._createVariableDefinition)13 LocalReaction (org.yakindu.sct.model.stext.stext.LocalReaction)12 StextTestFactory._createLocalReaction (org.yakindu.sct.model.stext.test.util.StextTestFactory._createLocalReaction)12 Sequence (org.yakindu.sct.model.sexec.Sequence)10 ReactionEffect (org.yakindu.sct.model.stext.stext.ReactionEffect)8 StextTestFactory._createReactionEffect (org.yakindu.sct.model.stext.test.util.StextTestFactory._createReactionEffect)8 If (org.yakindu.sct.model.sexec.If)6 ElementReferenceExpression (org.yakindu.base.expressions.expressions.ElementReferenceExpression)5 PrimitiveValueExpression (org.yakindu.base.expressions.expressions.PrimitiveValueExpression)5 Region (org.yakindu.sct.model.sgraph.Region)5 State (org.yakindu.sct.model.sgraph.State)5 Statechart (org.yakindu.sct.model.sgraph.Statechart)5 SGraphTestFactory._createRegion (org.yakindu.sct.model.sgraph.test.util.SGraphTestFactory._createRegion)5 SGraphTestFactory._createState (org.yakindu.sct.model.sgraph.test.util.SGraphTestFactory._createState)5 SGraphTestFactory._createStatechart (org.yakindu.sct.model.sgraph.test.util.SGraphTestFactory._createStatechart)5