Example usage for org.antlr.v4.runtime.atn LexerATNSimulator getSharedContextCache

List of usage examples for org.antlr.v4.runtime.atn LexerATNSimulator getSharedContextCache

Introduction

In this page you can find the example usage for org.antlr.v4.runtime.atn LexerATNSimulator getSharedContextCache.

Prototype

public PredictionContextCache getSharedContextCache() 

Source Link

Usage

From source file:com.tunnelvisionlabs.postgresql.PostgreSqlLexerUtils.java

License:Open Source License

public static PostgreSqlLexer createLexer(CharStream input) {
    PostgreSqlLexer lexer = new PostgreSqlLexer(input);

    // Use the custom LexerATNSimulator to work around known bugs
    LexerATNSimulator interpreter = lexer.getInterpreter();
    interpreter = new PostgreSqlLexerAtnSimulator(lexer, interpreter.atn, interpreter.decisionToDFA,
            interpreter.getSharedContextCache());
    lexer.setInterpreter(interpreter);//from  w  ww .  j a v a2 s.co m

    return lexer;
}