exptokseq[i] = jj_expentries.get(i); return new ParseException(token, exptokseq, tokenImage);
retval += add_escapes(tok.image); retval += " \""; tok = tok.next;
private static String generateMessage(ParseException e, String statement, Integer line, Integer column) { StringBuilder result = new StringBuilder(); result.append("Error parsing query:\n"); String[] stmLines = statement.split("\n"); for (int i = 0; i < stmLines.length; i++) { result.append(stmLines[i]); result.append("\n"); if (i == line - 1) { for (int c = 0; c < column - 1; c++) { result.append(' '); } result.append("^\n"); } } result.append(e.getMessage()); return result.toString(); }
/** * This constructor is used by the method "generateParseException" * in the generated parser. Calling this constructor generates * a new object of this type with the fields "currentToken", * "expectedTokenSequences", and "tokenImage" set. */ public ParseException(Token currentTokenVal, int[][] expectedTokenSequencesVal, String[] tokenImageVal ) { super(initialise(currentTokenVal, expectedTokenSequencesVal, tokenImageVal)); currentToken = currentTokenVal; expectedTokenSequences = expectedTokenSequencesVal; tokenImage = tokenImageVal; }
private Query getQuery(OIndexDefinition index, String query, ODocument metadata, Analyzer queryAnalyzer, String[] fields, Map<String, OType> types) throws ParseException { Map<String, Float> boost = Optional.ofNullable(metadata.<Map<String, Float>>getProperty("boost")).orElse(new HashMap<>()); Analyzer analyzer = Optional.ofNullable(metadata.<Boolean>getProperty("customAnalysis")).filter(b -> b == true) .map(b -> analyzerFactory.createAnalyzer(index, OLuceneAnalyzerFactory.AnalyzerKind.QUERY, metadata)).orElse(queryAnalyzer); final OLuceneMultiFieldQueryParser queryParser = new OLuceneMultiFieldQueryParser(types, fields, analyzer, boost); queryParser.setAllowLeadingWildcard( Optional.ofNullable(metadata.<Boolean>getProperty("allowLeadingWildcard")).orElse(allowLeadingWildcard)); queryParser.setSplitOnWhitespace( Optional.ofNullable(metadata.<Boolean>getProperty("splitOnWhitespace")).orElse(splitOnWhitespace)); // TODO REMOVED // queryParser.setLowercaseExpandedTerms( // Optional.ofNullable(metadata.<Boolean>getProperty("lowercaseExpandedTerms")) // .orElse(lowercaseExpandedTerms)); try { return queryParser.parse(query); } catch (org.apache.lucene.queryparser.classic.ParseException e) { OLogManager.instance().error(this, "Exception is suppressed, original exception is ", e); //noinspection ThrowInsideCatchBlockWhichIgnoresCaughtException throw new ParseException(e.getMessage()); } }
public Object executeInContext(final OCommandContext iContext, final Map<Object, Object> iArgs) { final String language = request.getLanguage(); parserText = request.getText(); parameters = iArgs; parameters = iArgs; if (language.equalsIgnoreCase("SQL")) { // SPECIAL CASE: EXECUTE THE COMMANDS IN SEQUENCE try { parserText = preParse(parserText, iArgs); } catch (ParseException e) { throw OException.wrapException(new OCommandExecutionException("Invalid script:" + e.getMessage()), e); } return executeSQL(); } else { return executeJsr223Script(language, iContext, iArgs); } }
jj_la1[197] = jj_gen; jj_consume_token(-1); throw new ParseException();
jj_la1[183] = jj_gen; jj_consume_token(-1); throw new ParseException();
jj_la1[167] = jj_gen; jj_consume_token(-1); throw new ParseException(); jj_la1[168] = jj_gen; jj_consume_token(-1); throw new ParseException();
jj_la1[202] = jj_gen; jj_consume_token(-1); throw new ParseException();
jj_la1[3] = jj_gen; jj_consume_token(-1); throw new ParseException();
jj_la1[138] = jj_gen; jj_consume_token(-1); throw new ParseException(); jj_la1[139] = jj_gen; jj_consume_token(-1); throw new ParseException();
jj_la1[157] = jj_gen; jj_consume_token(-1); throw new ParseException();
jj_la1[115] = jj_gen; jj_consume_token(-1); throw new ParseException(); jj_la1[116] = jj_gen; jj_consume_token(-1); throw new ParseException(); jj_la1[119] = jj_gen; jj_consume_token(-1); throw new ParseException();
jj_la1[252] = jj_gen; jj_consume_token(-1); throw new ParseException(); jj_la1[253] = jj_gen; jj_consume_token(-1); throw new ParseException(); jj_la1[254] = jj_gen; jj_consume_token(-1); throw new ParseException();
jj_la1[203] = jj_gen; jj_consume_token(-1); throw new ParseException(); jj_la1[204] = jj_gen; jj_consume_token(-1); throw new ParseException();
} else { jj_consume_token(-1); throw new ParseException();
} else { jj_consume_token(-1); throw new ParseException(); } else { jj_consume_token(-1); throw new ParseException(); jj_la1[207] = jj_gen; jj_consume_token(-1); throw new ParseException();
jj_la1[414] = jj_gen; jj_consume_token(-1); throw new ParseException();
jj_la1[306] = jj_gen; jj_consume_token(-1); throw new ParseException();