Search in sources :

Example 1 with AsyncCall

use of org.abs_models.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 : SyncCall(org.abs_models.frontend.ast.SyncCall) Call(org.abs_models.frontend.ast.Call) AsyncCall(org.abs_models.frontend.ast.AsyncCall) SyncCall(org.abs_models.frontend.ast.SyncCall) AsyncCall(org.abs_models.frontend.ast.AsyncCall)

Example 2 with AsyncCall

use of org.abs_models.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(org.abs_models.frontend.ast.List) PureExp(org.abs_models.frontend.ast.PureExp) AsyncCall(org.abs_models.frontend.ast.AsyncCall) VarUse(org.abs_models.frontend.ast.VarUse)

Aggregations

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