use of com.dat3m.dartagnan.parsers.LitmusPPCLexer 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;
}
Aggregations