Commit ac3fc9e508b979755dbdf8fb05c8bf0e0acb7b51
1 parent
3e66a04a
bug cql parser
Showing
5 changed files
with
544 additions
and
434 deletions
docker/Dockerfile
1 | 1 | # Automatically generated Dockerfile |
2 | -# - Build 2017-01-23 14:37 | |
2 | +# - Build 2017-01-28 11:32 | |
3 | 3 | # - Lucene/Solr version 6.3.0 |
4 | 4 | # - Mtas release 20170110 |
5 | 5 | # |
... | ... | @@ -55,7 +55,7 @@ RUN apt-get update && apt-get install -y lsof software-properties-common python- |
55 | 55 | && chmod -R 755 /var/www/html \ |
56 | 56 | && printf "echo\n" >> /start.sh \ |
57 | 57 | && printf "echo \"================ Mtas -- Multi Tier Annotation Search =================\"\n" >> /start.sh \ |
58 | -&& printf "echo \" Timestamp 2017-01-23 14:37\"\n" >> /start.sh \ | |
58 | +&& printf "echo \" Timestamp 2017-01-28 11:32\"\n" >> /start.sh \ | |
59 | 59 | && printf "echo \" Lucene/Solr version 6.3.0\"\n" >> /start.sh \ |
60 | 60 | && printf "echo \" Mtas release 20170110\"\n" >> /start.sh \ |
61 | 61 | && printf "echo \" See https://meertensinstituut.github.io/mtas/ for more information\"\n" >> /start.sh \ |
... | ... |
junit/mtas/parser/MtasCQLParserTestSentence.java
... | ... | @@ -78,6 +78,7 @@ public class MtasCQLParserTestSentence { |
78 | 78 | basicTest18(); |
79 | 79 | basicTest19(); |
80 | 80 | basicTest20(); |
81 | + basicTest21(); | |
81 | 82 | } |
82 | 83 | |
83 | 84 | private void basicTest1() throws ParseException { |
... | ... | @@ -324,4 +325,11 @@ public class MtasCQLParserTestSentence { |
324 | 325 | testCQLEquivalent(field, null, cql9, cql10); |
325 | 326 | } |
326 | 327 | |
328 | + private void basicTest21() { | |
329 | + String field = "testveld"; | |
330 | + String cql1 = "(<s/>(<s/> containing [t_lc=\"rembrandt\"])</s>)"; | |
331 | + String cql2 = "<s/>(<s/> containing [t_lc=\"rembrandt\"])</s>"; | |
332 | + testCQLEquivalent(field, null, cql1, cql2); | |
333 | + } | |
334 | + | |
327 | 335 | } |
... | ... |
src/mtas/codec/util/CodecComponent.java
... | ... | @@ -1703,11 +1703,9 @@ public class CodecComponent { |
1703 | 1703 | Collections.sort(data, new Comparator<MtasTreeHit<String>>() { |
1704 | 1704 | @Override |
1705 | 1705 | public int compare(MtasTreeHit<String> hit1, MtasTreeHit<String> hit2) { |
1706 | - int compare = (hit1.additionalId > hit2.additionalId) ? 1 | |
1707 | - : ((hit1.additionalId < hit2.additionalId) ? -1 : 0); | |
1706 | + int compare = Integer.compare(hit1.additionalId, hit2.additionalId); | |
1708 | 1707 | compare = (compare == 0) |
1709 | - ? ((hit1.additionalRef > hit2.additionalRef) ? 1 | |
1710 | - : (hit2.additionalRef < hit2.additionalRef) ? -1 : 0) | |
1708 | + ? Long.compare(hit1.additionalRef,hit2.additionalRef) | |
1711 | 1709 | : compare; |
1712 | 1710 | return compare; |
1713 | 1711 | } |
... | ... |
src/mtas/parser/cql/MtasCQLParser.java
... | ... | @@ -91,6 +91,8 @@ public class MtasCQLParser implements MtasCQLParserConstants { |
91 | 91 | final private MtasSpanSequenceItem cqlBlock(String field, String defaultPrefix, HashMap<String, String[] > variables, HashSet<String > usedVariables, MtasSpanQuery ignore,Integer maximumIgnoreLength) throws ParseException, ParseException { |
92 | 92 | MtasCQLParserSentenceCondition sc1 = null, sc2 = null; |
93 | 93 | MtasSpanSequenceItem si1 = null, si2=null; |
94 | + ArrayList < MtasSpanSequenceItem > itemList1 = new ArrayList < MtasSpanSequenceItem > (); | |
95 | + ArrayList < MtasSpanSequenceItem > itemList2 = new ArrayList < MtasSpanSequenceItem > (); | |
94 | 96 | MtasSpanQuery q1 = null, q2 = null; |
95 | 97 | Token end = null; |
96 | 98 | String operator = null; |
... | ... | @@ -100,44 +102,66 @@ public class MtasCQLParser implements MtasCQLParserConstants { |
100 | 102 | String OPERATOR_NOT_WITHIN = "not_within"; |
101 | 103 | String OPERATOR_INTERSECTING = "intersecting"; |
102 | 104 | String OPERATOR_NOT_INTERSECTING = "not_intersecting"; |
103 | - if (jj_2_2(1000)) { | |
105 | + if (jj_2_3(1000)) { | |
104 | 106 | sc1 = sentence(field, defaultPrefix, variables, usedVariables, ignore, maximumIgnoreLength); |
105 | - } else if (jj_2_3(1000)) { | |
107 | + } else if (jj_2_4(1000)) { | |
106 | 108 | jj_consume_token(BRACKET_START); |
107 | 109 | si1 = cqlBlock(field, defaultPrefix, variables, usedVariables, ignore, maximumIgnoreLength); |
110 | + itemList1.add(si1); | |
111 | + label_2: | |
112 | + while (true) { | |
113 | + if (jj_2_2(1000)) { | |
114 | + ; | |
115 | + } else { | |
116 | + break label_2; | |
117 | + } | |
118 | + si1 = cqlBlock(field, defaultPrefix, variables, usedVariables, ignore, maximumIgnoreLength); | |
119 | + itemList1.add(si1); | |
120 | + } | |
108 | 121 | jj_consume_token(BRACKET_END); |
109 | 122 | } else { |
110 | 123 | jj_consume_token(-1); |
111 | 124 | throw new ParseException(); |
112 | 125 | } |
113 | - if (jj_2_12(1000)) { | |
114 | - if (jj_2_4(1000)) { | |
126 | + if (jj_2_14(1000)) { | |
127 | + if (jj_2_5(1000)) { | |
115 | 128 | jj_consume_token(CONTAINING); |
116 | 129 | operator = OPERATOR_CONTAINING; |
117 | - } else if (jj_2_5(1000)) { | |
130 | + } else if (jj_2_6(1000)) { | |
118 | 131 | jj_consume_token(NOT_CONTAINING); |
119 | 132 | operator = OPERATOR_NOT_CONTAINING; |
120 | - } else if (jj_2_6(1000)) { | |
133 | + } else if (jj_2_7(1000)) { | |
121 | 134 | jj_consume_token(WITHIN); |
122 | 135 | operator = OPERATOR_WITHIN; |
123 | - } else if (jj_2_7(1000)) { | |
136 | + } else if (jj_2_8(1000)) { | |
124 | 137 | jj_consume_token(NOT_WITHIN); |
125 | 138 | operator = OPERATOR_NOT_WITHIN; |
126 | - } else if (jj_2_8(1000)) { | |
139 | + } else if (jj_2_9(1000)) { | |
127 | 140 | jj_consume_token(INTERSECTING); |
128 | 141 | operator = OPERATOR_INTERSECTING; |
129 | - } else if (jj_2_9(1000)) { | |
142 | + } else if (jj_2_10(1000)) { | |
130 | 143 | jj_consume_token(NOT_INTERSECTING); |
131 | 144 | operator = OPERATOR_NOT_INTERSECTING; |
132 | 145 | } else { |
133 | 146 | jj_consume_token(-1); |
134 | 147 | throw new ParseException(); |
135 | 148 | } |
136 | - if (jj_2_10(1000)) { | |
149 | + if (jj_2_12(1000)) { | |
137 | 150 | sc2 = sentence(field, defaultPrefix, variables, usedVariables, ignore, maximumIgnoreLength); |
138 | - } else if (jj_2_11(1000)) { | |
151 | + } else if (jj_2_13(1000)) { | |
139 | 152 | jj_consume_token(BRACKET_START); |
140 | 153 | si2 = cqlBlock(field, defaultPrefix, variables, usedVariables, ignore, maximumIgnoreLength); |
154 | + itemList2.add(si2); | |
155 | + label_3: | |
156 | + while (true) { | |
157 | + if (jj_2_11(1000)) { | |
158 | + ; | |
159 | + } else { | |
160 | + break label_3; | |
161 | + } | |
162 | + si2 = cqlBlock(field, defaultPrefix, variables, usedVariables, ignore, maximumIgnoreLength); | |
163 | + itemList2.add(si2); | |
164 | + } | |
141 | 165 | jj_consume_token(BRACKET_END); |
142 | 166 | } else { |
143 | 167 | jj_consume_token(-1); |
... | ... | @@ -149,12 +173,22 @@ public class MtasCQLParser implements MtasCQLParserConstants { |
149 | 173 | if (sc1 != null) |
150 | 174 | { |
151 | 175 | si1 = new MtasSpanSequenceItem(sc1.getQuery(),sc1.isOptional()); |
176 | + } else if(itemList1.size()==1) { | |
177 | + si1 = itemList1.get(0); | |
178 | + } else { | |
179 | + MtasSpanQuery q = new MtasSpanSequenceQuery(itemList1, ignore, maximumIgnoreLength); | |
180 | + si1 = new MtasSpanSequenceItem(q, false); | |
152 | 181 | } |
153 | 182 | if (operator != null) |
154 | 183 | { |
155 | 184 | if (sc2 != null) |
156 | 185 | { |
157 | 186 | si2 = new MtasSpanSequenceItem(sc2.getQuery(),sc2.isOptional()); |
187 | + } else if(itemList2.size()==1) { | |
188 | + si2 = itemList2.get(0); | |
189 | + } else { | |
190 | + MtasSpanQuery q = new MtasSpanSequenceQuery(itemList2, ignore, maximumIgnoreLength); | |
191 | + si2 = new MtasSpanSequenceItem(q, false); | |
158 | 192 | } |
159 | 193 | if (operator.equals(OPERATOR_CONTAINING)) |
160 | 194 | { |
... | ... | @@ -221,26 +255,26 @@ public class MtasCQLParser implements MtasCQLParserConstants { |
221 | 255 | Token maxValue = null; |
222 | 256 | int minimumOccurence = 1; |
223 | 257 | int maximumOccurence = 1; |
224 | - if (jj_2_17(1000)) { | |
258 | + if (jj_2_19(1000)) { | |
225 | 259 | basicSentence = basicSentence(field, defaultPrefix, variables, usedVariables, ignore, maximumIgnoreLength); |
226 | 260 | condition = new MtasCQLParserSentencePartCondition(basicSentence, ignore, maximumIgnoreLength); |
227 | - } else if (jj_2_18(1000)) { | |
261 | + } else if (jj_2_20(1000)) { | |
228 | 262 | jj_consume_token(BRACKET_START); |
229 | 263 | sentencePart = sentencePart(field, defaultPrefix, variables, usedVariables, ignore, maximumIgnoreLength); |
230 | 264 | jj_consume_token(BRACKET_END); |
231 | - if (jj_2_16(1000)) { | |
265 | + if (jj_2_18(1000)) { | |
232 | 266 | questionMark = null; |
233 | - if (jj_2_13(1000)) { | |
267 | + if (jj_2_15(1000)) { | |
234 | 268 | jj_consume_token(CURLY_BRACKET_START); |
235 | 269 | minValue = jj_consume_token(NUMBER); |
236 | 270 | jj_consume_token(KOMMA); |
237 | 271 | maxValue = jj_consume_token(NUMBER); |
238 | 272 | jj_consume_token(CURLY_BRACKET_END); |
239 | - } else if (jj_2_14(1000)) { | |
273 | + } else if (jj_2_16(1000)) { | |
240 | 274 | jj_consume_token(CURLY_BRACKET_START); |
241 | 275 | minValue = jj_consume_token(NUMBER); |
242 | 276 | jj_consume_token(CURLY_BRACKET_END); |
243 | - } else if (jj_2_15(1000)) { | |
277 | + } else if (jj_2_17(1000)) { | |
244 | 278 | questionMark = jj_consume_token(QUESTION_MARK); |
245 | 279 | } else { |
246 | 280 | jj_consume_token(-1); |
... | ... | @@ -272,9 +306,9 @@ public class MtasCQLParser implements MtasCQLParserConstants { |
272 | 306 | jj_consume_token(-1); |
273 | 307 | throw new ParseException(); |
274 | 308 | } |
275 | - if (jj_2_20(1000)) { | |
309 | + if (jj_2_22(1000)) { | |
276 | 310 | operator = null; |
277 | - if (jj_2_19(1000)) { | |
311 | + if (jj_2_21(1000)) { | |
278 | 312 | operator = jj_consume_token(OR); |
279 | 313 | } else { |
280 | 314 | ; |
... | ... | @@ -300,27 +334,27 @@ public class MtasCQLParser implements MtasCQLParserConstants { |
300 | 334 | MtasCQLParserWordFullCondition subWordCondition; |
301 | 335 | MtasCQLParserGroupFullCondition subGroupCondition; |
302 | 336 | MtasCQLParserBasicSentenceCondition condition = new MtasCQLParserBasicSentenceCondition(ignore, maximumIgnoreLength); |
303 | - if (jj_2_21(1000)) { | |
337 | + if (jj_2_23(1000)) { | |
304 | 338 | subWordCondition = word(field, defaultPrefix, variables, usedVariables); |
305 | 339 | condition.addWord(subWordCondition); |
306 | - } else if (jj_2_22(1000)) { | |
340 | + } else if (jj_2_24(1000)) { | |
307 | 341 | subGroupCondition = group(field); |
308 | 342 | condition.addGroup(subGroupCondition); |
309 | 343 | } else { |
310 | 344 | jj_consume_token(-1); |
311 | 345 | throw new ParseException(); |
312 | 346 | } |
313 | - label_2: | |
347 | + label_4: | |
314 | 348 | while (true) { |
315 | - if (jj_2_23(1000)) { | |
349 | + if (jj_2_25(1000)) { | |
316 | 350 | ; |
317 | 351 | } else { |
318 | - break label_2; | |
352 | + break label_4; | |
319 | 353 | } |
320 | - if (jj_2_24(1000)) { | |
354 | + if (jj_2_26(1000)) { | |
321 | 355 | subWordCondition = word(field, defaultPrefix, variables, usedVariables); |
322 | 356 | condition.addWord(subWordCondition); |
323 | - } else if (jj_2_25(1000)) { | |
357 | + } else if (jj_2_27(1000)) { | |
324 | 358 | subGroupCondition = group(field); |
325 | 359 | condition.addGroup(subGroupCondition); |
326 | 360 | } else { |
... | ... | @@ -343,9 +377,9 @@ public class MtasCQLParser implements MtasCQLParserConstants { |
343 | 377 | int minimumOccurence = 1; |
344 | 378 | int maximumOccurence = 1; |
345 | 379 | jj_consume_token(GROUP_START); |
346 | - if (jj_2_27(1000)) { | |
380 | + if (jj_2_29(1000)) { | |
347 | 381 | condition = groupCondition(field); |
348 | - if (jj_2_26(1000)) { | |
382 | + if (jj_2_28(1000)) { | |
349 | 383 | slash = jj_consume_token(SLASH); |
350 | 384 | } else { |
351 | 385 | ; |
... | ... | @@ -359,7 +393,7 @@ public class MtasCQLParser implements MtasCQLParserConstants { |
359 | 393 | startGroup = false; |
360 | 394 | } |
361 | 395 | endGroup = false; |
362 | - } else if (jj_2_28(1000)) { | |
396 | + } else if (jj_2_30(1000)) { | |
363 | 397 | jj_consume_token(SLASH); |
364 | 398 | condition = groupCondition(field); |
365 | 399 | startGroup = true; |
... | ... | @@ -369,19 +403,19 @@ public class MtasCQLParser implements MtasCQLParserConstants { |
369 | 403 | throw new ParseException(); |
370 | 404 | } |
371 | 405 | jj_consume_token(GROUP_END); |
372 | - if (jj_2_32(1000)) { | |
406 | + if (jj_2_34(1000)) { | |
373 | 407 | questionMark = null; |
374 | - if (jj_2_29(1000)) { | |
408 | + if (jj_2_31(1000)) { | |
375 | 409 | jj_consume_token(CURLY_BRACKET_START); |
376 | 410 | minValue = jj_consume_token(NUMBER); |
377 | 411 | jj_consume_token(KOMMA); |
378 | 412 | maxValue = jj_consume_token(NUMBER); |
379 | 413 | jj_consume_token(CURLY_BRACKET_END); |
380 | - } else if (jj_2_30(1000)) { | |
414 | + } else if (jj_2_32(1000)) { | |
381 | 415 | jj_consume_token(CURLY_BRACKET_START); |
382 | 416 | minValue = jj_consume_token(NUMBER); |
383 | 417 | jj_consume_token(CURLY_BRACKET_END); |
384 | - } else if (jj_2_31(1000)) { | |
418 | + } else if (jj_2_33(1000)) { | |
385 | 419 | questionMark = jj_consume_token(QUESTION_MARK); |
386 | 420 | } else { |
387 | 421 | jj_consume_token(-1); |
... | ... | @@ -427,11 +461,11 @@ public class MtasCQLParser implements MtasCQLParserConstants { |
427 | 461 | final private MtasCQLParserGroupCondition groupCondition(String field) throws ParseException, ParseException { |
428 | 462 | Token prefix; |
429 | 463 | Token value = null; |
430 | - if (jj_2_33(1000)) { | |
464 | + if (jj_2_35(1000)) { | |
431 | 465 | prefix = jj_consume_token(UNQUOTED_VALUE); |
432 | 466 | jj_consume_token(TOKEN_EQUALS); |
433 | 467 | value = jj_consume_token(QUOTED_VALUE); |
434 | - } else if (jj_2_34(1000)) { | |
468 | + } else if (jj_2_36(1000)) { | |
435 | 469 | prefix = jj_consume_token(UNQUOTED_VALUE); |
436 | 470 | value = null; |
437 | 471 | } else { |
... | ... | @@ -462,42 +496,42 @@ public class MtasCQLParser implements MtasCQLParserConstants { |
462 | 496 | Token maxValue = null; |
463 | 497 | int minimumOccurence = 1; |
464 | 498 | int maximumOccurence = 1; |
465 | - if (jj_2_41(1000)) { | |
499 | + if (jj_2_43(1000)) { | |
466 | 500 | value = jj_consume_token(QUOTED_VALUE); |
467 | 501 | condition = new MtasCQLParserDefaultPrefixCondition(field, defaultPrefix, unquoteString(value.image), variables, usedVariables); |
468 | - } else if (jj_2_42(1000)) { | |
502 | + } else if (jj_2_44(1000)) { | |
469 | 503 | jj_consume_token(WORD_START); |
470 | - if (jj_2_39(1000)) { | |
504 | + if (jj_2_41(1000)) { | |
471 | 505 | subCondition = wordCondition(field, variables, usedVariables); |
472 | - if (jj_2_37(1000)) { | |
506 | + if (jj_2_39(1000)) { | |
473 | 507 | jj_consume_token(AND); |
474 | 508 | condition = new MtasCQLParserWordCondition(field, MtasCQLParserWordCondition.TYPE_AND); |
475 | 509 | condition.addCondition(subCondition); |
476 | 510 | subCondition = wordCondition(field, variables, usedVariables); |
477 | 511 | condition.addCondition(subCondition); |
478 | - label_3: | |
512 | + label_5: | |
479 | 513 | while (true) { |
480 | - if (jj_2_35(1000)) { | |
514 | + if (jj_2_37(1000)) { | |
481 | 515 | ; |
482 | 516 | } else { |
483 | - break label_3; | |
517 | + break label_5; | |
484 | 518 | } |
485 | 519 | jj_consume_token(AND); |
486 | 520 | subCondition = wordCondition(field, variables, usedVariables); |
487 | 521 | condition.addCondition(subCondition); |
488 | 522 | } |
489 | - } else if (jj_2_38(1000)) { | |
523 | + } else if (jj_2_40(1000)) { | |
490 | 524 | jj_consume_token(OR); |
491 | 525 | condition = new MtasCQLParserWordCondition(field, MtasCQLParserWordCondition.TYPE_OR); |
492 | 526 | condition.addCondition(subCondition); |
493 | 527 | subCondition = wordCondition(field, variables, usedVariables); |
494 | 528 | condition.addCondition(subCondition); |
495 | - label_4: | |
529 | + label_6: | |
496 | 530 | while (true) { |
497 | - if (jj_2_36(1000)) { | |
531 | + if (jj_2_38(1000)) { | |
498 | 532 | ; |
499 | 533 | } else { |
500 | - break label_4; | |
534 | + break label_6; | |
501 | 535 | } |
502 | 536 | jj_consume_token(OR); |
503 | 537 | subCondition = wordCondition(field, variables, usedVariables); |
... | ... | @@ -507,14 +541,14 @@ public class MtasCQLParser implements MtasCQLParserConstants { |
507 | 541 | jj_consume_token(-1); |
508 | 542 | throw new ParseException(); |
509 | 543 | } |
510 | - } else if (jj_2_40(1000)) { | |
544 | + } else if (jj_2_42(1000)) { | |
511 | 545 | condition = wordCondition(field, variables, usedVariables); |
512 | 546 | } else { |
513 | 547 | jj_consume_token(-1); |
514 | 548 | throw new ParseException(); |
515 | 549 | } |
516 | 550 | jj_consume_token(WORD_END); |
517 | - } else if (jj_2_43(1000)) { | |
551 | + } else if (jj_2_45(1000)) { | |
518 | 552 | condition = new MtasCQLParserWordCondition(field, MtasCQLParserWordCondition.TYPE_AND); |
519 | 553 | jj_consume_token(WORD_START); |
520 | 554 | jj_consume_token(WORD_END); |
... | ... | @@ -522,19 +556,19 @@ public class MtasCQLParser implements MtasCQLParserConstants { |
522 | 556 | jj_consume_token(-1); |
523 | 557 | throw new ParseException(); |
524 | 558 | } |
525 | - if (jj_2_47(1000)) { | |
559 | + if (jj_2_49(1000)) { | |
526 | 560 | questionMark = null; |
527 | - if (jj_2_44(1000)) { | |
561 | + if (jj_2_46(1000)) { | |
528 | 562 | jj_consume_token(CURLY_BRACKET_START); |
529 | 563 | minValue = jj_consume_token(NUMBER); |
530 | 564 | jj_consume_token(KOMMA); |
531 | 565 | maxValue = jj_consume_token(NUMBER); |
532 | 566 | jj_consume_token(CURLY_BRACKET_END); |
533 | - } else if (jj_2_45(1000)) { | |
567 | + } else if (jj_2_47(1000)) { | |
534 | 568 | jj_consume_token(CURLY_BRACKET_START); |
535 | 569 | minValue = jj_consume_token(NUMBER); |
536 | 570 | jj_consume_token(CURLY_BRACKET_END); |
537 | - } else if (jj_2_46(1000)) { | |
571 | + } else if (jj_2_48(1000)) { | |
538 | 572 | questionMark = jj_consume_token(QUESTION_MARK); |
539 | 573 | } else { |
540 | 574 | jj_consume_token(-1); |
... | ... | @@ -571,18 +605,18 @@ public class MtasCQLParser implements MtasCQLParserConstants { |
571 | 605 | final private MtasCQLParserWordCondition wordCondition(String field, HashMap<String, String[] > variables, HashSet<String > usedVariables) throws ParseException, ParseException { |
572 | 606 | Token negation = null; |
573 | 607 | MtasCQLParserWordCondition condition, subCondition; |
574 | - if (jj_2_68(1000)) { | |
575 | - if (jj_2_48(1000)) { | |
608 | + if (jj_2_70(1000)) { | |
609 | + if (jj_2_50(1000)) { | |
576 | 610 | negation = jj_consume_token(NEGATION); |
577 | 611 | } else { |
578 | 612 | ; |
579 | 613 | } |
580 | 614 | jj_consume_token(BRACKET_START); |
581 | - if (jj_2_65(1000)) { | |
615 | + if (jj_2_67(1000)) { | |
582 | 616 | condition = new MtasCQLParserWordCondition(field, MtasCQLParserWordCondition.TYPE_AND); |
583 | - if (jj_2_49(1000)) { | |
617 | + if (jj_2_51(1000)) { | |
584 | 618 | subCondition = wordAtomCondition(field, variables, usedVariables); |
585 | - } else if (jj_2_50(1000)) { | |
619 | + } else if (jj_2_52(1000)) { | |
586 | 620 | subCondition = wordCondition(field, variables, usedVariables); |
587 | 621 | } else { |
588 | 622 | jj_consume_token(-1); |
... | ... | @@ -590,26 +624,26 @@ public class MtasCQLParser implements MtasCQLParserConstants { |
590 | 624 | } |
591 | 625 | condition.addCondition(subCondition); |
592 | 626 | jj_consume_token(AND); |
593 | - if (jj_2_51(1000)) { | |
627 | + if (jj_2_53(1000)) { | |
594 | 628 | subCondition = wordAtomCondition(field, variables, usedVariables); |
595 | - } else if (jj_2_52(1000)) { | |
629 | + } else if (jj_2_54(1000)) { | |
596 | 630 | subCondition = wordCondition(field, variables, usedVariables); |
597 | 631 | } else { |
598 | 632 | jj_consume_token(-1); |
599 | 633 | throw new ParseException(); |
600 | 634 | } |
601 | 635 | condition.addCondition(subCondition); |
602 | - label_5: | |
636 | + label_7: | |
603 | 637 | while (true) { |
604 | - if (jj_2_53(1000)) { | |
638 | + if (jj_2_55(1000)) { | |
605 | 639 | ; |
606 | 640 | } else { |
607 | - break label_5; | |
641 | + break label_7; | |
608 | 642 | } |
609 | 643 | jj_consume_token(AND); |
610 | - if (jj_2_54(1000)) { | |
644 | + if (jj_2_56(1000)) { | |
611 | 645 | subCondition = wordAtomCondition(field, variables, usedVariables); |
612 | - } else if (jj_2_55(1000)) { | |
646 | + } else if (jj_2_57(1000)) { | |
613 | 647 | subCondition = wordCondition(field, variables, usedVariables); |
614 | 648 | } else { |
615 | 649 | jj_consume_token(-1); |
... | ... | @@ -617,11 +651,11 @@ public class MtasCQLParser implements MtasCQLParserConstants { |
617 | 651 | } |
618 | 652 | condition.addCondition(subCondition); |
619 | 653 | } |
620 | - } else if (jj_2_66(1000)) { | |
654 | + } else if (jj_2_68(1000)) { | |
621 | 655 | condition = new MtasCQLParserWordCondition(field, MtasCQLParserWordCondition.TYPE_OR); |
622 | - if (jj_2_56(1000)) { | |
656 | + if (jj_2_58(1000)) { | |
623 | 657 | subCondition = wordAtomCondition(field, variables, usedVariables); |
624 | - } else if (jj_2_57(1000)) { | |
658 | + } else if (jj_2_59(1000)) { | |
625 | 659 | subCondition = wordCondition(field, variables, usedVariables); |
626 | 660 | } else { |
627 | 661 | jj_consume_token(-1); |
... | ... | @@ -629,26 +663,26 @@ public class MtasCQLParser implements MtasCQLParserConstants { |
629 | 663 | } |
630 | 664 | condition.addCondition(subCondition); |
631 | 665 | jj_consume_token(OR); |
632 | - if (jj_2_58(1000)) { | |
666 | + if (jj_2_60(1000)) { | |
633 | 667 | subCondition = wordAtomCondition(field, variables, usedVariables); |
634 | - } else if (jj_2_59(1000)) { | |
668 | + } else if (jj_2_61(1000)) { | |
635 | 669 | subCondition = wordCondition(field, variables, usedVariables); |
636 | 670 | } else { |
637 | 671 | jj_consume_token(-1); |
638 | 672 | throw new ParseException(); |
639 | 673 | } |
640 | 674 | condition.addCondition(subCondition); |
641 | - label_6: | |
675 | + label_8: | |
642 | 676 | while (true) { |
643 | - if (jj_2_60(1000)) { | |
677 | + if (jj_2_62(1000)) { | |
644 | 678 | ; |
645 | 679 | } else { |
646 | - break label_6; | |
680 | + break label_8; | |
647 | 681 | } |
648 | 682 | jj_consume_token(OR); |
649 | - if (jj_2_61(1000)) { | |
683 | + if (jj_2_63(1000)) { | |
650 | 684 | subCondition = wordAtomCondition(field, variables, usedVariables); |
651 | - } else if (jj_2_62(1000)) { | |
685 | + } else if (jj_2_64(1000)) { | |
652 | 686 | subCondition = wordCondition(field, variables, usedVariables); |
653 | 687 | } else { |
654 | 688 | jj_consume_token(-1); |
... | ... | @@ -656,10 +690,10 @@ public class MtasCQLParser implements MtasCQLParserConstants { |
656 | 690 | } |
657 | 691 | condition.addCondition(subCondition); |
658 | 692 | } |
659 | - } else if (jj_2_67(1000)) { | |
660 | - if (jj_2_63(1000)) { | |
693 | + } else if (jj_2_69(1000)) { | |
694 | + if (jj_2_65(1000)) { | |
661 | 695 | condition = wordAtomCondition(field, variables, usedVariables); |
662 | - } else if (jj_2_64(1000)) { | |
696 | + } else if (jj_2_66(1000)) { | |
663 | 697 | condition = wordCondition(field, variables, usedVariables); |
664 | 698 | } else { |
665 | 699 | jj_consume_token(-1); |
... | ... | @@ -676,7 +710,7 @@ public class MtasCQLParser implements MtasCQLParserConstants { |
676 | 710 | } |
677 | 711 | //System.out.println("=== wordCondition ===\n" + condition + "\n"); |
678 | 712 | {if (true) return condition;} |
679 | - } else if (jj_2_69(1000)) { | |
713 | + } else if (jj_2_71(1000)) { | |
680 | 714 | //plain atom is a valid condition |
681 | 715 | subCondition = wordAtomCondition(field, variables, usedVariables); |
682 | 716 | //System.out.println("=== wordCondition ===\n" + subCondition + "\n"); |
... | ... | @@ -695,16 +729,16 @@ public class MtasCQLParser implements MtasCQLParserConstants { |
695 | 729 | Token nequals = null; |
696 | 730 | Token prefix; |
697 | 731 | Token value; |
698 | - if (jj_2_70(1000)) { | |
732 | + if (jj_2_72(1000)) { | |
699 | 733 | negation = jj_consume_token(NEGATION); |
700 | 734 | } else { |
701 | 735 | ; |
702 | 736 | } |
703 | - if (jj_2_77(1000)) { | |
737 | + if (jj_2_79(1000)) { | |
704 | 738 | jj_consume_token(OCTOTHORPE); |
705 | - if (jj_2_71(1000)) { | |
739 | + if (jj_2_73(1000)) { | |
706 | 740 | value = jj_consume_token(NUMBER); |
707 | - } else if (jj_2_72(1000)) { | |
741 | + } else if (jj_2_74(1000)) { | |
708 | 742 | value = jj_consume_token(UNQUOTED_VALUE); |
709 | 743 | } else { |
710 | 744 | jj_consume_token(-1); |
... | ... | @@ -740,11 +774,11 @@ public class MtasCQLParser implements MtasCQLParserConstants { |
740 | 774 | {if (true) throw new ParseException("invalid range");} |
741 | 775 | } |
742 | 776 | {if (true) return condition;} |
743 | - } else if (jj_2_78(1000)) { | |
777 | + } else if (jj_2_80(1000)) { | |
744 | 778 | prefix = jj_consume_token(UNQUOTED_VALUE); |
745 | - if (jj_2_73(1000)) { | |
779 | + if (jj_2_75(1000)) { | |
746 | 780 | nequals = jj_consume_token(TOKEN_NOTEQUALS); |
747 | - } else if (jj_2_74(1000)) { | |
781 | + } else if (jj_2_76(1000)) { | |
748 | 782 | jj_consume_token(TOKEN_EQUALS); |
749 | 783 | } else { |
750 | 784 | jj_consume_token(-1); |
... | ... | @@ -769,11 +803,11 @@ public class MtasCQLParser implements MtasCQLParserConstants { |
769 | 803 | //System.out.println("=== wordAtomCondition ===\n" + condition + "\n"); |
770 | 804 | {if (true) return condition;} |
771 | 805 | } |
772 | - } else if (jj_2_79(1000)) { | |
806 | + } else if (jj_2_81(1000)) { | |
773 | 807 | prefix = jj_consume_token(UNQUOTED_VALUE); |
774 | - if (jj_2_75(1000)) { | |
808 | + if (jj_2_77(1000)) { | |
775 | 809 | nequals = jj_consume_token(TOKEN_NOTEQUALS); |
776 | - } else if (jj_2_76(1000)) { | |
810 | + } else if (jj_2_78(1000)) { | |
777 | 811 | jj_consume_token(TOKEN_EQUALS); |
778 | 812 | } else { |
779 | 813 | jj_consume_token(-1); |
... | ... | @@ -1358,158 +1392,142 @@ public class MtasCQLParser implements MtasCQLParserConstants { |
1358 | 1392 | finally { jj_save(78, xla); } |
1359 | 1393 | } |
1360 | 1394 | |
1361 | - private boolean jj_3_54() { | |
1362 | - if (jj_3R_15()) return true; | |
1363 | - return false; | |
1395 | + private boolean jj_2_80(int xla) { | |
1396 | + jj_la = xla; jj_lastpos = jj_scanpos = token; | |
1397 | + try { return !jj_3_80(); } | |
1398 | + catch(LookaheadSuccess ls) { return true; } | |
1399 | + finally { jj_save(79, xla); } | |
1364 | 1400 | } |
1365 | 1401 | |
1366 | - private boolean jj_3_26() { | |
1367 | - if (jj_scan_token(SLASH)) return true; | |
1368 | - return false; | |
1402 | + private boolean jj_2_81(int xla) { | |
1403 | + jj_la = xla; jj_lastpos = jj_scanpos = token; | |
1404 | + try { return !jj_3_81(); } | |
1405 | + catch(LookaheadSuccess ls) { return true; } | |
1406 | + finally { jj_save(80, xla); } | |
1369 | 1407 | } |
1370 | 1408 | |
1371 | - private boolean jj_3_53() { | |
1372 | - if (jj_scan_token(AND)) return true; | |
1409 | + private boolean jj_3_29() { | |
1410 | + if (jj_3R_15()) return true; | |
1373 | 1411 | Token xsp; |
1374 | 1412 | xsp = jj_scanpos; |
1375 | - if (jj_3_54()) { | |
1376 | - jj_scanpos = xsp; | |
1377 | - if (jj_3_55()) return true; | |
1378 | - } | |
1379 | - return false; | |
1380 | - } | |
1381 | - | |
1382 | - private boolean jj_3_31() { | |
1383 | - if (jj_scan_token(QUESTION_MARK)) return true; | |
1384 | - return false; | |
1385 | - } | |
1386 | - | |
1387 | - private boolean jj_3_30() { | |
1388 | - if (jj_scan_token(CURLY_BRACKET_START)) return true; | |
1389 | - if (jj_scan_token(NUMBER)) return true; | |
1390 | - if (jj_scan_token(CURLY_BRACKET_END)) return true; | |
1413 | + if (jj_3_28()) jj_scanpos = xsp; | |
1391 | 1414 | return false; |
1392 | 1415 | } |
1393 | 1416 | |
1394 | - private boolean jj_3_52() { | |
1395 | - if (jj_3R_14()) return true; | |
1417 | + private boolean jj_3R_14() { | |
1418 | + if (jj_scan_token(GROUP_START)) return true; | |
1419 | + Token xsp; | |
1420 | + xsp = jj_scanpos; | |
1421 | + if (jj_3_29()) { | |
1422 | + jj_scanpos = xsp; | |
1423 | + if (jj_3_30()) return true; | |
1424 | + } | |
1425 | + if (jj_scan_token(GROUP_END)) return true; | |
1426 | + xsp = jj_scanpos; | |
1427 | + if (jj_3_34()) jj_scanpos = xsp; | |
1396 | 1428 | return false; |
1397 | 1429 | } |
1398 | 1430 | |
1399 | - private boolean jj_3_29() { | |
1400 | - if (jj_scan_token(CURLY_BRACKET_START)) return true; | |
1401 | - if (jj_scan_token(NUMBER)) return true; | |
1402 | - if (jj_scan_token(KOMMA)) return true; | |
1403 | - if (jj_scan_token(NUMBER)) return true; | |
1404 | - if (jj_scan_token(CURLY_BRACKET_END)) return true; | |
1431 | + private boolean jj_3_78() { | |
1432 | + if (jj_scan_token(TOKEN_EQUALS)) return true; | |
1405 | 1433 | return false; |
1406 | 1434 | } |
1407 | 1435 | |
1408 | - private boolean jj_3_51() { | |
1409 | - if (jj_3R_15()) return true; | |
1436 | + private boolean jj_3_77() { | |
1437 | + if (jj_scan_token(TOKEN_NOTEQUALS)) return true; | |
1410 | 1438 | return false; |
1411 | 1439 | } |
1412 | 1440 | |
1413 | - private boolean jj_3_32() { | |
1441 | + private boolean jj_3_81() { | |
1442 | + if (jj_scan_token(UNQUOTED_VALUE)) return true; | |
1414 | 1443 | Token xsp; |
1415 | 1444 | xsp = jj_scanpos; |
1416 | - if (jj_3_29()) { | |
1417 | - jj_scanpos = xsp; | |
1418 | - if (jj_3_30()) { | |
1445 | + if (jj_3_77()) { | |
1419 | 1446 | jj_scanpos = xsp; |
1420 | - if (jj_3_31()) return true; | |
1421 | - } | |
1447 | + if (jj_3_78()) return true; | |
1422 | 1448 | } |
1449 | + if (jj_scan_token(QUOTED_VALUE)) return true; | |
1423 | 1450 | return false; |
1424 | 1451 | } |
1425 | 1452 | |
1426 | - private boolean jj_3_50() { | |
1453 | + private boolean jj_3_11() { | |
1454 | + if (jj_3R_9()) return true; | |
1455 | + return false; | |
1456 | + } | |
1457 | + | |
1458 | + private boolean jj_3_27() { | |
1427 | 1459 | if (jj_3R_14()) return true; |
1428 | 1460 | return false; |
1429 | 1461 | } |
1430 | 1462 | |
1431 | - private boolean jj_3_49() { | |
1432 | - if (jj_3R_15()) return true; | |
1463 | + private boolean jj_3_48() { | |
1464 | + if (jj_scan_token(QUESTION_MARK)) return true; | |
1433 | 1465 | return false; |
1434 | 1466 | } |
1435 | 1467 | |
1436 | - private boolean jj_3_28() { | |
1437 | - if (jj_scan_token(SLASH)) return true; | |
1468 | + private boolean jj_3_26() { | |
1438 | 1469 | if (jj_3R_13()) return true; |
1439 | 1470 | return false; |
1440 | 1471 | } |
1441 | 1472 | |
1442 | - private boolean jj_3_65() { | |
1473 | + private boolean jj_3_47() { | |
1474 | + if (jj_scan_token(CURLY_BRACKET_START)) return true; | |
1475 | + if (jj_scan_token(NUMBER)) return true; | |
1476 | + if (jj_scan_token(CURLY_BRACKET_END)) return true; | |
1477 | + return false; | |
1478 | + } | |
1479 | + | |
1480 | + private boolean jj_3_13() { | |
1481 | + if (jj_scan_token(BRACKET_START)) return true; | |
1482 | + if (jj_3R_9()) return true; | |
1443 | 1483 | Token xsp; |
1444 | - xsp = jj_scanpos; | |
1445 | - if (jj_3_49()) { | |
1446 | - jj_scanpos = xsp; | |
1447 | - if (jj_3_50()) return true; | |
1448 | - } | |
1449 | - if (jj_scan_token(AND)) return true; | |
1450 | - xsp = jj_scanpos; | |
1451 | - if (jj_3_51()) { | |
1452 | - jj_scanpos = xsp; | |
1453 | - if (jj_3_52()) return true; | |
1454 | - } | |
1455 | 1484 | while (true) { |
1456 | 1485 | xsp = jj_scanpos; |
1457 | - if (jj_3_53()) { jj_scanpos = xsp; break; } | |
1486 | + if (jj_3_11()) { jj_scanpos = xsp; break; } | |
1458 | 1487 | } |
1488 | + if (jj_scan_token(BRACKET_END)) return true; | |
1459 | 1489 | return false; |
1460 | 1490 | } |
1461 | 1491 | |
1462 | - private boolean jj_3_48() { | |
1463 | - if (jj_scan_token(NEGATION)) return true; | |
1492 | + private boolean jj_3_46() { | |
1493 | + if (jj_scan_token(CURLY_BRACKET_START)) return true; | |
1494 | + if (jj_scan_token(NUMBER)) return true; | |
1495 | + if (jj_scan_token(KOMMA)) return true; | |
1496 | + if (jj_scan_token(NUMBER)) return true; | |
1497 | + if (jj_scan_token(CURLY_BRACKET_END)) return true; | |
1464 | 1498 | return false; |
1465 | 1499 | } |
1466 | 1500 | |
1467 | - private boolean jj_3_68() { | |
1468 | - Token xsp; | |
1469 | - xsp = jj_scanpos; | |
1470 | - if (jj_3_48()) jj_scanpos = xsp; | |
1471 | - if (jj_scan_token(BRACKET_START)) return true; | |
1472 | - xsp = jj_scanpos; | |
1473 | - if (jj_3_65()) { | |
1474 | - jj_scanpos = xsp; | |
1475 | - if (jj_3_66()) { | |
1476 | - jj_scanpos = xsp; | |
1477 | - if (jj_3_67()) return true; | |
1478 | - } | |
1479 | - } | |
1480 | - if (jj_scan_token(BRACKET_END)) return true; | |
1501 | + private boolean jj_3_12() { | |
1502 | + if (jj_3R_10()) return true; | |
1481 | 1503 | return false; |
1482 | 1504 | } |
1483 | 1505 | |
1484 | - private boolean jj_3R_14() { | |
1506 | + private boolean jj_3_25() { | |
1485 | 1507 | Token xsp; |
1486 | 1508 | xsp = jj_scanpos; |
1487 | - if (jj_3_68()) { | |
1509 | + if (jj_3_26()) { | |
1488 | 1510 | jj_scanpos = xsp; |
1489 | - if (jj_3_69()) return true; | |
1511 | + if (jj_3_27()) return true; | |
1490 | 1512 | } |
1491 | 1513 | return false; |
1492 | 1514 | } |
1493 | 1515 | |
1494 | - private boolean jj_3_27() { | |
1495 | - if (jj_3R_13()) return true; | |
1516 | + private boolean jj_3_49() { | |
1496 | 1517 | Token xsp; |
1497 | 1518 | xsp = jj_scanpos; |
1498 | - if (jj_3_26()) jj_scanpos = xsp; | |
1519 | + if (jj_3_46()) { | |
1520 | + jj_scanpos = xsp; | |
1521 | + if (jj_3_47()) { | |
1522 | + jj_scanpos = xsp; | |
1523 | + if (jj_3_48()) return true; | |
1524 | + } | |
1525 | + } | |
1499 | 1526 | return false; |
1500 | 1527 | } |
1501 | 1528 | |
1502 | - private boolean jj_3R_12() { | |
1503 | - if (jj_scan_token(GROUP_START)) return true; | |
1504 | - Token xsp; | |
1505 | - xsp = jj_scanpos; | |
1506 | - if (jj_3_27()) { | |
1507 | - jj_scanpos = xsp; | |
1508 | - if (jj_3_28()) return true; | |
1509 | - } | |
1510 | - if (jj_scan_token(GROUP_END)) return true; | |
1511 | - xsp = jj_scanpos; | |
1512 | - if (jj_3_32()) jj_scanpos = xsp; | |
1529 | + private boolean jj_3_10() { | |
1530 | + if (jj_scan_token(NOT_INTERSECTING)) return true; | |
1513 | 1531 | return false; |
1514 | 1532 | } |
1515 | 1533 | |
... | ... | @@ -1518,10 +1536,8 @@ public class MtasCQLParser implements MtasCQLParserConstants { |
1518 | 1536 | return false; |
1519 | 1537 | } |
1520 | 1538 | |
1521 | - private boolean jj_3_11() { | |
1522 | - if (jj_scan_token(BRACKET_START)) return true; | |
1523 | - if (jj_3R_7()) return true; | |
1524 | - if (jj_scan_token(BRACKET_END)) return true; | |
1539 | + private boolean jj_3_24() { | |
1540 | + if (jj_3R_14()) return true; | |
1525 | 1541 | return false; |
1526 | 1542 | } |
1527 | 1543 | |
... | ... | @@ -1530,127 +1546,93 @@ public class MtasCQLParser implements MtasCQLParserConstants { |
1530 | 1546 | return false; |
1531 | 1547 | } |
1532 | 1548 | |
1533 | - private boolean jj_3_10() { | |
1534 | - if (jj_3R_8()) return true; | |
1535 | - return false; | |
1536 | - } | |
1537 | - | |
1538 | 1549 | private boolean jj_3_9() { |
1539 | - if (jj_scan_token(NOT_INTERSECTING)) return true; | |
1550 | + if (jj_scan_token(INTERSECTING)) return true; | |
1540 | 1551 | return false; |
1541 | 1552 | } |
1542 | 1553 | |
1543 | - private boolean jj_3_79() { | |
1544 | - if (jj_scan_token(UNQUOTED_VALUE)) return true; | |
1545 | - Token xsp; | |
1546 | - xsp = jj_scanpos; | |
1547 | - if (jj_3_75()) { | |
1548 | - jj_scanpos = xsp; | |
1549 | - if (jj_3_76()) return true; | |
1550 | - } | |
1551 | - if (jj_scan_token(QUOTED_VALUE)) return true; | |
1554 | + private boolean jj_3_23() { | |
1555 | + if (jj_3R_13()) return true; | |
1552 | 1556 | return false; |
1553 | 1557 | } |
1554 | 1558 | |
1555 | - private boolean jj_3_8() { | |
1556 | - if (jj_scan_token(INTERSECTING)) return true; | |
1559 | + private boolean jj_3_45() { | |
1560 | + if (jj_scan_token(WORD_START)) return true; | |
1561 | + if (jj_scan_token(WORD_END)) return true; | |
1557 | 1562 | return false; |
1558 | 1563 | } |
1559 | 1564 | |
1560 | - private boolean jj_3_7() { | |
1561 | - if (jj_scan_token(NOT_WITHIN)) return true; | |
1565 | + private boolean jj_3_42() { | |
1566 | + if (jj_3R_16()) return true; | |
1562 | 1567 | return false; |
1563 | 1568 | } |
1564 | 1569 | |
1565 | - private boolean jj_3_25() { | |
1566 | - if (jj_3R_12()) return true; | |
1570 | + private boolean jj_3R_11() { | |
1571 | + Token xsp; | |
1572 | + xsp = jj_scanpos; | |
1573 | + if (jj_3_23()) { | |
1574 | + jj_scanpos = xsp; | |
1575 | + if (jj_3_24()) return true; | |
1576 | + } | |
1577 | + while (true) { | |
1578 | + xsp = jj_scanpos; | |
1579 | + if (jj_3_25()) { jj_scanpos = xsp; break; } | |
1580 | + } | |
1567 | 1581 | return false; |
1568 | 1582 | } |
1569 | 1583 | |
1570 | - private boolean jj_3_6() { | |
1571 | - if (jj_scan_token(WITHIN)) return true; | |
1584 | + private boolean jj_3_8() { | |
1585 | + if (jj_scan_token(NOT_WITHIN)) return true; | |
1572 | 1586 | return false; |
1573 | 1587 | } |
1574 | 1588 | |
1575 | - private boolean jj_3_46() { | |
1576 | - if (jj_scan_token(QUESTION_MARK)) return true; | |
1589 | + private boolean jj_3_80() { | |
1590 | + if (jj_scan_token(UNQUOTED_VALUE)) return true; | |
1591 | + Token xsp; | |
1592 | + xsp = jj_scanpos; | |
1593 | + if (jj_3_75()) { | |
1594 | + jj_scanpos = xsp; | |
1595 | + if (jj_3_76()) return true; | |
1596 | + } | |
1597 | + if (jj_scan_token(VARIABLE)) return true; | |
1577 | 1598 | return false; |
1578 | 1599 | } |
1579 | 1600 | |
1580 | - private boolean jj_3_24() { | |
1581 | - if (jj_3R_11()) return true; | |
1601 | + private boolean jj_3_38() { | |
1602 | + if (jj_scan_token(OR)) return true; | |
1603 | + if (jj_3R_16()) return true; | |
1582 | 1604 | return false; |
1583 | 1605 | } |
1584 | 1606 | |
1585 | - private boolean jj_3_45() { | |
1586 | - if (jj_scan_token(CURLY_BRACKET_START)) return true; | |
1587 | - if (jj_scan_token(NUMBER)) return true; | |
1588 | - if (jj_scan_token(CURLY_BRACKET_END)) return true; | |
1607 | + private boolean jj_3_7() { | |
1608 | + if (jj_scan_token(WITHIN)) return true; | |
1589 | 1609 | return false; |
1590 | 1610 | } |
1591 | 1611 | |
1592 | - private boolean jj_3_44() { | |
1593 | - if (jj_scan_token(CURLY_BRACKET_START)) return true; | |
1594 | - if (jj_scan_token(NUMBER)) return true; | |
1595 | - if (jj_scan_token(KOMMA)) return true; | |
1596 | - if (jj_scan_token(NUMBER)) return true; | |
1597 | - if (jj_scan_token(CURLY_BRACKET_END)) return true; | |
1612 | + private boolean jj_3_6() { | |
1613 | + if (jj_scan_token(NOT_CONTAINING)) return true; | |
1598 | 1614 | return false; |
1599 | 1615 | } |
1600 | 1616 | |
1601 | 1617 | private boolean jj_3_5() { |
1602 | - if (jj_scan_token(NOT_CONTAINING)) return true; | |
1618 | + if (jj_scan_token(CONTAINING)) return true; | |
1603 | 1619 | return false; |
1604 | 1620 | } |
1605 | 1621 | |
1606 | - private boolean jj_3_23() { | |
1622 | + private boolean jj_3_40() { | |
1623 | + if (jj_scan_token(OR)) return true; | |
1624 | + if (jj_3R_16()) return true; | |
1607 | 1625 | Token xsp; |
1608 | - xsp = jj_scanpos; | |
1609 | - if (jj_3_24()) { | |
1610 | - jj_scanpos = xsp; | |
1611 | - if (jj_3_25()) return true; | |
1626 | + while (true) { | |
1627 | + xsp = jj_scanpos; | |
1628 | + if (jj_3_38()) { jj_scanpos = xsp; break; } | |
1612 | 1629 | } |
1613 | 1630 | return false; |
1614 | 1631 | } |
1615 | 1632 | |
1616 | - private boolean jj_3_4() { | |
1617 | - if (jj_scan_token(CONTAINING)) return true; | |
1618 | - return false; | |
1619 | - } | |
1620 | - | |
1621 | - private boolean jj_3_47() { | |
1622 | - Token xsp; | |
1623 | - xsp = jj_scanpos; | |
1624 | - if (jj_3_44()) { | |
1625 | - jj_scanpos = xsp; | |
1626 | - if (jj_3_45()) { | |
1627 | - jj_scanpos = xsp; | |
1628 | - if (jj_3_46()) return true; | |
1629 | - } | |
1630 | - } | |
1631 | - return false; | |
1632 | - } | |
1633 | - | |
1634 | - private boolean jj_3_74() { | |
1635 | - if (jj_scan_token(TOKEN_EQUALS)) return true; | |
1636 | - return false; | |
1637 | - } | |
1638 | - | |
1639 | - private boolean jj_3_22() { | |
1640 | - if (jj_3R_12()) return true; | |
1641 | - return false; | |
1642 | - } | |
1643 | - | |
1644 | - private boolean jj_3_73() { | |
1645 | - if (jj_scan_token(TOKEN_NOTEQUALS)) return true; | |
1646 | - return false; | |
1647 | - } | |
1648 | - | |
1649 | - private boolean jj_3_12() { | |
1633 | + private boolean jj_3_14() { | |
1650 | 1634 | Token xsp; |
1651 | 1635 | xsp = jj_scanpos; |
1652 | - if (jj_3_4()) { | |
1653 | - jj_scanpos = xsp; | |
1654 | 1636 | if (jj_3_5()) { |
1655 | 1637 | jj_scanpos = xsp; |
1656 | 1638 | if (jj_3_6()) { |
... | ... | @@ -1659,235 +1641,183 @@ public class MtasCQLParser implements MtasCQLParserConstants { |
1659 | 1641 | jj_scanpos = xsp; |
1660 | 1642 | if (jj_3_8()) { |
1661 | 1643 | jj_scanpos = xsp; |
1662 | - if (jj_3_9()) return true; | |
1644 | + if (jj_3_9()) { | |
1645 | + jj_scanpos = xsp; | |
1646 | + if (jj_3_10()) return true; | |
1663 | 1647 | } |
1664 | 1648 | } |
1665 | 1649 | } |
1666 | 1650 | } |
1667 | 1651 | } |
1668 | 1652 | xsp = jj_scanpos; |
1669 | - if (jj_3_10()) { | |
1653 | + if (jj_3_12()) { | |
1670 | 1654 | jj_scanpos = xsp; |
1671 | - if (jj_3_11()) return true; | |
1655 | + if (jj_3_13()) return true; | |
1672 | 1656 | } |
1673 | 1657 | return false; |
1674 | 1658 | } |
1675 | 1659 | |
1676 | - private boolean jj_3_3() { | |
1677 | - if (jj_scan_token(BRACKET_START)) return true; | |
1678 | - if (jj_3R_7()) return true; | |
1679 | - if (jj_scan_token(BRACKET_END)) return true; | |
1680 | - return false; | |
1681 | - } | |
1682 | - | |
1683 | - private boolean jj_3_21() { | |
1684 | - if (jj_3R_11()) return true; | |
1685 | - return false; | |
1686 | - } | |
1687 | - | |
1688 | - private boolean jj_3_43() { | |
1689 | - if (jj_scan_token(WORD_START)) return true; | |
1690 | - if (jj_scan_token(WORD_END)) return true; | |
1660 | + private boolean jj_3_37() { | |
1661 | + if (jj_scan_token(AND)) return true; | |
1662 | + if (jj_3R_16()) return true; | |
1691 | 1663 | return false; |
1692 | 1664 | } |
1693 | 1665 | |
1694 | 1666 | private boolean jj_3_2() { |
1695 | - if (jj_3R_8()) return true; | |
1667 | + if (jj_3R_9()) return true; | |
1696 | 1668 | return false; |
1697 | 1669 | } |
1698 | 1670 | |
1699 | - private boolean jj_3_40() { | |
1700 | - if (jj_3R_14()) return true; | |
1671 | + private boolean jj_3_21() { | |
1672 | + if (jj_scan_token(OR)) return true; | |
1701 | 1673 | return false; |
1702 | 1674 | } |
1703 | 1675 | |
1704 | - private boolean jj_3R_9() { | |
1676 | + private boolean jj_3_39() { | |
1677 | + if (jj_scan_token(AND)) return true; | |
1678 | + if (jj_3R_16()) return true; | |
1705 | 1679 | Token xsp; |
1706 | - xsp = jj_scanpos; | |
1707 | - if (jj_3_21()) { | |
1708 | - jj_scanpos = xsp; | |
1709 | - if (jj_3_22()) return true; | |
1710 | - } | |
1711 | 1680 | while (true) { |
1712 | 1681 | xsp = jj_scanpos; |
1713 | - if (jj_3_23()) { jj_scanpos = xsp; break; } | |
1714 | - } | |
1715 | - return false; | |
1716 | - } | |
1717 | - | |
1718 | - private boolean jj_3_78() { | |
1719 | - if (jj_scan_token(UNQUOTED_VALUE)) return true; | |
1720 | - Token xsp; | |
1721 | - xsp = jj_scanpos; | |
1722 | - if (jj_3_73()) { | |
1723 | - jj_scanpos = xsp; | |
1724 | - if (jj_3_74()) return true; | |
1682 | + if (jj_3_37()) { jj_scanpos = xsp; break; } | |
1725 | 1683 | } |
1726 | - if (jj_scan_token(VARIABLE)) return true; | |
1727 | 1684 | return false; |
1728 | 1685 | } |
1729 | 1686 | |
1730 | - private boolean jj_3_36() { | |
1731 | - if (jj_scan_token(OR)) return true; | |
1732 | - if (jj_3R_14()) return true; | |
1733 | - return false; | |
1734 | - } | |
1735 | - | |
1736 | - private boolean jj_3R_7() { | |
1737 | - Token xsp; | |
1738 | - xsp = jj_scanpos; | |
1739 | - if (jj_3_2()) { | |
1740 | - jj_scanpos = xsp; | |
1741 | - if (jj_3_3()) return true; | |
1742 | - } | |
1743 | - xsp = jj_scanpos; | |
1744 | - if (jj_3_12()) jj_scanpos = xsp; | |
1745 | - return false; | |
1746 | - } | |
1747 | - | |
1748 | - private boolean jj_3_38() { | |
1749 | - if (jj_scan_token(OR)) return true; | |
1750 | - if (jj_3R_14()) return true; | |
1687 | + private boolean jj_3_4() { | |
1688 | + if (jj_scan_token(BRACKET_START)) return true; | |
1689 | + if (jj_3R_9()) return true; | |
1751 | 1690 | Token xsp; |
1752 | 1691 | while (true) { |
1753 | 1692 | xsp = jj_scanpos; |
1754 | - if (jj_3_36()) { jj_scanpos = xsp; break; } | |
1693 | + if (jj_3_2()) { jj_scanpos = xsp; break; } | |
1755 | 1694 | } |
1695 | + if (jj_scan_token(BRACKET_END)) return true; | |
1756 | 1696 | return false; |
1757 | 1697 | } |
1758 | 1698 | |
1759 | - private boolean jj_3_35() { | |
1760 | - if (jj_scan_token(AND)) return true; | |
1761 | - if (jj_3R_14()) return true; | |
1762 | - return false; | |
1763 | - } | |
1764 | - | |
1765 | - private boolean jj_3_19() { | |
1766 | - if (jj_scan_token(OR)) return true; | |
1767 | - return false; | |
1768 | - } | |
1769 | - | |
1770 | - private boolean jj_3_37() { | |
1771 | - if (jj_scan_token(AND)) return true; | |
1772 | - if (jj_3R_14()) return true; | |
1699 | + private boolean jj_3_22() { | |
1773 | 1700 | Token xsp; |
1774 | - while (true) { | |
1775 | - xsp = jj_scanpos; | |
1776 | - if (jj_3_35()) { jj_scanpos = xsp; break; } | |
1777 | - } | |
1701 | + xsp = jj_scanpos; | |
1702 | + if (jj_3_21()) jj_scanpos = xsp; | |
1703 | + if (jj_3R_12()) return true; | |
1778 | 1704 | return false; |
1779 | 1705 | } |
1780 | 1706 | |
1781 | - private boolean jj_3_20() { | |
1782 | - Token xsp; | |
1783 | - xsp = jj_scanpos; | |
1784 | - if (jj_3_19()) jj_scanpos = xsp; | |
1707 | + private boolean jj_3_3() { | |
1785 | 1708 | if (jj_3R_10()) return true; |
1786 | 1709 | return false; |
1787 | 1710 | } |
1788 | 1711 | |
1789 | - private boolean jj_3_39() { | |
1790 | - if (jj_3R_14()) return true; | |
1712 | + private boolean jj_3_41() { | |
1713 | + if (jj_3R_16()) return true; | |
1791 | 1714 | Token xsp; |
1792 | 1715 | xsp = jj_scanpos; |
1793 | - if (jj_3_37()) { | |
1716 | + if (jj_3_39()) { | |
1794 | 1717 | jj_scanpos = xsp; |
1795 | - if (jj_3_38()) return true; | |
1718 | + if (jj_3_40()) return true; | |
1796 | 1719 | } |
1797 | 1720 | return false; |
1798 | 1721 | } |
1799 | 1722 | |
1800 | - private boolean jj_3_72() { | |
1723 | + private boolean jj_3_74() { | |
1801 | 1724 | if (jj_scan_token(UNQUOTED_VALUE)) return true; |
1802 | 1725 | return false; |
1803 | 1726 | } |
1804 | 1727 | |
1805 | - private boolean jj_3_1() { | |
1806 | - if (jj_3R_7()) return true; | |
1728 | + private boolean jj_3R_9() { | |
1729 | + Token xsp; | |
1730 | + xsp = jj_scanpos; | |
1731 | + if (jj_3_3()) { | |
1732 | + jj_scanpos = xsp; | |
1733 | + if (jj_3_4()) return true; | |
1734 | + } | |
1735 | + xsp = jj_scanpos; | |
1736 | + if (jj_3_14()) jj_scanpos = xsp; | |
1807 | 1737 | return false; |
1808 | 1738 | } |
1809 | 1739 | |
1810 | - private boolean jj_3_71() { | |
1740 | + private boolean jj_3_73() { | |
1811 | 1741 | if (jj_scan_token(NUMBER)) return true; |
1812 | 1742 | return false; |
1813 | 1743 | } |
1814 | 1744 | |
1815 | - private boolean jj_3_42() { | |
1745 | + private boolean jj_3_44() { | |
1816 | 1746 | if (jj_scan_token(WORD_START)) return true; |
1817 | 1747 | Token xsp; |
1818 | 1748 | xsp = jj_scanpos; |
1819 | - if (jj_3_39()) { | |
1749 | + if (jj_3_41()) { | |
1820 | 1750 | jj_scanpos = xsp; |
1821 | - if (jj_3_40()) return true; | |
1751 | + if (jj_3_42()) return true; | |
1822 | 1752 | } |
1823 | 1753 | if (jj_scan_token(WORD_END)) return true; |
1824 | 1754 | return false; |
1825 | 1755 | } |
1826 | 1756 | |
1827 | - private boolean jj_3_41() { | |
1757 | + private boolean jj_3_43() { | |
1828 | 1758 | if (jj_scan_token(QUOTED_VALUE)) return true; |
1829 | 1759 | return false; |
1830 | 1760 | } |
1831 | 1761 | |
1832 | - private boolean jj_3_77() { | |
1762 | + private boolean jj_3_79() { | |
1833 | 1763 | if (jj_scan_token(OCTOTHORPE)) return true; |
1834 | 1764 | Token xsp; |
1835 | 1765 | xsp = jj_scanpos; |
1836 | - if (jj_3_71()) { | |
1766 | + if (jj_3_73()) { | |
1837 | 1767 | jj_scanpos = xsp; |
1838 | - if (jj_3_72()) return true; | |
1768 | + if (jj_3_74()) return true; | |
1839 | 1769 | } |
1840 | 1770 | return false; |
1841 | 1771 | } |
1842 | 1772 | |
1843 | - private boolean jj_3R_11() { | |
1773 | + private boolean jj_3R_13() { | |
1844 | 1774 | Token xsp; |
1845 | 1775 | xsp = jj_scanpos; |
1846 | - if (jj_3_41()) { | |
1776 | + if (jj_3_43()) { | |
1847 | 1777 | jj_scanpos = xsp; |
1848 | - if (jj_3_42()) { | |
1778 | + if (jj_3_44()) { | |
1849 | 1779 | jj_scanpos = xsp; |
1850 | - if (jj_3_43()) return true; | |
1780 | + if (jj_3_45()) return true; | |
1851 | 1781 | } |
1852 | 1782 | } |
1853 | 1783 | xsp = jj_scanpos; |
1854 | - if (jj_3_47()) jj_scanpos = xsp; | |
1784 | + if (jj_3_49()) jj_scanpos = xsp; | |
1855 | 1785 | return false; |
1856 | 1786 | } |
1857 | 1787 | |
1858 | - private boolean jj_3_70() { | |
1788 | + private boolean jj_3_72() { | |
1859 | 1789 | if (jj_scan_token(NEGATION)) return true; |
1860 | 1790 | return false; |
1861 | 1791 | } |
1862 | 1792 | |
1863 | - private boolean jj_3R_15() { | |
1793 | + private boolean jj_3R_17() { | |
1864 | 1794 | Token xsp; |
1865 | 1795 | xsp = jj_scanpos; |
1866 | - if (jj_3_70()) jj_scanpos = xsp; | |
1796 | + if (jj_3_72()) jj_scanpos = xsp; | |
1867 | 1797 | xsp = jj_scanpos; |
1868 | - if (jj_3_77()) { | |
1798 | + if (jj_3_79()) { | |
1869 | 1799 | jj_scanpos = xsp; |
1870 | - if (jj_3_78()) { | |
1800 | + if (jj_3_80()) { | |
1871 | 1801 | jj_scanpos = xsp; |
1872 | - if (jj_3_79()) return true; | |
1802 | + if (jj_3_81()) return true; | |
1873 | 1803 | } |
1874 | 1804 | } |
1875 | 1805 | return false; |
1876 | 1806 | } |
1877 | 1807 | |
1878 | - private boolean jj_3_15() { | |
1808 | + private boolean jj_3_17() { | |
1879 | 1809 | if (jj_scan_token(QUESTION_MARK)) return true; |
1880 | 1810 | return false; |
1881 | 1811 | } |
1882 | 1812 | |
1883 | - private boolean jj_3_14() { | |
1813 | + private boolean jj_3_16() { | |
1884 | 1814 | if (jj_scan_token(CURLY_BRACKET_START)) return true; |
1885 | 1815 | if (jj_scan_token(NUMBER)) return true; |
1886 | 1816 | if (jj_scan_token(CURLY_BRACKET_END)) return true; |
1887 | 1817 | return false; |
1888 | 1818 | } |
1889 | 1819 | |
1890 | - private boolean jj_3_13() { | |
1820 | + private boolean jj_3_15() { | |
1891 | 1821 | if (jj_scan_token(CURLY_BRACKET_START)) return true; |
1892 | 1822 | if (jj_scan_token(NUMBER)) return true; |
1893 | 1823 | if (jj_scan_token(KOMMA)) return true; |
... | ... | @@ -1896,161 +1826,299 @@ public class MtasCQLParser implements MtasCQLParserConstants { |
1896 | 1826 | return false; |
1897 | 1827 | } |
1898 | 1828 | |
1899 | - private boolean jj_3_16() { | |
1829 | + private boolean jj_3_18() { | |
1900 | 1830 | Token xsp; |
1901 | 1831 | xsp = jj_scanpos; |
1902 | - if (jj_3_13()) { | |
1832 | + if (jj_3_15()) { | |
1903 | 1833 | jj_scanpos = xsp; |
1904 | - if (jj_3_14()) { | |
1834 | + if (jj_3_16()) { | |
1905 | 1835 | jj_scanpos = xsp; |
1906 | - if (jj_3_15()) return true; | |
1836 | + if (jj_3_17()) return true; | |
1907 | 1837 | } |
1908 | 1838 | } |
1909 | 1839 | return false; |
1910 | 1840 | } |
1911 | 1841 | |
1912 | - private boolean jj_3_69() { | |
1913 | - if (jj_3R_15()) return true; | |
1842 | + private boolean jj_3_71() { | |
1843 | + if (jj_3R_17()) return true; | |
1914 | 1844 | return false; |
1915 | 1845 | } |
1916 | 1846 | |
1917 | - private boolean jj_3_18() { | |
1847 | + private boolean jj_3_20() { | |
1918 | 1848 | if (jj_scan_token(BRACKET_START)) return true; |
1919 | - if (jj_3R_10()) return true; | |
1849 | + if (jj_3R_12()) return true; | |
1920 | 1850 | if (jj_scan_token(BRACKET_END)) return true; |
1921 | 1851 | Token xsp; |
1922 | 1852 | xsp = jj_scanpos; |
1923 | - if (jj_3_16()) jj_scanpos = xsp; | |
1853 | + if (jj_3_18()) jj_scanpos = xsp; | |
1924 | 1854 | return false; |
1925 | 1855 | } |
1926 | 1856 | |
1927 | - private boolean jj_3_17() { | |
1857 | + private boolean jj_3_1() { | |
1928 | 1858 | if (jj_3R_9()) return true; |
1929 | 1859 | return false; |
1930 | 1860 | } |
1931 | 1861 | |
1932 | - private boolean jj_3R_10() { | |
1862 | + private boolean jj_3_19() { | |
1863 | + if (jj_3R_11()) return true; | |
1864 | + return false; | |
1865 | + } | |
1866 | + | |
1867 | + private boolean jj_3R_12() { | |
1933 | 1868 | Token xsp; |
1934 | 1869 | xsp = jj_scanpos; |
1935 | - if (jj_3_17()) { | |
1870 | + if (jj_3_19()) { | |
1936 | 1871 | jj_scanpos = xsp; |
1937 | - if (jj_3_18()) return true; | |
1872 | + if (jj_3_20()) return true; | |
1938 | 1873 | } |
1939 | 1874 | xsp = jj_scanpos; |
1940 | - if (jj_3_20()) jj_scanpos = xsp; | |
1875 | + if (jj_3_22()) jj_scanpos = xsp; | |
1941 | 1876 | return false; |
1942 | 1877 | } |
1943 | 1878 | |
1944 | - private boolean jj_3_64() { | |
1945 | - if (jj_3R_14()) return true; | |
1879 | + private boolean jj_3_66() { | |
1880 | + if (jj_3R_16()) return true; | |
1946 | 1881 | return false; |
1947 | 1882 | } |
1948 | 1883 | |
1949 | - private boolean jj_3_63() { | |
1950 | - if (jj_3R_15()) return true; | |
1884 | + private boolean jj_3_65() { | |
1885 | + if (jj_3R_17()) return true; | |
1951 | 1886 | return false; |
1952 | 1887 | } |
1953 | 1888 | |
1954 | - private boolean jj_3_34() { | |
1889 | + private boolean jj_3_36() { | |
1955 | 1890 | if (jj_scan_token(UNQUOTED_VALUE)) return true; |
1956 | 1891 | return false; |
1957 | 1892 | } |
1958 | 1893 | |
1959 | - private boolean jj_3_33() { | |
1894 | + private boolean jj_3_35() { | |
1960 | 1895 | if (jj_scan_token(UNQUOTED_VALUE)) return true; |
1961 | 1896 | if (jj_scan_token(TOKEN_EQUALS)) return true; |
1962 | 1897 | if (jj_scan_token(QUOTED_VALUE)) return true; |
1963 | 1898 | return false; |
1964 | 1899 | } |
1965 | 1900 | |
1966 | - private boolean jj_3_67() { | |
1901 | + private boolean jj_3_69() { | |
1967 | 1902 | Token xsp; |
1968 | 1903 | xsp = jj_scanpos; |
1969 | - if (jj_3_63()) { | |
1904 | + if (jj_3_65()) { | |
1970 | 1905 | jj_scanpos = xsp; |
1971 | - if (jj_3_64()) return true; | |
1906 | + if (jj_3_66()) return true; | |
1972 | 1907 | } |
1973 | 1908 | return false; |
1974 | 1909 | } |
1975 | 1910 | |
1976 | - private boolean jj_3R_13() { | |
1911 | + private boolean jj_3R_15() { | |
1977 | 1912 | Token xsp; |
1978 | 1913 | xsp = jj_scanpos; |
1979 | - if (jj_3_33()) { | |
1914 | + if (jj_3_35()) { | |
1980 | 1915 | jj_scanpos = xsp; |
1981 | - if (jj_3_34()) return true; | |
1916 | + if (jj_3_36()) return true; | |
1982 | 1917 | } |
1983 | 1918 | return false; |
1984 | 1919 | } |
1985 | 1920 | |
1986 | - private boolean jj_3_62() { | |
1987 | - if (jj_3R_14()) return true; | |
1921 | + private boolean jj_3_64() { | |
1922 | + if (jj_3R_16()) return true; | |
1988 | 1923 | return false; |
1989 | 1924 | } |
1990 | 1925 | |
1991 | - private boolean jj_3_61() { | |
1992 | - if (jj_3R_15()) return true; | |
1926 | + private boolean jj_3_63() { | |
1927 | + if (jj_3R_17()) return true; | |
1993 | 1928 | return false; |
1994 | 1929 | } |
1995 | 1930 | |
1996 | - private boolean jj_3_60() { | |
1931 | + private boolean jj_3_62() { | |
1997 | 1932 | if (jj_scan_token(OR)) return true; |
1998 | 1933 | Token xsp; |
1999 | 1934 | xsp = jj_scanpos; |
2000 | - if (jj_3_61()) { | |
1935 | + if (jj_3_63()) { | |
2001 | 1936 | jj_scanpos = xsp; |
2002 | - if (jj_3_62()) return true; | |
1937 | + if (jj_3_64()) return true; | |
2003 | 1938 | } |
2004 | 1939 | return false; |
2005 | 1940 | } |
2006 | 1941 | |
2007 | - private boolean jj_3_59() { | |
2008 | - if (jj_3R_14()) return true; | |
1942 | + private boolean jj_3_61() { | |
1943 | + if (jj_3R_16()) return true; | |
2009 | 1944 | return false; |
2010 | 1945 | } |
2011 | 1946 | |
2012 | - private boolean jj_3R_8() { | |
2013 | - if (jj_3R_10()) return true; | |
1947 | + private boolean jj_3R_10() { | |
1948 | + if (jj_3R_12()) return true; | |
1949 | + return false; | |
1950 | + } | |
1951 | + | |
1952 | + private boolean jj_3_60() { | |
1953 | + if (jj_3R_17()) return true; | |
1954 | + return false; | |
1955 | + } | |
1956 | + | |
1957 | + private boolean jj_3_59() { | |
1958 | + if (jj_3R_16()) return true; | |
2014 | 1959 | return false; |
2015 | 1960 | } |
2016 | 1961 | |
2017 | 1962 | private boolean jj_3_58() { |
2018 | - if (jj_3R_15()) return true; | |
1963 | + if (jj_3R_17()) return true; | |
1964 | + return false; | |
1965 | + } | |
1966 | + | |
1967 | + private boolean jj_3_68() { | |
1968 | + Token xsp; | |
1969 | + xsp = jj_scanpos; | |
1970 | + if (jj_3_58()) { | |
1971 | + jj_scanpos = xsp; | |
1972 | + if (jj_3_59()) return true; | |
1973 | + } | |
1974 | + if (jj_scan_token(OR)) return true; | |
1975 | + xsp = jj_scanpos; | |
1976 | + if (jj_3_60()) { | |
1977 | + jj_scanpos = xsp; | |
1978 | + if (jj_3_61()) return true; | |
1979 | + } | |
1980 | + while (true) { | |
1981 | + xsp = jj_scanpos; | |
1982 | + if (jj_3_62()) { jj_scanpos = xsp; break; } | |
1983 | + } | |
2019 | 1984 | return false; |
2020 | 1985 | } |
2021 | 1986 | |
2022 | 1987 | private boolean jj_3_57() { |
2023 | - if (jj_3R_14()) return true; | |
1988 | + if (jj_3R_16()) return true; | |
2024 | 1989 | return false; |
2025 | 1990 | } |
2026 | 1991 | |
2027 | 1992 | private boolean jj_3_56() { |
2028 | - if (jj_3R_15()) return true; | |
1993 | + if (jj_3R_17()) return true; | |
2029 | 1994 | return false; |
2030 | 1995 | } |
2031 | 1996 | |
2032 | - private boolean jj_3_66() { | |
1997 | + private boolean jj_3_28() { | |
1998 | + if (jj_scan_token(SLASH)) return true; | |
1999 | + return false; | |
2000 | + } | |
2001 | + | |
2002 | + private boolean jj_3_55() { | |
2003 | + if (jj_scan_token(AND)) return true; | |
2033 | 2004 | Token xsp; |
2034 | 2005 | xsp = jj_scanpos; |
2035 | 2006 | if (jj_3_56()) { |
2036 | 2007 | jj_scanpos = xsp; |
2037 | 2008 | if (jj_3_57()) return true; |
2038 | 2009 | } |
2039 | - if (jj_scan_token(OR)) return true; | |
2010 | + return false; | |
2011 | + } | |
2012 | + | |
2013 | + private boolean jj_3_33() { | |
2014 | + if (jj_scan_token(QUESTION_MARK)) return true; | |
2015 | + return false; | |
2016 | + } | |
2017 | + | |
2018 | + private boolean jj_3_32() { | |
2019 | + if (jj_scan_token(CURLY_BRACKET_START)) return true; | |
2020 | + if (jj_scan_token(NUMBER)) return true; | |
2021 | + if (jj_scan_token(CURLY_BRACKET_END)) return true; | |
2022 | + return false; | |
2023 | + } | |
2024 | + | |
2025 | + private boolean jj_3_54() { | |
2026 | + if (jj_3R_16()) return true; | |
2027 | + return false; | |
2028 | + } | |
2029 | + | |
2030 | + private boolean jj_3_31() { | |
2031 | + if (jj_scan_token(CURLY_BRACKET_START)) return true; | |
2032 | + if (jj_scan_token(NUMBER)) return true; | |
2033 | + if (jj_scan_token(KOMMA)) return true; | |
2034 | + if (jj_scan_token(NUMBER)) return true; | |
2035 | + if (jj_scan_token(CURLY_BRACKET_END)) return true; | |
2036 | + return false; | |
2037 | + } | |
2038 | + | |
2039 | + private boolean jj_3_53() { | |
2040 | + if (jj_3R_17()) return true; | |
2041 | + return false; | |
2042 | + } | |
2043 | + | |
2044 | + private boolean jj_3_34() { | |
2045 | + Token xsp; | |
2040 | 2046 | xsp = jj_scanpos; |
2041 | - if (jj_3_58()) { | |
2047 | + if (jj_3_31()) { | |
2042 | 2048 | jj_scanpos = xsp; |
2043 | - if (jj_3_59()) return true; | |
2049 | + if (jj_3_32()) { | |
2050 | + jj_scanpos = xsp; | |
2051 | + if (jj_3_33()) return true; | |
2052 | + } | |
2053 | + } | |
2054 | + return false; | |
2055 | + } | |
2056 | + | |
2057 | + private boolean jj_3_52() { | |
2058 | + if (jj_3R_16()) return true; | |
2059 | + return false; | |
2060 | + } | |
2061 | + | |
2062 | + private boolean jj_3_51() { | |
2063 | + if (jj_3R_17()) return true; | |
2064 | + return false; | |
2065 | + } | |
2066 | + | |
2067 | + private boolean jj_3_30() { | |
2068 | + if (jj_scan_token(SLASH)) return true; | |
2069 | + if (jj_3R_15()) return true; | |
2070 | + return false; | |
2071 | + } | |
2072 | + | |
2073 | + private boolean jj_3_67() { | |
2074 | + Token xsp; | |
2075 | + xsp = jj_scanpos; | |
2076 | + if (jj_3_51()) { | |
2077 | + jj_scanpos = xsp; | |
2078 | + if (jj_3_52()) return true; | |
2079 | + } | |
2080 | + if (jj_scan_token(AND)) return true; | |
2081 | + xsp = jj_scanpos; | |
2082 | + if (jj_3_53()) { | |
2083 | + jj_scanpos = xsp; | |
2084 | + if (jj_3_54()) return true; | |
2044 | 2085 | } |
2045 | 2086 | while (true) { |
2046 | 2087 | xsp = jj_scanpos; |
2047 | - if (jj_3_60()) { jj_scanpos = xsp; break; } | |
2088 | + if (jj_3_55()) { jj_scanpos = xsp; break; } | |
2048 | 2089 | } |
2049 | 2090 | return false; |
2050 | 2091 | } |
2051 | 2092 | |
2052 | - private boolean jj_3_55() { | |
2053 | - if (jj_3R_14()) return true; | |
2093 | + private boolean jj_3_50() { | |
2094 | + if (jj_scan_token(NEGATION)) return true; | |
2095 | + return false; | |
2096 | + } | |
2097 | + | |
2098 | + private boolean jj_3_70() { | |
2099 | + Token xsp; | |
2100 | + xsp = jj_scanpos; | |
2101 | + if (jj_3_50()) jj_scanpos = xsp; | |
2102 | + if (jj_scan_token(BRACKET_START)) return true; | |
2103 | + xsp = jj_scanpos; | |
2104 | + if (jj_3_67()) { | |
2105 | + jj_scanpos = xsp; | |
2106 | + if (jj_3_68()) { | |
2107 | + jj_scanpos = xsp; | |
2108 | + if (jj_3_69()) return true; | |
2109 | + } | |
2110 | + } | |
2111 | + if (jj_scan_token(BRACKET_END)) return true; | |
2112 | + return false; | |
2113 | + } | |
2114 | + | |
2115 | + private boolean jj_3R_16() { | |
2116 | + Token xsp; | |
2117 | + xsp = jj_scanpos; | |
2118 | + if (jj_3_70()) { | |
2119 | + jj_scanpos = xsp; | |
2120 | + if (jj_3_71()) return true; | |
2121 | + } | |
2054 | 2122 | return false; |
2055 | 2123 | } |
2056 | 2124 | |
... | ... | @@ -2078,7 +2146,7 @@ public class MtasCQLParser implements MtasCQLParserConstants { |
2078 | 2146 | private static void jj_la1_init_1() { |
2079 | 2147 | jj_la1_1 = new int[] {}; |
2080 | 2148 | } |
2081 | - final private JJCalls[] jj_2_rtns = new JJCalls[79]; | |
2149 | + final private JJCalls[] jj_2_rtns = new JJCalls[81]; | |
2082 | 2150 | private boolean jj_rescan = false; |
2083 | 2151 | private int jj_gc = 0; |
2084 | 2152 | |
... | ... | @@ -2306,7 +2374,7 @@ public class MtasCQLParser implements MtasCQLParserConstants { |
2306 | 2374 | |
2307 | 2375 | private void jj_rescan_token() { |
2308 | 2376 | jj_rescan = true; |
2309 | - for (int i = 0; i < 79; i++) { | |
2377 | + for (int i = 0; i < 81; i++) { | |
2310 | 2378 | try { |
2311 | 2379 | JJCalls p = jj_2_rtns[i]; |
2312 | 2380 | do { |
... | ... | @@ -2392,6 +2460,8 @@ public class MtasCQLParser implements MtasCQLParserConstants { |
2392 | 2460 | case 76: jj_3_77(); break; |
2393 | 2461 | case 77: jj_3_78(); break; |
2394 | 2462 | case 78: jj_3_79(); break; |
2463 | + case 79: jj_3_80(); break; | |
2464 | + case 80: jj_3_81(); break; | |
2395 | 2465 | } |
2396 | 2466 | } |
2397 | 2467 | p = p.next; |
... | ... |
src/mtas/parser/cql/MtasCQLParser.jj
... | ... | @@ -278,6 +278,8 @@ private MtasSpanSequenceItem cqlBlock(String field, String defaultPrefix, HashMa |
278 | 278 | { |
279 | 279 | MtasCQLParserSentenceCondition sc1 = null, sc2 = null; |
280 | 280 | MtasSpanSequenceItem si1 = null, si2=null; |
281 | + ArrayList < MtasSpanSequenceItem > itemList1 = new ArrayList < MtasSpanSequenceItem > (); | |
282 | + ArrayList < MtasSpanSequenceItem > itemList2 = new ArrayList < MtasSpanSequenceItem > (); | |
281 | 283 | MtasSpanQuery q1 = null, q2 = null; |
282 | 284 | Token end = null; |
283 | 285 | String operator = null; |
... | ... | @@ -292,7 +294,18 @@ private MtasSpanSequenceItem cqlBlock(String field, String defaultPrefix, HashMa |
292 | 294 | ( |
293 | 295 | sc1 = sentence(field, defaultPrefix, variables, usedVariables, ignore, maximumIgnoreLength) |
294 | 296 | | |
295 | - < BRACKET_START > si1 = cqlBlock(field, defaultPrefix, variables, usedVariables, ignore, maximumIgnoreLength) < BRACKET_END > | |
297 | + < BRACKET_START > | |
298 | + si1 = cqlBlock(field, defaultPrefix, variables, usedVariables, ignore, maximumIgnoreLength) | |
299 | + { | |
300 | + itemList1.add(si1); | |
301 | + } | |
302 | + ( | |
303 | + si1 = cqlBlock(field, defaultPrefix, variables, usedVariables, ignore, maximumIgnoreLength) | |
304 | + { | |
305 | + itemList1.add(si1); | |
306 | + } | |
307 | + )* | |
308 | + < BRACKET_END > | |
296 | 309 | ) |
297 | 310 | [ |
298 | 311 | ( |
... | ... | @@ -323,20 +336,41 @@ private MtasSpanSequenceItem cqlBlock(String field, String defaultPrefix, HashMa |
323 | 336 | ) |
324 | 337 | ( |
325 | 338 | sc2 = sentence(field, defaultPrefix, variables, usedVariables, ignore, maximumIgnoreLength) |
326 | - | < BRACKET_START > si2 = cqlBlock(field, defaultPrefix, variables, usedVariables, ignore, maximumIgnoreLength) < BRACKET_END > | |
339 | + | < BRACKET_START > | |
340 | + si2 = cqlBlock(field, defaultPrefix, variables, usedVariables, ignore, maximumIgnoreLength) | |
341 | + { | |
342 | + itemList2.add(si2); | |
343 | + } | |
344 | + ( | |
345 | + si2 = cqlBlock(field, defaultPrefix, variables, usedVariables, ignore, maximumIgnoreLength) | |
346 | + { | |
347 | + itemList2.add(si2); | |
348 | + } | |
349 | + )* | |
350 | + < BRACKET_END > | |
327 | 351 | ) |
328 | 352 | ] |
329 | 353 | { |
330 | 354 | if (sc1 != null) |
331 | 355 | { |
332 | - si1 = new MtasSpanSequenceItem(sc1.getQuery(),sc1.isOptional()); | |
356 | + si1 = new MtasSpanSequenceItem(sc1.getQuery(),sc1.isOptional()); | |
357 | + } else if(itemList1.size()==1) { | |
358 | + si1 = itemList1.get(0); | |
359 | + } else { | |
360 | + MtasSpanQuery q = new MtasSpanSequenceQuery(itemList1, ignore, maximumIgnoreLength); | |
361 | + si1 = new MtasSpanSequenceItem(q, false); | |
333 | 362 | } |
334 | 363 | if (operator != null) |
335 | 364 | { |
336 | 365 | if (sc2 != null) |
337 | 366 | { |
338 | 367 | si2 = new MtasSpanSequenceItem(sc2.getQuery(),sc2.isOptional()); |
339 | - } | |
368 | + } else if(itemList2.size()==1) { | |
369 | + si2 = itemList2.get(0); | |
370 | + } else { | |
371 | + MtasSpanQuery q = new MtasSpanSequenceQuery(itemList2, ignore, maximumIgnoreLength); | |
372 | + si2 = new MtasSpanSequenceItem(q, false); | |
373 | + } | |
340 | 374 | if (operator.equals(OPERATOR_CONTAINING)) |
341 | 375 | { |
342 | 376 | MtasSpanQuery q = new MtasSpanContainingQuery(si1.getQuery(), si2.getQuery()); |
... | ... |