use of abs.frontend.ast.DataConstructorExp in project abstools by abstools.
the class AnnotationTests method assertHasLocAnnotation.
private void assertHasLocAnnotation(Type t, String s) {
List<TypeAnnotation> anns = t.getTypeAnnotations();
TypeAnnotation a = anns.get(0);
assertEquals("LocationType", a.getType().getSimpleName());
assertEquals(s, ((DataConstructorExp) a.getValue()).getDecl().getName());
}
use of abs.frontend.ast.DataConstructorExp in project abstools by abstools.
the class PureExpressionBuilder method parseValue.
DataConstructorExp parseValue(String currentHeapReference, List<String> initialisationsOrders, String testName, Set<String> heap, ABSTerm term) {
final DataConstructorExp result = new DataConstructorExp();
String fn = getABSTermFunctor(term);
result.setConstructor(fn);
result.setParamList(new abs.frontend.ast.List<PureExp>());
List<ABSData> vs = getABSTermArgs(term);
for (int i = 0; i < vs.size(); i++) {
result.setParam(createPureExpression(currentHeapReference, initialisationsOrders, testName, heap, vs.get(i)), i);
}
return result;
}
use of abs.frontend.ast.DataConstructorExp in project abstools by abstools.
the class ASTBasedABSTestRunnerGenerator method generateMainBlockAST.
private MainBlock generateMainBlockAST(List<Import> list) {
final MainBlock block = new MainBlock();
DataConstructorExp empty = new DataConstructorExp("EmptySet", new List<>());
VarDeclStmt futsStatement = getVarDecl(futs, getType("Set", getFutUnitType()), empty);
block.addStmtNoTransform(futsStatement);
VarDeclStmt futStatement = getVarDecl(fut, getFutUnitType(), null);
block.addStmtNoTransform(futStatement);
Set<TypeUse> use = new HashSet<>();
for (InterfaceDecl key : tests.keySet()) {
for (ClassDecl clazz : tests.get(key)) {
use.addAll(generateTestClassImplAST(key, clazz, block));
}
}
block.addStmtNoTransform(generateWaitSyncAST());
return block;
}
use of abs.frontend.ast.DataConstructorExp in project abstools by abstools.
the class AnnotationHelper method getAnnotationsOfType.
public static java.util.List<Annotation> getAnnotationsOfType(List<Annotation> annos, String qualifiedName) {
ArrayList<Annotation> res = new ArrayList<>();
for (Annotation a : annos) {
if (a.getType().getQualifiedName().equals(qualifiedName)) {
DataConstructorExp de = (DataConstructorExp) a.getValue();
res.add(a);
}
}
return res;
}
Aggregations