String localModelName = baseProcessor.getImportLocalName(toplevelDecl);
if (localModelName != null)
environment.getRenamings().add(0, new Renaming(Collections.<String>emptyList(), localModelName, FileCommands.fileName(modulePath)));
} else {
IStrategoTerm appl = baseLanguage.getTransformationApplication(toplevelDecl);
IStrategoTerm model = getApplicationSubterm(appl, "TransApp", 1);
IStrategoTerm transformation = getApplicationSubterm(appl, "TransApp", 0);
ImportCommands imp = new ImportCommands(baseProcessor, environment, this, driverResult, new STRCommands(strParser, strCache, environment, baseProcessor));
Pair<String, Boolean> transformationResult = imp.transformModel(model, transformation, toplevelDecl);
if (transformationResult == null)
return ;
modulePath = transformationResult.a;
isCircularImport = transformationResult.b;
String localModelName = baseProcessor.getImportLocalName(toplevelDecl);
if (localModelName != null)
environment.getRenamings().add(0, new Renaming(Collections.<String>emptyList(), localModelName, FileCommands.fileName(modulePath)));
else
environment.getRenamings().add(0, new Renaming(ImportCommands.getTransformationApplicationModelPath(appl, baseProcessor), modulePath));
IStrategoTerm reconstructedImport = baseProcessor.reconstructImport(modulePath, toplevelDecl);
desugaredBodyDecls.remove(toplevelDecl);
desugaredBodyDecls.add(reconstructedImport);
toplevelDecl = reconstructedImport;
}