/** * Converts the given ANTLR RecognitionException into a QuerySyntaxException. The RecognitionException * does not become the cause because ANTLR exceptions are not serializable. * * @param e The ANTLR exception * @param hql The query string * * @return The QuerySyntaxException */ public static QuerySyntaxException convert(RecognitionException e, String hql) { String positionInfo = e.getLine() > 0 && e.getColumn() > 0 ? " near line " + e.getLine() + ", column " + e.getColumn() : ""; return new QuerySyntaxException( e.getMessage() + positionInfo, hql ); }
rootDoc.put(packagePath, packageDoc); } catch (RecognitionException e) { log.error("ignored due to RecognitionException: " + filename + " [" + e.getMessage() + "]"); log.debug("ignored due to RecognitionException: " + filename + " [" + e.getMessage() + "]", e); } catch (TokenStreamException e) { log.error("ignored due to TokenStreamException: " + filename + " [" + e.getMessage() + "]");
throw new QueryException( e.getMessage(), e );
/** @deprecated As of ANTLR 2.7.0 */ public String getErrorMessage() { return getMessage(); }
public TokenStreamRecognitionException(RecognitionException re) { super(re.getMessage()); this.recog = re; }
public String getMessage() { return wrappedException.getMessage(); }
/** * Reports the given error. * @param ex encountered exception. */ public void reportError(RecognitionException ex) { Object[] args = { getFilename(), new Integer(ex.line), new Integer(ex.column), ex.getMessage() }; _logger.l7dlog(Level.ERROR, "PARSER_ERROR", args, ex); }
public String toString() { return FileLineFormatter.getFormatter(). getFormatString(fileName, line, column) + getMessage(); } }
@Override public void reportError(RecognitionException e) { throw new UnexpectedTokenException(e.getMessage(), e, e.getLine()); }
public void reportError(RecognitionException e) { throw new UnexpectedTokenException(e.getMessage(), e, e.getLine()); }
/** * Reports the given error. * * @param ex exception which caused the error. */ public void reportError(RecognitionException ex) { Object[] args = { getFilename(), new Integer(getLine()),new Integer(getColumn()), ex.getMessage() }; _logger.l7dlog(Level.ERROR, "PARSER_ERROR", args, ex); }
/** * Reports the given error. * * @param ex encountered exception. */ public void reportError(RecognitionException ex) { Integer line = new Integer((recognizer!=null?recognizer.getStartLine():0) +ex.getLine()); Integer column = new Integer((recognizer!=null?recognizer.getStartColumn():0) +ex.getColumn()); Object args[] = { getFilename(), line, column, ex.getMessage() }; _logger.l7dlog(Level.ERROR, "PARSER_ERROR", args, ex); }
public QuerySyntaxError(RecognitionException e) { super( e.getMessage() + ( ( e.getLine() > 0 && e.getColumn() > 0 ) ? ( " near line " + e.getLine() + ", column " + e.getColumn() ) : "" ), e ); }
/** * Reports the given error. * * @param ex exception which caused the error. */ public void reportError(RecognitionException ex) { ex.printStackTrace(); Integer line = new Integer((recognizer!=null?recognizer.getStartLine():0) +getLine()); Integer column = new Integer((recognizer!=null?recognizer.getStartColumn():0) +getColumn()); Object args[] = { getFilename(), line, column, ex.getMessage() }; _logger.l7dlog(Level.ERROR, "PARSER_ERROR" , args, ex); }
public static QuerySyntaxException convert(RecognitionException e, String hql) { String positionInfo = e.getLine() > 0 && e.getColumn() > 0 ? " near line " + e.getLine() + ", column " + e.getColumn() : ""; return new QuerySyntaxException( e.getMessage() + positionInfo, hql ); }
public QuerySyntaxError(RecognitionException e, String hql) { super( e.getMessage() + ( ( e.getLine() > 0 && e.getColumn() > 0 ) ? ( " near line " + e.getLine() + ", column " + e.getColumn() ) : "" ), e ); setQueryString( hql ); } }
public static QuerySyntaxException convert(RecognitionException e, String hql) { String positionInfo = e.getLine() > 0 && e.getColumn() > 0 ? " near line " + e.getLine() + ", column " + e.getColumn() : ""; return new QuerySyntaxException( e.getMessage() + positionInfo, hql ); }
public Message next() throws ParseException { try { return internalParser.next(); } catch (RecognitionException e) { throw new ParseException(e.getMessage(), e, e.getLine()); } catch (TokenStreamException e) { throw new ParseException(e.getMessage(), e, -1); } }
public static QuerySyntaxException convert(RecognitionException e, String hql) { String positionInfo = e.getLine() > 0 && e.getColumn() > 0 ? " near line " + e.getLine() + ", column " + e.getColumn() : ""; return new QuerySyntaxException( e.getMessage() + positionInfo, hql ); }
private Catalog parseCatalog(ExtendedCatalogParser parser) throws ParseException { try { parser.catalog(); } catch (RecognitionException e) { throw new UnexpectedTokenException(e.getMessage(), e, e.getLine()); } catch (TokenStreamException e) { throw new ParseException(e.getMessage(), e, -1); } return parser.getCatalog(); }