use of com.dat3m.dartagnan.parsers.LitmusX86Parser in project Dat3M by hernanponcedeleon.
the class ParserLitmusX86 method parse.
@Override
public Program parse(CharStream charStream) {
LitmusX86Lexer lexer = new LitmusX86Lexer(charStream);
CommonTokenStream tokenStream = new CommonTokenStream(lexer);
LitmusX86Parser parser = new LitmusX86Parser(tokenStream);
parser.addErrorListener(new DiagnosticErrorListener(true));
parser.addErrorListener(new ParserErrorListener());
ProgramBuilder pb = new ProgramBuilder(SourceLanguage.LITMUS);
ParserRuleContext parserEntryPoint = parser.main();
VisitorLitmusX86 visitor = new VisitorLitmusX86(pb);
Program program = (Program) parserEntryPoint.accept(visitor);
program.setArch(Arch.TSO);
return program;
}
Aggregations