}
}
}
private static IStrategoAppl composeDefinitions(IStrategoAppl base, List<IStrategoTerm> extensions) {
IStrategoConstructor cons = base.getConstructor();
if (cons.getName().equals("Module") && cons.getArity() == 3) {
ITermFactory factory = Environment.getTermFactory();
List<IStrategoTerm> allDefinitions = new ArrayList<IStrategoTerm>();
addAll(allDefinitions, (IStrategoList) termAt(base, 2));
allDefinitions.addAll(extensions);
return factory.makeAppl(cons, termAt(base, 0), termAt(base, 1), factory.makeList(allDefinitions));