Search in sources :

Example 1 with SyncCall

use of abs.frontend.ast.SyncCall 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 SyncCall

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

the class ASTBasedABSTestRunnerGenerator method generateDataPointsAST.

private TypeUse generateDataPointsAST(InterfaceDecl key, ClassDecl clazz, Set<TypeUse> use, MainBlock block) {
    MethodSig dataPoint = findDataPoints(key);
    if (dataPoint == null) {
        return null;
    }
    Access rt = dataPoint.getReturnType();
    if (!(rt instanceof ParametricDataTypeUse)) {
        return null;
    }
    ParametricDataTypeUse prt = (ParametricDataTypeUse) rt;
    if (!prt.getName().equals("Set")) {
        return null;
    }
    // Set has only one type parameter
    TypeUse u = (TypeUse) prt.getParam(0).copy();
    use.add(u);
    String objName = uncap(clazz.getName()) + "dataPoint";
    String dataSet = dataPointSetName(clazz);
    block.addStmtNoTransform(newObj(key, clazz, objName, true));
    block.addStmtNoTransform(getVarDecl(dataSet, prt.copy(), new SyncCall(new VarUse(objName), dataPoint.getName(), new List<>())));
    return u;
}
Also used : MethodSig(abs.frontend.ast.MethodSig) TypeUse(abs.frontend.ast.TypeUse) ParametricDataTypeUse(abs.frontend.ast.ParametricDataTypeUse) DataTypeUse(abs.frontend.ast.DataTypeUse) SyncCall(abs.frontend.ast.SyncCall) Access(abs.frontend.ast.Access) VarUse(abs.frontend.ast.VarUse) ParametricDataTypeUse(abs.frontend.ast.ParametricDataTypeUse)

Aggregations

SyncCall (abs.frontend.ast.SyncCall)2 Access (abs.frontend.ast.Access)1 AsyncCall (abs.frontend.ast.AsyncCall)1 Call (abs.frontend.ast.Call)1 DataTypeUse (abs.frontend.ast.DataTypeUse)1 MethodSig (abs.frontend.ast.MethodSig)1 ParametricDataTypeUse (abs.frontend.ast.ParametricDataTypeUse)1 TypeUse (abs.frontend.ast.TypeUse)1 VarUse (abs.frontend.ast.VarUse)1