Index: solr/core/src/java/org/apache/solr/search/SolrQueryParser.java =================================================================== --- solr/core/src/java/org/apache/solr/search/SolrQueryParser.java (revision 1410741) +++ solr/core/src/java/org/apache/solr/search/SolrQueryParser.java (working copy) @@ -254,4 +254,9 @@ return newFuzzyQuery(t, minSimilarity, getFuzzyPrefixLength()); } + @Override + protected Query getLocalParams(String qfield, String lparams) throws ParseException { + QParser nested = parser.subQuery(lparams, null); + return nested.getQuery(); + } } Index: lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/QueryParserConstants.java =================================================================== --- lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/QueryParserConstants.java (revision 1410741) +++ lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/QueryParserConstants.java (working copy) @@ -23,55 +23,61 @@ /** RegularExpression Id. */ int _QUOTED_CHAR = 6; /** RegularExpression Id. */ - int AND = 8; + int _SQUOTED_CHAR = 7; /** RegularExpression Id. */ - int OR = 9; + int AND = 9; /** RegularExpression Id. */ - int NOT = 10; + int OR = 10; /** RegularExpression Id. */ - int PLUS = 11; + int NOT = 11; /** RegularExpression Id. */ - int MINUS = 12; + int PLUS = 12; /** RegularExpression Id. */ - int BAREOPER = 13; + int MINUS = 13; /** RegularExpression Id. */ - int LPAREN = 14; + int BAREOPER = 14; /** RegularExpression Id. */ - int RPAREN = 15; + int LPAREN = 15; /** RegularExpression Id. */ - int COLON = 16; + int RPAREN = 16; /** RegularExpression Id. */ - int STAR = 17; + int COLON = 17; /** RegularExpression Id. */ - int CARAT = 18; + int STAR = 18; /** RegularExpression Id. */ - int QUOTED = 19; + int CARAT = 19; /** RegularExpression Id. */ - int TERM = 20; + int QUOTED = 20; /** RegularExpression Id. */ - int FUZZY_SLOP = 21; + int SQUOTED = 21; /** RegularExpression Id. */ - int PREFIXTERM = 22; + int TERM = 22; /** RegularExpression Id. */ - int WILDTERM = 23; + int FUZZY_SLOP = 23; /** RegularExpression Id. */ - int REGEXPTERM = 24; + int PREFIXTERM = 24; /** RegularExpression Id. */ - int RANGEIN_START = 25; + int WILDTERM = 25; /** RegularExpression Id. */ - int RANGEEX_START = 26; + int REGEXPTERM = 26; /** RegularExpression Id. */ - int NUMBER = 27; + int RANGEIN_START = 27; /** RegularExpression Id. */ - int RANGE_TO = 28; + int RANGEEX_START = 28; /** RegularExpression Id. */ - int RANGEIN_END = 29; + int LPARAMS = 29; /** RegularExpression Id. */ - int RANGEEX_END = 30; + int NUMBER = 30; /** RegularExpression Id. */ - int RANGE_QUOTED = 31; + int RANGE_TO = 31; /** RegularExpression Id. */ - int RANGE_GOOP = 32; + int RANGEIN_END = 32; + /** RegularExpression Id. */ + int RANGEEX_END = 33; + /** RegularExpression Id. */ + int RANGE_QUOTED = 34; + /** RegularExpression Id. */ + int RANGE_GOOP = 35; /** Lexical state. */ int Boost = 0; @@ -89,7 +95,8 @@ "<_TERM_CHAR>", "<_WHITESPACE>", "<_QUOTED_CHAR>", - "", + "<_SQUOTED_CHAR>", + "", "", "", "", @@ -102,6 +109,7 @@ "\"*\"", "\"^\"", "", + "", "", "", "", @@ -109,6 +117,7 @@ "", "\"[\"", "\"{\"", + "", "", "\"TO\"", "\"]\"", Index: lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/QueryParser.java =================================================================== --- lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/QueryParser.java (revision 1410741) +++ lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/QueryParser.java (working copy) @@ -200,6 +200,7 @@ case REGEXPTERM: case RANGEIN_START: case RANGEEX_START: + case LPARAMS: case NUMBER: ; break; @@ -223,6 +224,7 @@ final public Query Clause(String field) throws ParseException { Query q; Token fieldToken=null, boost=null; + Token localParams=null; if (jj_2_1(2)) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case TERM: @@ -270,8 +272,21 @@ ; } break; + case LPARAMS: + localParams = jj_consume_token(LPARAMS); + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case CARAT: + jj_consume_token(CARAT); + boost = jj_consume_token(NUMBER); + break; + default: + jj_la1[7] = jj_gen; + ; + } + q=getLocalParams(field, localParams.image); + break; default: - jj_la1[7] = jj_gen; + jj_la1[8] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -324,7 +339,7 @@ term.image = term.image.substring(0,1); break; default: - jj_la1[8] = jj_gen; + jj_la1[9] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -334,7 +349,7 @@ fuzzy=true; break; default: - jj_la1[9] = jj_gen; + jj_la1[10] = jj_gen; ; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { @@ -347,15 +362,15 @@ fuzzy=true; break; default: - jj_la1[10] = jj_gen; + jj_la1[11] = jj_gen; ; } break; default: - jj_la1[11] = jj_gen; + jj_la1[12] = jj_gen; ; } - q = handleBareTokenQuery(field, term, fuzzySlop, prefix, wildcard, fuzzy, regexp); + q = handleBareTokenQuery(getField(field), term, fuzzySlop, prefix, wildcard, fuzzy, regexp); break; case RANGEIN_START: case RANGEEX_START: @@ -368,7 +383,7 @@ jj_consume_token(RANGEEX_START); break; default: - jj_la1[12] = jj_gen; + jj_la1[13] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -380,7 +395,7 @@ goop1 = jj_consume_token(RANGE_QUOTED); break; default: - jj_la1[13] = jj_gen; + jj_la1[14] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -389,7 +404,7 @@ jj_consume_token(RANGE_TO); break; default: - jj_la1[14] = jj_gen; + jj_la1[15] = jj_gen; ; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { @@ -400,7 +415,7 @@ goop2 = jj_consume_token(RANGE_QUOTED); break; default: - jj_la1[15] = jj_gen; + jj_la1[16] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -413,7 +428,7 @@ jj_consume_token(RANGEEX_END); break; default: - jj_la1[16] = jj_gen; + jj_la1[17] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -423,7 +438,7 @@ boost = jj_consume_token(NUMBER); break; default: - jj_la1[17] = jj_gen; + jj_la1[18] = jj_gen; ; } boolean startOpen=false; @@ -438,7 +453,7 @@ } else if ("*".equals(goop2.image)) { endOpen=true; } - q = getRangeQuery(field, startOpen ? null : discardEscapeChar(goop1.image), endOpen ? null : discardEscapeChar(goop2.image), startInc, endInc); + q = getRangeQuery(getField(field), startOpen ? null : discardEscapeChar(goop1.image), endOpen ? null : discardEscapeChar(goop2.image), startInc, endInc); break; case QUOTED: term = jj_consume_token(QUOTED); @@ -447,7 +462,7 @@ fuzzySlop = jj_consume_token(FUZZY_SLOP); break; default: - jj_la1[18] = jj_gen; + jj_la1[19] = jj_gen; ; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { @@ -456,13 +471,13 @@ boost = jj_consume_token(NUMBER); break; default: - jj_la1[19] = jj_gen; + jj_la1[20] = jj_gen; ; } - q = handleQuotedTerm(field, term, fuzzySlop); + q = handleQuotedTerm(getField(field), term, fuzzySlop); break; default: - jj_la1[20] = jj_gen; + jj_la1[21] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -477,6 +492,12 @@ finally { jj_save(0, xla); } } + private boolean jj_3R_3() { + if (jj_scan_token(STAR)) return true; + if (jj_scan_token(COLON)) return true; + return false; + } + private boolean jj_3R_2() { if (jj_scan_token(TERM)) return true; if (jj_scan_token(COLON)) return true; @@ -493,12 +514,6 @@ return false; } - private boolean jj_3R_3() { - if (jj_scan_token(STAR)) return true; - if (jj_scan_token(COLON)) return true; - return false; - } - /** Generated Token Manager. */ public QueryParserTokenManager token_source; /** Current token. */ @@ -509,7 +524,7 @@ private Token jj_scanpos, jj_lastpos; private int jj_la; private int jj_gen; - final private int[] jj_la1 = new int[21]; + final private int[] jj_la1 = new int[22]; static private int[] jj_la1_0; static private int[] jj_la1_1; static { @@ -517,10 +532,10 @@ jj_la1_init_1(); } private static void jj_la1_init_0() { - jj_la1_0 = new int[] {0x300,0x300,0x1c00,0x1c00,0xfda7f00,0x120000,0x40000,0xfda6000,0x9d22000,0x200000,0x200000,0x40000,0x6000000,0x80000000,0x10000000,0x80000000,0x60000000,0x40000,0x200000,0x40000,0xfda2000,}; + jj_la1_0 = new int[] {0x600,0x600,0x3800,0x3800,0x7f54fe00,0x440000,0x80000,0x80000,0x7f54c000,0x47444000,0x800000,0x800000,0x80000,0x18000000,0x0,0x80000000,0x0,0x0,0x80000,0x800000,0x80000,0x5f544000,}; } 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,0x1,0x0,0x1,0x0,0x0,0x0,0x0,0x0,}; + jj_la1_1 = new int[] {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xc,0x0,0xc,0x3,0x0,0x0,0x0,0x0,}; } final private JJCalls[] jj_2_rtns = new JJCalls[1]; private boolean jj_rescan = false; @@ -532,7 +547,7 @@ token = new Token(); jj_ntk = -1; jj_gen = 0; - for (int i = 0; i < 21; i++) jj_la1[i] = -1; + for (int i = 0; i < 22; i++) jj_la1[i] = -1; for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); } @@ -542,7 +557,7 @@ token = new Token(); jj_ntk = -1; jj_gen = 0; - for (int i = 0; i < 21; i++) jj_la1[i] = -1; + for (int i = 0; i < 22; i++) jj_la1[i] = -1; for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); } @@ -552,7 +567,7 @@ token = new Token(); jj_ntk = -1; jj_gen = 0; - for (int i = 0; i < 21; i++) jj_la1[i] = -1; + for (int i = 0; i < 22; i++) jj_la1[i] = -1; for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); } @@ -562,7 +577,7 @@ token = new Token(); jj_ntk = -1; jj_gen = 0; - for (int i = 0; i < 21; i++) jj_la1[i] = -1; + for (int i = 0; i < 22; i++) jj_la1[i] = -1; for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); } @@ -674,12 +689,12 @@ /** Generate ParseException. */ public ParseException generateParseException() { jj_expentries.clear(); - boolean[] la1tokens = new boolean[33]; + boolean[] la1tokens = new boolean[36]; if (jj_kind >= 0) { la1tokens[jj_kind] = true; jj_kind = -1; } - for (int i = 0; i < 21; i++) { + for (int i = 0; i < 22; i++) { if (jj_la1[i] == jj_gen) { for (int j = 0; j < 32; j++) { if ((jj_la1_0[i] & (1< | <_ESCAPED_CHAR> | "-" | "+" ) > | <#_WHITESPACE: ( " " | "\t" | "\n" | "\r" | "\u3000") > | <#_QUOTED_CHAR: ( ~[ "\"", "\\" ] | <_ESCAPED_CHAR> ) > +| <#_SQUOTED_CHAR: ( ~[ "'", "\\" ] | <_ESCAPED_CHAR> ) > } SKIP : { @@ -161,6 +162,7 @@ | | : Boost | )* "\""> +| )* "'"> | (<_TERM_CHAR>)* > | )+ ( "." (<_NUM_CHAR>)+ )? )? > | (<_TERM_CHAR>)* "*" ) > @@ -168,6 +170,7 @@ | | : Range | : Range +| )* (~["=","}"])+ ( "=" ( | | (~[" ","}"])+ )? )? )* "}")+ (~[")"," ","\t","\n","{","^"])* > } TOKEN : { @@ -249,8 +252,10 @@ Query Clause(String field) : { Query q; Token fieldToken=null, boost=null; + Token localParams=null; } { + [ LOOKAHEAD(2) ( @@ -259,10 +264,11 @@ ) ] + ( q=Term(field) | q=Query(field) ( boost=)? - + | (localParams = ( boost=)? { q=getLocalParams(field, localParams.image); } ) ) { return handleBoost(q, boost); } } @@ -292,7 +298,7 @@ [ fuzzySlop= { fuzzy=true; } ] [ boost= [ fuzzySlop= { fuzzy=true; } ] ] { - q = handleBareTokenQuery(field, term, fuzzySlop, prefix, wildcard, fuzzy, regexp); + q = handleBareTokenQuery(getField(field), term, fuzzySlop, prefix, wildcard, fuzzy, regexp); } | ( ( {startInc=true;} | ) ( goop1=|goop1= ) @@ -313,12 +319,12 @@ } else if ("*".equals(goop2.image)) { endOpen=true; } - q = getRangeQuery(field, startOpen ? null : discardEscapeChar(goop1.image), endOpen ? null : discardEscapeChar(goop2.image), startInc, endInc); + q = getRangeQuery(getField(field), startOpen ? null : discardEscapeChar(goop1.image), endOpen ? null : discardEscapeChar(goop2.image), startInc, endInc); } | term= [ fuzzySlop= ] [ boost= ] - { q = handleQuotedTerm(field, term, fuzzySlop); } + { q = handleQuotedTerm(getField(field), term, fuzzySlop); } ) { return handleBoost(q, boost); } } Index: lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/QueryParserBase.java =================================================================== --- lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/QueryParserBase.java (revision 1410741) +++ lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/QueryParserBase.java (working copy) @@ -113,7 +113,7 @@ ReInit(new FastCharStream(new StringReader(query))); try { // TopLevelQuery is a Query followed by the end-of-input (EOF) - Query res = TopLevelQuery(field); + Query res = TopLevelQuery(null); // pass null so we can tell later if an explicit field was provided or not return res!=null ? res : newBooleanQuery(false); } catch (ParseException tme) { @@ -149,6 +149,11 @@ return field; } + /** Handles the default field if null is passed */ + public String getField(String fieldName) { + return fieldName != null ? fieldName : field; + } + /** * @see #setAutoGeneratePhraseQueries(boolean) */ @@ -1035,7 +1040,11 @@ return newFuzzyQuery(t, minSimilarity, fuzzyPrefixLength); } + protected Query getLocalParams(String qfield, String lparams) throws ParseException { + return getFieldQuery(getField(qfield), lparams, false); + } + // extracted from the .jj grammar Query handleBareTokenQuery(String qfield, Token term, Token fuzzySlop, boolean prefix, boolean wildcard, boolean fuzzy, boolean regexp) throws ParseException { Query q; Index: lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/QueryParserTokenManager.java =================================================================== --- lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/QueryParserTokenManager.java (revision 1410741) +++ lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/QueryParserTokenManager.java (working copy) @@ -43,23 +43,23 @@ switch(curChar) { case 40: - return jjStopAtPos(0, 14); + return jjStopAtPos(0, 15); case 41: - return jjStopAtPos(0, 15); + return jjStopAtPos(0, 16); case 42: - return jjStartNfaWithStates_2(0, 17, 43); + return jjStartNfaWithStates_2(0, 18, 66); case 43: - return jjStartNfaWithStates_2(0, 11, 15); + return jjStartNfaWithStates_2(0, 12, 15); case 45: - return jjStartNfaWithStates_2(0, 12, 15); + return jjStartNfaWithStates_2(0, 13, 15); case 58: - return jjStopAtPos(0, 16); + return jjStopAtPos(0, 17); case 91: - return jjStopAtPos(0, 25); + return jjStopAtPos(0, 27); case 94: - return jjStopAtPos(0, 18); + return jjStopAtPos(0, 19); case 123: - return jjStopAtPos(0, 26); + return jjStartNfaWithStates_2(0, 28, 40); default : return jjMoveNfa_2(0, 0); } @@ -87,7 +87,7 @@ private int jjMoveNfa_2(int startState, int curPos) { int startsAt = 0; - jjnewStateCnt = 43; + jjnewStateCnt = 66; int i = 1; jjstateSet[0] = startState; int kind = 0x7fffffff; @@ -102,17 +102,25 @@ { switch(jjstateSet[--i]) { + case 66: + case 32: + if ((0xfbff7cf8ffffd9ffL & l) == 0L) + break; + if (kind > 25) + kind = 25; + jjCheckNAddTwoStates(32, 33); + break; case 0: if ((0xfbff54f8ffffd9ffL & l) != 0L) { - if (kind > 23) - kind = 23; - jjCheckNAddTwoStates(27, 28); + if (kind > 25) + kind = 25; + jjCheckNAddTwoStates(32, 33); } else if ((0x100002600L & l) != 0L) { - if (kind > 7) - kind = 7; + if (kind > 8) + kind = 8; } else if ((0x280200000000L & l) != 0L) jjstateSet[jjnewStateCnt++] = 15; @@ -122,50 +130,44 @@ jjCheckNAddStates(3, 5); if ((0x7bff50f8ffffd9ffL & l) != 0L) { - if (kind > 20) - kind = 20; + if (kind > 22) + kind = 22; jjCheckNAddStates(6, 10); } else if (curChar == 42) { - if (kind > 22) - kind = 22; + if (kind > 24) + kind = 24; } else if (curChar == 33) { - if (kind > 10) - kind = 10; + if (kind > 11) + kind = 11; } - if (curChar == 38) + if (curChar == 39) + jjCheckNAddStates(11, 13); + else if (curChar == 38) jjstateSet[jjnewStateCnt++] = 4; break; - case 43: - case 27: - if ((0xfbff7cf8ffffd9ffL & l) == 0L) - break; - if (kind > 23) - kind = 23; - jjCheckNAddTwoStates(27, 28); - break; case 4: - if (curChar == 38 && kind > 8) - kind = 8; + if (curChar == 38 && kind > 9) + kind = 9; break; case 5: if (curChar == 38) jjstateSet[jjnewStateCnt++] = 4; break; case 13: - if (curChar == 33 && kind > 10) - kind = 10; + if (curChar == 33 && kind > 11) + kind = 11; break; case 14: if ((0x280200000000L & l) != 0L) jjstateSet[jjnewStateCnt++] = 15; break; case 15: - if ((0x100002600L & l) != 0L && kind > 13) - kind = 13; + if ((0x100002600L & l) != 0L && kind > 14) + kind = 14; break; case 16: if (curChar == 34) @@ -179,81 +181,153 @@ jjCheckNAddStates(3, 5); break; case 20: - if (curChar == 34 && kind > 19) - kind = 19; + if (curChar == 34 && kind > 20) + kind = 20; break; + case 21: + if (curChar == 39) + jjCheckNAddStates(11, 13); + break; case 22: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 21) - kind = 21; - jjAddStates(11, 12); + if ((0xffffff7fffffffffL & l) != 0L) + jjCheckNAddStates(11, 13); break; - case 23: - if (curChar == 46) - jjCheckNAdd(24); - break; case 24: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 21) - kind = 21; - jjCheckNAdd(24); + jjCheckNAddStates(11, 13); break; case 25: - if (curChar == 42 && kind > 22) - kind = 22; + if (curChar == 39 && kind > 21) + kind = 21; break; - case 26: - if ((0xfbff54f8ffffd9ffL & l) == 0L) + case 27: + if ((0x3ff000000000000L & l) == 0L) break; if (kind > 23) kind = 23; - jjCheckNAddTwoStates(27, 28); + jjAddStates(14, 15); break; + case 28: + if (curChar == 46) + jjCheckNAdd(29); + break; case 29: + if ((0x3ff000000000000L & l) == 0L) + break; if (kind > 23) kind = 23; - jjCheckNAddTwoStates(27, 28); + jjCheckNAdd(29); break; case 30: - case 32: + if (curChar == 42 && kind > 24) + kind = 24; + break; + case 31: + if ((0xfbff54f8ffffd9ffL & l) == 0L) + break; + if (kind > 25) + kind = 25; + jjCheckNAddTwoStates(32, 33); + break; + case 34: + if (kind > 25) + kind = 25; + jjCheckNAddTwoStates(32, 33); + break; + case 35: + case 37: if (curChar == 47) jjCheckNAddStates(0, 2); break; - case 31: + case 36: if ((0xffff7fffffffffffL & l) != 0L) jjCheckNAddStates(0, 2); break; - case 34: - if (curChar == 47 && kind > 24) - kind = 24; + case 39: + if (curChar == 47 && kind > 26) + kind = 26; break; - case 35: + case 40: + if (curChar == 33) + jjCheckNAddStates(16, 18); + break; + case 41: + if ((0x100002600L & l) != 0L) + jjCheckNAddTwoStates(41, 42); + break; + case 42: + if ((0xdfffffffffffffffL & l) != 0L) + jjCheckNAddStates(19, 22); + break; + case 43: + if (curChar == 61) + jjCheckNAddStates(23, 28); + break; + case 44: + if (curChar == 34) + jjCheckNAddStates(29, 31); + break; + case 45: + if ((0xfffffffbffffffffL & l) != 0L) + jjCheckNAddStates(29, 31); + break; + case 47: + jjCheckNAddStates(29, 31); + break; + case 48: + if (curChar == 34) + jjCheckNAddStates(16, 18); + break; + case 51: + if ((0xfffffdfefffff9ffL & l) == 0L) + break; + if (kind > 29) + kind = 29; + jjstateSet[jjnewStateCnt++] = 51; + break; + case 52: + if (curChar == 39) + jjCheckNAddStates(32, 34); + break; + case 53: + if ((0xffffff7fffffffffL & l) != 0L) + jjCheckNAddStates(32, 34); + break; + case 55: + jjCheckNAddStates(32, 34); + break; + case 56: + if (curChar == 39) + jjCheckNAddStates(16, 18); + break; + case 57: + if ((0xfffffffeffffffffL & l) != 0L) + jjCheckNAddStates(35, 38); + break; + case 58: if ((0x7bff50f8ffffd9ffL & l) == 0L) break; - if (kind > 20) - kind = 20; + if (kind > 22) + kind = 22; jjCheckNAddStates(6, 10); break; - case 36: + case 59: if ((0x7bff78f8ffffd9ffL & l) == 0L) break; - if (kind > 20) - kind = 20; - jjCheckNAddTwoStates(36, 37); + if (kind > 22) + kind = 22; + jjCheckNAddTwoStates(59, 60); break; - case 38: - if (kind > 20) - kind = 20; - jjCheckNAddTwoStates(36, 37); + case 61: + if (kind > 22) + kind = 22; + jjCheckNAddTwoStates(59, 60); break; - case 39: + case 62: if ((0x7bff78f8ffffd9ffL & l) != 0L) - jjCheckNAddStates(13, 15); + jjCheckNAddStates(39, 41); break; - case 41: - jjCheckNAddStates(13, 15); + case 64: + jjCheckNAddStates(39, 41); break; default : break; } @@ -266,26 +340,38 @@ { switch(jjstateSet[--i]) { + case 66: + if ((0x97ffffff87ffffffL & l) != 0L) + { + if (kind > 25) + kind = 25; + jjCheckNAddTwoStates(32, 33); + } + else if (curChar == 92) + jjCheckNAddTwoStates(34, 34); + break; case 0: if ((0x97ffffff87ffffffL & l) != 0L) { - if (kind > 20) - kind = 20; + if (kind > 22) + kind = 22; jjCheckNAddStates(6, 10); } else if (curChar == 92) - jjCheckNAddStates(16, 18); + jjCheckNAddStates(42, 44); + else if (curChar == 123) + jjstateSet[jjnewStateCnt++] = 40; else if (curChar == 126) { - if (kind > 21) - kind = 21; - jjstateSet[jjnewStateCnt++] = 22; + if (kind > 23) + kind = 23; + jjstateSet[jjnewStateCnt++] = 27; } if ((0x97ffffff87ffffffL & l) != 0L) { - if (kind > 23) - kind = 23; - jjCheckNAddTwoStates(27, 28); + if (kind > 25) + kind = 25; + jjCheckNAddTwoStates(32, 33); } if (curChar == 78) jjstateSet[jjnewStateCnt++] = 11; @@ -296,19 +382,9 @@ else if (curChar == 65) jjstateSet[jjnewStateCnt++] = 2; break; - case 43: - if ((0x97ffffff87ffffffL & l) != 0L) - { - if (kind > 23) - kind = 23; - jjCheckNAddTwoStates(27, 28); - } - else if (curChar == 92) - jjCheckNAddTwoStates(29, 29); - break; case 1: - if (curChar == 68 && kind > 8) - kind = 8; + if (curChar == 68 && kind > 9) + kind = 9; break; case 2: if (curChar == 78) @@ -319,24 +395,24 @@ jjstateSet[jjnewStateCnt++] = 2; break; case 6: - if (curChar == 82 && kind > 9) - kind = 9; + if (curChar == 82 && kind > 10) + kind = 10; break; case 7: if (curChar == 79) jjstateSet[jjnewStateCnt++] = 6; break; case 8: - if (curChar == 124 && kind > 9) - kind = 9; + if (curChar == 124 && kind > 10) + kind = 10; break; case 9: if (curChar == 124) jjstateSet[jjnewStateCnt++] = 8; break; case 10: - if (curChar == 84 && kind > 10) - kind = 10; + if (curChar == 84 && kind > 11) + kind = 11; break; case 11: if (curChar == 79) @@ -357,80 +433,139 @@ case 19: jjCheckNAddStates(3, 5); break; - case 21: - if (curChar != 126) - break; - if (kind > 21) - kind = 21; - jjstateSet[jjnewStateCnt++] = 22; + case 22: + if ((0xffffffffefffffffL & l) != 0L) + jjCheckNAddStates(11, 13); break; + case 23: + if (curChar == 92) + jjstateSet[jjnewStateCnt++] = 24; + break; + case 24: + jjCheckNAddStates(11, 13); + break; case 26: - if ((0x97ffffff87ffffffL & l) == 0L) + if (curChar != 126) break; if (kind > 23) kind = 23; - jjCheckNAddTwoStates(27, 28); + jjstateSet[jjnewStateCnt++] = 27; break; - case 27: + case 31: if ((0x97ffffff87ffffffL & l) == 0L) break; - if (kind > 23) - kind = 23; - jjCheckNAddTwoStates(27, 28); + if (kind > 25) + kind = 25; + jjCheckNAddTwoStates(32, 33); break; - case 28: + case 32: + if ((0x97ffffff87ffffffL & l) == 0L) + break; + if (kind > 25) + kind = 25; + jjCheckNAddTwoStates(32, 33); + break; + case 33: if (curChar == 92) - jjCheckNAddTwoStates(29, 29); + jjCheckNAddTwoStates(34, 34); break; - case 29: - if (kind > 23) - kind = 23; - jjCheckNAddTwoStates(27, 28); + case 34: + if (kind > 25) + kind = 25; + jjCheckNAddTwoStates(32, 33); break; - case 31: + case 36: jjAddStates(0, 2); break; - case 33: + case 38: if (curChar == 92) - jjstateSet[jjnewStateCnt++] = 32; + jjstateSet[jjnewStateCnt++] = 37; break; - case 35: + case 42: + if ((0xdfffffffffffffffL & l) != 0L) + jjCheckNAddStates(19, 22); + break; + case 45: + if ((0xffffffffefffffffL & l) != 0L) + jjCheckNAddStates(29, 31); + break; + case 46: + if (curChar == 92) + jjstateSet[jjnewStateCnt++] = 47; + break; + case 47: + jjCheckNAddStates(29, 31); + break; + case 49: + if (curChar != 125) + break; + if (kind > 29) + kind = 29; + jjCheckNAddTwoStates(50, 51); + break; + case 50: + if (curChar == 123) + jjstateSet[jjnewStateCnt++] = 40; + break; + case 51: + if ((0xf7ffffffbfffffffL & l) == 0L) + break; + if (kind > 29) + kind = 29; + jjCheckNAdd(51); + break; + case 53: + if ((0xffffffffefffffffL & l) != 0L) + jjCheckNAddStates(32, 34); + break; + case 54: + if (curChar == 92) + jjstateSet[jjnewStateCnt++] = 55; + break; + case 55: + jjCheckNAddStates(32, 34); + break; + case 57: + if ((0xdfffffffffffffffL & l) != 0L) + jjCheckNAddStates(35, 38); + break; + case 58: if ((0x97ffffff87ffffffL & l) == 0L) break; - if (kind > 20) - kind = 20; + if (kind > 22) + kind = 22; jjCheckNAddStates(6, 10); break; - case 36: + case 59: if ((0x97ffffff87ffffffL & l) == 0L) break; - if (kind > 20) - kind = 20; - jjCheckNAddTwoStates(36, 37); + if (kind > 22) + kind = 22; + jjCheckNAddTwoStates(59, 60); break; - case 37: + case 60: if (curChar == 92) - jjCheckNAddTwoStates(38, 38); + jjCheckNAddTwoStates(61, 61); break; - case 38: - if (kind > 20) - kind = 20; - jjCheckNAddTwoStates(36, 37); + case 61: + if (kind > 22) + kind = 22; + jjCheckNAddTwoStates(59, 60); break; - case 39: + case 62: if ((0x97ffffff87ffffffL & l) != 0L) - jjCheckNAddStates(13, 15); + jjCheckNAddStates(39, 41); break; - case 40: + case 63: if (curChar == 92) - jjCheckNAddTwoStates(41, 41); + jjCheckNAddTwoStates(64, 64); break; - case 41: - jjCheckNAddStates(13, 15); + case 64: + jjCheckNAddStates(39, 41); break; - case 42: + case 65: if (curChar == 92) - jjCheckNAddStates(16, 18); + jjCheckNAddStates(42, 44); break; default : break; } @@ -447,88 +582,122 @@ { switch(jjstateSet[--i]) { + case 66: + case 32: + if (!jjCanMove_2(hiByte, i1, i2, l1, l2)) + break; + if (kind > 25) + kind = 25; + jjCheckNAddTwoStates(32, 33); + break; case 0: if (jjCanMove_0(hiByte, i1, i2, l1, l2)) { - if (kind > 7) - kind = 7; + if (kind > 8) + kind = 8; } if (jjCanMove_2(hiByte, i1, i2, l1, l2)) { - if (kind > 23) - kind = 23; - jjCheckNAddTwoStates(27, 28); + if (kind > 25) + kind = 25; + jjCheckNAddTwoStates(32, 33); } if (jjCanMove_2(hiByte, i1, i2, l1, l2)) { - if (kind > 20) - kind = 20; + if (kind > 22) + kind = 22; jjCheckNAddStates(6, 10); } break; - case 43: - case 27: - if (!jjCanMove_2(hiByte, i1, i2, l1, l2)) - break; - if (kind > 23) - kind = 23; - jjCheckNAddTwoStates(27, 28); - break; case 15: - if (jjCanMove_0(hiByte, i1, i2, l1, l2) && kind > 13) - kind = 13; + if (jjCanMove_0(hiByte, i1, i2, l1, l2) && kind > 14) + kind = 14; break; case 17: case 19: if (jjCanMove_1(hiByte, i1, i2, l1, l2)) jjCheckNAddStates(3, 5); break; - case 26: + case 22: + case 24: + if (jjCanMove_1(hiByte, i1, i2, l1, l2)) + jjCheckNAddStates(11, 13); + break; + case 31: if (!jjCanMove_2(hiByte, i1, i2, l1, l2)) break; - if (kind > 23) - kind = 23; - jjCheckNAddTwoStates(27, 28); + if (kind > 25) + kind = 25; + jjCheckNAddTwoStates(32, 33); break; - case 29: + case 34: if (!jjCanMove_1(hiByte, i1, i2, l1, l2)) break; - if (kind > 23) - kind = 23; - jjCheckNAddTwoStates(27, 28); + if (kind > 25) + kind = 25; + jjCheckNAddTwoStates(32, 33); break; - case 31: + case 36: if (jjCanMove_1(hiByte, i1, i2, l1, l2)) jjAddStates(0, 2); break; - case 35: + case 41: + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) + jjCheckNAddTwoStates(41, 42); + break; + case 42: + if (jjCanMove_1(hiByte, i1, i2, l1, l2)) + jjCheckNAddStates(19, 22); + break; + case 45: + case 47: + if (jjCanMove_1(hiByte, i1, i2, l1, l2)) + jjCheckNAddStates(29, 31); + break; + case 51: + if (!jjCanMove_1(hiByte, i1, i2, l1, l2)) + break; + if (kind > 29) + kind = 29; + jjstateSet[jjnewStateCnt++] = 51; + break; + case 53: + case 55: + if (jjCanMove_1(hiByte, i1, i2, l1, l2)) + jjCheckNAddStates(32, 34); + break; + case 57: + if (jjCanMove_1(hiByte, i1, i2, l1, l2)) + jjCheckNAddStates(35, 38); + break; + case 58: if (!jjCanMove_2(hiByte, i1, i2, l1, l2)) break; - if (kind > 20) - kind = 20; + if (kind > 22) + kind = 22; jjCheckNAddStates(6, 10); break; - case 36: + case 59: if (!jjCanMove_2(hiByte, i1, i2, l1, l2)) break; - if (kind > 20) - kind = 20; - jjCheckNAddTwoStates(36, 37); + if (kind > 22) + kind = 22; + jjCheckNAddTwoStates(59, 60); break; - case 38: + case 61: if (!jjCanMove_1(hiByte, i1, i2, l1, l2)) break; - if (kind > 20) - kind = 20; - jjCheckNAddTwoStates(36, 37); + if (kind > 22) + kind = 22; + jjCheckNAddTwoStates(59, 60); break; - case 39: + case 62: if (jjCanMove_2(hiByte, i1, i2, l1, l2)) - jjCheckNAddStates(13, 15); + jjCheckNAddStates(39, 41); break; - case 41: + case 64: if (jjCanMove_1(hiByte, i1, i2, l1, l2)) - jjCheckNAddStates(13, 15); + jjCheckNAddStates(39, 41); break; default : break; } @@ -541,7 +710,7 @@ kind = 0x7fffffff; } ++curPos; - if ((i = jjnewStateCnt) == (startsAt = 43 - (jjnewStateCnt = startsAt))) + if ((i = jjnewStateCnt) == (startsAt = 66 - (jjnewStateCnt = startsAt))) return curPos; try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { return curPos; } @@ -572,9 +741,9 @@ case 0: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 27) - kind = 27; - jjAddStates(19, 20); + if (kind > 30) + kind = 30; + jjAddStates(45, 46); break; case 1: if (curChar == 46) @@ -583,8 +752,8 @@ case 2: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 27) - kind = 27; + if (kind > 30) + kind = 30; jjCheckNAdd(2); break; default : break; @@ -635,9 +804,9 @@ switch (pos) { case 0: - if ((active0 & 0x10000000L) != 0L) + if ((active0 & 0x80000000L) != 0L) { - jjmatchedKind = 32; + jjmatchedKind = 35; return 6; } return -1; @@ -654,11 +823,11 @@ switch(curChar) { case 84: - return jjMoveStringLiteralDfa1_1(0x10000000L); + return jjMoveStringLiteralDfa1_1(0x80000000L); case 93: - return jjStopAtPos(0, 29); + return jjStopAtPos(0, 32); case 125: - return jjStopAtPos(0, 30); + return jjStopAtPos(0, 33); default : return jjMoveNfa_1(0, 0); } @@ -673,8 +842,8 @@ switch(curChar) { case 79: - if ((active0 & 0x10000000L) != 0L) - return jjStartNfaWithStates_1(1, 28, 6); + if ((active0 & 0x80000000L) != 0L) + return jjStartNfaWithStates_1(1, 31, 6); break; default : break; @@ -710,14 +879,14 @@ case 0: if ((0xfffffffeffffffffL & l) != 0L) { - if (kind > 32) - kind = 32; + if (kind > 35) + kind = 35; jjCheckNAdd(6); } if ((0x100002600L & l) != 0L) { - if (kind > 7) - kind = 7; + if (kind > 8) + kind = 8; } else if (curChar == 34) jjCheckNAddTwoStates(2, 4); @@ -728,21 +897,21 @@ break; case 2: if ((0xfffffffbffffffffL & l) != 0L) - jjCheckNAddStates(21, 23); + jjCheckNAddStates(47, 49); break; case 3: if (curChar == 34) - jjCheckNAddStates(21, 23); + jjCheckNAddStates(47, 49); break; case 5: - if (curChar == 34 && kind > 31) - kind = 31; + if (curChar == 34 && kind > 34) + kind = 34; break; case 6: if ((0xfffffffeffffffffL & l) == 0L) break; - if (kind > 32) - kind = 32; + if (kind > 35) + kind = 35; jjCheckNAdd(6); break; default : break; @@ -760,12 +929,12 @@ case 6: if ((0xdfffffffdfffffffL & l) == 0L) break; - if (kind > 32) - kind = 32; + if (kind > 35) + kind = 35; jjCheckNAdd(6); break; case 2: - jjAddStates(21, 23); + jjAddStates(47, 49); break; case 4: if (curChar == 92) @@ -789,25 +958,25 @@ case 0: if (jjCanMove_0(hiByte, i1, i2, l1, l2)) { - if (kind > 7) - kind = 7; + if (kind > 8) + kind = 8; } if (jjCanMove_1(hiByte, i1, i2, l1, l2)) { - if (kind > 32) - kind = 32; + if (kind > 35) + kind = 35; jjCheckNAdd(6); } break; case 2: if (jjCanMove_1(hiByte, i1, i2, l1, l2)) - jjAddStates(21, 23); + jjAddStates(47, 49); break; case 6: if (!jjCanMove_1(hiByte, i1, i2, l1, l2)) break; - if (kind > 32) - kind = 32; + if (kind > 35) + kind = 35; jjCheckNAdd(6); break; default : break; @@ -828,8 +997,10 @@ } } static final int[] jjnextStates = { - 31, 33, 34, 17, 18, 20, 36, 39, 25, 40, 37, 22, 23, 39, 25, 40, - 38, 41, 29, 0, 1, 2, 4, 5, + 36, 38, 39, 17, 18, 20, 59, 62, 30, 63, 60, 22, 23, 25, 27, 28, + 41, 42, 49, 41, 42, 43, 49, 41, 42, 44, 52, 57, 49, 45, 46, 48, + 53, 54, 56, 41, 42, 57, 49, 62, 30, 63, 61, 64, 34, 0, 1, 2, + 4, 5, }; private static final boolean jjCanMove_0(int hiByte, int i1, int i2, long l1, long l2) { @@ -870,9 +1041,9 @@ /** Token literal values. */ public static final String[] jjstrLiteralImages = { -"", null, null, null, null, null, null, null, null, null, null, "\53", "\55", -null, "\50", "\51", "\72", "\52", "\136", null, null, null, null, null, null, -"\133", "\173", null, "\124\117", "\135", "\175", null, null, }; +"", null, null, null, null, null, null, null, null, null, null, null, "\53", +"\55", null, "\50", "\51", "\72", "\52", "\136", null, null, null, null, null, null, +null, "\133", "\173", null, null, "\124\117", "\135", "\175", null, null, }; /** Lexer state names. */ public static final String[] lexStateNames = { @@ -883,18 +1054,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, -1, 0, -1, -1, -1, -1, -1, -1, - 1, 1, 2, -1, 2, 2, -1, -1, + -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, -1, 1, 1, -1, 2, -1, 2, 2, -1, -1, }; static final long[] jjtoToken = { - 0x1ffffff01L, + 0xffffffe01L, }; static final long[] jjtoSkip = { - 0x80L, + 0x100L, }; protected CharStream input_stream; -private final int[] jjrounds = new int[43]; -private final int[] jjstateSet = new int[86]; +private final int[] jjrounds = new int[66]; +private final int[] jjstateSet = new int[132]; protected char curChar; /** Constructor. */ public QueryParserTokenManager(CharStream stream){ @@ -919,7 +1090,7 @@ { int i; jjround = 0x80000001; - for (i = 43; i-- > 0;) + for (i = 66; i-- > 0;) jjrounds[i] = 0x80000000; }