Search in sources :

Example 1 with UnaryBooleanOperator

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

the class FactorImpl method unsetUnaryBooleanOperator.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public void unsetUnaryBooleanOperator() {
    UnaryBooleanOperator oldUnaryBooleanOperator = unaryBooleanOperator;
    boolean oldUnaryBooleanOperatorESet = unaryBooleanOperatorESet;
    unaryBooleanOperator = UNARY_BOOLEAN_OPERATOR_EDEFAULT;
    unaryBooleanOperatorESet = false;
    if (eNotificationRequired())
        eNotify(new ENotificationImpl(this, Notification.UNSET, AadlBaPackage.FACTOR__UNARY_BOOLEAN_OPERATOR, oldUnaryBooleanOperator, UNARY_BOOLEAN_OPERATOR_EDEFAULT, oldUnaryBooleanOperatorESet));
}
Also used : ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl) UnaryBooleanOperator(org.osate.ba.aadlba.UnaryBooleanOperator)

Example 2 with UnaryBooleanOperator

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

the class FactorImpl method setUnaryBooleanOperator.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public void setUnaryBooleanOperator(UnaryBooleanOperator newUnaryBooleanOperator) {
    UnaryBooleanOperator oldUnaryBooleanOperator = unaryBooleanOperator;
    unaryBooleanOperator = newUnaryBooleanOperator == null ? UNARY_BOOLEAN_OPERATOR_EDEFAULT : newUnaryBooleanOperator;
    boolean oldUnaryBooleanOperatorESet = unaryBooleanOperatorESet;
    unaryBooleanOperatorESet = true;
    if (eNotificationRequired())
        eNotify(new ENotificationImpl(this, Notification.SET, AadlBaPackage.FACTOR__UNARY_BOOLEAN_OPERATOR, oldUnaryBooleanOperator, unaryBooleanOperator, !oldUnaryBooleanOperatorESet));
}
Also used : ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl) UnaryBooleanOperator(org.osate.ba.aadlba.UnaryBooleanOperator)

Example 3 with UnaryBooleanOperator

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

the class BAVisitor method caseFactor.

@Override
public Boolean caseFactor(Factor object) {
    BinaryNumericOperator bno = object.getBinaryNumericOperator();
    UnaryBooleanOperator ubo = object.getUnaryBooleanOperator();
    visit(object.getFirstValue());
    BTSExp lhs = pop();
    if (object.getSecondValue() != null) {
        assert (!BAUtils.isNoneEnumerator(bno));
        visit(object.getSecondValue());
        BTSExp rhs = pop();
        BTSBinaryOp.Type op = BAUtils.toBinaryOp(bno);
        push(BTSBinaryExp$.MODULE$.apply(op, lhs, rhs, toNone()));
    } else {
        if (BAUtils.isNoneEnumerator(ubo)) {
            push(lhs);
        } else {
            BAUtils.convertToUnaryExp(lhs, ubo);
        }
    }
    return false;
}
Also used : UnaryBooleanOperator(org.osate.ba.aadlba.UnaryBooleanOperator) BTSExp(org.sireum.hamr.ir.BTSExp) BinaryNumericOperator(org.osate.ba.aadlba.BinaryNumericOperator) BTSBinaryOp(org.sireum.hamr.ir.BTSBinaryOp)

Aggregations

UnaryBooleanOperator (org.osate.ba.aadlba.UnaryBooleanOperator)3 ENotificationImpl (org.eclipse.emf.ecore.impl.ENotificationImpl)2 BinaryNumericOperator (org.osate.ba.aadlba.BinaryNumericOperator)1 BTSBinaryOp (org.sireum.hamr.ir.BTSBinaryOp)1 BTSExp (org.sireum.hamr.ir.BTSExp)1