Package persistence.antlr

Examples of persistence.antlr.MismatchedCharException


     */
    //gf1166 Wrap ANTLRException inside EJBQLException
    protected EJBQLException handleANTLRException(ANTLRException ex) {
        EJBQLException result = null;
        if (ex instanceof MismatchedCharException) {
            MismatchedCharException mismatched = (MismatchedCharException)ex;
            if (mismatched.foundChar == EOF_CHAR) {
                result = EJBQLException.unexpectedEOF(getQueryInfo(),
                    mismatched.getLine(), mismatched.getColumn(), ex);
            } else if (mismatched.mismatchType == MismatchedCharException.CHAR) {
                result = EJBQLException.expectedCharFound(getQueryInfo(),
                    mismatched.getLine(), mismatched.getColumn(),
                    String.valueOf((char)mismatched.expecting),
                    String.valueOf((char)mismatched.foundChar),
                    ex);
            }
        }
        else if (ex instanceof MismatchedTokenException) {
            MismatchedTokenException mismatched = (MismatchedTokenException)ex;
            Token token = mismatched.token;
            if (token != null) {
                if (token.getType() == Token.EOF_TYPE) {
                    result = EJBQLException.unexpectedEOF(getQueryInfo(),
                        mismatched.getLine(), mismatched.getColumn(), ex);
                }
                else {
                    result = EJBQLException.syntaxErrorAt(getQueryInfo(),
                        mismatched.getLine(), mismatched.getColumn(),
                        token.getText(), ex);
                }
            }
        }
        else if (ex instanceof NoViableAltException) {
View Full Code Here

TOP

Related Classes of persistence.antlr.MismatchedCharException

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.