use of com.rockwellcollins.atc.agree.agree.NamedID in project AGREE by loonwerks.
the class AgreeASTBuilder method caseExistsExpr.
@Override
public Expr caseExistsExpr(ExistsExpr expr) {
com.rockwellcollins.atc.agree.agree.Expr arrayExpr = expr.getArray();
Expr array = doSwitch(arrayExpr);
AgreeTypeSystem.TypeDef agreeType = AgreeTypeSystem.infer(arrayExpr);
int size = 0;
if (agreeType instanceof AgreeTypeSystem.ArrayTypeDef) {
size = ((AgreeTypeSystem.ArrayTypeDef) agreeType).size;
} else {
throw new AgreeException("ERROR: caseExistsExpr - '" + agreeType.getClass() + "' not handled");
}
NamedID binding = expr.getBinding();
Expr final_expr = new BoolExpr(false);
for (int i = 0; i < size; ++i) {
Expr arrayAccess = new ArrayAccessExpr(array, i);
Expr body = doSwitch(expr.getExpr()).accept(new SubstitutionVisitor(binding.getName(), arrayAccess));
final_expr = LustreExprFactory.makeORExpr(final_expr, body);
}
return final_expr;
}
use of com.rockwellcollins.atc.agree.agree.NamedID in project AGREE by loonwerks.
the class FoldRightExprImpl method basicSetAccumulator.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetAccumulator(NamedID newAccumulator, NotificationChain msgs) {
NamedID oldAccumulator = accumulator;
accumulator = newAccumulator;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, AgreePackage.FOLD_RIGHT_EXPR__ACCUMULATOR, oldAccumulator, newAccumulator);
if (msgs == null)
msgs = notification;
else
msgs.add(notification);
}
return msgs;
}
use of com.rockwellcollins.atc.agree.agree.NamedID in project AGREE by loonwerks.
the class ForallExprImpl method basicSetBinding.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetBinding(NamedID newBinding, NotificationChain msgs) {
NamedID oldBinding = binding;
binding = newBinding;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, AgreePackage.FORALL_EXPR__BINDING, oldBinding, newBinding);
if (msgs == null)
msgs = notification;
else
msgs.add(notification);
}
return msgs;
}
use of com.rockwellcollins.atc.agree.agree.NamedID in project AGREE by loonwerks.
the class ExistsExprImpl method basicSetBinding.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetBinding(NamedID newBinding, NotificationChain msgs) {
NamedID oldBinding = binding;
binding = newBinding;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, AgreePackage.EXISTS_EXPR__BINDING, oldBinding, newBinding);
if (msgs == null)
msgs = notification;
else
msgs.add(notification);
}
return msgs;
}
use of com.rockwellcollins.atc.agree.agree.NamedID in project AGREE by loonwerks.
the class FlatmapExprImpl method basicSetBinding.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetBinding(NamedID newBinding, NotificationChain msgs) {
NamedID oldBinding = binding;
binding = newBinding;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, AgreePackage.FLATMAP_EXPR__BINDING, oldBinding, newBinding);
if (msgs == null)
msgs = notification;
else
msgs.add(notification);
}
return msgs;
}
Aggregations