use of abs.frontend.ast.List in project abstools by abstools.
the class ASTBasedABSTestRunnerGenerator method generateAsyncTestCallAST.
private void generateAsyncTestCallAST(Block block, String objectRef, MethodSig method) {
List<PureExp> args = new List<>();
if (method.getNumParam() > 0) {
args.add(new VarUse(dataValue));
}
block.addStmtNoTransform(getVAssign(fut, new AsyncCall(new VarUse(objectRef), method.getName(), args)));
block.addStmtNoTransform(getVAssign(futs, getFnApp("Insert", new VarUse(fut), new VarUse(futs))));
}
use of abs.frontend.ast.List 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