use of abs.frontend.ast.ProductDecl 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);
}
use of abs.frontend.ast.ProductDecl in project abstools by abstools.
the class DumpProducts method parse.
@Override
public Model parse(final String[] args) throws DeltaModellingException, IOException, WrongProgramArgumentException, ParserConfigurationException, InternalBackendException {
Model m = super.parse(args);
if (m.hasParserErrors()) {
// Main.parse() already printed a list of parse errors in this case.
throw new ParseException("Can't parse input.");
}
Iterator<ProductDecl> pi = m.getProductDecls().iterator();
while (pi.hasNext()) {
System.out.print(pi.next().getName());
if (pi.hasNext())
System.out.print(' ');
}
return m;
}
Aggregations