Search in sources :

Example 1 with VisitorLitmusAArch64

use of com.dat3m.dartagnan.parsers.program.visitors.VisitorLitmusAArch64 in project Dat3M by hernanponcedeleon.

the class ParserLitmusAArch64 method parse.

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

Aggregations

ParserErrorListener (com.dat3m.dartagnan.exception.ParserErrorListener)1 LitmusAArch64Lexer (com.dat3m.dartagnan.parsers.LitmusAArch64Lexer)1 LitmusAArch64Parser (com.dat3m.dartagnan.parsers.LitmusAArch64Parser)1 ProgramBuilder (com.dat3m.dartagnan.parsers.program.utils.ProgramBuilder)1 VisitorLitmusAArch64 (com.dat3m.dartagnan.parsers.program.visitors.VisitorLitmusAArch64)1 Program (com.dat3m.dartagnan.program.Program)1