use of com.dat3m.dartagnan.wmm.relation.Relation in project Dat3M by hernanponcedeleon.
the class VisitorBase method visitAxiomDefinition.
@Override
public Object visitAxiomDefinition(CatParser.AxiomDefinitionContext ctx) {
try {
Relation r = ctx.e.accept(relationVisitor);
if (r == null) {
throw new ParsingException(ctx.getText());
}
Constructor<?> constructor = ctx.cls.getConstructor(Relation.class);
wmm.addAxiom((Axiom) constructor.newInstance(r));
} catch (NoSuchMethodException | InstantiationException | IllegalAccessException | InvocationTargetException e) {
throw new ParsingException(ctx.getText());
}
return null;
}
use of com.dat3m.dartagnan.wmm.relation.Relation in project Dat3M by hernanponcedeleon.
the class VisitorBase method visitLetRecAndDefinition.
@Override
public Object visitLetRecAndDefinition(CatParser.LetRecAndDefinitionContext ctx) {
RecursiveRelation rRecursive = (RecursiveRelation) relationRepository.getRelation(RecursiveRelation.class, ctx.n.getText());
Relation rConcrete = ctx.e.accept(relationVisitor);
if (rRecursive == null || rConcrete == null) {
throw new ParsingException(ctx.getText());
}
rRecursive.setConcreteRelation(rConcrete);
recursiveGroup.add(rRecursive);
return null;
}
use of com.dat3m.dartagnan.wmm.relation.Relation in project Dat3M by hernanponcedeleon.
the class VisitorBase method visitLetDefinition.
@Override
public Object visitLetDefinition(CatParser.LetDefinitionContext ctx) {
Relation r = ctx.e.accept(relationVisitor);
if (r != null) {
r.setName(ctx.n.getText());
relationRepository.updateRelation(r);
} else {
FilterAbstract f = ctx.e.accept(filterVisitor);
f.setName(ctx.n.getText());
wmm.addFilter(f);
}
return null;
}
use of com.dat3m.dartagnan.wmm.relation.Relation in project Dat3M by hernanponcedeleon.
the class VisitorBase method visitLetRecDefinition.
@Override
public Object visitLetRecDefinition(CatParser.LetRecDefinitionContext ctx) {
recursiveGroup = new HashSet<>();
recursiveDef = true;
RecursiveRelation rRecursive = (RecursiveRelation) relationRepository.getRelation(RecursiveRelation.class, ctx.n.getText());
Relation rConcrete = ctx.e.accept(relationVisitor);
if (rRecursive == null || rConcrete == null) {
throw new ParsingException(ctx.getText());
}
rRecursive.setConcreteRelation(rConcrete);
recursiveGroup.add(rRecursive);
for (CatParser.LetRecAndDefinitionContext c : ctx.letRecAndDefinition()) {
c.accept(this);
}
wmm.addRecursiveGroup(recursiveGroup);
recursiveDef = false;
return null;
}
use of com.dat3m.dartagnan.wmm.relation.Relation in project Dat3M by hernanponcedeleon.
the class VisitorRelation method visitBinaryRelation.
private Relation visitBinaryRelation(CatParser.ExpressionContext e1, CatParser.ExpressionContext e2, Class<?> c) {
Relation r1 = e1.accept(this);
Relation r2 = e2.accept(this);
if (r1 != null && r2 != null) {
return base.relationRepository.getRelation(c, r1, r2);
}
return null;
}
Aggregations