Search in sources :

Example 6 with JPA2Lexer

use of com.haulmont.cuba.core.sys.jpql.antlr2.JPA2Lexer in project cuba by cuba-platform.

the class Parser method createParser.

private static JPA2Parser createParser(String input) {
    if (input.contains("~"))
        throw new IllegalArgumentException("Input string cannot contain \"~\"");
    CharStream cs = new AntlrNoCaseStringStream(input);
    JPA2Lexer lexer = new JPA2Lexer(cs);
    TokenStream tstream = new CommonTokenStream(lexer);
    return new JPA2Parser(tstream);
}
Also used : CommonTokenStream(org.antlr.runtime.CommonTokenStream) CommonTokenStream(org.antlr.runtime.CommonTokenStream) TokenStream(org.antlr.runtime.TokenStream) JPA2Parser(com.haulmont.cuba.core.sys.jpql.antlr2.JPA2Parser) JPA2Lexer(com.haulmont.cuba.core.sys.jpql.antlr2.JPA2Lexer) CharStream(org.antlr.runtime.CharStream)

Aggregations

JPA2Lexer (com.haulmont.cuba.core.sys.jpql.antlr2.JPA2Lexer)6 JPA2Parser (com.haulmont.cuba.core.sys.jpql.antlr2.JPA2Parser)6 CharStream (org.antlr.runtime.CharStream)6 CommonTokenStream (org.antlr.runtime.CommonTokenStream)6 TokenStream (org.antlr.runtime.TokenStream)6 CommonTree (org.antlr.runtime.tree.CommonTree)5 Test (org.junit.Test)4 Ignore (org.junit.Ignore)1