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