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));
}
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;
}
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;
}
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));
}
Aggregations