Search in sources :

Example 1 with UnaryAddingOperator

use of org.osate.ba.aadlba.UnaryAddingOperator in project osate2 by osate.

the class SimpleExpressionImpl method unsetUnaryAddingOperator.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public void unsetUnaryAddingOperator() {
    UnaryAddingOperator oldUnaryAddingOperator = unaryAddingOperator;
    boolean oldUnaryAddingOperatorESet = unaryAddingOperatorESet;
    unaryAddingOperator = UNARY_ADDING_OPERATOR_EDEFAULT;
    unaryAddingOperatorESet = false;
    if (eNotificationRequired())
        eNotify(new ENotificationImpl(this, Notification.UNSET, AadlBaPackage.SIMPLE_EXPRESSION__UNARY_ADDING_OPERATOR, oldUnaryAddingOperator, UNARY_ADDING_OPERATOR_EDEFAULT, oldUnaryAddingOperatorESet));
}
Also used : UnaryAddingOperator(org.osate.ba.aadlba.UnaryAddingOperator) ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl)

Example 2 with UnaryAddingOperator

use of org.osate.ba.aadlba.UnaryAddingOperator in project osate-plugin by sireum.

the class BAVisitor method caseSimpleExpression.

@Override
public Boolean caseSimpleExpression(SimpleExpression object) {
    assert (object.getTerms().size() > 0);
    List<BinaryAddingOperator> binOps = object.getBinaryAddingOperators();
    UnaryAddingOperator unaryOp = object.getUnaryAddingOperator();
    List<BTSExp> expressions = new ArrayList<>();
    for (Term t : object.getTerms()) {
        visit(t);
        expressions.add(pop());
    }
    if (expressions.size() > 1) {
        push(convertToBinaryExp(expressions, binOps));
    } else {
        if (BAUtils.isNoneEnumerator(unaryOp)) {
            push(expressions.get(0));
        } else {
            push(BAUtils.convertToUnaryExp(expressions.get(0), unaryOp));
        }
    }
    return false;
}
Also used : UnaryAddingOperator(org.osate.ba.aadlba.UnaryAddingOperator) BinaryAddingOperator(org.osate.ba.aadlba.BinaryAddingOperator) ArrayList(java.util.ArrayList) BTSExp(org.sireum.hamr.ir.BTSExp) Term(org.osate.ba.aadlba.Term)

Example 3 with UnaryAddingOperator

use of org.osate.ba.aadlba.UnaryAddingOperator in project osate2 by osate.

the class SimpleExpressionItemProvider method getText.

/**
 * This returns the label text for the adapted class.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public String getText(Object object) {
    UnaryAddingOperator labelValue = ((SimpleExpression) object).getUnaryAddingOperator();
    String label = labelValue == null ? null : labelValue.toString();
    return label == null || label.length() == 0 ? getString("_UI_SimpleExpression_type") : getString("_UI_SimpleExpression_type") + " " + label;
}
Also used : UnaryAddingOperator(org.osate.ba.aadlba.UnaryAddingOperator) SimpleExpression(org.osate.ba.aadlba.SimpleExpression)

Example 4 with UnaryAddingOperator

use of org.osate.ba.aadlba.UnaryAddingOperator in project osate2 by osate.

the class SimpleExpressionImpl method setUnaryAddingOperator.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public void setUnaryAddingOperator(UnaryAddingOperator newUnaryAddingOperator) {
    UnaryAddingOperator oldUnaryAddingOperator = unaryAddingOperator;
    unaryAddingOperator = newUnaryAddingOperator == null ? UNARY_ADDING_OPERATOR_EDEFAULT : newUnaryAddingOperator;
    boolean oldUnaryAddingOperatorESet = unaryAddingOperatorESet;
    unaryAddingOperatorESet = true;
    if (eNotificationRequired())
        eNotify(new ENotificationImpl(this, Notification.SET, AadlBaPackage.SIMPLE_EXPRESSION__UNARY_ADDING_OPERATOR, oldUnaryAddingOperator, unaryAddingOperator, !oldUnaryAddingOperatorESet));
}
Also used : UnaryAddingOperator(org.osate.ba.aadlba.UnaryAddingOperator) ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl)

Aggregations

UnaryAddingOperator (org.osate.ba.aadlba.UnaryAddingOperator)4 ENotificationImpl (org.eclipse.emf.ecore.impl.ENotificationImpl)2 ArrayList (java.util.ArrayList)1 BinaryAddingOperator (org.osate.ba.aadlba.BinaryAddingOperator)1 SimpleExpression (org.osate.ba.aadlba.SimpleExpression)1 Term (org.osate.ba.aadlba.Term)1 BTSExp (org.sireum.hamr.ir.BTSExp)1