use of abs.frontend.ast.StarImport in project abstools by abstools.
the class ABSUnitTestCaseTranslator method addImports.
private void addImports(ModuleDecl module) {
// export *;
// import * from AbsUnit;
// import * from AbsUnit.Hamcrest;
// import * from AbsUnit.Hamcrest.Core;
module.addExport(new StarExport());
module.addImport(new StarImport("AbsUnit"));
module.addImport(new StarImport("AbsUnit.Hamcrest"));
module.addImport(new StarImport("AbsUnit.Hamcrest.Core"));
for (String ip : importModules) {
module.addImport(new StarImport(ip));
}
}
use of abs.frontend.ast.StarImport in project abstools by abstools.
the class ASTBasedABSTestRunnerGenerator method generateImportsAST.
private List<Import> generateImportsAST() {
List<Import> imports = new List<>();
Set<String> mn = new HashSet<>();
Set<String> qn = new HashSet<>();
for (InterfaceDecl key : tests.keySet()) {
getImportsFrom(mn, qn, key.getModuleDecl());
for (ClassDecl clazz : tests.get(key)) {
getImportsFrom(mn, qn, clazz.getModuleDecl());
}
}
for (String m : mn) {
imports.add(new StarImport(m));
}
if (!qn.isEmpty()) {
List<Name> names = new List<>();
for (String q : qn) {
names.add(new Name(q));
}
imports.add(new NamedImport(names));
}
return imports;
}
Aggregations