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