Search in sources :

Example 1 with LitmusLISALexer

use of com.dat3m.dartagnan.parsers.LitmusLISALexer 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;
}
Also used : Program(com.dat3m.dartagnan.program.Program) LitmusLISAParser(com.dat3m.dartagnan.parsers.LitmusLISAParser) VisitorLitmusLISA(com.dat3m.dartagnan.parsers.program.visitors.VisitorLitmusLISA) ProgramBuilder(com.dat3m.dartagnan.parsers.program.utils.ProgramBuilder) LitmusLISALexer(com.dat3m.dartagnan.parsers.LitmusLISALexer) ParserErrorListener(com.dat3m.dartagnan.exception.ParserErrorListener)

Aggregations

ParserErrorListener (com.dat3m.dartagnan.exception.ParserErrorListener)1 LitmusLISALexer (com.dat3m.dartagnan.parsers.LitmusLISALexer)1 LitmusLISAParser (com.dat3m.dartagnan.parsers.LitmusLISAParser)1 ProgramBuilder (com.dat3m.dartagnan.parsers.program.utils.ProgramBuilder)1 VisitorLitmusLISA (com.dat3m.dartagnan.parsers.program.visitors.VisitorLitmusLISA)1 Program (com.dat3m.dartagnan.program.Program)1