Search in sources :

Example 1 with AsyncCall

use of abs.frontend.ast.AsyncCall in project abstools by abstools.

the class AbsASTBuilderUtil method getCall.

public static final Call getCall(PureExp who, String method, boolean sync, PureExp... exps) {
    Call call;
    if (sync) {
        call = new SyncCall();
    } else {
        call = new AsyncCall();
    }
    call.setCallee(who);
    call.setMethod(method);
    for (int i = 0; i < exps.length; i++) {
        call.setParam(exps[i], i);
    }
    return call;
}
Also used : Call(abs.frontend.ast.Call) AsyncCall(abs.frontend.ast.AsyncCall) SyncCall(abs.frontend.ast.SyncCall) SyncCall(abs.frontend.ast.SyncCall) AsyncCall(abs.frontend.ast.AsyncCall)

Example 2 with AsyncCall

use of abs.frontend.ast.AsyncCall 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))));
}
Also used : List(abs.frontend.ast.List) PureExp(abs.frontend.ast.PureExp) AsyncCall(abs.frontend.ast.AsyncCall) VarUse(abs.frontend.ast.VarUse)

Aggregations

AsyncCall (abs.frontend.ast.AsyncCall)2 Call (abs.frontend.ast.Call)1 List (abs.frontend.ast.List)1 PureExp (abs.frontend.ast.PureExp)1 SyncCall (abs.frontend.ast.SyncCall)1 VarUse (abs.frontend.ast.VarUse)1