use of abs.frontend.ast.Import in project abstools by abstools.
the class AbsASTBuilderUtil method generateImportAST.
public static final Set<Import> generateImportAST(TypeUse t) {
Set<Import> imports = new HashSet<>();
imports.add(generateImportAST(t.getName(), t.getModuleDecl().getName()));
if (t instanceof ParametricDataTypeUse) {
for (TypeUse st : ((ParametricDataTypeUse) t).getParams()) {
imports.addAll(generateImportAST(st));
}
}
return imports;
}
use of abs.frontend.ast.Import 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