Search in sources :

Example 1 with AppCond

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);
}
Also used : ProductDecl(abs.frontend.ast.ProductDecl) ProductFeatureSet(abs.frontend.ast.ProductFeatureSet) Feature(abs.frontend.ast.Feature) AppCondFeature(abs.frontend.ast.AppCondFeature) AppCondFeature(abs.frontend.ast.AppCondFeature) DeltaClause(abs.frontend.ast.DeltaClause) DeltaWrapper(apet.absunit.DeltaForGetSetFieldsBuilder.DeltaWrapper) Deltaspec(abs.frontend.ast.Deltaspec) DeltaID(abs.frontend.ast.DeltaID) AppCond(abs.frontend.ast.AppCond) ProductLine(abs.frontend.ast.ProductLine) HashSet(java.util.HashSet)

Aggregations

AppCond (abs.frontend.ast.AppCond)1 AppCondFeature (abs.frontend.ast.AppCondFeature)1 DeltaClause (abs.frontend.ast.DeltaClause)1 DeltaID (abs.frontend.ast.DeltaID)1 Deltaspec (abs.frontend.ast.Deltaspec)1 Feature (abs.frontend.ast.Feature)1 ProductDecl (abs.frontend.ast.ProductDecl)1 ProductFeatureSet (abs.frontend.ast.ProductFeatureSet)1 ProductLine (abs.frontend.ast.ProductLine)1 DeltaWrapper (apet.absunit.DeltaForGetSetFieldsBuilder.DeltaWrapper)1 HashSet (java.util.HashSet)1