Package com.mysql.clusterj.jdbc.antlr

Examples of com.mysql.clusterj.jdbc.antlr.QueuingErrorListener


    private CommonTree parse(String preparedSql) {
        CommonTree result = null;
        ANTLRNoCaseStringStream inputStream = new ANTLRNoCaseStringStream(preparedSql);
        MySQL51Lexer lexer = new MySQL51Lexer(inputStream);
        CommonTokenStream tokens = new CommonTokenStream(lexer);
        lexer.setErrorListener(new QueuingErrorListener(lexer));
        tokens.getTokens();
        if (lexer.getErrorListener().hasErrors()) {
            logger.warn(local.message("ERR_Lexing_SQ",preparedSql));
            return result;
        }
        PlaceholderNode.resetId();
        MySQL51Parser parser = new MySQL51Parser(tokens);
        parser.setTreeAdaptor(mySQLTreeAdaptor);
        parser.setErrorListener(new QueuingErrorListener(parser));
        try {
            CommonTree stmtTree = (CommonTree) parser.statement().getTree();
            result = stmtTree;
        } catch (RecognitionException e) {
            logger.warn(local.message("ERR_Parsing_SQL", preparedSql));
View Full Code Here

TOP

Related Classes of com.mysql.clusterj.jdbc.antlr.QueuingErrorListener

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.