Search in sources :

Example 1 with EmptyCrossReference

use of com.progress.xref.EmptyCrossReference in project sonar-openedge by Riverside-Software.

the class C3Test method genericTest.

private void genericTest(String filename, boolean c3) throws IOException {
    try (InputStream input = Files.newInputStream(Paths.get(filename))) {
        ABLLexer lexer = new ABLLexer(session, ByteSource.wrap(ByteStreams.toByteArray(input)), filename, false);
        CommonTokenStream tokStream = new CommonTokenStream(lexer);
        Proparse parser = new Proparse(tokStream);
        if (c3)
            parser.initialize(session, new EmptyCrossReference(), true);
        else
            parser.initialize(session, new EmptyCrossReference());
        parser.setErrorHandler(new ProparseErrorStrategy(false, false, false));
        parser.getInterpreter().setPredictionMode(PredictionMode.LL);
        parser.program();
    }
}
Also used : Proparse(org.prorefactor.proparse.antlr4.Proparse) CommonTokenStream(org.antlr.v4.runtime.CommonTokenStream) ProparseErrorStrategy(org.prorefactor.proparse.ProparseErrorStrategy) EmptyCrossReference(com.progress.xref.EmptyCrossReference) InputStream(java.io.InputStream) ABLLexer(org.prorefactor.proparse.ABLLexer)

Aggregations

EmptyCrossReference (com.progress.xref.EmptyCrossReference)1 InputStream (java.io.InputStream)1 CommonTokenStream (org.antlr.v4.runtime.CommonTokenStream)1 ABLLexer (org.prorefactor.proparse.ABLLexer)1 ProparseErrorStrategy (org.prorefactor.proparse.ProparseErrorStrategy)1 Proparse (org.prorefactor.proparse.antlr4.Proparse)1