Search in sources :

Example 1 with Program

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

the class AliasAnalysisTest method analyze.

private AliasAnalysis analyze(ProgramBuilder builder, Alias method) throws InvalidConfigurationException {
    Program program = builder.build();
    LoopUnrolling.newInstance().run(program);
    Compilation.newInstance().run(program);
    return AliasAnalysis.fromConfig(program, Configuration.builder().setOption(ALIAS_METHOD, method.asStringOption()).build());
}
Also used : Program(com.dat3m.dartagnan.program.Program)

Example 2 with Program

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

the class ParserBoogie method parse.

@Override
public Program parse(CharStream charStream) {
    BoogieLexer lexer = new BoogieLexer(charStream);
    CommonTokenStream tokenStream = new CommonTokenStream(lexer);
    BoogieParser parser = new BoogieParser(tokenStream);
    parser.addErrorListener(new ParserErrorListener());
    ProgramBuilder pb = new ProgramBuilder(SourceLanguage.BOOGIE);
    ParserRuleContext parserEntryPoint = parser.main();
    VisitorBoogie visitor = new VisitorBoogie(pb);
    Program program = (Program) parserEntryPoint.accept(visitor);
    return program;
}
Also used : BoogieLexer(com.dat3m.dartagnan.parsers.BoogieLexer) Program(com.dat3m.dartagnan.program.Program) ProgramBuilder(com.dat3m.dartagnan.parsers.program.utils.ProgramBuilder) BoogieParser(com.dat3m.dartagnan.parsers.BoogieParser) VisitorBoogie(com.dat3m.dartagnan.parsers.program.visitors.boogie.VisitorBoogie) ParserErrorListener(com.dat3m.dartagnan.exception.ParserErrorListener)

Example 3 with Program

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

the class ParserLitmusC method parse.

@Override
public Program parse(CharStream charStream) {
    LitmusCLexer lexer = new LitmusCLexer(charStream);
    CommonTokenStream tokenStream = new CommonTokenStream(lexer);
    LitmusCParser parser = new LitmusCParser(tokenStream);
    parser.setErrorHandler(new BailErrorStrategy());
    ProgramBuilder pb = new ProgramBuilder(SourceLanguage.LITMUS);
    ParserRuleContext parserEntryPoint = parser.main();
    VisitorLitmusC visitor = new VisitorLitmusC(pb);
    Program program = (Program) parserEntryPoint.accept(visitor);
    program.setArch(Arch.LKMM);
    return program;
}
Also used : LitmusCLexer(com.dat3m.dartagnan.parsers.LitmusCLexer) Program(com.dat3m.dartagnan.program.Program) LitmusCParser(com.dat3m.dartagnan.parsers.LitmusCParser) ProgramBuilder(com.dat3m.dartagnan.parsers.program.utils.ProgramBuilder) VisitorLitmusC(com.dat3m.dartagnan.parsers.program.visitors.VisitorLitmusC)

Example 4 with Program

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

the class ParserLitmusLISA method parse.

@Override
public Program parse(CharStream charStream) {
    LitmusLISALexer lexer = new LitmusLISALexer(charStream);
    CommonTokenStream tokenStream = new CommonTokenStream(lexer);
    LitmusLISAParser parser = new LitmusLISAParser(tokenStream);
    parser.addErrorListener(new DiagnosticErrorListener(true));
    parser.addErrorListener(new ParserErrorListener());
    ProgramBuilder pb = new ProgramBuilder(SourceLanguage.LITMUS);
    ParserRuleContext parserEntryPoint = parser.main();
    VisitorLitmusLISA visitor = new VisitorLitmusLISA(pb);
    Program program = (Program) parserEntryPoint.accept(visitor);
    return program;
}
Also used : Program(com.dat3m.dartagnan.program.Program) LitmusLISAParser(com.dat3m.dartagnan.parsers.LitmusLISAParser) VisitorLitmusLISA(com.dat3m.dartagnan.parsers.program.visitors.VisitorLitmusLISA) ProgramBuilder(com.dat3m.dartagnan.parsers.program.utils.ProgramBuilder) LitmusLISALexer(com.dat3m.dartagnan.parsers.LitmusLISALexer) ParserErrorListener(com.dat3m.dartagnan.exception.ParserErrorListener)

Example 5 with Program

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

the class ParserLitmusPPC method parse.

@Override
public Program parse(CharStream charStream) {
    LitmusPPCLexer lexer = new LitmusPPCLexer(charStream);
    CommonTokenStream tokenStream = new CommonTokenStream(lexer);
    LitmusPPCParser parser = new LitmusPPCParser(tokenStream);
    parser.addErrorListener(new DiagnosticErrorListener(true));
    parser.addErrorListener(new ParserErrorListener());
    ProgramBuilder pb = new ProgramBuilder(SourceLanguage.LITMUS);
    ParserRuleContext parserEntryPoint = parser.main();
    VisitorLitmusPPC visitor = new VisitorLitmusPPC(pb);
    Program program = (Program) parserEntryPoint.accept(visitor);
    program.setArch(Arch.POWER);
    return program;
}
Also used : VisitorLitmusPPC(com.dat3m.dartagnan.parsers.program.visitors.VisitorLitmusPPC) Program(com.dat3m.dartagnan.program.Program) ProgramBuilder(com.dat3m.dartagnan.parsers.program.utils.ProgramBuilder) LitmusPPCLexer(com.dat3m.dartagnan.parsers.LitmusPPCLexer) LitmusPPCParser(com.dat3m.dartagnan.parsers.LitmusPPCParser) ParserErrorListener(com.dat3m.dartagnan.exception.ParserErrorListener)

Aggregations

Program (com.dat3m.dartagnan.program.Program)41 Test (org.junit.Test)22 File (java.io.File)21 ProgramParser (com.dat3m.dartagnan.parsers.program.ProgramParser)20 ProgramBuilder (com.dat3m.dartagnan.parsers.program.utils.ProgramBuilder)10 Printer (com.dat3m.dartagnan.utils.printer.Printer)8 VerificationTask (com.dat3m.dartagnan.verification.VerificationTask)6 Configuration (org.sosy_lab.common.configuration.Configuration)6 ParserErrorListener (com.dat3m.dartagnan.exception.ParserErrorListener)5 Compilation (com.dat3m.dartagnan.program.processing.compilation.Compilation)5 Collectors (java.util.stream.Collectors)5 SolverContext (org.sosy_lab.java_smt.api.SolverContext)5 ParserCat (com.dat3m.dartagnan.parsers.cat.ParserCat)4 Tag (com.dat3m.dartagnan.program.event.Tag)4 Event (com.dat3m.dartagnan.program.event.core.Event)4 Result (com.dat3m.dartagnan.utils.Result)4 Wmm (com.dat3m.dartagnan.wmm.Wmm)4 InvalidConfigurationException (org.sosy_lab.common.configuration.InvalidConfigurationException)4 ProverEnvironment (org.sosy_lab.java_smt.api.ProverEnvironment)4 FilterBasic (com.dat3m.dartagnan.program.filter.FilterBasic)3