Index: lucene/src/test/org/apache/lucene/queryParser/TestQueryParser.java =================================================================== --- lucene/src/test/org/apache/lucene/queryParser/TestQueryParser.java (revision 984862) +++ lucene/src/test/org/apache/lucene/queryParser/TestQueryParser.java (working copy) @@ -54,6 +54,7 @@ import org.apache.lucene.search.PhraseQuery; import org.apache.lucene.search.PrefixQuery; import org.apache.lucene.search.Query; +import org.apache.lucene.search.RegexpQuery; import org.apache.lucene.search.TermRangeQuery; import org.apache.lucene.search.ScoreDoc; import org.apache.lucene.search.TermQuery; @@ -1053,6 +1054,16 @@ } + public void testRegexps() throws Exception { + QueryParser qp = new QueryParser(TEST_VERSION_CURRENT, "field", new MockAnalyzer(MockTokenizer.WHITESPACE, false)); + Query q = new RegexpQuery(new Term("field", "[a-z][123]")); + assertEquals(q, qp.parse("/[a-z][123]/")); + qp.setLowercaseExpandedTerms(true); + assertEquals(q, qp.parse("/[A-Z][123]/")); + q.setBoost(0.5f); + assertEquals(q, qp.parse("/[A-Z][123]/^0.5")); + } + public void testStopwords() throws Exception { CharacterRunAutomaton stopSet = new CharacterRunAutomaton(new RegExp("the|foo").toAutomaton()); QueryParser qp = new QueryParser(TEST_VERSION_CURRENT, "a", new MockAnalyzer(MockTokenizer.SIMPLE, true, stopSet, true)); Index: lucene/src/java/org/apache/lucene/queryParser/QueryParserConstants.java =================================================================== --- lucene/src/java/org/apache/lucene/queryParser/QueryParserConstants.java (revision 984862) +++ lucene/src/java/org/apache/lucene/queryParser/QueryParserConstants.java (working copy) @@ -53,27 +53,29 @@ /** RegularExpression Id. */ int WILDTERM = 22; /** RegularExpression Id. */ - int RANGEIN_START = 23; + int REGEXPTERM = 23; /** RegularExpression Id. */ - int RANGEEX_START = 24; + int RANGEIN_START = 24; /** RegularExpression Id. */ - int NUMBER = 25; + int RANGEEX_START = 25; /** RegularExpression Id. */ - int RANGEIN_TO = 26; + int NUMBER = 26; /** RegularExpression Id. */ - int RANGEIN_END = 27; + int RANGEIN_TO = 27; /** RegularExpression Id. */ - int RANGEIN_QUOTED = 28; + int RANGEIN_END = 28; /** RegularExpression Id. */ - int RANGEIN_GOOP = 29; + int RANGEIN_QUOTED = 29; /** RegularExpression Id. */ - int RANGEEX_TO = 30; + int RANGEIN_GOOP = 30; /** RegularExpression Id. */ - int RANGEEX_END = 31; + int RANGEEX_TO = 31; /** RegularExpression Id. */ - int RANGEEX_QUOTED = 32; + int RANGEEX_END = 32; /** RegularExpression Id. */ - int RANGEEX_GOOP = 33; + int RANGEEX_QUOTED = 33; + /** RegularExpression Id. */ + int RANGEEX_GOOP = 34; /** Lexical state. */ int Boost = 0; @@ -109,6 +111,7 @@ "", "", "", + "", "\"[\"", "\"{\"", "", Index: lucene/src/java/org/apache/lucene/queryParser/QueryParser.java =================================================================== --- lucene/src/java/org/apache/lucene/queryParser/QueryParser.java (revision 984862) +++ lucene/src/java/org/apache/lucene/queryParser/QueryParser.java (working copy) @@ -29,6 +29,7 @@ import org.apache.lucene.search.MultiPhraseQuery; import org.apache.lucene.search.PhraseQuery; import org.apache.lucene.search.PrefixQuery; +import org.apache.lucene.search.RegexpQuery; import org.apache.lucene.search.Query; import org.apache.lucene.search.TermRangeQuery; import org.apache.lucene.search.TermQuery; @@ -862,6 +863,17 @@ } /** + * Builds a new RegexpQuery instance + * @param prefix Regexp term + * @return new RegexpQuery instance + */ + protected Query newRegexpQuery(Term regexp) { + RegexpQuery query = new RegexpQuery(regexp); + query.setRewriteMethod(multiTermRewriteMethod); + return query; + } + + /** * Builds a new FuzzyQuery instance * @param term Term * @param minimumSimilarity minimum similarity @@ -986,6 +998,35 @@ } /** + * Factory method for generating a query. Called when parser + * parses an input term token that contains a regular expression + * query. + *

+ * Depending on settings, pattern term may be lower-cased + * automatically. It will not go through the default Analyzer, + * however, since normal Analyzers are unlikely to work properly + * with regular expression templates. + *

+ * Can be overridden by extending classes, to provide custom handling for + * regular expression queries, which may be necessary due to missing analyzer + * calls. + * + * @param field Name of the field query will use. + * @param termStr Term token that contains a regular expression + * + * @return Resulting {@link Query} built for the term + * @exception ParseException throw in overridden method to disallow + */ + protected Query getRegexpQuery(String field, String termStr) throws ParseException + { + if (lowercaseExpandedTerms) { + termStr = termStr.toLowerCase(); + } + Term t = new Term(field, termStr); + return newRegexpQuery(t); + } + + /** * Factory method for generating a query (similar to * {@link #getWildcardQuery}). Called when parser parses an input term * token that uses prefix notation; that is, contains a single '*' wildcard @@ -1234,6 +1275,7 @@ case TERM: case PREFIXTERM: case WILDTERM: + case REGEXPTERM: case RANGEIN_START: case RANGEEX_START: case NUMBER: @@ -1285,6 +1327,7 @@ case TERM: case PREFIXTERM: case WILDTERM: + case REGEXPTERM: case RANGEIN_START: case RANGEEX_START: case NUMBER: @@ -1325,12 +1368,14 @@ boolean prefix = false; boolean wildcard = false; boolean fuzzy = false; + boolean regexp = false; Query q; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case STAR: case TERM: case PREFIXTERM: case WILDTERM: + case REGEXPTERM: case NUMBER: switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case TERM: @@ -1348,6 +1393,10 @@ term = jj_consume_token(WILDTERM); wildcard=true; break; + case REGEXPTERM: + term = jj_consume_token(REGEXPTERM); + regexp=true; + break; case NUMBER: term = jj_consume_token(NUMBER); break; @@ -1390,6 +1439,9 @@ q = getPrefixQuery(field, discardEscapeChar(term.image.substring (0, term.image.length()-1))); + } else if (regexp) { + q = getRegexpQuery(field, + discardEscapeChar(term.image.substring(1, term.image.length()-1))); } else if (fuzzy) { float fms = fuzzyMinSim; try { @@ -1569,6 +1621,12 @@ finally { jj_save(0, xla); } } + private boolean jj_3R_2() { + if (jj_scan_token(TERM)) return true; + if (jj_scan_token(COLON)) return true; + return false; + } + private boolean jj_3_1() { Token xsp; xsp = jj_scanpos; @@ -1585,12 +1643,6 @@ return false; } - private boolean jj_3R_2() { - if (jj_scan_token(TERM)) return true; - if (jj_scan_token(COLON)) return true; - return false; - } - /** Generated Token Manager. */ public QueryParserTokenManager token_source; /** Current token. */ @@ -1609,10 +1661,10 @@ jj_la1_init_1(); } private static void jj_la1_init_0() { - jj_la1_0 = new int[] {0x300,0x300,0x1c00,0x1c00,0x3ed3f00,0x90000,0x20000,0x3ed2000,0x2690000,0x100000,0x100000,0x20000,0x30000000,0x4000000,0x30000000,0x20000,0x0,0x40000000,0x0,0x20000,0x100000,0x20000,0x3ed0000,}; + jj_la1_0 = new int[] {0x300,0x300,0x1c00,0x1c00,0x7ed3f00,0x90000,0x20000,0x7ed2000,0x4e90000,0x100000,0x100000,0x20000,0x60000000,0x8000000,0x60000000,0x20000,0x0,0x80000000,0x0,0x20000,0x100000,0x20000,0x7ed0000,}; } private static void jj_la1_init_1() { - jj_la1_1 = new int[] {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x3,0x0,0x3,0x0,0x0,0x0,0x0,}; + jj_la1_1 = new int[] {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x6,0x0,0x6,0x0,0x0,0x0,0x0,}; } final private JJCalls[] jj_2_rtns = new JJCalls[1]; private boolean jj_rescan = false; @@ -1766,7 +1818,7 @@ /** Generate ParseException. */ public ParseException generateParseException() { jj_expentries.clear(); - boolean[] la1tokens = new boolean[34]; + boolean[] la1tokens = new boolean[35]; if (jj_kind >= 0) { la1tokens[jj_kind] = true; jj_kind = -1; @@ -1783,7 +1835,7 @@ } } } - for (int i = 0; i < 34; i++) { + for (int i = 0; i < 35; i++) { if (la1tokens[i]) { jj_expentry = new int[1]; jj_expentry[0] = i; Index: lucene/src/java/org/apache/lucene/queryParser/QueryParser.jj =================================================================== --- lucene/src/java/org/apache/lucene/queryParser/QueryParser.jj (revision 984862) +++ lucene/src/java/org/apache/lucene/queryParser/QueryParser.jj (working copy) @@ -53,6 +53,7 @@ import org.apache.lucene.search.MultiPhraseQuery; import org.apache.lucene.search.PhraseQuery; import org.apache.lucene.search.PrefixQuery; +import org.apache.lucene.search.RegexpQuery; import org.apache.lucene.search.Query; import org.apache.lucene.search.TermRangeQuery; import org.apache.lucene.search.TermQuery; @@ -886,6 +887,17 @@ } /** + * Builds a new RegexpQuery instance + * @param prefix Regexp term + * @return new RegexpQuery instance + */ + protected Query newRegexpQuery(Term regexp) { + RegexpQuery query = new RegexpQuery(regexp); + query.setRewriteMethod(multiTermRewriteMethod); + return query; + } + + /** * Builds a new FuzzyQuery instance * @param term Term * @param minimumSimilarity minimum similarity @@ -1010,6 +1022,35 @@ } /** + * Factory method for generating a query. Called when parser + * parses an input term token that contains a regular expression + * query. + *

+ * Depending on settings, pattern term may be lower-cased + * automatically. It will not go through the default Analyzer, + * however, since normal Analyzers are unlikely to work properly + * with regular expression templates. + *

+ * Can be overridden by extending classes, to provide custom handling for + * regular expression queries, which may be necessary due to missing analyzer + * calls. + * + * @param field Name of the field query will use. + * @param termStr Term token that contains a regular expression + * + * @return Resulting {@link Query} built for the term + * @exception ParseException throw in overridden method to disallow + */ + protected Query getRegexpQuery(String field, String termStr) throws ParseException + { + if (lowercaseExpandedTerms) { + termStr = termStr.toLowerCase(); + } + Term t = new Term(field, termStr); + return newRegexpQuery(t); + } + + /** * Factory method for generating a query (similar to * {@link #getWildcardQuery}). Called when parser parses an input term * token that uses prefix notation; that is, contains a single '*' wildcard @@ -1218,6 +1259,7 @@ | )+ ( "." (<_NUM_CHAR>)+ )? )? > | (<_TERM_CHAR>)* "*" ) > | | [ "*", "?" ]) (<_TERM_CHAR> | ( [ "*", "?" ] ))* > +| | : RangeIn | : RangeEx } @@ -1340,6 +1382,7 @@ boolean prefix = false; boolean wildcard = false; boolean fuzzy = false; + boolean regexp = false; Query q; } { @@ -1349,6 +1392,7 @@ | term= { wildcard=true; } | term= { prefix=true; } | term= { wildcard=true; } + | term= { regexp=true; } | term= ) [ fuzzySlop= { fuzzy=true; } ] @@ -1361,6 +1405,9 @@ q = getPrefixQuery(field, discardEscapeChar(term.image.substring (0, term.image.length()-1))); + } else if (regexp) { + q = getRegexpQuery(field, + discardEscapeChar(term.image.substring(1, term.image.length()-1))); } else if (fuzzy) { float fms = fuzzyMinSim; try { Index: lucene/src/java/org/apache/lucene/queryParser/QueryParserTokenManager.java =================================================================== --- lucene/src/java/org/apache/lucene/queryParser/QueryParserTokenManager.java (revision 984862) +++ lucene/src/java/org/apache/lucene/queryParser/QueryParserTokenManager.java (working copy) @@ -27,6 +27,7 @@ import org.apache.lucene.search.MultiPhraseQuery; import org.apache.lucene.search.PhraseQuery; import org.apache.lucene.search.PrefixQuery; +import org.apache.lucene.search.RegexpQuery; import org.apache.lucene.search.Query; import org.apache.lucene.search.TermRangeQuery; import org.apache.lucene.search.TermQuery; @@ -70,7 +71,7 @@ case 41: return jjStopAtPos(0, 14); case 42: - return jjStartNfaWithStates_3(0, 16, 36); + return jjStartNfaWithStates_3(0, 16, 39); case 43: return jjStopAtPos(0, 11); case 45: @@ -78,11 +79,11 @@ case 58: return jjStopAtPos(0, 15); case 91: - return jjStopAtPos(0, 23); + return jjStopAtPos(0, 24); case 94: return jjStopAtPos(0, 17); case 123: - return jjStopAtPos(0, 24); + return jjStopAtPos(0, 25); default : return jjMoveNfa_3(0, 0); } @@ -110,7 +111,7 @@ private int jjMoveNfa_3(int startState, int curPos) { int startsAt = 0; - jjnewStateCnt = 36; + jjnewStateCnt = 39; int i = 1; jjstateSet[0] = startState; int kind = 0x7fffffff; @@ -125,14 +126,6 @@ { switch(jjstateSet[--i]) { - case 36: - case 25: - if ((0xfbfffcf8ffffd9ffL & l) == 0L) - break; - if (kind > 22) - kind = 22; - jjCheckNAddTwoStates(25, 26); - break; case 0: if ((0xfbffd4f8ffffd9ffL & l) != 0L) { @@ -163,9 +156,19 @@ if (kind > 21) kind = 21; } - if (curChar == 38) + if (curChar == 47) + jjCheckNAddTwoStates(29, 30); + else if (curChar == 38) jjstateSet[jjnewStateCnt++] = 4; break; + case 39: + case 25: + if ((0xfbfffcf8ffffd9ffL & l) == 0L) + break; + if (kind > 22) + kind = 22; + jjCheckNAddTwoStates(25, 26); + break; case 4: if (curChar == 38 && kind > 8) kind = 8; @@ -228,29 +231,41 @@ jjCheckNAddTwoStates(25, 26); break; case 28: + if (curChar == 47) + jjCheckNAddTwoStates(29, 30); + break; + case 29: + if ((0xffff7fffffffffffL & l) != 0L) + jjCheckNAddTwoStates(29, 30); + break; + case 30: + if (curChar == 47 && kind > 23) + kind = 23; + break; + case 31: if ((0x7bffd0f8ffffd9ffL & l) == 0L) break; if (kind > 19) kind = 19; jjCheckNAddStates(3, 7); break; - case 29: + case 32: if ((0x7bfff8f8ffffd9ffL & l) == 0L) break; if (kind > 19) kind = 19; - jjCheckNAddTwoStates(29, 30); + jjCheckNAddTwoStates(32, 33); break; - case 31: + case 34: if (kind > 19) kind = 19; - jjCheckNAddTwoStates(29, 30); + jjCheckNAddTwoStates(32, 33); break; - case 32: + case 35: if ((0x7bfff8f8ffffd9ffL & l) != 0L) jjCheckNAddStates(10, 12); break; - case 34: + case 37: jjCheckNAddStates(10, 12); break; default : break; @@ -264,16 +279,6 @@ { switch(jjstateSet[--i]) { - case 36: - if ((0x97ffffff87ffffffL & l) != 0L) - { - if (kind > 22) - kind = 22; - jjCheckNAddTwoStates(25, 26); - } - else if (curChar == 92) - jjCheckNAddTwoStates(27, 27); - break; case 0: if ((0x97ffffff87ffffffL & l) != 0L) { @@ -304,6 +309,16 @@ else if (curChar == 65) jjstateSet[jjnewStateCnt++] = 2; break; + case 39: + if ((0x97ffffff87ffffffL & l) != 0L) + { + if (kind > 22) + kind = 22; + jjCheckNAddTwoStates(25, 26); + } + else if (curChar == 92) + jjCheckNAddTwoStates(27, 27); + break; case 1: if (curChar == 68 && kind > 8) kind = 8; @@ -385,41 +400,44 @@ kind = 22; jjCheckNAddTwoStates(25, 26); break; - case 28: + case 29: + jjAddStates(16, 17); + break; + case 31: if ((0x97ffffff87ffffffL & l) == 0L) break; if (kind > 19) kind = 19; jjCheckNAddStates(3, 7); break; - case 29: + case 32: if ((0x97ffffff87ffffffL & l) == 0L) break; if (kind > 19) kind = 19; - jjCheckNAddTwoStates(29, 30); + jjCheckNAddTwoStates(32, 33); break; - case 30: + case 33: if (curChar == 92) - jjCheckNAddTwoStates(31, 31); + jjCheckNAddTwoStates(34, 34); break; - case 31: + case 34: if (kind > 19) kind = 19; - jjCheckNAddTwoStates(29, 30); + jjCheckNAddTwoStates(32, 33); break; - case 32: + case 35: if ((0x97ffffff87ffffffL & l) != 0L) jjCheckNAddStates(10, 12); break; - case 33: + case 36: if (curChar == 92) - jjCheckNAddTwoStates(34, 34); + jjCheckNAddTwoStates(37, 37); break; - case 34: + case 37: jjCheckNAddStates(10, 12); break; - case 35: + case 38: if (curChar == 92) jjCheckNAddStates(13, 15); break; @@ -438,14 +456,6 @@ { switch(jjstateSet[--i]) { - case 36: - case 25: - if (!jjCanMove_2(hiByte, i1, i2, l1, l2)) - break; - if (kind > 22) - kind = 22; - jjCheckNAddTwoStates(25, 26); - break; case 0: if (jjCanMove_0(hiByte, i1, i2, l1, l2)) { @@ -465,6 +475,14 @@ jjCheckNAddStates(3, 7); } break; + case 39: + case 25: + if (!jjCanMove_2(hiByte, i1, i2, l1, l2)) + break; + if (kind > 22) + kind = 22; + jjCheckNAddTwoStates(25, 26); + break; case 15: case 17: if (jjCanMove_1(hiByte, i1, i2, l1, l2)) @@ -484,32 +502,36 @@ kind = 22; jjCheckNAddTwoStates(25, 26); break; - case 28: + case 29: + if (jjCanMove_1(hiByte, i1, i2, l1, l2)) + jjAddStates(16, 17); + break; + case 31: if (!jjCanMove_2(hiByte, i1, i2, l1, l2)) break; if (kind > 19) kind = 19; jjCheckNAddStates(3, 7); break; - case 29: + case 32: if (!jjCanMove_2(hiByte, i1, i2, l1, l2)) break; if (kind > 19) kind = 19; - jjCheckNAddTwoStates(29, 30); + jjCheckNAddTwoStates(32, 33); break; - case 31: + case 34: if (!jjCanMove_1(hiByte, i1, i2, l1, l2)) break; if (kind > 19) kind = 19; - jjCheckNAddTwoStates(29, 30); + jjCheckNAddTwoStates(32, 33); break; - case 32: + case 35: if (jjCanMove_2(hiByte, i1, i2, l1, l2)) jjCheckNAddStates(10, 12); break; - case 34: + case 37: if (jjCanMove_1(hiByte, i1, i2, l1, l2)) jjCheckNAddStates(10, 12); break; @@ -524,7 +546,7 @@ kind = 0x7fffffff; } ++curPos; - if ((i = jjnewStateCnt) == (startsAt = 36 - (jjnewStateCnt = startsAt))) + if ((i = jjnewStateCnt) == (startsAt = 39 - (jjnewStateCnt = startsAt))) return curPos; try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { return curPos; } @@ -535,9 +557,9 @@ switch (pos) { case 0: - if ((active0 & 0x40000000L) != 0L) + if ((active0 & 0x80000000L) != 0L) { - jjmatchedKind = 33; + jjmatchedKind = 34; return 6; } return -1; @@ -554,9 +576,9 @@ switch(curChar) { case 84: - return jjMoveStringLiteralDfa1_1(0x40000000L); + return jjMoveStringLiteralDfa1_1(0x80000000L); case 125: - return jjStopAtPos(0, 31); + return jjStopAtPos(0, 32); default : return jjMoveNfa_1(0, 0); } @@ -571,8 +593,8 @@ switch(curChar) { case 79: - if ((active0 & 0x40000000L) != 0L) - return jjStartNfaWithStates_1(1, 30, 6); + if ((active0 & 0x80000000L) != 0L) + return jjStartNfaWithStates_1(1, 31, 6); break; default : break; @@ -608,8 +630,8 @@ case 0: if ((0xfffffffeffffffffL & l) != 0L) { - if (kind > 33) - kind = 33; + if (kind > 34) + kind = 34; jjCheckNAdd(6); } if ((0x100002600L & l) != 0L) @@ -626,21 +648,21 @@ break; case 2: if ((0xfffffffbffffffffL & l) != 0L) - jjCheckNAddStates(16, 18); + jjCheckNAddStates(18, 20); break; case 3: if (curChar == 34) - jjCheckNAddStates(16, 18); + jjCheckNAddStates(18, 20); break; case 5: - if (curChar == 34 && kind > 32) - kind = 32; + if (curChar == 34 && kind > 33) + kind = 33; break; case 6: if ((0xfffffffeffffffffL & l) == 0L) break; - if (kind > 33) - kind = 33; + if (kind > 34) + kind = 34; jjCheckNAdd(6); break; default : break; @@ -658,12 +680,12 @@ case 6: if ((0xdfffffffffffffffL & l) == 0L) break; - if (kind > 33) - kind = 33; + if (kind > 34) + kind = 34; jjCheckNAdd(6); break; case 2: - jjAddStates(16, 18); + jjAddStates(18, 20); break; case 4: if (curChar == 92) @@ -692,20 +714,20 @@ } if (jjCanMove_1(hiByte, i1, i2, l1, l2)) { - if (kind > 33) - kind = 33; + if (kind > 34) + kind = 34; jjCheckNAdd(6); } break; case 2: if (jjCanMove_1(hiByte, i1, i2, l1, l2)) - jjAddStates(16, 18); + jjAddStates(18, 20); break; case 6: if (!jjCanMove_1(hiByte, i1, i2, l1, l2)) break; - if (kind > 33) - kind = 33; + if (kind > 34) + kind = 34; jjCheckNAdd(6); break; default : break; @@ -750,9 +772,9 @@ case 0: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 25) - kind = 25; - jjAddStates(19, 20); + if (kind > 26) + kind = 26; + jjAddStates(21, 22); break; case 1: if (curChar == 46) @@ -761,8 +783,8 @@ case 2: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 25) - kind = 25; + if (kind > 26) + kind = 26; jjCheckNAdd(2); break; default : break; @@ -813,9 +835,9 @@ switch (pos) { case 0: - if ((active0 & 0x4000000L) != 0L) + if ((active0 & 0x8000000L) != 0L) { - jjmatchedKind = 29; + jjmatchedKind = 30; return 6; } return -1; @@ -832,9 +854,9 @@ switch(curChar) { case 84: - return jjMoveStringLiteralDfa1_2(0x4000000L); + return jjMoveStringLiteralDfa1_2(0x8000000L); case 93: - return jjStopAtPos(0, 27); + return jjStopAtPos(0, 28); default : return jjMoveNfa_2(0, 0); } @@ -849,8 +871,8 @@ switch(curChar) { case 79: - if ((active0 & 0x4000000L) != 0L) - return jjStartNfaWithStates_2(1, 26, 6); + if ((active0 & 0x8000000L) != 0L) + return jjStartNfaWithStates_2(1, 27, 6); break; default : break; @@ -886,8 +908,8 @@ case 0: if ((0xfffffffeffffffffL & l) != 0L) { - if (kind > 29) - kind = 29; + if (kind > 30) + kind = 30; jjCheckNAdd(6); } if ((0x100002600L & l) != 0L) @@ -904,21 +926,21 @@ break; case 2: if ((0xfffffffbffffffffL & l) != 0L) - jjCheckNAddStates(16, 18); + jjCheckNAddStates(18, 20); break; case 3: if (curChar == 34) - jjCheckNAddStates(16, 18); + jjCheckNAddStates(18, 20); break; case 5: - if (curChar == 34 && kind > 28) - kind = 28; + if (curChar == 34 && kind > 29) + kind = 29; break; case 6: if ((0xfffffffeffffffffL & l) == 0L) break; - if (kind > 29) - kind = 29; + if (kind > 30) + kind = 30; jjCheckNAdd(6); break; default : break; @@ -936,12 +958,12 @@ case 6: if ((0xffffffffdfffffffL & l) == 0L) break; - if (kind > 29) - kind = 29; + if (kind > 30) + kind = 30; jjCheckNAdd(6); break; case 2: - jjAddStates(16, 18); + jjAddStates(18, 20); break; case 4: if (curChar == 92) @@ -970,20 +992,20 @@ } if (jjCanMove_1(hiByte, i1, i2, l1, l2)) { - if (kind > 29) - kind = 29; + if (kind > 30) + kind = 30; jjCheckNAdd(6); } break; case 2: if (jjCanMove_1(hiByte, i1, i2, l1, l2)) - jjAddStates(16, 18); + jjAddStates(18, 20); break; case 6: if (!jjCanMove_1(hiByte, i1, i2, l1, l2)) break; - if (kind > 29) - kind = 29; + if (kind > 30) + kind = 30; jjCheckNAdd(6); break; default : break; @@ -1004,8 +1026,8 @@ } } static final int[] jjnextStates = { - 15, 16, 18, 29, 32, 23, 33, 30, 20, 21, 32, 23, 33, 31, 34, 27, - 2, 4, 5, 0, 1, + 15, 16, 18, 32, 35, 23, 36, 33, 20, 21, 35, 23, 36, 34, 37, 27, + 29, 30, 2, 4, 5, 0, 1, }; private static final boolean jjCanMove_0(int hiByte, int i1, int i2, long l1, long l2) { @@ -1047,8 +1069,8 @@ /** Token literal values. */ public static final String[] jjstrLiteralImages = { "", null, null, null, null, null, null, null, null, null, null, "\53", "\55", -"\50", "\51", "\72", "\52", "\136", null, null, null, null, null, "\133", "\173", -null, "\124\117", "\135", null, null, "\124\117", "\175", null, null, }; +"\50", "\51", "\72", "\52", "\136", null, null, null, null, null, null, "\133", +"\173", null, "\124\117", "\135", null, null, "\124\117", "\175", null, null, }; /** Lexer state names. */ public static final String[] lexStateNames = { @@ -1060,18 +1082,18 @@ /** Lex State array. */ public static final int[] jjnewLexState = { - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, -1, -1, -1, 2, 1, - 3, -1, 3, -1, -1, -1, 3, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, -1, -1, -1, -1, 2, + 1, 3, -1, 3, -1, -1, -1, 3, -1, -1, }; static final long[] jjtoToken = { - 0x3ffffff01L, + 0x7ffffff01L, }; static final long[] jjtoSkip = { 0x80L, }; protected CharStream input_stream; -private final int[] jjrounds = new int[36]; -private final int[] jjstateSet = new int[72]; +private final int[] jjrounds = new int[39]; +private final int[] jjstateSet = new int[78]; protected char curChar; /** Constructor. */ public QueryParserTokenManager(CharStream stream){ @@ -1096,7 +1118,7 @@ { int i; jjround = 0x80000001; - for (i = 36; i-- > 0;) + for (i = 39; i-- > 0;) jjrounds[i] = 0x80000000; }