Search in sources :

Example 1 with Location

use of com.dat3m.dartagnan.program.memory.Location in project Dat3M by hernanponcedeleon.

the class VisitorLitmusAssertions method acceptAssertionValue.

private LastValueInterface acceptAssertionValue(LitmusAssertionsParser.AssertionValueContext ctx, boolean right) {
    if (ctx.constant() != null) {
        return new IValue(new BigInteger(ctx.constant().getText()), ARCH_PRECISION);
    }
    String name = ctx.varName().getText();
    if (ctx.threadId() != null) {
        return programBuilder.getOrErrorRegister(ctx.threadId().id, name);
    }
    MemoryObject base = programBuilder.getObject(name);
    checkState(base != null, "uninitialized location %s", name);
    TerminalNode offset = ctx.DigitSequence();
    int o = offset == null ? 0 : Integer.parseInt(offset.getText());
    return right && offset == null ? base : new Location(name, base, o);
}
Also used : IValue(com.dat3m.dartagnan.expression.IValue) MemoryObject(com.dat3m.dartagnan.program.memory.MemoryObject) BigInteger(java.math.BigInteger) TerminalNode(org.antlr.v4.runtime.tree.TerminalNode) Location(com.dat3m.dartagnan.program.memory.Location)

Aggregations

IValue (com.dat3m.dartagnan.expression.IValue)1 Location (com.dat3m.dartagnan.program.memory.Location)1 MemoryObject (com.dat3m.dartagnan.program.memory.MemoryObject)1 BigInteger (java.math.BigInteger)1 TerminalNode (org.antlr.v4.runtime.tree.TerminalNode)1