use of abs.frontend.ast.AppCond in project abstools by abstools.
the class ABSUnitTestCaseTranslator method buildProductLine.
void buildProductLine(ModuleDecl module) {
if (deltas.isEmpty()) {
return;
}
console("Generating product line description...");
productline = new ProductLine();
productline.setName(CONFIGURATION_NAME);
Feature feature = new Feature();
feature.setName(FEATURE_NAME);
productline.addFeature(feature);
AppCond ac = new AppCondFeature(FEATURE_NAME);
Set<String> applicationConditions = new HashSet<String>();
DeltaClause lastClause = null;
for (DeltaWrapper d : deltas) {
DeltaClause clause = new DeltaClause();
Deltaspec spec = new Deltaspec();
String name = d.getDelta().getName();
spec.setDeltaID(name);
clause.setDeltaspec(spec);
clause.setAppCond(ac);
if (d.isLast()) {
lastClause = clause;
} else {
applicationConditions.add(name);
}
productline.addDeltaClause(clause);
}
if (lastClause != null) {
for (String n : applicationConditions) {
lastClause.addAfterDeltaID(new DeltaID(n));
}
}
product = new ProductDecl();
product.setName(PRODUCT_NAME);
ProductFeatureSet featureSet = new ProductFeatureSet();
featureSet.addFeature(feature);
product.setProductExpr(featureSet);
}
Aggregations