isomorfeus-ferret 0.13.8 → 0.13.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. checksums.yaml +4 -4
  2. data/ext/isomorfeus_ferret_ext/bm_store.c +3 -3
  3. data/ext/isomorfeus_ferret_ext/bzlib.h +83 -82
  4. data/ext/isomorfeus_ferret_ext/frb_index.c +17 -23
  5. data/ext/isomorfeus_ferret_ext/frb_search.c +1 -4
  6. data/ext/isomorfeus_ferret_ext/frb_store.c +32 -34
  7. data/ext/isomorfeus_ferret_ext/frt_analysis.c +4 -4
  8. data/ext/isomorfeus_ferret_ext/frt_analysis.h +9 -9
  9. data/ext/isomorfeus_ferret_ext/frt_bitvector.c +1 -1
  10. data/ext/isomorfeus_ferret_ext/frt_bitvector.h +1 -1
  11. data/ext/isomorfeus_ferret_ext/frt_compound_io.c +41 -66
  12. data/ext/isomorfeus_ferret_ext/frt_config.h +8 -0
  13. data/ext/isomorfeus_ferret_ext/frt_except.c +1 -0
  14. data/ext/isomorfeus_ferret_ext/frt_filter.c +2 -4
  15. data/ext/isomorfeus_ferret_ext/frt_fs_store.c +24 -19
  16. data/ext/isomorfeus_ferret_ext/frt_global.c +6 -4
  17. data/ext/isomorfeus_ferret_ext/frt_global.h +1 -1
  18. data/ext/isomorfeus_ferret_ext/frt_hash.c +40 -48
  19. data/ext/isomorfeus_ferret_ext/frt_hash.h +14 -16
  20. data/ext/isomorfeus_ferret_ext/frt_hashset.c +5 -5
  21. data/ext/isomorfeus_ferret_ext/frt_ind.c +2 -3
  22. data/ext/isomorfeus_ferret_ext/frt_index.c +148 -219
  23. data/ext/isomorfeus_ferret_ext/frt_index.h +31 -31
  24. data/ext/isomorfeus_ferret_ext/frt_lang.c +1 -4
  25. data/ext/isomorfeus_ferret_ext/frt_multimapper.c +8 -9
  26. data/ext/isomorfeus_ferret_ext/frt_multimapper.h +1 -1
  27. data/ext/isomorfeus_ferret_ext/frt_q_boolean.c +6 -6
  28. data/ext/isomorfeus_ferret_ext/frt_q_match_all.c +8 -3
  29. data/ext/isomorfeus_ferret_ext/frt_q_parser.c +1743 -1742
  30. data/ext/isomorfeus_ferret_ext/frt_q_phrase.c +1 -2
  31. data/ext/isomorfeus_ferret_ext/frt_q_span.c +11 -10
  32. data/ext/isomorfeus_ferret_ext/frt_ram_store.c +24 -40
  33. data/ext/isomorfeus_ferret_ext/frt_search.c +29 -28
  34. data/ext/isomorfeus_ferret_ext/frt_search.h +18 -19
  35. data/ext/isomorfeus_ferret_ext/frt_store.c +47 -40
  36. data/ext/isomorfeus_ferret_ext/frt_store.h +46 -48
  37. data/ext/isomorfeus_ferret_ext/frt_threading.h +12 -5
  38. data/ext/isomorfeus_ferret_ext/isomorfeus_ferret.c +4 -3
  39. data/ext/isomorfeus_ferret_ext/test_1710.c +1 -2
  40. data/ext/isomorfeus_ferret_ext/test_compound_io.c +8 -8
  41. data/ext/isomorfeus_ferret_ext/test_fields.c +7 -7
  42. data/ext/isomorfeus_ferret_ext/test_file_deleter.c +1 -1
  43. data/ext/isomorfeus_ferret_ext/test_filter.c +4 -3
  44. data/ext/isomorfeus_ferret_ext/test_fs_store.c +1 -1
  45. data/ext/isomorfeus_ferret_ext/test_highlighter.c +3 -1
  46. data/ext/isomorfeus_ferret_ext/test_index.c +61 -61
  47. data/ext/isomorfeus_ferret_ext/test_q_const_score.c +2 -1
  48. data/ext/isomorfeus_ferret_ext/test_q_filtered.c +3 -2
  49. data/ext/isomorfeus_ferret_ext/test_q_fuzzy.c +3 -1
  50. data/ext/isomorfeus_ferret_ext/test_q_span.c +8 -1
  51. data/ext/isomorfeus_ferret_ext/test_ram_store.c +4 -4
  52. data/ext/isomorfeus_ferret_ext/test_search.c +9 -4
  53. data/ext/isomorfeus_ferret_ext/test_segments.c +4 -3
  54. data/ext/isomorfeus_ferret_ext/test_sort.c +17 -9
  55. data/ext/isomorfeus_ferret_ext/test_term.c +4 -2
  56. data/ext/isomorfeus_ferret_ext/test_term_vectors.c +2 -2
  57. data/ext/isomorfeus_ferret_ext/test_threading.c +5 -4
  58. data/lib/isomorfeus/ferret/index/index.rb +8 -3
  59. data/lib/isomorfeus/ferret/version.rb +1 -1
  60. metadata +16 -2
@@ -1,73 +1,73 @@
1
- /* A Bison parser, made by GNU Bison 3.8.2. */
2
-
3
- /* Bison implementation for Yacc-like parsers in C
4
-
5
- Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation,
6
- Inc.
7
-
8
- This program is free software: you can redistribute it and/or modify
9
- it under the terms of the GNU General Public License as published by
10
- the Free Software Foundation, either version 3 of the License, or
11
- (at your option) any later version.
12
-
13
- This program is distributed in the hope that it will be useful,
14
- but WITHOUT ANY WARRANTY; without even the implied warranty of
15
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
- GNU General Public License for more details.
17
-
18
- You should have received a copy of the GNU General Public License
19
- along with this program. If not, see <https://www.gnu.org/licenses/>. */
20
-
21
- /* As a special exception, you may create a larger work that contains
22
- part or all of the Bison parser skeleton and distribute that work
23
- under terms of your choice, so long as that work isn't itself a
24
- parser generator using the skeleton or a modified version thereof
25
- as a parser skeleton. Alternatively, if you modify or redistribute
26
- the parser skeleton itself, you may (at your option) remove this
27
- special exception, which will cause the skeleton and the resulting
28
- Bison output files to be licensed under the GNU General Public
29
- License without this special exception.
30
-
31
- This special exception was added by the Free Software Foundation in
32
- version 2.2 of Bison. */
33
-
34
- /* C LALR(1) parser skeleton written by Richard Stallman, by
35
- simplifying the original so-called "semantic" parser. */
36
-
37
- /* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
38
- especially those whose name start with YY_ or yy_. They are
39
- private implementation details that can be changed or removed. */
40
-
41
- /* All symbols defined below should begin with yy or YY, to avoid
42
- infringing on user name space. This should be done even for local
43
- variables, as they might otherwise be expanded by user macros.
44
- There are some unavoidable exceptions within include files to
45
- define necessary library symbols; they are noted "INFRINGES ON
46
- USER NAME SPACE" below. */
47
-
48
- /* Identify Bison output, and Bison version. */
49
- #define YYBISON 30802
50
-
51
- /* Bison version string. */
52
- #define YYBISON_VERSION "3.8.2"
53
-
54
- /* Skeleton name. */
55
- #define YYSKELETON_NAME "yacc.c"
56
-
57
- /* Pure parsers. */
58
- #define YYPURE 2
59
-
60
- /* Push parsers. */
61
- #define YYPUSH 0
62
-
63
- /* Pull parsers. */
64
- #define YYPULL 1
65
-
66
-
67
-
68
-
69
- /* First part of user prologue. */
70
- #line 1 "frt_q_parser.y"
1
+ /* A Bison parser, made by GNU Bison 3.8.2. */
2
+
3
+ /* Bison implementation for Yacc-like parsers in C
4
+
5
+ Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation,
6
+ Inc.
7
+
8
+ This program is free software: you can redistribute it and/or modify
9
+ it under the terms of the GNU General Public License as published by
10
+ the Free Software Foundation, either version 3 of the License, or
11
+ (at your option) any later version.
12
+
13
+ This program is distributed in the hope that it will be useful,
14
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ GNU General Public License for more details.
17
+
18
+ You should have received a copy of the GNU General Public License
19
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
20
+
21
+ /* As a special exception, you may create a larger work that contains
22
+ part or all of the Bison parser skeleton and distribute that work
23
+ under terms of your choice, so long as that work isn't itself a
24
+ parser generator using the skeleton or a modified version thereof
25
+ as a parser skeleton. Alternatively, if you modify or redistribute
26
+ the parser skeleton itself, you may (at your option) remove this
27
+ special exception, which will cause the skeleton and the resulting
28
+ Bison output files to be licensed under the GNU General Public
29
+ License without this special exception.
30
+
31
+ This special exception was added by the Free Software Foundation in
32
+ version 2.2 of Bison. */
33
+
34
+ /* C LALR(1) parser skeleton written by Richard Stallman, by
35
+ simplifying the original so-called "semantic" parser. */
36
+
37
+ /* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
38
+ especially those whose name start with YY_ or yy_. They are
39
+ private implementation details that can be changed or removed. */
40
+
41
+ /* All symbols defined below should begin with yy or YY, to avoid
42
+ infringing on user name space. This should be done even for local
43
+ variables, as they might otherwise be expanded by user macros.
44
+ There are some unavoidable exceptions within include files to
45
+ define necessary library symbols; they are noted "INFRINGES ON
46
+ USER NAME SPACE" below. */
47
+
48
+ /* Identify Bison output, and Bison version. */
49
+ #define YYBISON 30802
50
+
51
+ /* Bison version string. */
52
+ #define YYBISON_VERSION "3.8.2"
53
+
54
+ /* Skeleton name. */
55
+ #define YYSKELETON_NAME "yacc.c"
56
+
57
+ /* Pure parsers. */
58
+ #define YYPURE 2
59
+
60
+ /* Push parsers. */
61
+ #define YYPUSH 0
62
+
63
+ /* Pull parsers. */
64
+ #define YYPULL 1
65
+
66
+
67
+
68
+
69
+ /* First part of user prologue. */
70
+ #line 1 "frt_q_parser.y"
71
71
 
72
72
  /*****************************************************************************
73
73
  * QueryParser
@@ -182,65 +182,65 @@ typedef struct FrtBCArray {
182
182
  float frt_qp_default_fuzzy_min_sim = 0.5;
183
183
  int frt_qp_default_fuzzy_pre_len = 0;
184
184
 
185
-
186
- #line 187 "frt_q_parser.c"
187
-
188
- # ifndef YY_CAST
189
- # ifdef __cplusplus
190
- # define YY_CAST(Type, Val) static_cast<Type> (Val)
191
- # define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
192
- # else
193
- # define YY_CAST(Type, Val) ((Type) (Val))
194
- # define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
195
- # endif
196
- # endif
197
- # ifndef YY_NULLPTR
198
- # if defined __cplusplus
199
- # if 201103L <= __cplusplus
200
- # define YY_NULLPTR nullptr
201
- # else
202
- # define YY_NULLPTR 0
203
- # endif
204
- # else
205
- # define YY_NULLPTR ((void*)0)
206
- # endif
207
- # endif
208
-
209
-
210
- /* Debug traces. */
211
- #ifndef YYDEBUG
212
- # define YYDEBUG 0
213
- #endif
214
- #if YYDEBUG
215
- extern int yydebug;
216
- #endif
217
-
218
- /* Token kinds. */
219
- #ifndef YYTOKENTYPE
220
- # define YYTOKENTYPE
221
- enum yytokentype
222
- {
223
- YYEMPTY = -2,
224
- YYEOF = 0, /* "end of file" */
225
- YYerror = 256, /* error */
226
- YYUNDEF = 257, /* "invalid token" */
227
- QWRD = 258, /* QWRD */
228
- WILD_STR = 259, /* WILD_STR */
229
- LOW = 260, /* LOW */
230
- AND = 261, /* AND */
231
- OR = 262, /* OR */
232
- REQ = 263, /* REQ */
233
- NOT = 264, /* NOT */
234
- HIGH = 265 /* HIGH */
235
- };
236
- typedef enum yytokentype yytoken_kind_t;
237
- #endif
238
-
239
- /* Value type. */
240
- #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
241
- union YYSTYPE
242
- {
243
- #line 116 "frt_q_parser.y"
185
+
186
+ #line 187 "frt_q_parser.c"
187
+
188
+ # ifndef YY_CAST
189
+ # ifdef __cplusplus
190
+ # define YY_CAST(Type, Val) static_cast<Type> (Val)
191
+ # define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
192
+ # else
193
+ # define YY_CAST(Type, Val) ((Type) (Val))
194
+ # define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
195
+ # endif
196
+ # endif
197
+ # ifndef YY_NULLPTR
198
+ # if defined __cplusplus
199
+ # if 201103L <= __cplusplus
200
+ # define YY_NULLPTR nullptr
201
+ # else
202
+ # define YY_NULLPTR 0
203
+ # endif
204
+ # else
205
+ # define YY_NULLPTR ((void*)0)
206
+ # endif
207
+ # endif
208
+
209
+
210
+ /* Debug traces. */
211
+ #ifndef YYDEBUG
212
+ # define YYDEBUG 0
213
+ #endif
214
+ #if YYDEBUG
215
+ extern int yydebug;
216
+ #endif
217
+
218
+ /* Token kinds. */
219
+ #ifndef YYTOKENTYPE
220
+ # define YYTOKENTYPE
221
+ enum yytokentype
222
+ {
223
+ YYEMPTY = -2,
224
+ YYEOF = 0, /* "end of file" */
225
+ YYerror = 256, /* error */
226
+ YYUNDEF = 257, /* "invalid token" */
227
+ QWRD = 258, /* QWRD */
228
+ WILD_STR = 259, /* WILD_STR */
229
+ LOW = 260, /* LOW */
230
+ AND = 261, /* AND */
231
+ OR = 262, /* OR */
232
+ REQ = 263, /* REQ */
233
+ NOT = 264, /* NOT */
234
+ HIGH = 265 /* HIGH */
235
+ };
236
+ typedef enum yytokentype yytoken_kind_t;
237
+ #endif
238
+
239
+ /* Value type. */
240
+ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
241
+ union YYSTYPE
242
+ {
243
+ #line 116 "frt_q_parser.y"
244
244
 
245
245
  FrtQuery *query;
246
246
  FrtBooleanClause *bcls;
@@ -248,74 +248,74 @@ union YYSTYPE
248
248
  FrtHashSet *hashset;
249
249
  Phrase *phrase;
250
250
  char *str;
251
-
252
- #line 253 "frt_q_parser.c"
253
-
254
- };
255
- typedef union YYSTYPE YYSTYPE;
256
- # define YYSTYPE_IS_TRIVIAL 1
257
- # define YYSTYPE_IS_DECLARED 1
258
- #endif
259
-
260
-
261
-
262
-
263
- int yyparse (FrtQParser *qp, rb_encoding *encoding);
264
-
265
-
266
-
267
- /* Symbol kind. */
268
- enum yysymbol_kind_t
269
- {
270
- YYSYMBOL_YYEMPTY = -2,
271
- YYSYMBOL_YYEOF = 0, /* "end of file" */
272
- YYSYMBOL_YYerror = 1, /* error */
273
- YYSYMBOL_YYUNDEF = 2, /* "invalid token" */
274
- YYSYMBOL_QWRD = 3, /* QWRD */
275
- YYSYMBOL_WILD_STR = 4, /* WILD_STR */
276
- YYSYMBOL_LOW = 5, /* LOW */
277
- YYSYMBOL_AND = 6, /* AND */
278
- YYSYMBOL_OR = 7, /* OR */
279
- YYSYMBOL_REQ = 8, /* REQ */
280
- YYSYMBOL_NOT = 9, /* NOT */
281
- YYSYMBOL_10_ = 10, /* ':' */
282
- YYSYMBOL_HIGH = 11, /* HIGH */
283
- YYSYMBOL_12_ = 12, /* '^' */
284
- YYSYMBOL_13_ = 13, /* '(' */
285
- YYSYMBOL_14_ = 14, /* ')' */
286
- YYSYMBOL_15_ = 15, /* '~' */
287
- YYSYMBOL_16_ = 16, /* '*' */
288
- YYSYMBOL_17_ = 17, /* '|' */
289
- YYSYMBOL_18_ = 18, /* '"' */
290
- YYSYMBOL_19_ = 19, /* '<' */
291
- YYSYMBOL_20_ = 20, /* '>' */
292
- YYSYMBOL_21_ = 21, /* '[' */
293
- YYSYMBOL_22_ = 22, /* ']' */
294
- YYSYMBOL_23_ = 23, /* '}' */
295
- YYSYMBOL_24_ = 24, /* '{' */
296
- YYSYMBOL_25_ = 25, /* '=' */
297
- YYSYMBOL_YYACCEPT = 26, /* $accept */
298
- YYSYMBOL_bool_q = 27, /* bool_q */
299
- YYSYMBOL_bool_clss = 28, /* bool_clss */
300
- YYSYMBOL_bool_cls = 29, /* bool_cls */
301
- YYSYMBOL_boosted_q = 30, /* boosted_q */
302
- YYSYMBOL_q = 31, /* q */
303
- YYSYMBOL_term_q = 32, /* term_q */
304
- YYSYMBOL_wild_q = 33, /* wild_q */
305
- YYSYMBOL_field_q = 34, /* field_q */
306
- YYSYMBOL_35_1 = 35, /* $@1 */
307
- YYSYMBOL_36_2 = 36, /* $@2 */
308
- YYSYMBOL_37_3 = 37, /* $@3 */
309
- YYSYMBOL_field = 38, /* field */
310
- YYSYMBOL_phrase_q = 39, /* phrase_q */
311
- YYSYMBOL_ph_words = 40, /* ph_words */
312
- YYSYMBOL_range_q = 41 /* range_q */
313
- };
314
- typedef enum yysymbol_kind_t yysymbol_kind_t;
315
-
316
-
317
- /* Second part of user prologue. */
318
- #line 124 "frt_q_parser.y"
251
+
252
+ #line 253 "frt_q_parser.c"
253
+
254
+ };
255
+ typedef union YYSTYPE YYSTYPE;
256
+ # define YYSTYPE_IS_TRIVIAL 1
257
+ # define YYSTYPE_IS_DECLARED 1
258
+ #endif
259
+
260
+
261
+
262
+
263
+ int yyparse (FrtQParser *qp, rb_encoding *encoding);
264
+
265
+
266
+
267
+ /* Symbol kind. */
268
+ enum yysymbol_kind_t
269
+ {
270
+ YYSYMBOL_YYEMPTY = -2,
271
+ YYSYMBOL_YYEOF = 0, /* "end of file" */
272
+ YYSYMBOL_YYerror = 1, /* error */
273
+ YYSYMBOL_YYUNDEF = 2, /* "invalid token" */
274
+ YYSYMBOL_QWRD = 3, /* QWRD */
275
+ YYSYMBOL_WILD_STR = 4, /* WILD_STR */
276
+ YYSYMBOL_LOW = 5, /* LOW */
277
+ YYSYMBOL_AND = 6, /* AND */
278
+ YYSYMBOL_OR = 7, /* OR */
279
+ YYSYMBOL_REQ = 8, /* REQ */
280
+ YYSYMBOL_NOT = 9, /* NOT */
281
+ YYSYMBOL_10_ = 10, /* ':' */
282
+ YYSYMBOL_HIGH = 11, /* HIGH */
283
+ YYSYMBOL_12_ = 12, /* '^' */
284
+ YYSYMBOL_13_ = 13, /* '(' */
285
+ YYSYMBOL_14_ = 14, /* ')' */
286
+ YYSYMBOL_15_ = 15, /* '~' */
287
+ YYSYMBOL_16_ = 16, /* '*' */
288
+ YYSYMBOL_17_ = 17, /* '|' */
289
+ YYSYMBOL_18_ = 18, /* '"' */
290
+ YYSYMBOL_19_ = 19, /* '<' */
291
+ YYSYMBOL_20_ = 20, /* '>' */
292
+ YYSYMBOL_21_ = 21, /* '[' */
293
+ YYSYMBOL_22_ = 22, /* ']' */
294
+ YYSYMBOL_23_ = 23, /* '}' */
295
+ YYSYMBOL_24_ = 24, /* '{' */
296
+ YYSYMBOL_25_ = 25, /* '=' */
297
+ YYSYMBOL_YYACCEPT = 26, /* $accept */
298
+ YYSYMBOL_bool_q = 27, /* bool_q */
299
+ YYSYMBOL_bool_clss = 28, /* bool_clss */
300
+ YYSYMBOL_bool_cls = 29, /* bool_cls */
301
+ YYSYMBOL_boosted_q = 30, /* boosted_q */
302
+ YYSYMBOL_q = 31, /* q */
303
+ YYSYMBOL_term_q = 32, /* term_q */
304
+ YYSYMBOL_wild_q = 33, /* wild_q */
305
+ YYSYMBOL_field_q = 34, /* field_q */
306
+ YYSYMBOL_35_1 = 35, /* $@1 */
307
+ YYSYMBOL_36_2 = 36, /* $@2 */
308
+ YYSYMBOL_37_3 = 37, /* $@3 */
309
+ YYSYMBOL_field = 38, /* field */
310
+ YYSYMBOL_phrase_q = 39, /* phrase_q */
311
+ YYSYMBOL_ph_words = 40, /* ph_words */
312
+ YYSYMBOL_range_q = 41 /* range_q */
313
+ };
314
+ typedef enum yysymbol_kind_t yysymbol_kind_t;
315
+
316
+
317
+ /* Second part of user prologue. */
318
+ #line 124 "frt_q_parser.y"
319
319
 
320
320
  static int yylex(YYSTYPE *lvalp, FrtQParser *qp);
321
321
  static int yyerror(FrtQParser *qp, rb_encoding *encoding, char const *msg);
@@ -397,1551 +397,1551 @@ static void qp_pop_fields(FrtQParser *self);
397
397
  FRT_HANDLED();\
398
398
  FRT_XENDTRY\
399
399
  if (qp->destruct) Y;
400
-
401
- #line 402 "frt_q_parser.c"
402
-
403
-
404
- #ifdef short
405
- # undef short
406
- #endif
407
-
408
- /* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
409
- <limits.h> and (if available) <stdint.h> are included
410
- so that the code can choose integer types of a good width. */
411
-
412
- #ifndef __PTRDIFF_MAX__
413
- # include <limits.h> /* INFRINGES ON USER NAME SPACE */
414
- # if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
415
- # include <stdint.h> /* INFRINGES ON USER NAME SPACE */
416
- # define YY_STDINT_H
417
- # endif
418
- #endif
419
-
420
- /* Narrow types that promote to a signed type and that can represent a
421
- signed or unsigned integer of at least N bits. In tables they can
422
- save space and decrease cache pressure. Promoting to a signed type
423
- helps avoid bugs in integer arithmetic. */
424
-
425
- #ifdef __INT_LEAST8_MAX__
426
- typedef __INT_LEAST8_TYPE__ yytype_int8;
427
- #elif defined YY_STDINT_H
428
- typedef int_least8_t yytype_int8;
429
- #else
430
- typedef signed char yytype_int8;
431
- #endif
432
-
433
- #ifdef __INT_LEAST16_MAX__
434
- typedef __INT_LEAST16_TYPE__ yytype_int16;
435
- #elif defined YY_STDINT_H
436
- typedef int_least16_t yytype_int16;
437
- #else
438
- typedef short yytype_int16;
439
- #endif
440
-
441
- /* Work around bug in HP-UX 11.23, which defines these macros
442
- incorrectly for preprocessor constants. This workaround can likely
443
- be removed in 2023, as HPE has promised support for HP-UX 11.23
444
- (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of
445
- <https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>. */
446
- #ifdef __hpux
447
- # undef UINT_LEAST8_MAX
448
- # undef UINT_LEAST16_MAX
449
- # define UINT_LEAST8_MAX 255
450
- # define UINT_LEAST16_MAX 65535
451
- #endif
452
-
453
- #if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
454
- typedef __UINT_LEAST8_TYPE__ yytype_uint8;
455
- #elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
456
- && UINT_LEAST8_MAX <= INT_MAX)
457
- typedef uint_least8_t yytype_uint8;
458
- #elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
459
- typedef unsigned char yytype_uint8;
460
- #else
461
- typedef short yytype_uint8;
462
- #endif
463
-
464
- #if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
465
- typedef __UINT_LEAST16_TYPE__ yytype_uint16;
466
- #elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
467
- && UINT_LEAST16_MAX <= INT_MAX)
468
- typedef uint_least16_t yytype_uint16;
469
- #elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
470
- typedef unsigned short yytype_uint16;
471
- #else
472
- typedef int yytype_uint16;
473
- #endif
474
-
475
- #ifndef YYPTRDIFF_T
476
- # if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
477
- # define YYPTRDIFF_T __PTRDIFF_TYPE__
478
- # define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
479
- # elif defined PTRDIFF_MAX
480
- # ifndef ptrdiff_t
481
- # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
482
- # endif
483
- # define YYPTRDIFF_T ptrdiff_t
484
- # define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
485
- # else
486
- # define YYPTRDIFF_T long
487
- # define YYPTRDIFF_MAXIMUM LONG_MAX
488
- # endif
489
- #endif
490
-
491
- #ifndef YYSIZE_T
492
- # ifdef __SIZE_TYPE__
493
- # define YYSIZE_T __SIZE_TYPE__
494
- # elif defined size_t
495
- # define YYSIZE_T size_t
496
- # elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
497
- # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
498
- # define YYSIZE_T size_t
499
- # else
500
- # define YYSIZE_T unsigned
501
- # endif
502
- #endif
503
-
504
- #define YYSIZE_MAXIMUM \
505
- YY_CAST (YYPTRDIFF_T, \
506
- (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \
507
- ? YYPTRDIFF_MAXIMUM \
508
- : YY_CAST (YYSIZE_T, -1)))
509
-
510
- #define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
511
-
512
-
513
- /* Stored state numbers (used for stacks). */
514
- typedef yytype_int8 yy_state_t;
515
-
516
- /* State numbers in computations. */
517
- typedef int yy_state_fast_t;
518
-
519
- #ifndef YY_
520
- # if defined YYENABLE_NLS && YYENABLE_NLS
521
- # if ENABLE_NLS
522
- # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
523
- # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
524
- # endif
525
- # endif
526
- # ifndef YY_
527
- # define YY_(Msgid) Msgid
528
- # endif
529
- #endif
530
-
531
-
532
- #ifndef YY_ATTRIBUTE_PURE
533
- # if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
534
- # define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
535
- # else
536
- # define YY_ATTRIBUTE_PURE
537
- # endif
538
- #endif
539
-
540
- #ifndef YY_ATTRIBUTE_UNUSED
541
- # if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
542
- # define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
543
- # else
544
- # define YY_ATTRIBUTE_UNUSED
545
- # endif
546
- #endif
547
-
548
- /* Suppress unused-variable warnings by "using" E. */
549
- #if ! defined lint || defined __GNUC__
550
- # define YY_USE(E) ((void) (E))
551
- #else
552
- # define YY_USE(E) /* empty */
553
- #endif
554
-
555
- /* Suppress an incorrect diagnostic about yylval being uninitialized. */
556
- #if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
557
- # if __GNUC__ * 100 + __GNUC_MINOR__ < 407
558
- # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
559
- _Pragma ("GCC diagnostic push") \
560
- _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
561
- # else
562
- # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
563
- _Pragma ("GCC diagnostic push") \
564
- _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
565
- _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
566
- # endif
567
- # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
568
- _Pragma ("GCC diagnostic pop")
569
- #else
570
- # define YY_INITIAL_VALUE(Value) Value
571
- #endif
572
- #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
573
- # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
574
- # define YY_IGNORE_MAYBE_UNINITIALIZED_END
575
- #endif
576
- #ifndef YY_INITIAL_VALUE
577
- # define YY_INITIAL_VALUE(Value) /* Nothing. */
578
- #endif
579
-
580
- #if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
581
- # define YY_IGNORE_USELESS_CAST_BEGIN \
582
- _Pragma ("GCC diagnostic push") \
583
- _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
584
- # define YY_IGNORE_USELESS_CAST_END \
585
- _Pragma ("GCC diagnostic pop")
586
- #endif
587
- #ifndef YY_IGNORE_USELESS_CAST_BEGIN
588
- # define YY_IGNORE_USELESS_CAST_BEGIN
589
- # define YY_IGNORE_USELESS_CAST_END
590
- #endif
591
-
592
-
593
- #define YY_ASSERT(E) ((void) (0 && (E)))
594
-
595
- #if !defined yyoverflow
596
-
597
- /* The parser invokes alloca or malloc; define the necessary symbols. */
598
-
599
- # ifdef YYSTACK_USE_ALLOCA
600
- # if YYSTACK_USE_ALLOCA
601
- # ifdef __GNUC__
602
- # define YYSTACK_ALLOC __builtin_alloca
603
- # elif defined __BUILTIN_VA_ARG_INCR
604
- # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
605
- # elif defined _AIX
606
- # define YYSTACK_ALLOC __alloca
607
- # elif defined _MSC_VER
608
- # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
609
- # define alloca _alloca
610
- # else
611
- # define YYSTACK_ALLOC alloca
612
- # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
613
- # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
614
- /* Use EXIT_SUCCESS as a witness for stdlib.h. */
615
- # ifndef EXIT_SUCCESS
616
- # define EXIT_SUCCESS 0
617
- # endif
618
- # endif
619
- # endif
620
- # endif
621
- # endif
622
-
623
- # ifdef YYSTACK_ALLOC
624
- /* Pacify GCC's 'empty if-body' warning. */
625
- # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
626
- # ifndef YYSTACK_ALLOC_MAXIMUM
627
- /* The OS might guarantee only one guard page at the bottom of the stack,
628
- and a page size can be as small as 4096 bytes. So we cannot safely
629
- invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
630
- to allow for a few compiler-allocated temporary stack slots. */
631
- # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
632
- # endif
633
- # else
634
- # define YYSTACK_ALLOC YYMALLOC
635
- # define YYSTACK_FREE YYFREE
636
- # ifndef YYSTACK_ALLOC_MAXIMUM
637
- # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
638
- # endif
639
- # if (defined __cplusplus && ! defined EXIT_SUCCESS \
640
- && ! ((defined YYMALLOC || defined malloc) \
641
- && (defined YYFREE || defined free)))
642
- # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
643
- # ifndef EXIT_SUCCESS
644
- # define EXIT_SUCCESS 0
645
- # endif
646
- # endif
647
- # ifndef YYMALLOC
648
- # define YYMALLOC malloc
649
- # if ! defined malloc && ! defined EXIT_SUCCESS
650
- void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
651
- # endif
652
- # endif
653
- # ifndef YYFREE
654
- # define YYFREE free
655
- # if ! defined free && ! defined EXIT_SUCCESS
656
- void free (void *); /* INFRINGES ON USER NAME SPACE */
657
- # endif
658
- # endif
659
- # endif
660
- #endif /* !defined yyoverflow */
661
-
662
- #if (! defined yyoverflow \
663
- && (! defined __cplusplus \
664
- || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
665
-
666
- /* A type that is properly aligned for any stack member. */
667
- union yyalloc
668
- {
669
- yy_state_t yyss_alloc;
670
- YYSTYPE yyvs_alloc;
671
- };
672
-
673
- /* The size of the maximum gap between one aligned stack and the next. */
674
- # define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
675
-
676
- /* The size of an array large to enough to hold all stacks, each with
677
- N elements. */
678
- # define YYSTACK_BYTES(N) \
679
- ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \
680
- + YYSTACK_GAP_MAXIMUM)
681
-
682
- # define YYCOPY_NEEDED 1
683
-
684
- /* Relocate STACK from its old location to the new one. The
685
- local variables YYSIZE and YYSTACKSIZE give the old and new number of
686
- elements in the stack, and YYPTR gives the new location of the
687
- stack. Advance YYPTR to a properly aligned location for the next
688
- stack. */
689
- # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
690
- do \
691
- { \
692
- YYPTRDIFF_T yynewbytes; \
693
- YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
694
- Stack = &yyptr->Stack_alloc; \
695
- yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
696
- yyptr += yynewbytes / YYSIZEOF (*yyptr); \
697
- } \
698
- while (0)
699
-
700
- #endif
701
-
702
- #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
703
- /* Copy COUNT objects from SRC to DST. The source and destination do
704
- not overlap. */
705
- # ifndef YYCOPY
706
- # if defined __GNUC__ && 1 < __GNUC__
707
- # define YYCOPY(Dst, Src, Count) \
708
- __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
709
- # else
710
- # define YYCOPY(Dst, Src, Count) \
711
- do \
712
- { \
713
- YYPTRDIFF_T yyi; \
714
- for (yyi = 0; yyi < (Count); yyi++) \
715
- (Dst)[yyi] = (Src)[yyi]; \
716
- } \
717
- while (0)
718
- # endif
719
- # endif
720
- #endif /* !YYCOPY_NEEDED */
721
-
722
- /* YYFINAL -- State number of the termination state. */
723
- #define YYFINAL 39
724
- /* YYLAST -- Last index in YYTABLE. */
725
- #define YYLAST 126
726
-
727
- /* YYNTOKENS -- Number of terminals. */
728
- #define YYNTOKENS 26
729
- /* YYNNTS -- Number of nonterminals. */
730
- #define YYNNTS 16
731
- /* YYNRULES -- Number of rules. */
732
- #define YYNRULES 51
733
- /* YYNSTATES -- Number of states. */
734
- #define YYNSTATES 80
735
-
736
- /* YYMAXUTOK -- Last valid token kind. */
737
- #define YYMAXUTOK 265
738
-
739
-
740
- /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
741
- as returned by yylex, with out-of-bounds checking. */
742
- #define YYTRANSLATE(YYX) \
743
- (0 <= (YYX) && (YYX) <= YYMAXUTOK \
744
- ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \
745
- : YYSYMBOL_YYUNDEF)
746
-
747
- /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
748
- as returned by yylex. */
749
- static const yytype_int8 yytranslate[] =
750
- {
751
- 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
752
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
753
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
754
- 2, 2, 2, 2, 18, 2, 2, 2, 2, 2,
755
- 13, 14, 16, 2, 2, 2, 2, 2, 2, 2,
756
- 2, 2, 2, 2, 2, 2, 2, 2, 10, 2,
757
- 19, 25, 20, 2, 2, 2, 2, 2, 2, 2,
758
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
759
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
760
- 2, 21, 2, 22, 12, 2, 2, 2, 2, 2,
761
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
762
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
763
- 2, 2, 2, 24, 17, 23, 15, 2, 2, 2,
764
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
765
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
766
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
767
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
768
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
769
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
770
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
771
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
772
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
773
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
774
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
775
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
776
- 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
777
- 5, 6, 7, 8, 9, 11
778
- };
779
-
780
- #if YYDEBUG
781
- /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
782
- static const yytype_int16 yyrline[] =
783
- {
784
- 0, 226, 226, 227, 229, 230, 231, 232, 234, 235,
785
- 236, 238, 239, 241, 242, 243, 244, 245, 246, 247,
786
- 249, 250, 251, 253, 255, 255, 257, 257, 257, 260,
787
- 261, 263, 264, 265, 266, 268, 269, 270, 271, 272,
788
- 274, 275, 276, 277, 278, 279, 280, 281, 282, 283,
789
- 284, 285
790
- };
791
- #endif
792
-
793
- /** Accessing symbol of state STATE. */
794
- #define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])
795
-
796
- #if YYDEBUG || 0
797
- /* The user-facing name of the symbol whose (internal) number is
798
- YYSYMBOL. No bounds checking. */
799
- static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;
800
-
801
- /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
802
- First, the terminals, then, starting at YYNTOKENS, nonterminals. */
803
- static const char *const yytname[] =
804
- {
805
- "\"end of file\"", "error", "\"invalid token\"", "QWRD", "WILD_STR",
806
- "LOW", "AND", "OR", "REQ", "NOT", "':'", "HIGH", "'^'", "'('", "')'",
807
- "'~'", "'*'", "'|'", "'\"'", "'<'", "'>'", "'['", "']'", "'}'", "'{'",
808
- "'='", "$accept", "bool_q", "bool_clss", "bool_cls", "boosted_q", "q",
809
- "term_q", "wild_q", "field_q", "$@1", "$@2", "$@3", "field", "phrase_q",
810
- "ph_words", "range_q", YY_NULLPTR
811
- };
812
-
813
- static const char *
814
- yysymbol_name (yysymbol_kind_t yysymbol)
815
- {
816
- return yytname[yysymbol];
817
- }
818
- #endif
819
-
820
- #define YYPACT_NINF (-30)
821
-
822
- #define yypact_value_is_default(Yyn) \
823
- ((Yyn) == YYPACT_NINF)
824
-
825
- #define YYTABLE_NINF (-30)
826
-
827
- #define yytable_value_is_error(Yyn) \
828
- 0
829
-
830
- /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
831
- STATE-NUM. */
832
- static const yytype_int8 yypact[] =
833
- {
834
- 83, -4, -30, 102, 102, 64, -30, 7, -2, -1,
835
- 6, 15, 31, 45, -30, -30, 29, -30, -30, -30,
836
- -5, -30, -30, 40, -30, -30, -30, 26, 47, -30,
837
- 55, 42, 19, -15, 68, -30, 71, 0, 1, -30,
838
- 83, 83, -30, 72, 102, 73, -30, -30, 102, 76,
839
- -30, -30, 78, 74, 70, -30, -30, -30, -30, -6,
840
- -30, 33, -30, -30, -30, -30, -30, -30, -30, -30,
841
- -30, 90, -30, -30, -30, -30, -30, -30, -30, -30
842
- };
843
-
844
- /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
845
- Performed when YYTABLE does not specify something else to do. Zero
846
- means the default is an error. */
847
- static const yytype_int8 yydefact[] =
848
- {
849
- 2, 20, 23, 0, 0, 0, 26, 0, 0, 0,
850
- 0, 0, 0, 3, 4, 10, 11, 13, 19, 16,
851
- 0, 17, 18, 22, 8, 9, 14, 0, 0, 35,
852
- 33, 0, 0, 48, 0, 51, 0, 0, 0, 1,
853
- 0, 0, 7, 0, 0, 0, 21, 15, 0, 0,
854
- 36, 37, 0, 31, 0, 45, 44, 49, 50, 0,
855
- 46, 0, 47, 5, 6, 12, 24, 30, 27, 34,
856
- 39, 0, 38, 40, 41, 42, 43, 25, 28, 32
857
- };
858
-
859
- /* YYPGOTO[NTERM-NUM]. */
860
- static const yytype_int8 yypgoto[] =
861
- {
862
- -30, -30, 89, -13, 56, -29, -30, -30, -30, -30,
863
- -30, -30, -30, -30, -30, -30
864
- };
865
-
866
- /* YYDEFGOTO[NTERM-NUM]. */
867
- static const yytype_int8 yydefgoto[] =
868
- {
869
- 0, 12, 13, 14, 15, 16, 17, 18, 19, 77,
870
- 28, 78, 20, 21, 32, 22
871
- };
872
-
873
- /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
874
- positive, shift that token. If negative, reduce the rule whose
875
- number is the opposite. If YYTABLE_NINF, syntax error. */
876
- static const yytype_int8 yytable[] =
877
- {
878
- 42, 33, 35, 59, 61, 44, -29, 55, 56, 37,
879
- 29, 23, 45, -29, 42, 66, 73, 74, 38, 68,
880
- 60, 62, 51, 34, 36, 30, 31, 63, 64, 1,
881
- 2, 39, 40, 41, 3, 4, 52, 53, 54, 5,
882
- 47, 43, 6, 46, 7, 8, 9, 10, 1, 2,
883
- 11, 40, 41, 3, 4, 75, 76, 48, 5, 24,
884
- 25, 6, 50, 7, 8, 9, 10, 1, 2, 11,
885
- 49, 57, 3, 4, 58, 65, 67, 5, 26, 69,
886
- 6, 70, 7, 8, 9, 10, 1, 2, 11, 71,
887
- 72, 3, 4, 79, 27, 0, 5, 0, 0, 6,
888
- 0, 7, 8, 9, 10, 1, 2, 11, 0, 0,
889
- 0, 0, 0, 0, 0, 5, 0, 0, 6, 0,
890
- 7, 8, 9, 10, 0, 0, 11
891
- };
892
-
893
- static const yytype_int8 yycheck[] =
894
- {
895
- 13, 3, 3, 3, 3, 10, 10, 22, 23, 3,
896
- 3, 15, 17, 17, 27, 44, 22, 23, 3, 48,
897
- 20, 20, 3, 25, 25, 18, 19, 40, 41, 3,
898
- 4, 0, 6, 7, 8, 9, 17, 18, 19, 13,
899
- 14, 12, 16, 3, 18, 19, 20, 21, 3, 4,
900
- 24, 6, 7, 8, 9, 22, 23, 10, 13, 3,
901
- 4, 16, 20, 18, 19, 20, 21, 3, 4, 24,
902
- 15, 3, 8, 9, 3, 3, 3, 13, 14, 3,
903
- 16, 3, 18, 19, 20, 21, 3, 4, 24, 15,
904
- 20, 8, 9, 3, 5, -1, 13, -1, -1, 16,
905
- -1, 18, 19, 20, 21, 3, 4, 24, -1, -1,
906
- -1, -1, -1, -1, -1, 13, -1, -1, 16, -1,
907
- 18, 19, 20, 21, -1, -1, 24
908
- };
909
-
910
- /* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
911
- state STATE-NUM. */
912
- static const yytype_int8 yystos[] =
913
- {
914
- 0, 3, 4, 8, 9, 13, 16, 18, 19, 20,
915
- 21, 24, 27, 28, 29, 30, 31, 32, 33, 34,
916
- 38, 39, 41, 15, 30, 30, 14, 28, 36, 3,
917
- 18, 19, 40, 3, 25, 3, 25, 3, 3, 0,
918
- 6, 7, 29, 12, 10, 17, 3, 14, 10, 15,
919
- 20, 3, 17, 18, 19, 22, 23, 3, 3, 3,
920
- 20, 3, 20, 29, 29, 3, 31, 3, 31, 3,
921
- 3, 15, 20, 22, 23, 22, 23, 35, 37, 3
922
- };
923
-
924
- /* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */
925
- static const yytype_int8 yyr1[] =
926
- {
927
- 0, 26, 27, 27, 28, 28, 28, 28, 29, 29,
928
- 29, 30, 30, 31, 31, 31, 31, 31, 31, 31,
929
- 32, 32, 32, 33, 35, 34, 36, 37, 34, 38,
930
- 38, 39, 39, 39, 39, 40, 40, 40, 40, 40,
931
- 41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
932
- 41, 41
933
- };
934
-
935
- /* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */
936
- static const yytype_int8 yyr2[] =
937
- {
938
- 0, 2, 0, 1, 1, 3, 3, 2, 2, 2,
939
- 1, 1, 3, 1, 2, 3, 1, 1, 1, 1,
940
- 1, 3, 2, 1, 0, 4, 0, 0, 5, 1,
941
- 3, 3, 5, 2, 4, 1, 2, 2, 3, 3,
942
- 4, 4, 4, 4, 3, 3, 3, 3, 2, 3,
943
- 3, 2
944
- };
945
-
946
-
947
- enum { YYENOMEM = -2 };
948
-
949
- #define yyerrok (yyerrstatus = 0)
950
- #define yyclearin (yychar = YYEMPTY)
951
-
952
- #define YYACCEPT goto yyacceptlab
953
- #define YYABORT goto yyabortlab
954
- #define YYERROR goto yyerrorlab
955
- #define YYNOMEM goto yyexhaustedlab
956
-
957
-
958
- #define YYRECOVERING() (!!yyerrstatus)
959
-
960
- #define YYBACKUP(Token, Value) \
961
- do \
962
- if (yychar == YYEMPTY) \
963
- { \
964
- yychar = (Token); \
965
- yylval = (Value); \
966
- YYPOPSTACK (yylen); \
967
- yystate = *yyssp; \
968
- goto yybackup; \
969
- } \
970
- else \
971
- { \
972
- yyerror (qp, encoding, YY_("syntax error: cannot back up")); \
973
- YYERROR; \
974
- } \
975
- while (0)
976
-
977
- /* Backward compatibility with an undocumented macro.
978
- Use YYerror or YYUNDEF. */
979
- #define YYERRCODE YYUNDEF
980
-
981
-
982
- /* Enable debugging if requested. */
983
- #if YYDEBUG
984
-
985
- # ifndef YYFPRINTF
986
- # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
987
- # define YYFPRINTF fprintf
988
- # endif
989
-
990
- # define YYDPRINTF(Args) \
991
- do { \
992
- if (yydebug) \
993
- YYFPRINTF Args; \
994
- } while (0)
995
-
996
-
997
-
998
-
999
- # define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \
1000
- do { \
1001
- if (yydebug) \
1002
- { \
1003
- YYFPRINTF (stderr, "%s ", Title); \
1004
- yy_symbol_print (stderr, \
1005
- Kind, Value, qp, encoding); \
1006
- YYFPRINTF (stderr, "\n"); \
1007
- } \
1008
- } while (0)
1009
-
1010
-
1011
- /*-----------------------------------.
1012
- | Print this symbol's value on YYO. |
1013
- `-----------------------------------*/
1014
-
1015
- static void
1016
- yy_symbol_value_print (FILE *yyo,
1017
- yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, FrtQParser *qp, rb_encoding *encoding)
1018
- {
1019
- FILE *yyoutput = yyo;
1020
- YY_USE (yyoutput);
1021
- YY_USE (qp);
1022
- YY_USE (encoding);
1023
- if (!yyvaluep)
1024
- return;
1025
- YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1026
- YY_USE (yykind);
1027
- YY_IGNORE_MAYBE_UNINITIALIZED_END
1028
- }
1029
-
1030
-
1031
- /*---------------------------.
1032
- | Print this symbol on YYO. |
1033
- `---------------------------*/
1034
-
1035
- static void
1036
- yy_symbol_print (FILE *yyo,
1037
- yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, FrtQParser *qp, rb_encoding *encoding)
1038
- {
1039
- YYFPRINTF (yyo, "%s %s (",
1040
- yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));
1041
-
1042
- yy_symbol_value_print (yyo, yykind, yyvaluep, qp, encoding);
1043
- YYFPRINTF (yyo, ")");
1044
- }
1045
-
1046
- /*------------------------------------------------------------------.
1047
- | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1048
- | TOP (included). |
1049
- `------------------------------------------------------------------*/
1050
-
1051
- static void
1052
- yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)
1053
- {
1054
- YYFPRINTF (stderr, "Stack now");
1055
- for (; yybottom <= yytop; yybottom++)
1056
- {
1057
- int yybot = *yybottom;
1058
- YYFPRINTF (stderr, " %d", yybot);
1059
- }
1060
- YYFPRINTF (stderr, "\n");
1061
- }
1062
-
1063
- # define YY_STACK_PRINT(Bottom, Top) \
1064
- do { \
1065
- if (yydebug) \
1066
- yy_stack_print ((Bottom), (Top)); \
1067
- } while (0)
1068
-
1069
-
1070
- /*------------------------------------------------.
1071
- | Report that the YYRULE is going to be reduced. |
1072
- `------------------------------------------------*/
1073
-
1074
- static void
1075
- yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp,
1076
- int yyrule, FrtQParser *qp, rb_encoding *encoding)
1077
- {
1078
- int yylno = yyrline[yyrule];
1079
- int yynrhs = yyr2[yyrule];
1080
- int yyi;
1081
- YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
1082
- yyrule - 1, yylno);
1083
- /* The symbols being reduced. */
1084
- for (yyi = 0; yyi < yynrhs; yyi++)
1085
- {
1086
- YYFPRINTF (stderr, " $%d = ", yyi + 1);
1087
- yy_symbol_print (stderr,
1088
- YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
1089
- &yyvsp[(yyi + 1) - (yynrhs)], qp, encoding);
1090
- YYFPRINTF (stderr, "\n");
1091
- }
1092
- }
1093
-
1094
- # define YY_REDUCE_PRINT(Rule) \
1095
- do { \
1096
- if (yydebug) \
1097
- yy_reduce_print (yyssp, yyvsp, Rule, qp, encoding); \
1098
- } while (0)
1099
-
1100
- /* Nonzero means print parse trace. It is left uninitialized so that
1101
- multiple parsers can coexist. */
1102
- int yydebug;
1103
- #else /* !YYDEBUG */
1104
- # define YYDPRINTF(Args) ((void) 0)
1105
- # define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
1106
- # define YY_STACK_PRINT(Bottom, Top)
1107
- # define YY_REDUCE_PRINT(Rule)
1108
- #endif /* !YYDEBUG */
1109
-
1110
-
1111
- /* YYINITDEPTH -- initial size of the parser's stacks. */
1112
- #ifndef YYINITDEPTH
1113
- # define YYINITDEPTH 200
1114
- #endif
1115
-
1116
- /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1117
- if the built-in stack extension method is used).
1118
-
1119
- Do not make this value too large; the results are undefined if
1120
- YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1121
- evaluated with infinite-precision integer arithmetic. */
1122
-
1123
- #ifndef YYMAXDEPTH
1124
- # define YYMAXDEPTH 10000
1125
- #endif
1126
-
1127
-
1128
-
1129
-
1130
-
1131
-
1132
- /*-----------------------------------------------.
1133
- | Release the memory associated to this symbol. |
1134
- `-----------------------------------------------*/
1135
-
1136
- static void
1137
- yydestruct (const char *yymsg,
1138
- yysymbol_kind_t yykind, YYSTYPE *yyvaluep, FrtQParser *qp, rb_encoding *encoding)
1139
- {
1140
- YY_USE (yyvaluep);
1141
- YY_USE (qp);
1142
- YY_USE (encoding);
1143
- if (!yymsg)
1144
- yymsg = "Deleting";
1145
- YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
1146
-
1147
- YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1148
- switch (yykind)
1149
- {
1150
- case YYSYMBOL_bool_q: /* bool_q */
1151
- #line 221 "frt_q_parser.y"
1152
- { if (((*yyvaluep).query) && qp->destruct) frt_q_deref(((*yyvaluep).query)); }
1153
- #line 1154 "frt_q_parser.c"
1154
- break;
1155
-
1156
- case YYSYMBOL_bool_clss: /* bool_clss */
1157
- #line 223 "frt_q_parser.y"
1158
- { if (((*yyvaluep).bclss) && qp->destruct) bca_destroy(((*yyvaluep).bclss)); }
1159
- #line 1160 "frt_q_parser.c"
1160
- break;
1161
-
1162
- case YYSYMBOL_bool_cls: /* bool_cls */
1163
- #line 222 "frt_q_parser.y"
1164
- { if (((*yyvaluep).bcls) && qp->destruct) frt_bc_deref(((*yyvaluep).bcls)); }
1165
- #line 1166 "frt_q_parser.c"
1166
- break;
1167
-
1168
- case YYSYMBOL_boosted_q: /* boosted_q */
1169
- #line 221 "frt_q_parser.y"
1170
- { if (((*yyvaluep).query) && qp->destruct) frt_q_deref(((*yyvaluep).query)); }
1171
- #line 1172 "frt_q_parser.c"
1172
- break;
1173
-
1174
- case YYSYMBOL_q: /* q */
1175
- #line 221 "frt_q_parser.y"
1176
- { if (((*yyvaluep).query) && qp->destruct) frt_q_deref(((*yyvaluep).query)); }
1177
- #line 1178 "frt_q_parser.c"
1178
- break;
1179
-
1180
- case YYSYMBOL_term_q: /* term_q */
1181
- #line 221 "frt_q_parser.y"
1182
- { if (((*yyvaluep).query) && qp->destruct) frt_q_deref(((*yyvaluep).query)); }
1183
- #line 1184 "frt_q_parser.c"
1184
- break;
1185
-
1186
- case YYSYMBOL_wild_q: /* wild_q */
1187
- #line 221 "frt_q_parser.y"
1188
- { if (((*yyvaluep).query) && qp->destruct) frt_q_deref(((*yyvaluep).query)); }
1189
- #line 1190 "frt_q_parser.c"
1190
- break;
1191
-
1192
- case YYSYMBOL_field_q: /* field_q */
1193
- #line 221 "frt_q_parser.y"
1194
- { if (((*yyvaluep).query) && qp->destruct) frt_q_deref(((*yyvaluep).query)); }
1195
- #line 1196 "frt_q_parser.c"
1196
- break;
1197
-
1198
- case YYSYMBOL_phrase_q: /* phrase_q */
1199
- #line 221 "frt_q_parser.y"
1200
- { if (((*yyvaluep).query) && qp->destruct) frt_q_deref(((*yyvaluep).query)); }
1201
- #line 1202 "frt_q_parser.c"
1202
- break;
1203
-
1204
- case YYSYMBOL_ph_words: /* ph_words */
1205
- #line 224 "frt_q_parser.y"
1206
- { if (((*yyvaluep).phrase) && qp->destruct) ph_destroy(((*yyvaluep).phrase)); }
1207
- #line 1208 "frt_q_parser.c"
1208
- break;
1209
-
1210
- case YYSYMBOL_range_q: /* range_q */
1211
- #line 221 "frt_q_parser.y"
1212
- { if (((*yyvaluep).query) && qp->destruct) frt_q_deref(((*yyvaluep).query)); }
1213
- #line 1214 "frt_q_parser.c"
1214
- break;
1215
-
1216
- default:
1217
- break;
1218
- }
1219
- YY_IGNORE_MAYBE_UNINITIALIZED_END
1220
- }
1221
-
1222
-
1223
-
1224
-
1225
-
1226
-
1227
- /*----------.
1228
- | yyparse. |
1229
- `----------*/
1230
-
1231
- int
1232
- yyparse (FrtQParser *qp, rb_encoding *encoding)
1233
- {
1234
- /* Lookahead token kind. */
1235
- int yychar;
1236
-
1237
-
1238
- /* The semantic value of the lookahead symbol. */
1239
- /* Default value used for initialization, for pacifying older GCCs
1240
- or non-GCC compilers. */
1241
- YY_INITIAL_VALUE (static YYSTYPE yyval_default;)
1242
- YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
1243
-
1244
- /* Number of syntax errors so far. */
1245
- int yynerrs = 0;
1246
-
1247
- yy_state_fast_t yystate = 0;
1248
- /* Number of tokens to shift before error messages enabled. */
1249
- int yyerrstatus = 0;
1250
-
1251
- /* Refer to the stacks through separate pointers, to allow yyoverflow
1252
- to reallocate them elsewhere. */
1253
-
1254
- /* Their size. */
1255
- YYPTRDIFF_T yystacksize = YYINITDEPTH;
1256
-
1257
- /* The state stack: array, bottom, top. */
1258
- yy_state_t yyssa[YYINITDEPTH];
1259
- yy_state_t *yyss = yyssa;
1260
- yy_state_t *yyssp = yyss;
1261
-
1262
- /* The semantic value stack: array, bottom, top. */
1263
- YYSTYPE yyvsa[YYINITDEPTH];
1264
- YYSTYPE *yyvs = yyvsa;
1265
- YYSTYPE *yyvsp = yyvs;
1266
-
1267
- int yyn;
1268
- /* The return value of yyparse. */
1269
- int yyresult;
1270
- /* Lookahead symbol kind. */
1271
- yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY;
1272
- /* The variables used to return semantic value and location from the
1273
- action routines. */
1274
- YYSTYPE yyval;
1275
-
1276
-
1277
-
1278
- #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1279
-
1280
- /* The number of symbols on the RHS of the reduced rule.
1281
- Keep to zero when no symbol should be popped. */
1282
- int yylen = 0;
1283
-
1284
- YYDPRINTF ((stderr, "Starting parse\n"));
1285
-
1286
- yychar = YYEMPTY; /* Cause a token to be read. */
1287
-
1288
- goto yysetstate;
1289
-
1290
-
1291
- /*------------------------------------------------------------.
1292
- | yynewstate -- push a new state, which is found in yystate. |
1293
- `------------------------------------------------------------*/
1294
- yynewstate:
1295
- /* In all cases, when you get here, the value and location stacks
1296
- have just been pushed. So pushing a state here evens the stacks. */
1297
- yyssp++;
1298
-
1299
-
1300
- /*--------------------------------------------------------------------.
1301
- | yysetstate -- set current state (the top of the stack) to yystate. |
1302
- `--------------------------------------------------------------------*/
1303
- yysetstate:
1304
- YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1305
- YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
1306
- YY_IGNORE_USELESS_CAST_BEGIN
1307
- *yyssp = YY_CAST (yy_state_t, yystate);
1308
- YY_IGNORE_USELESS_CAST_END
1309
- YY_STACK_PRINT (yyss, yyssp);
1310
-
1311
- if (yyss + yystacksize - 1 <= yyssp)
1312
- #if !defined yyoverflow && !defined YYSTACK_RELOCATE
1313
- YYNOMEM;
1314
- #else
1315
- {
1316
- /* Get the current used size of the three stacks, in elements. */
1317
- YYPTRDIFF_T yysize = yyssp - yyss + 1;
1318
-
1319
- # if defined yyoverflow
1320
- {
1321
- /* Give user a chance to reallocate the stack. Use copies of
1322
- these so that the &'s don't force the real ones into
1323
- memory. */
1324
- yy_state_t *yyss1 = yyss;
1325
- YYSTYPE *yyvs1 = yyvs;
1326
-
1327
- /* Each stack pointer address is followed by the size of the
1328
- data in use in that stack, in bytes. This used to be a
1329
- conditional around just the two extra args, but that might
1330
- be undefined if yyoverflow is a macro. */
1331
- yyoverflow (YY_("memory exhausted"),
1332
- &yyss1, yysize * YYSIZEOF (*yyssp),
1333
- &yyvs1, yysize * YYSIZEOF (*yyvsp),
1334
- &yystacksize);
1335
- yyss = yyss1;
1336
- yyvs = yyvs1;
1337
- }
1338
- # else /* defined YYSTACK_RELOCATE */
1339
- /* Extend the stack our own way. */
1340
- if (YYMAXDEPTH <= yystacksize)
1341
- YYNOMEM;
1342
- yystacksize *= 2;
1343
- if (YYMAXDEPTH < yystacksize)
1344
- yystacksize = YYMAXDEPTH;
1345
-
1346
- {
1347
- yy_state_t *yyss1 = yyss;
1348
- union yyalloc *yyptr =
1349
- YY_CAST (union yyalloc *,
1350
- YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
1351
- if (! yyptr)
1352
- YYNOMEM;
1353
- YYSTACK_RELOCATE (yyss_alloc, yyss);
1354
- YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1355
- # undef YYSTACK_RELOCATE
1356
- if (yyss1 != yyssa)
1357
- YYSTACK_FREE (yyss1);
1358
- }
1359
- # endif
1360
-
1361
- yyssp = yyss + yysize - 1;
1362
- yyvsp = yyvs + yysize - 1;
1363
-
1364
- YY_IGNORE_USELESS_CAST_BEGIN
1365
- YYDPRINTF ((stderr, "Stack size increased to %ld\n",
1366
- YY_CAST (long, yystacksize)));
1367
- YY_IGNORE_USELESS_CAST_END
1368
-
1369
- if (yyss + yystacksize - 1 <= yyssp)
1370
- YYABORT;
1371
- }
1372
- #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
1373
-
1374
-
1375
- if (yystate == YYFINAL)
1376
- YYACCEPT;
1377
-
1378
- goto yybackup;
1379
-
1380
-
1381
- /*-----------.
1382
- | yybackup. |
1383
- `-----------*/
1384
- yybackup:
1385
- /* Do appropriate processing given the current state. Read a
1386
- lookahead token if we need one and don't already have one. */
1387
-
1388
- /* First try to decide what to do without reference to lookahead token. */
1389
- yyn = yypact[yystate];
1390
- if (yypact_value_is_default (yyn))
1391
- goto yydefault;
1392
-
1393
- /* Not known => get a lookahead token if don't already have one. */
1394
-
1395
- /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */
1396
- if (yychar == YYEMPTY)
1397
- {
1398
- YYDPRINTF ((stderr, "Reading a token\n"));
1399
- yychar = yylex (&yylval, qp);
1400
- }
1401
-
1402
- if (yychar <= YYEOF)
1403
- {
1404
- yychar = YYEOF;
1405
- yytoken = YYSYMBOL_YYEOF;
1406
- YYDPRINTF ((stderr, "Now at end of input.\n"));
1407
- }
1408
- else if (yychar == YYerror)
1409
- {
1410
- /* The scanner already issued an error message, process directly
1411
- to error recovery. But do not keep the error token as
1412
- lookahead, it is too special and may lead us to an endless
1413
- loop in error recovery. */
1414
- yychar = YYUNDEF;
1415
- yytoken = YYSYMBOL_YYerror;
1416
- goto yyerrlab1;
1417
- }
1418
- else
1419
- {
1420
- yytoken = YYTRANSLATE (yychar);
1421
- YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1422
- }
1423
-
1424
- /* If the proper action on seeing token YYTOKEN is to reduce or to
1425
- detect an error, take that action. */
1426
- yyn += yytoken;
1427
- if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1428
- goto yydefault;
1429
- yyn = yytable[yyn];
1430
- if (yyn <= 0)
1431
- {
1432
- if (yytable_value_is_error (yyn))
1433
- goto yyerrlab;
1434
- yyn = -yyn;
1435
- goto yyreduce;
1436
- }
1437
-
1438
- /* Count tokens shifted since error; after three, turn off error
1439
- status. */
1440
- if (yyerrstatus)
1441
- yyerrstatus--;
1442
-
1443
- /* Shift the lookahead token. */
1444
- YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1445
- yystate = yyn;
1446
- YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1447
- *++yyvsp = yylval;
1448
- YY_IGNORE_MAYBE_UNINITIALIZED_END
1449
-
1450
- /* Discard the shifted token. */
1451
- yychar = YYEMPTY;
1452
- goto yynewstate;
1453
-
1454
-
1455
- /*-----------------------------------------------------------.
1456
- | yydefault -- do the default action for the current state. |
1457
- `-----------------------------------------------------------*/
1458
- yydefault:
1459
- yyn = yydefact[yystate];
1460
- if (yyn == 0)
1461
- goto yyerrlab;
1462
- goto yyreduce;
1463
-
1464
-
1465
- /*-----------------------------.
1466
- | yyreduce -- do a reduction. |
1467
- `-----------------------------*/
1468
- yyreduce:
1469
- /* yyn is the number of a rule to reduce with. */
1470
- yylen = yyr2[yyn];
1471
-
1472
- /* If YYLEN is nonzero, implement the default value of the action:
1473
- '$$ = $1'.
1474
-
1475
- Otherwise, the following line sets YYVAL to garbage.
1476
- This behavior is undocumented and Bison
1477
- users should not rely upon it. Assigning to YYVAL
1478
- unconditionally makes the parser a bit smaller, and it avoids a
1479
- GCC warning that YYVAL may be used uninitialized. */
1480
- yyval = yyvsp[1-yylen];
1481
-
1482
-
1483
- YY_REDUCE_PRINT (yyn);
1484
- switch (yyn)
1485
- {
1486
- case 2: /* bool_q: %empty */
1487
- #line 226 "frt_q_parser.y"
1488
- { qp->result = (yyval.query) = NULL; }
1489
- #line 1490 "frt_q_parser.c"
1490
- break;
1491
-
1492
- case 3: /* bool_q: bool_clss */
1493
- #line 227 "frt_q_parser.y"
1494
- { T qp->result = (yyval.query) = get_bool_q((yyvsp[0].bclss)); E }
1495
- #line 1496 "frt_q_parser.c"
1496
- break;
1497
-
1498
- case 4: /* bool_clss: bool_cls */
1499
- #line 229 "frt_q_parser.y"
1500
- { T (yyval.bclss) = first_cls((yyvsp[0].bcls)); E }
1501
- #line 1502 "frt_q_parser.c"
1502
- break;
1503
-
1504
- case 5: /* bool_clss: bool_clss AND bool_cls */
1505
- #line 230 "frt_q_parser.y"
1506
- { T (yyval.bclss) = add_and_cls((yyvsp[-2].bclss), (yyvsp[0].bcls)); E }
1507
- #line 1508 "frt_q_parser.c"
1508
- break;
1509
-
1510
- case 6: /* bool_clss: bool_clss OR bool_cls */
1511
- #line 231 "frt_q_parser.y"
1512
- { T (yyval.bclss) = add_or_cls((yyvsp[-2].bclss), (yyvsp[0].bcls)); E }
1513
- #line 1514 "frt_q_parser.c"
1514
- break;
1515
-
1516
- case 7: /* bool_clss: bool_clss bool_cls */
1517
- #line 232 "frt_q_parser.y"
1518
- { T (yyval.bclss) = add_default_cls(qp, (yyvsp[-1].bclss), (yyvsp[0].bcls)); E }
1519
- #line 1520 "frt_q_parser.c"
1520
- break;
1521
-
1522
- case 8: /* bool_cls: REQ boosted_q */
1523
- #line 234 "frt_q_parser.y"
1524
- { T (yyval.bcls) = get_bool_cls((yyvsp[0].query), FRT_BC_MUST); E }
1525
- #line 1526 "frt_q_parser.c"
1526
- break;
1527
-
1528
- case 9: /* bool_cls: NOT boosted_q */
1529
- #line 235 "frt_q_parser.y"
1530
- { T (yyval.bcls) = get_bool_cls((yyvsp[0].query), FRT_BC_MUST_NOT); E }
1531
- #line 1532 "frt_q_parser.c"
1532
- break;
1533
-
1534
- case 10: /* bool_cls: boosted_q */
1535
- #line 236 "frt_q_parser.y"
1536
- { T (yyval.bcls) = get_bool_cls((yyvsp[0].query), FRT_BC_SHOULD); E }
1537
- #line 1538 "frt_q_parser.c"
1538
- break;
1539
-
1540
- case 12: /* boosted_q: q '^' QWRD */
1541
- #line 239 "frt_q_parser.y"
1542
- { T if ((yyvsp[-2].query)) sscanf((yyvsp[0].str),"%f",&((yyvsp[-2].query)->boost)); (yyval.query)=(yyvsp[-2].query); E }
1543
- #line 1544 "frt_q_parser.c"
1544
- break;
1545
-
1546
- case 14: /* q: '(' ')' */
1547
- #line 242 "frt_q_parser.y"
1548
- { T (yyval.query) = frt_bq_new_max(true, qp->max_clauses); E }
1549
- #line 1550 "frt_q_parser.c"
1550
- break;
1551
-
1552
- case 15: /* q: '(' bool_clss ')' */
1553
- #line 243 "frt_q_parser.y"
1554
- { T (yyval.query) = get_bool_q((yyvsp[-1].bclss)); E }
1555
- #line 1556 "frt_q_parser.c"
1556
- break;
1557
-
1558
- case 20: /* term_q: QWRD */
1559
- #line 249 "frt_q_parser.y"
1560
- { FLDS((yyval.query), get_term_q(qp, field, (yyvsp[0].str), encoding)); Y}
1561
- #line 1562 "frt_q_parser.c"
1562
- break;
1563
-
1564
- case 21: /* term_q: QWRD '~' QWRD */
1565
- #line 250 "frt_q_parser.y"
1566
- { FLDS((yyval.query), get_fuzzy_q(qp, field, (yyvsp[-2].str), (yyvsp[0].str), encoding)); Y}
1567
- #line 1568 "frt_q_parser.c"
1568
- break;
1569
-
1570
- case 22: /* term_q: QWRD '~' */
1571
- #line 251 "frt_q_parser.y"
1572
- { FLDS((yyval.query), get_fuzzy_q(qp, field, (yyvsp[-1].str), NULL, encoding)); Y}
1573
- #line 1574 "frt_q_parser.c"
1574
- break;
1575
-
1576
- case 23: /* wild_q: WILD_STR */
1577
- #line 253 "frt_q_parser.y"
1578
- { FLDS((yyval.query), get_wild_q(qp, field, (yyvsp[0].str), encoding)); Y}
1579
- #line 1580 "frt_q_parser.c"
1580
- break;
1581
-
1582
- case 24: /* $@1: %empty */
1583
- #line 255 "frt_q_parser.y"
1584
- { qp_pop_fields(qp); }
1585
- #line 1586 "frt_q_parser.c"
1586
- break;
1587
-
1588
- case 25: /* field_q: field ':' q $@1 */
1589
- #line 256 "frt_q_parser.y"
1590
- { (yyval.query) = (yyvsp[-1].query); }
1591
- #line 1592 "frt_q_parser.c"
1592
- break;
1593
-
1594
- case 26: /* $@2: %empty */
1595
- #line 257 "frt_q_parser.y"
1596
- { qp_push_fields(qp, qp->all_fields, false); }
1597
- #line 1598 "frt_q_parser.c"
1598
- break;
1599
-
1600
- case 27: /* $@3: %empty */
1601
- #line 257 "frt_q_parser.y"
1602
- { qp_pop_fields(qp); }
1603
- #line 1604 "frt_q_parser.c"
1604
- break;
1605
-
1606
- case 28: /* field_q: '*' $@2 ':' q $@3 */
1607
- #line 258 "frt_q_parser.y"
1608
- { (yyval.query) = (yyvsp[-1].query); }
1609
- #line 1610 "frt_q_parser.c"
1610
- break;
1611
-
1612
- case 29: /* field: QWRD */
1613
- #line 260 "frt_q_parser.y"
1614
- { (yyval.hashset) = first_field(qp, (yyvsp[0].str)); }
1615
- #line 1616 "frt_q_parser.c"
1616
- break;
1617
-
1618
- case 30: /* field: field '|' QWRD */
1619
- #line 261 "frt_q_parser.y"
1620
- { (yyval.hashset) = add_field(qp, (yyvsp[0].str));}
1621
- #line 1622 "frt_q_parser.c"
1622
- break;
1623
-
1624
- case 31: /* phrase_q: '"' ph_words '"' */
1625
- #line 263 "frt_q_parser.y"
1626
- { (yyval.query) = get_phrase_q(qp, (yyvsp[-1].phrase), NULL, encoding); }
1627
- #line 1628 "frt_q_parser.c"
1628
- break;
1629
-
1630
- case 32: /* phrase_q: '"' ph_words '"' '~' QWRD */
1631
- #line 264 "frt_q_parser.y"
1632
- { (yyval.query) = get_phrase_q(qp, (yyvsp[-3].phrase), (yyvsp[0].str), encoding); }
1633
- #line 1634 "frt_q_parser.c"
1634
- break;
1635
-
1636
- case 33: /* phrase_q: '"' '"' */
1637
- #line 265 "frt_q_parser.y"
1638
- { (yyval.query) = NULL; }
1639
- #line 1640 "frt_q_parser.c"
1640
- break;
1641
-
1642
- case 34: /* phrase_q: '"' '"' '~' QWRD */
1643
- #line 266 "frt_q_parser.y"
1644
- { (yyval.query) = NULL; (void)(yyvsp[0].str);}
1645
- #line 1646 "frt_q_parser.c"
1646
- break;
1647
-
1648
- case 35: /* ph_words: QWRD */
1649
- #line 268 "frt_q_parser.y"
1650
- { (yyval.phrase) = ph_first_word((yyvsp[0].str)); }
1651
- #line 1652 "frt_q_parser.c"
1652
- break;
1653
-
1654
- case 36: /* ph_words: '<' '>' */
1655
- #line 269 "frt_q_parser.y"
1656
- { (yyval.phrase) = ph_first_word(NULL); }
1657
- #line 1658 "frt_q_parser.c"
1658
- break;
1659
-
1660
- case 37: /* ph_words: ph_words QWRD */
1661
- #line 270 "frt_q_parser.y"
1662
- { (yyval.phrase) = ph_add_word((yyvsp[-1].phrase), (yyvsp[0].str)); }
1663
- #line 1664 "frt_q_parser.c"
1664
- break;
1665
-
1666
- case 38: /* ph_words: ph_words '<' '>' */
1667
- #line 271 "frt_q_parser.y"
1668
- { (yyval.phrase) = ph_add_word((yyvsp[-2].phrase), NULL); }
1669
- #line 1670 "frt_q_parser.c"
1670
- break;
1671
-
1672
- case 39: /* ph_words: ph_words '|' QWRD */
1673
- #line 272 "frt_q_parser.y"
1674
- { (yyval.phrase) = ph_add_multi_word((yyvsp[-2].phrase), (yyvsp[0].str)); }
1675
- #line 1676 "frt_q_parser.c"
1676
- break;
1677
-
1678
- case 40: /* range_q: '[' QWRD QWRD ']' */
1679
- #line 274 "frt_q_parser.y"
1680
- { FLDS((yyval.query), get_r_q(qp, field, (yyvsp[-2].str), (yyvsp[-1].str), true, true, encoding)); Y}
1681
- #line 1682 "frt_q_parser.c"
1682
- break;
1683
-
1684
- case 41: /* range_q: '[' QWRD QWRD '}' */
1685
- #line 275 "frt_q_parser.y"
1686
- { FLDS((yyval.query), get_r_q(qp, field, (yyvsp[-2].str), (yyvsp[-1].str), true, false, encoding)); Y}
1687
- #line 1688 "frt_q_parser.c"
1688
- break;
1689
-
1690
- case 42: /* range_q: '{' QWRD QWRD ']' */
1691
- #line 276 "frt_q_parser.y"
1692
- { FLDS((yyval.query), get_r_q(qp, field, (yyvsp[-2].str), (yyvsp[-1].str), false, true, encoding)); Y}
1693
- #line 1694 "frt_q_parser.c"
1694
- break;
1695
-
1696
- case 43: /* range_q: '{' QWRD QWRD '}' */
1697
- #line 277 "frt_q_parser.y"
1698
- { FLDS((yyval.query), get_r_q(qp, field, (yyvsp[-2].str), (yyvsp[-1].str), false, false, encoding)); Y}
1699
- #line 1700 "frt_q_parser.c"
1700
- break;
1701
-
1702
- case 44: /* range_q: '<' QWRD '}' */
1703
- #line 278 "frt_q_parser.y"
1704
- { FLDS((yyval.query), get_r_q(qp, field, NULL,(yyvsp[-1].str), false, false, encoding)); Y}
1705
- #line 1706 "frt_q_parser.c"
1706
- break;
1707
-
1708
- case 45: /* range_q: '<' QWRD ']' */
1709
- #line 279 "frt_q_parser.y"
1710
- { FLDS((yyval.query), get_r_q(qp, field, NULL,(yyvsp[-1].str), false, true, encoding)); Y}
1711
- #line 1712 "frt_q_parser.c"
1712
- break;
1713
-
1714
- case 46: /* range_q: '[' QWRD '>' */
1715
- #line 280 "frt_q_parser.y"
1716
- { FLDS((yyval.query), get_r_q(qp, field, (yyvsp[-1].str), NULL,true, false, encoding)); Y}
1717
- #line 1718 "frt_q_parser.c"
1718
- break;
1719
-
1720
- case 47: /* range_q: '{' QWRD '>' */
1721
- #line 281 "frt_q_parser.y"
1722
- { FLDS((yyval.query), get_r_q(qp, field, (yyvsp[-1].str), NULL,false, false, encoding)); Y}
1723
- #line 1724 "frt_q_parser.c"
1724
- break;
1725
-
1726
- case 48: /* range_q: '<' QWRD */
1727
- #line 282 "frt_q_parser.y"
1728
- { FLDS((yyval.query), get_r_q(qp, field, NULL,(yyvsp[0].str), false, false, encoding)); Y}
1729
- #line 1730 "frt_q_parser.c"
1730
- break;
1731
-
1732
- case 49: /* range_q: '<' '=' QWRD */
1733
- #line 283 "frt_q_parser.y"
1734
- { FLDS((yyval.query), get_r_q(qp, field, NULL,(yyvsp[0].str), false, true, encoding)); Y}
1735
- #line 1736 "frt_q_parser.c"
1736
- break;
1737
-
1738
- case 50: /* range_q: '>' '=' QWRD */
1739
- #line 284 "frt_q_parser.y"
1740
- { FLDS((yyval.query), get_r_q(qp, field, (yyvsp[0].str), NULL,true, false, encoding)); Y}
1741
- #line 1742 "frt_q_parser.c"
1742
- break;
1743
-
1744
- case 51: /* range_q: '>' QWRD */
1745
- #line 285 "frt_q_parser.y"
1746
- { FLDS((yyval.query), get_r_q(qp, field, (yyvsp[0].str), NULL,false, false, encoding)); Y}
1747
- #line 1748 "frt_q_parser.c"
1748
- break;
1749
-
1750
-
1751
- #line 1752 "frt_q_parser.c"
1752
-
1753
- default: break;
1754
- }
1755
- /* User semantic actions sometimes alter yychar, and that requires
1756
- that yytoken be updated with the new translation. We take the
1757
- approach of translating immediately before every use of yytoken.
1758
- One alternative is translating here after every semantic action,
1759
- but that translation would be missed if the semantic action invokes
1760
- YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1761
- if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
1762
- incorrect destructor might then be invoked immediately. In the
1763
- case of YYERROR or YYBACKUP, subsequent parser actions might lead
1764
- to an incorrect destructor call or verbose syntax error message
1765
- before the lookahead is translated. */
1766
- YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc);
1767
-
1768
- YYPOPSTACK (yylen);
1769
- yylen = 0;
1770
-
1771
- *++yyvsp = yyval;
1772
-
1773
- /* Now 'shift' the result of the reduction. Determine what state
1774
- that goes to, based on the state we popped back to and the rule
1775
- number reduced by. */
1776
- {
1777
- const int yylhs = yyr1[yyn] - YYNTOKENS;
1778
- const int yyi = yypgoto[yylhs] + *yyssp;
1779
- yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
1780
- ? yytable[yyi]
1781
- : yydefgoto[yylhs]);
1782
- }
1783
-
1784
- goto yynewstate;
1785
-
1786
-
1787
- /*--------------------------------------.
1788
- | yyerrlab -- here on detecting error. |
1789
- `--------------------------------------*/
1790
- yyerrlab:
1791
- /* Make sure we have latest lookahead translation. See comments at
1792
- user semantic actions for why this is necessary. */
1793
- yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar);
1794
- /* If not already recovering from an error, report this error. */
1795
- if (!yyerrstatus)
1796
- {
1797
- ++yynerrs;
1798
- yyerror (qp, encoding, YY_("syntax error"));
1799
- }
1800
-
1801
- if (yyerrstatus == 3)
1802
- {
1803
- /* If just tried and failed to reuse lookahead token after an
1804
- error, discard it. */
1805
-
1806
- if (yychar <= YYEOF)
1807
- {
1808
- /* Return failure if at end of input. */
1809
- if (yychar == YYEOF)
1810
- YYABORT;
1811
- }
1812
- else
1813
- {
1814
- yydestruct ("Error: discarding",
1815
- yytoken, &yylval, qp, encoding);
1816
- yychar = YYEMPTY;
1817
- }
1818
- }
1819
-
1820
- /* Else will try to reuse lookahead token after shifting the error
1821
- token. */
1822
- goto yyerrlab1;
1823
-
1824
-
1825
- /*---------------------------------------------------.
1826
- | yyerrorlab -- error raised explicitly by YYERROR. |
1827
- `---------------------------------------------------*/
1828
- yyerrorlab:
1829
- /* Pacify compilers when the user code never invokes YYERROR and the
1830
- label yyerrorlab therefore never appears in user code. */
1831
- if (0)
1832
- YYERROR;
1833
- ++yynerrs;
1834
-
1835
- /* Do not reclaim the symbols of the rule whose action triggered
1836
- this YYERROR. */
1837
- YYPOPSTACK (yylen);
1838
- yylen = 0;
1839
- YY_STACK_PRINT (yyss, yyssp);
1840
- yystate = *yyssp;
1841
- goto yyerrlab1;
1842
-
1843
-
1844
- /*-------------------------------------------------------------.
1845
- | yyerrlab1 -- common code for both syntax error and YYERROR. |
1846
- `-------------------------------------------------------------*/
1847
- yyerrlab1:
1848
- yyerrstatus = 3; /* Each real token shifted decrements this. */
1849
-
1850
- /* Pop stack until we find a state that shifts the error token. */
1851
- for (;;)
1852
- {
1853
- yyn = yypact[yystate];
1854
- if (!yypact_value_is_default (yyn))
1855
- {
1856
- yyn += YYSYMBOL_YYerror;
1857
- if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
1858
- {
1859
- yyn = yytable[yyn];
1860
- if (0 < yyn)
1861
- break;
1862
- }
1863
- }
1864
-
1865
- /* Pop the current state because it cannot handle the error token. */
1866
- if (yyssp == yyss)
1867
- YYABORT;
1868
-
1869
-
1870
- yydestruct ("Error: popping",
1871
- YY_ACCESSING_SYMBOL (yystate), yyvsp, qp, encoding);
1872
- YYPOPSTACK (1);
1873
- yystate = *yyssp;
1874
- YY_STACK_PRINT (yyss, yyssp);
1875
- }
1876
-
1877
- YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1878
- *++yyvsp = yylval;
1879
- YY_IGNORE_MAYBE_UNINITIALIZED_END
1880
-
1881
-
1882
- /* Shift the error token. */
1883
- YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp);
1884
-
1885
- yystate = yyn;
1886
- goto yynewstate;
1887
-
1888
-
1889
- /*-------------------------------------.
1890
- | yyacceptlab -- YYACCEPT comes here. |
1891
- `-------------------------------------*/
1892
- yyacceptlab:
1893
- yyresult = 0;
1894
- goto yyreturnlab;
1895
-
1896
-
1897
- /*-----------------------------------.
1898
- | yyabortlab -- YYABORT comes here. |
1899
- `-----------------------------------*/
1900
- yyabortlab:
1901
- yyresult = 1;
1902
- goto yyreturnlab;
1903
-
1904
-
1905
- /*-----------------------------------------------------------.
1906
- | yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. |
1907
- `-----------------------------------------------------------*/
1908
- yyexhaustedlab:
1909
- yyerror (qp, encoding, YY_("memory exhausted"));
1910
- yyresult = 2;
1911
- goto yyreturnlab;
1912
-
1913
-
1914
- /*----------------------------------------------------------.
1915
- | yyreturnlab -- parsing is finished, clean up and return. |
1916
- `----------------------------------------------------------*/
1917
- yyreturnlab:
1918
- if (yychar != YYEMPTY)
1919
- {
1920
- /* Make sure we have latest lookahead translation. See comments at
1921
- user semantic actions for why this is necessary. */
1922
- yytoken = YYTRANSLATE (yychar);
1923
- yydestruct ("Cleanup: discarding lookahead",
1924
- yytoken, &yylval, qp, encoding);
1925
- }
1926
- /* Do not reclaim the symbols of the rule whose action triggered
1927
- this YYABORT or YYACCEPT. */
1928
- YYPOPSTACK (yylen);
1929
- YY_STACK_PRINT (yyss, yyssp);
1930
- while (yyssp != yyss)
1931
- {
1932
- yydestruct ("Cleanup: popping",
1933
- YY_ACCESSING_SYMBOL (+*yyssp), yyvsp, qp, encoding);
1934
- YYPOPSTACK (1);
1935
- }
1936
- #ifndef yyoverflow
1937
- if (yyss != yyssa)
1938
- YYSTACK_FREE (yyss);
1939
- #endif
1940
-
1941
- return yyresult;
1942
- }
1943
-
1944
- #line 287 "frt_q_parser.y"
400
+
401
+ #line 402 "frt_q_parser.c"
402
+
403
+
404
+ #ifdef short
405
+ # undef short
406
+ #endif
407
+
408
+ /* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
409
+ <limits.h> and (if available) <stdint.h> are included
410
+ so that the code can choose integer types of a good width. */
411
+
412
+ #ifndef __PTRDIFF_MAX__
413
+ # include <limits.h> /* INFRINGES ON USER NAME SPACE */
414
+ # if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
415
+ # include <stdint.h> /* INFRINGES ON USER NAME SPACE */
416
+ # define YY_STDINT_H
417
+ # endif
418
+ #endif
419
+
420
+ /* Narrow types that promote to a signed type and that can represent a
421
+ signed or unsigned integer of at least N bits. In tables they can
422
+ save space and decrease cache pressure. Promoting to a signed type
423
+ helps avoid bugs in integer arithmetic. */
424
+
425
+ #ifdef __INT_LEAST8_MAX__
426
+ typedef __INT_LEAST8_TYPE__ yytype_int8;
427
+ #elif defined YY_STDINT_H
428
+ typedef int_least8_t yytype_int8;
429
+ #else
430
+ typedef signed char yytype_int8;
431
+ #endif
432
+
433
+ #ifdef __INT_LEAST16_MAX__
434
+ typedef __INT_LEAST16_TYPE__ yytype_int16;
435
+ #elif defined YY_STDINT_H
436
+ typedef int_least16_t yytype_int16;
437
+ #else
438
+ typedef short yytype_int16;
439
+ #endif
440
+
441
+ /* Work around bug in HP-UX 11.23, which defines these macros
442
+ incorrectly for preprocessor constants. This workaround can likely
443
+ be removed in 2023, as HPE has promised support for HP-UX 11.23
444
+ (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of
445
+ <https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>. */
446
+ #ifdef __hpux
447
+ # undef UINT_LEAST8_MAX
448
+ # undef UINT_LEAST16_MAX
449
+ # define UINT_LEAST8_MAX 255
450
+ # define UINT_LEAST16_MAX 65535
451
+ #endif
452
+
453
+ #if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
454
+ typedef __UINT_LEAST8_TYPE__ yytype_uint8;
455
+ #elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
456
+ && UINT_LEAST8_MAX <= INT_MAX)
457
+ typedef uint_least8_t yytype_uint8;
458
+ #elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
459
+ typedef unsigned char yytype_uint8;
460
+ #else
461
+ typedef short yytype_uint8;
462
+ #endif
463
+
464
+ #if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
465
+ typedef __UINT_LEAST16_TYPE__ yytype_uint16;
466
+ #elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
467
+ && UINT_LEAST16_MAX <= INT_MAX)
468
+ typedef uint_least16_t yytype_uint16;
469
+ #elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
470
+ typedef unsigned short yytype_uint16;
471
+ #else
472
+ typedef int yytype_uint16;
473
+ #endif
474
+
475
+ #ifndef YYPTRDIFF_T
476
+ # if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
477
+ # define YYPTRDIFF_T __PTRDIFF_TYPE__
478
+ # define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
479
+ # elif defined PTRDIFF_MAX
480
+ # ifndef ptrdiff_t
481
+ # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
482
+ # endif
483
+ # define YYPTRDIFF_T ptrdiff_t
484
+ # define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
485
+ # else
486
+ # define YYPTRDIFF_T long
487
+ # define YYPTRDIFF_MAXIMUM LONG_MAX
488
+ # endif
489
+ #endif
490
+
491
+ #ifndef YYSIZE_T
492
+ # ifdef __SIZE_TYPE__
493
+ # define YYSIZE_T __SIZE_TYPE__
494
+ # elif defined size_t
495
+ # define YYSIZE_T size_t
496
+ # elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
497
+ # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
498
+ # define YYSIZE_T size_t
499
+ # else
500
+ # define YYSIZE_T unsigned
501
+ # endif
502
+ #endif
503
+
504
+ #define YYSIZE_MAXIMUM \
505
+ YY_CAST (YYPTRDIFF_T, \
506
+ (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \
507
+ ? YYPTRDIFF_MAXIMUM \
508
+ : YY_CAST (YYSIZE_T, -1)))
509
+
510
+ #define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
511
+
512
+
513
+ /* Stored state numbers (used for stacks). */
514
+ typedef yytype_int8 yy_state_t;
515
+
516
+ /* State numbers in computations. */
517
+ typedef int yy_state_fast_t;
518
+
519
+ #ifndef YY_
520
+ # if defined YYENABLE_NLS && YYENABLE_NLS
521
+ # if ENABLE_NLS
522
+ # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
523
+ # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
524
+ # endif
525
+ # endif
526
+ # ifndef YY_
527
+ # define YY_(Msgid) Msgid
528
+ # endif
529
+ #endif
530
+
531
+
532
+ #ifndef YY_ATTRIBUTE_PURE
533
+ # if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
534
+ # define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
535
+ # else
536
+ # define YY_ATTRIBUTE_PURE
537
+ # endif
538
+ #endif
539
+
540
+ #ifndef YY_ATTRIBUTE_UNUSED
541
+ # if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
542
+ # define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
543
+ # else
544
+ # define YY_ATTRIBUTE_UNUSED
545
+ # endif
546
+ #endif
547
+
548
+ /* Suppress unused-variable warnings by "using" E. */
549
+ #if ! defined lint || defined __GNUC__
550
+ # define YY_USE(E) ((void) (E))
551
+ #else
552
+ # define YY_USE(E) /* empty */
553
+ #endif
554
+
555
+ /* Suppress an incorrect diagnostic about yylval being uninitialized. */
556
+ #if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
557
+ # if __GNUC__ * 100 + __GNUC_MINOR__ < 407
558
+ # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
559
+ _Pragma ("GCC diagnostic push") \
560
+ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
561
+ # else
562
+ # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
563
+ _Pragma ("GCC diagnostic push") \
564
+ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
565
+ _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
566
+ # endif
567
+ # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
568
+ _Pragma ("GCC diagnostic pop")
569
+ #else
570
+ # define YY_INITIAL_VALUE(Value) Value
571
+ #endif
572
+ #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
573
+ # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
574
+ # define YY_IGNORE_MAYBE_UNINITIALIZED_END
575
+ #endif
576
+ #ifndef YY_INITIAL_VALUE
577
+ # define YY_INITIAL_VALUE(Value) /* Nothing. */
578
+ #endif
579
+
580
+ #if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
581
+ # define YY_IGNORE_USELESS_CAST_BEGIN \
582
+ _Pragma ("GCC diagnostic push") \
583
+ _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
584
+ # define YY_IGNORE_USELESS_CAST_END \
585
+ _Pragma ("GCC diagnostic pop")
586
+ #endif
587
+ #ifndef YY_IGNORE_USELESS_CAST_BEGIN
588
+ # define YY_IGNORE_USELESS_CAST_BEGIN
589
+ # define YY_IGNORE_USELESS_CAST_END
590
+ #endif
591
+
592
+
593
+ #define YY_ASSERT(E) ((void) (0 && (E)))
594
+
595
+ #if !defined yyoverflow
596
+
597
+ /* The parser invokes alloca or malloc; define the necessary symbols. */
598
+
599
+ # ifdef YYSTACK_USE_ALLOCA
600
+ # if YYSTACK_USE_ALLOCA
601
+ # ifdef __GNUC__
602
+ # define YYSTACK_ALLOC __builtin_alloca
603
+ # elif defined __BUILTIN_VA_ARG_INCR
604
+ # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
605
+ # elif defined _AIX
606
+ # define YYSTACK_ALLOC __alloca
607
+ # elif defined _MSC_VER
608
+ # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
609
+ # define alloca _alloca
610
+ # else
611
+ # define YYSTACK_ALLOC alloca
612
+ # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
613
+ # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
614
+ /* Use EXIT_SUCCESS as a witness for stdlib.h. */
615
+ # ifndef EXIT_SUCCESS
616
+ # define EXIT_SUCCESS 0
617
+ # endif
618
+ # endif
619
+ # endif
620
+ # endif
621
+ # endif
622
+
623
+ # ifdef YYSTACK_ALLOC
624
+ /* Pacify GCC's 'empty if-body' warning. */
625
+ # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
626
+ # ifndef YYSTACK_ALLOC_MAXIMUM
627
+ /* The OS might guarantee only one guard page at the bottom of the stack,
628
+ and a page size can be as small as 4096 bytes. So we cannot safely
629
+ invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
630
+ to allow for a few compiler-allocated temporary stack slots. */
631
+ # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
632
+ # endif
633
+ # else
634
+ # define YYSTACK_ALLOC YYMALLOC
635
+ # define YYSTACK_FREE YYFREE
636
+ # ifndef YYSTACK_ALLOC_MAXIMUM
637
+ # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
638
+ # endif
639
+ # if (defined __cplusplus && ! defined EXIT_SUCCESS \
640
+ && ! ((defined YYMALLOC || defined malloc) \
641
+ && (defined YYFREE || defined free)))
642
+ # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
643
+ # ifndef EXIT_SUCCESS
644
+ # define EXIT_SUCCESS 0
645
+ # endif
646
+ # endif
647
+ # ifndef YYMALLOC
648
+ # define YYMALLOC malloc
649
+ # if ! defined malloc && ! defined EXIT_SUCCESS
650
+ void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
651
+ # endif
652
+ # endif
653
+ # ifndef YYFREE
654
+ # define YYFREE free
655
+ # if ! defined free && ! defined EXIT_SUCCESS
656
+ void free (void *); /* INFRINGES ON USER NAME SPACE */
657
+ # endif
658
+ # endif
659
+ # endif
660
+ #endif /* !defined yyoverflow */
661
+
662
+ #if (! defined yyoverflow \
663
+ && (! defined __cplusplus \
664
+ || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
665
+
666
+ /* A type that is properly aligned for any stack member. */
667
+ union yyalloc
668
+ {
669
+ yy_state_t yyss_alloc;
670
+ YYSTYPE yyvs_alloc;
671
+ };
672
+
673
+ /* The size of the maximum gap between one aligned stack and the next. */
674
+ # define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
675
+
676
+ /* The size of an array large to enough to hold all stacks, each with
677
+ N elements. */
678
+ # define YYSTACK_BYTES(N) \
679
+ ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \
680
+ + YYSTACK_GAP_MAXIMUM)
681
+
682
+ # define YYCOPY_NEEDED 1
683
+
684
+ /* Relocate STACK from its old location to the new one. The
685
+ local variables YYSIZE and YYSTACKSIZE give the old and new number of
686
+ elements in the stack, and YYPTR gives the new location of the
687
+ stack. Advance YYPTR to a properly aligned location for the next
688
+ stack. */
689
+ # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
690
+ do \
691
+ { \
692
+ YYPTRDIFF_T yynewbytes; \
693
+ YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
694
+ Stack = &yyptr->Stack_alloc; \
695
+ yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
696
+ yyptr += yynewbytes / YYSIZEOF (*yyptr); \
697
+ } \
698
+ while (0)
699
+
700
+ #endif
701
+
702
+ #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
703
+ /* Copy COUNT objects from SRC to DST. The source and destination do
704
+ not overlap. */
705
+ # ifndef YYCOPY
706
+ # if defined __GNUC__ && 1 < __GNUC__
707
+ # define YYCOPY(Dst, Src, Count) \
708
+ __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
709
+ # else
710
+ # define YYCOPY(Dst, Src, Count) \
711
+ do \
712
+ { \
713
+ YYPTRDIFF_T yyi; \
714
+ for (yyi = 0; yyi < (Count); yyi++) \
715
+ (Dst)[yyi] = (Src)[yyi]; \
716
+ } \
717
+ while (0)
718
+ # endif
719
+ # endif
720
+ #endif /* !YYCOPY_NEEDED */
721
+
722
+ /* YYFINAL -- State number of the termination state. */
723
+ #define YYFINAL 39
724
+ /* YYLAST -- Last index in YYTABLE. */
725
+ #define YYLAST 126
726
+
727
+ /* YYNTOKENS -- Number of terminals. */
728
+ #define YYNTOKENS 26
729
+ /* YYNNTS -- Number of nonterminals. */
730
+ #define YYNNTS 16
731
+ /* YYNRULES -- Number of rules. */
732
+ #define YYNRULES 51
733
+ /* YYNSTATES -- Number of states. */
734
+ #define YYNSTATES 80
735
+
736
+ /* YYMAXUTOK -- Last valid token kind. */
737
+ #define YYMAXUTOK 265
738
+
739
+
740
+ /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
741
+ as returned by yylex, with out-of-bounds checking. */
742
+ #define YYTRANSLATE(YYX) \
743
+ (0 <= (YYX) && (YYX) <= YYMAXUTOK \
744
+ ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \
745
+ : YYSYMBOL_YYUNDEF)
746
+
747
+ /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
748
+ as returned by yylex. */
749
+ static const yytype_int8 yytranslate[] =
750
+ {
751
+ 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
752
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
753
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
754
+ 2, 2, 2, 2, 18, 2, 2, 2, 2, 2,
755
+ 13, 14, 16, 2, 2, 2, 2, 2, 2, 2,
756
+ 2, 2, 2, 2, 2, 2, 2, 2, 10, 2,
757
+ 19, 25, 20, 2, 2, 2, 2, 2, 2, 2,
758
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
759
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
760
+ 2, 21, 2, 22, 12, 2, 2, 2, 2, 2,
761
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
762
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
763
+ 2, 2, 2, 24, 17, 23, 15, 2, 2, 2,
764
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
765
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
766
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
767
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
768
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
769
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
770
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
771
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
772
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
773
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
774
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
775
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
776
+ 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
777
+ 5, 6, 7, 8, 9, 11
778
+ };
779
+
780
+ #if YYDEBUG
781
+ /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
782
+ static const yytype_int16 yyrline[] =
783
+ {
784
+ 0, 226, 226, 227, 229, 230, 231, 232, 234, 235,
785
+ 236, 238, 239, 241, 242, 243, 244, 245, 246, 247,
786
+ 249, 250, 251, 253, 255, 255, 257, 257, 257, 260,
787
+ 261, 263, 264, 265, 266, 268, 269, 270, 271, 272,
788
+ 274, 275, 276, 277, 278, 279, 280, 281, 282, 283,
789
+ 284, 285
790
+ };
791
+ #endif
792
+
793
+ /** Accessing symbol of state STATE. */
794
+ #define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])
795
+
796
+ #if YYDEBUG || 0
797
+ /* The user-facing name of the symbol whose (internal) number is
798
+ YYSYMBOL. No bounds checking. */
799
+ static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;
800
+
801
+ /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
802
+ First, the terminals, then, starting at YYNTOKENS, nonterminals. */
803
+ static const char *const yytname[] =
804
+ {
805
+ "\"end of file\"", "error", "\"invalid token\"", "QWRD", "WILD_STR",
806
+ "LOW", "AND", "OR", "REQ", "NOT", "':'", "HIGH", "'^'", "'('", "')'",
807
+ "'~'", "'*'", "'|'", "'\"'", "'<'", "'>'", "'['", "']'", "'}'", "'{'",
808
+ "'='", "$accept", "bool_q", "bool_clss", "bool_cls", "boosted_q", "q",
809
+ "term_q", "wild_q", "field_q", "$@1", "$@2", "$@3", "field", "phrase_q",
810
+ "ph_words", "range_q", YY_NULLPTR
811
+ };
812
+
813
+ static const char *
814
+ yysymbol_name (yysymbol_kind_t yysymbol)
815
+ {
816
+ return yytname[yysymbol];
817
+ }
818
+ #endif
819
+
820
+ #define YYPACT_NINF (-30)
821
+
822
+ #define yypact_value_is_default(Yyn) \
823
+ ((Yyn) == YYPACT_NINF)
824
+
825
+ #define YYTABLE_NINF (-30)
826
+
827
+ #define yytable_value_is_error(Yyn) \
828
+ 0
829
+
830
+ /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
831
+ STATE-NUM. */
832
+ static const yytype_int8 yypact[] =
833
+ {
834
+ 83, -4, -30, 102, 102, 64, -30, 7, -2, -1,
835
+ 6, 15, 31, 45, -30, -30, 29, -30, -30, -30,
836
+ -5, -30, -30, 40, -30, -30, -30, 26, 47, -30,
837
+ 55, 42, 19, -15, 68, -30, 71, 0, 1, -30,
838
+ 83, 83, -30, 72, 102, 73, -30, -30, 102, 76,
839
+ -30, -30, 78, 74, 70, -30, -30, -30, -30, -6,
840
+ -30, 33, -30, -30, -30, -30, -30, -30, -30, -30,
841
+ -30, 90, -30, -30, -30, -30, -30, -30, -30, -30
842
+ };
843
+
844
+ /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
845
+ Performed when YYTABLE does not specify something else to do. Zero
846
+ means the default is an error. */
847
+ static const yytype_int8 yydefact[] =
848
+ {
849
+ 2, 20, 23, 0, 0, 0, 26, 0, 0, 0,
850
+ 0, 0, 0, 3, 4, 10, 11, 13, 19, 16,
851
+ 0, 17, 18, 22, 8, 9, 14, 0, 0, 35,
852
+ 33, 0, 0, 48, 0, 51, 0, 0, 0, 1,
853
+ 0, 0, 7, 0, 0, 0, 21, 15, 0, 0,
854
+ 36, 37, 0, 31, 0, 45, 44, 49, 50, 0,
855
+ 46, 0, 47, 5, 6, 12, 24, 30, 27, 34,
856
+ 39, 0, 38, 40, 41, 42, 43, 25, 28, 32
857
+ };
858
+
859
+ /* YYPGOTO[NTERM-NUM]. */
860
+ static const yytype_int8 yypgoto[] =
861
+ {
862
+ -30, -30, 89, -13, 56, -29, -30, -30, -30, -30,
863
+ -30, -30, -30, -30, -30, -30
864
+ };
865
+
866
+ /* YYDEFGOTO[NTERM-NUM]. */
867
+ static const yytype_int8 yydefgoto[] =
868
+ {
869
+ 0, 12, 13, 14, 15, 16, 17, 18, 19, 77,
870
+ 28, 78, 20, 21, 32, 22
871
+ };
872
+
873
+ /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
874
+ positive, shift that token. If negative, reduce the rule whose
875
+ number is the opposite. If YYTABLE_NINF, syntax error. */
876
+ static const yytype_int8 yytable[] =
877
+ {
878
+ 42, 33, 35, 59, 61, 44, -29, 55, 56, 37,
879
+ 29, 23, 45, -29, 42, 66, 73, 74, 38, 68,
880
+ 60, 62, 51, 34, 36, 30, 31, 63, 64, 1,
881
+ 2, 39, 40, 41, 3, 4, 52, 53, 54, 5,
882
+ 47, 43, 6, 46, 7, 8, 9, 10, 1, 2,
883
+ 11, 40, 41, 3, 4, 75, 76, 48, 5, 24,
884
+ 25, 6, 50, 7, 8, 9, 10, 1, 2, 11,
885
+ 49, 57, 3, 4, 58, 65, 67, 5, 26, 69,
886
+ 6, 70, 7, 8, 9, 10, 1, 2, 11, 71,
887
+ 72, 3, 4, 79, 27, 0, 5, 0, 0, 6,
888
+ 0, 7, 8, 9, 10, 1, 2, 11, 0, 0,
889
+ 0, 0, 0, 0, 0, 5, 0, 0, 6, 0,
890
+ 7, 8, 9, 10, 0, 0, 11
891
+ };
892
+
893
+ static const yytype_int8 yycheck[] =
894
+ {
895
+ 13, 3, 3, 3, 3, 10, 10, 22, 23, 3,
896
+ 3, 15, 17, 17, 27, 44, 22, 23, 3, 48,
897
+ 20, 20, 3, 25, 25, 18, 19, 40, 41, 3,
898
+ 4, 0, 6, 7, 8, 9, 17, 18, 19, 13,
899
+ 14, 12, 16, 3, 18, 19, 20, 21, 3, 4,
900
+ 24, 6, 7, 8, 9, 22, 23, 10, 13, 3,
901
+ 4, 16, 20, 18, 19, 20, 21, 3, 4, 24,
902
+ 15, 3, 8, 9, 3, 3, 3, 13, 14, 3,
903
+ 16, 3, 18, 19, 20, 21, 3, 4, 24, 15,
904
+ 20, 8, 9, 3, 5, -1, 13, -1, -1, 16,
905
+ -1, 18, 19, 20, 21, 3, 4, 24, -1, -1,
906
+ -1, -1, -1, -1, -1, 13, -1, -1, 16, -1,
907
+ 18, 19, 20, 21, -1, -1, 24
908
+ };
909
+
910
+ /* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
911
+ state STATE-NUM. */
912
+ static const yytype_int8 yystos[] =
913
+ {
914
+ 0, 3, 4, 8, 9, 13, 16, 18, 19, 20,
915
+ 21, 24, 27, 28, 29, 30, 31, 32, 33, 34,
916
+ 38, 39, 41, 15, 30, 30, 14, 28, 36, 3,
917
+ 18, 19, 40, 3, 25, 3, 25, 3, 3, 0,
918
+ 6, 7, 29, 12, 10, 17, 3, 14, 10, 15,
919
+ 20, 3, 17, 18, 19, 22, 23, 3, 3, 3,
920
+ 20, 3, 20, 29, 29, 3, 31, 3, 31, 3,
921
+ 3, 15, 20, 22, 23, 22, 23, 35, 37, 3
922
+ };
923
+
924
+ /* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */
925
+ static const yytype_int8 yyr1[] =
926
+ {
927
+ 0, 26, 27, 27, 28, 28, 28, 28, 29, 29,
928
+ 29, 30, 30, 31, 31, 31, 31, 31, 31, 31,
929
+ 32, 32, 32, 33, 35, 34, 36, 37, 34, 38,
930
+ 38, 39, 39, 39, 39, 40, 40, 40, 40, 40,
931
+ 41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
932
+ 41, 41
933
+ };
934
+
935
+ /* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */
936
+ static const yytype_int8 yyr2[] =
937
+ {
938
+ 0, 2, 0, 1, 1, 3, 3, 2, 2, 2,
939
+ 1, 1, 3, 1, 2, 3, 1, 1, 1, 1,
940
+ 1, 3, 2, 1, 0, 4, 0, 0, 5, 1,
941
+ 3, 3, 5, 2, 4, 1, 2, 2, 3, 3,
942
+ 4, 4, 4, 4, 3, 3, 3, 3, 2, 3,
943
+ 3, 2
944
+ };
945
+
946
+
947
+ enum { YYENOMEM = -2 };
948
+
949
+ #define yyerrok (yyerrstatus = 0)
950
+ #define yyclearin (yychar = YYEMPTY)
951
+
952
+ #define YYACCEPT goto yyacceptlab
953
+ #define YYABORT goto yyabortlab
954
+ #define YYERROR goto yyerrorlab
955
+ #define YYNOMEM goto yyexhaustedlab
956
+
957
+
958
+ #define YYRECOVERING() (!!yyerrstatus)
959
+
960
+ #define YYBACKUP(Token, Value) \
961
+ do \
962
+ if (yychar == YYEMPTY) \
963
+ { \
964
+ yychar = (Token); \
965
+ yylval = (Value); \
966
+ YYPOPSTACK (yylen); \
967
+ yystate = *yyssp; \
968
+ goto yybackup; \
969
+ } \
970
+ else \
971
+ { \
972
+ yyerror (qp, encoding, YY_("syntax error: cannot back up")); \
973
+ YYERROR; \
974
+ } \
975
+ while (0)
976
+
977
+ /* Backward compatibility with an undocumented macro.
978
+ Use YYerror or YYUNDEF. */
979
+ #define YYERRCODE YYUNDEF
980
+
981
+
982
+ /* Enable debugging if requested. */
983
+ #if YYDEBUG
984
+
985
+ # ifndef YYFPRINTF
986
+ # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
987
+ # define YYFPRINTF fprintf
988
+ # endif
989
+
990
+ # define YYDPRINTF(Args) \
991
+ do { \
992
+ if (yydebug) \
993
+ YYFPRINTF Args; \
994
+ } while (0)
995
+
996
+
997
+
998
+
999
+ # define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \
1000
+ do { \
1001
+ if (yydebug) \
1002
+ { \
1003
+ YYFPRINTF (stderr, "%s ", Title); \
1004
+ yy_symbol_print (stderr, \
1005
+ Kind, Value, qp, encoding); \
1006
+ YYFPRINTF (stderr, "\n"); \
1007
+ } \
1008
+ } while (0)
1009
+
1010
+
1011
+ /*-----------------------------------.
1012
+ | Print this symbol's value on YYO. |
1013
+ `-----------------------------------*/
1014
+
1015
+ static void
1016
+ yy_symbol_value_print (FILE *yyo,
1017
+ yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, FrtQParser *qp, rb_encoding *encoding)
1018
+ {
1019
+ FILE *yyoutput = yyo;
1020
+ YY_USE (yyoutput);
1021
+ YY_USE (qp);
1022
+ YY_USE (encoding);
1023
+ if (!yyvaluep)
1024
+ return;
1025
+ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1026
+ YY_USE (yykind);
1027
+ YY_IGNORE_MAYBE_UNINITIALIZED_END
1028
+ }
1029
+
1030
+
1031
+ /*---------------------------.
1032
+ | Print this symbol on YYO. |
1033
+ `---------------------------*/
1034
+
1035
+ static void
1036
+ yy_symbol_print (FILE *yyo,
1037
+ yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, FrtQParser *qp, rb_encoding *encoding)
1038
+ {
1039
+ YYFPRINTF (yyo, "%s %s (",
1040
+ yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));
1041
+
1042
+ yy_symbol_value_print (yyo, yykind, yyvaluep, qp, encoding);
1043
+ YYFPRINTF (yyo, ")");
1044
+ }
1045
+
1046
+ /*------------------------------------------------------------------.
1047
+ | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1048
+ | TOP (included). |
1049
+ `------------------------------------------------------------------*/
1050
+
1051
+ static void
1052
+ yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)
1053
+ {
1054
+ YYFPRINTF (stderr, "Stack now");
1055
+ for (; yybottom <= yytop; yybottom++)
1056
+ {
1057
+ int yybot = *yybottom;
1058
+ YYFPRINTF (stderr, " %d", yybot);
1059
+ }
1060
+ YYFPRINTF (stderr, "\n");
1061
+ }
1062
+
1063
+ # define YY_STACK_PRINT(Bottom, Top) \
1064
+ do { \
1065
+ if (yydebug) \
1066
+ yy_stack_print ((Bottom), (Top)); \
1067
+ } while (0)
1068
+
1069
+
1070
+ /*------------------------------------------------.
1071
+ | Report that the YYRULE is going to be reduced. |
1072
+ `------------------------------------------------*/
1073
+
1074
+ static void
1075
+ yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp,
1076
+ int yyrule, FrtQParser *qp, rb_encoding *encoding)
1077
+ {
1078
+ int yylno = yyrline[yyrule];
1079
+ int yynrhs = yyr2[yyrule];
1080
+ int yyi;
1081
+ YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
1082
+ yyrule - 1, yylno);
1083
+ /* The symbols being reduced. */
1084
+ for (yyi = 0; yyi < yynrhs; yyi++)
1085
+ {
1086
+ YYFPRINTF (stderr, " $%d = ", yyi + 1);
1087
+ yy_symbol_print (stderr,
1088
+ YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
1089
+ &yyvsp[(yyi + 1) - (yynrhs)], qp, encoding);
1090
+ YYFPRINTF (stderr, "\n");
1091
+ }
1092
+ }
1093
+
1094
+ # define YY_REDUCE_PRINT(Rule) \
1095
+ do { \
1096
+ if (yydebug) \
1097
+ yy_reduce_print (yyssp, yyvsp, Rule, qp, encoding); \
1098
+ } while (0)
1099
+
1100
+ /* Nonzero means print parse trace. It is left uninitialized so that
1101
+ multiple parsers can coexist. */
1102
+ int yydebug;
1103
+ #else /* !YYDEBUG */
1104
+ # define YYDPRINTF(Args) ((void) 0)
1105
+ # define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
1106
+ # define YY_STACK_PRINT(Bottom, Top)
1107
+ # define YY_REDUCE_PRINT(Rule)
1108
+ #endif /* !YYDEBUG */
1109
+
1110
+
1111
+ /* YYINITDEPTH -- initial size of the parser's stacks. */
1112
+ #ifndef YYINITDEPTH
1113
+ # define YYINITDEPTH 200
1114
+ #endif
1115
+
1116
+ /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1117
+ if the built-in stack extension method is used).
1118
+
1119
+ Do not make this value too large; the results are undefined if
1120
+ YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1121
+ evaluated with infinite-precision integer arithmetic. */
1122
+
1123
+ #ifndef YYMAXDEPTH
1124
+ # define YYMAXDEPTH 10000
1125
+ #endif
1126
+
1127
+
1128
+
1129
+
1130
+
1131
+
1132
+ /*-----------------------------------------------.
1133
+ | Release the memory associated to this symbol. |
1134
+ `-----------------------------------------------*/
1135
+
1136
+ static void
1137
+ yydestruct (const char *yymsg,
1138
+ yysymbol_kind_t yykind, YYSTYPE *yyvaluep, FrtQParser *qp, rb_encoding *encoding)
1139
+ {
1140
+ YY_USE (yyvaluep);
1141
+ YY_USE (qp);
1142
+ YY_USE (encoding);
1143
+ if (!yymsg)
1144
+ yymsg = "Deleting";
1145
+ YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
1146
+
1147
+ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1148
+ switch (yykind)
1149
+ {
1150
+ case YYSYMBOL_bool_q: /* bool_q */
1151
+ #line 221 "frt_q_parser.y"
1152
+ { if (((*yyvaluep).query) && qp->destruct) frt_q_deref(((*yyvaluep).query)); }
1153
+ #line 1154 "frt_q_parser.c"
1154
+ break;
1155
+
1156
+ case YYSYMBOL_bool_clss: /* bool_clss */
1157
+ #line 223 "frt_q_parser.y"
1158
+ { if (((*yyvaluep).bclss) && qp->destruct) bca_destroy(((*yyvaluep).bclss)); }
1159
+ #line 1160 "frt_q_parser.c"
1160
+ break;
1161
+
1162
+ case YYSYMBOL_bool_cls: /* bool_cls */
1163
+ #line 222 "frt_q_parser.y"
1164
+ { if (((*yyvaluep).bcls) && qp->destruct) frt_bc_deref(((*yyvaluep).bcls)); }
1165
+ #line 1166 "frt_q_parser.c"
1166
+ break;
1167
+
1168
+ case YYSYMBOL_boosted_q: /* boosted_q */
1169
+ #line 221 "frt_q_parser.y"
1170
+ { if (((*yyvaluep).query) && qp->destruct) frt_q_deref(((*yyvaluep).query)); }
1171
+ #line 1172 "frt_q_parser.c"
1172
+ break;
1173
+
1174
+ case YYSYMBOL_q: /* q */
1175
+ #line 221 "frt_q_parser.y"
1176
+ { if (((*yyvaluep).query) && qp->destruct) frt_q_deref(((*yyvaluep).query)); }
1177
+ #line 1178 "frt_q_parser.c"
1178
+ break;
1179
+
1180
+ case YYSYMBOL_term_q: /* term_q */
1181
+ #line 221 "frt_q_parser.y"
1182
+ { if (((*yyvaluep).query) && qp->destruct) frt_q_deref(((*yyvaluep).query)); }
1183
+ #line 1184 "frt_q_parser.c"
1184
+ break;
1185
+
1186
+ case YYSYMBOL_wild_q: /* wild_q */
1187
+ #line 221 "frt_q_parser.y"
1188
+ { if (((*yyvaluep).query) && qp->destruct) frt_q_deref(((*yyvaluep).query)); }
1189
+ #line 1190 "frt_q_parser.c"
1190
+ break;
1191
+
1192
+ case YYSYMBOL_field_q: /* field_q */
1193
+ #line 221 "frt_q_parser.y"
1194
+ { if (((*yyvaluep).query) && qp->destruct) frt_q_deref(((*yyvaluep).query)); }
1195
+ #line 1196 "frt_q_parser.c"
1196
+ break;
1197
+
1198
+ case YYSYMBOL_phrase_q: /* phrase_q */
1199
+ #line 221 "frt_q_parser.y"
1200
+ { if (((*yyvaluep).query) && qp->destruct) frt_q_deref(((*yyvaluep).query)); }
1201
+ #line 1202 "frt_q_parser.c"
1202
+ break;
1203
+
1204
+ case YYSYMBOL_ph_words: /* ph_words */
1205
+ #line 224 "frt_q_parser.y"
1206
+ { if (((*yyvaluep).phrase) && qp->destruct) ph_destroy(((*yyvaluep).phrase)); }
1207
+ #line 1208 "frt_q_parser.c"
1208
+ break;
1209
+
1210
+ case YYSYMBOL_range_q: /* range_q */
1211
+ #line 221 "frt_q_parser.y"
1212
+ { if (((*yyvaluep).query) && qp->destruct) frt_q_deref(((*yyvaluep).query)); }
1213
+ #line 1214 "frt_q_parser.c"
1214
+ break;
1215
+
1216
+ default:
1217
+ break;
1218
+ }
1219
+ YY_IGNORE_MAYBE_UNINITIALIZED_END
1220
+ }
1221
+
1222
+
1223
+
1224
+
1225
+
1226
+
1227
+ /*----------.
1228
+ | yyparse. |
1229
+ `----------*/
1230
+
1231
+ int
1232
+ yyparse (FrtQParser *qp, rb_encoding *encoding)
1233
+ {
1234
+ /* Lookahead token kind. */
1235
+ int yychar;
1236
+
1237
+
1238
+ /* The semantic value of the lookahead symbol. */
1239
+ /* Default value used for initialization, for pacifying older GCCs
1240
+ or non-GCC compilers. */
1241
+ YY_INITIAL_VALUE (static YYSTYPE yyval_default;)
1242
+ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
1243
+
1244
+ /* Number of syntax errors so far. */
1245
+ int yynerrs = 0;
1246
+
1247
+ yy_state_fast_t yystate = 0;
1248
+ /* Number of tokens to shift before error messages enabled. */
1249
+ int yyerrstatus = 0;
1250
+
1251
+ /* Refer to the stacks through separate pointers, to allow yyoverflow
1252
+ to reallocate them elsewhere. */
1253
+
1254
+ /* Their size. */
1255
+ YYPTRDIFF_T yystacksize = YYINITDEPTH;
1256
+
1257
+ /* The state stack: array, bottom, top. */
1258
+ yy_state_t yyssa[YYINITDEPTH];
1259
+ yy_state_t *yyss = yyssa;
1260
+ yy_state_t *yyssp = yyss;
1261
+
1262
+ /* The semantic value stack: array, bottom, top. */
1263
+ YYSTYPE yyvsa[YYINITDEPTH];
1264
+ YYSTYPE *yyvs = yyvsa;
1265
+ YYSTYPE *yyvsp = yyvs;
1266
+
1267
+ int yyn;
1268
+ /* The return value of yyparse. */
1269
+ int yyresult;
1270
+ /* Lookahead symbol kind. */
1271
+ yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY;
1272
+ /* The variables used to return semantic value and location from the
1273
+ action routines. */
1274
+ YYSTYPE yyval;
1275
+
1276
+
1277
+
1278
+ #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1279
+
1280
+ /* The number of symbols on the RHS of the reduced rule.
1281
+ Keep to zero when no symbol should be popped. */
1282
+ int yylen = 0;
1283
+
1284
+ YYDPRINTF ((stderr, "Starting parse\n"));
1285
+
1286
+ yychar = YYEMPTY; /* Cause a token to be read. */
1287
+
1288
+ goto yysetstate;
1289
+
1290
+
1291
+ /*------------------------------------------------------------.
1292
+ | yynewstate -- push a new state, which is found in yystate. |
1293
+ `------------------------------------------------------------*/
1294
+ yynewstate:
1295
+ /* In all cases, when you get here, the value and location stacks
1296
+ have just been pushed. So pushing a state here evens the stacks. */
1297
+ yyssp++;
1298
+
1299
+
1300
+ /*--------------------------------------------------------------------.
1301
+ | yysetstate -- set current state (the top of the stack) to yystate. |
1302
+ `--------------------------------------------------------------------*/
1303
+ yysetstate:
1304
+ YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1305
+ YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
1306
+ YY_IGNORE_USELESS_CAST_BEGIN
1307
+ *yyssp = YY_CAST (yy_state_t, yystate);
1308
+ YY_IGNORE_USELESS_CAST_END
1309
+ YY_STACK_PRINT (yyss, yyssp);
1310
+
1311
+ if (yyss + yystacksize - 1 <= yyssp)
1312
+ #if !defined yyoverflow && !defined YYSTACK_RELOCATE
1313
+ YYNOMEM;
1314
+ #else
1315
+ {
1316
+ /* Get the current used size of the three stacks, in elements. */
1317
+ YYPTRDIFF_T yysize = yyssp - yyss + 1;
1318
+
1319
+ # if defined yyoverflow
1320
+ {
1321
+ /* Give user a chance to reallocate the stack. Use copies of
1322
+ these so that the &'s don't force the real ones into
1323
+ memory. */
1324
+ yy_state_t *yyss1 = yyss;
1325
+ YYSTYPE *yyvs1 = yyvs;
1326
+
1327
+ /* Each stack pointer address is followed by the size of the
1328
+ data in use in that stack, in bytes. This used to be a
1329
+ conditional around just the two extra args, but that might
1330
+ be undefined if yyoverflow is a macro. */
1331
+ yyoverflow (YY_("memory exhausted"),
1332
+ &yyss1, yysize * YYSIZEOF (*yyssp),
1333
+ &yyvs1, yysize * YYSIZEOF (*yyvsp),
1334
+ &yystacksize);
1335
+ yyss = yyss1;
1336
+ yyvs = yyvs1;
1337
+ }
1338
+ # else /* defined YYSTACK_RELOCATE */
1339
+ /* Extend the stack our own way. */
1340
+ if (YYMAXDEPTH <= yystacksize)
1341
+ YYNOMEM;
1342
+ yystacksize *= 2;
1343
+ if (YYMAXDEPTH < yystacksize)
1344
+ yystacksize = YYMAXDEPTH;
1345
+
1346
+ {
1347
+ yy_state_t *yyss1 = yyss;
1348
+ union yyalloc *yyptr =
1349
+ YY_CAST (union yyalloc *,
1350
+ YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
1351
+ if (! yyptr)
1352
+ YYNOMEM;
1353
+ YYSTACK_RELOCATE (yyss_alloc, yyss);
1354
+ YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1355
+ # undef YYSTACK_RELOCATE
1356
+ if (yyss1 != yyssa)
1357
+ YYSTACK_FREE (yyss1);
1358
+ }
1359
+ # endif
1360
+
1361
+ yyssp = yyss + yysize - 1;
1362
+ yyvsp = yyvs + yysize - 1;
1363
+
1364
+ YY_IGNORE_USELESS_CAST_BEGIN
1365
+ YYDPRINTF ((stderr, "Stack size increased to %ld\n",
1366
+ YY_CAST (long, yystacksize)));
1367
+ YY_IGNORE_USELESS_CAST_END
1368
+
1369
+ if (yyss + yystacksize - 1 <= yyssp)
1370
+ YYABORT;
1371
+ }
1372
+ #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
1373
+
1374
+
1375
+ if (yystate == YYFINAL)
1376
+ YYACCEPT;
1377
+
1378
+ goto yybackup;
1379
+
1380
+
1381
+ /*-----------.
1382
+ | yybackup. |
1383
+ `-----------*/
1384
+ yybackup:
1385
+ /* Do appropriate processing given the current state. Read a
1386
+ lookahead token if we need one and don't already have one. */
1387
+
1388
+ /* First try to decide what to do without reference to lookahead token. */
1389
+ yyn = yypact[yystate];
1390
+ if (yypact_value_is_default (yyn))
1391
+ goto yydefault;
1392
+
1393
+ /* Not known => get a lookahead token if don't already have one. */
1394
+
1395
+ /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */
1396
+ if (yychar == YYEMPTY)
1397
+ {
1398
+ YYDPRINTF ((stderr, "Reading a token\n"));
1399
+ yychar = yylex (&yylval, qp);
1400
+ }
1401
+
1402
+ if (yychar <= YYEOF)
1403
+ {
1404
+ yychar = YYEOF;
1405
+ yytoken = YYSYMBOL_YYEOF;
1406
+ YYDPRINTF ((stderr, "Now at end of input.\n"));
1407
+ }
1408
+ else if (yychar == YYerror)
1409
+ {
1410
+ /* The scanner already issued an error message, process directly
1411
+ to error recovery. But do not keep the error token as
1412
+ lookahead, it is too special and may lead us to an endless
1413
+ loop in error recovery. */
1414
+ yychar = YYUNDEF;
1415
+ yytoken = YYSYMBOL_YYerror;
1416
+ goto yyerrlab1;
1417
+ }
1418
+ else
1419
+ {
1420
+ yytoken = YYTRANSLATE (yychar);
1421
+ YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1422
+ }
1423
+
1424
+ /* If the proper action on seeing token YYTOKEN is to reduce or to
1425
+ detect an error, take that action. */
1426
+ yyn += yytoken;
1427
+ if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1428
+ goto yydefault;
1429
+ yyn = yytable[yyn];
1430
+ if (yyn <= 0)
1431
+ {
1432
+ if (yytable_value_is_error (yyn))
1433
+ goto yyerrlab;
1434
+ yyn = -yyn;
1435
+ goto yyreduce;
1436
+ }
1437
+
1438
+ /* Count tokens shifted since error; after three, turn off error
1439
+ status. */
1440
+ if (yyerrstatus)
1441
+ yyerrstatus--;
1442
+
1443
+ /* Shift the lookahead token. */
1444
+ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1445
+ yystate = yyn;
1446
+ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1447
+ *++yyvsp = yylval;
1448
+ YY_IGNORE_MAYBE_UNINITIALIZED_END
1449
+
1450
+ /* Discard the shifted token. */
1451
+ yychar = YYEMPTY;
1452
+ goto yynewstate;
1453
+
1454
+
1455
+ /*-----------------------------------------------------------.
1456
+ | yydefault -- do the default action for the current state. |
1457
+ `-----------------------------------------------------------*/
1458
+ yydefault:
1459
+ yyn = yydefact[yystate];
1460
+ if (yyn == 0)
1461
+ goto yyerrlab;
1462
+ goto yyreduce;
1463
+
1464
+
1465
+ /*-----------------------------.
1466
+ | yyreduce -- do a reduction. |
1467
+ `-----------------------------*/
1468
+ yyreduce:
1469
+ /* yyn is the number of a rule to reduce with. */
1470
+ yylen = yyr2[yyn];
1471
+
1472
+ /* If YYLEN is nonzero, implement the default value of the action:
1473
+ '$$ = $1'.
1474
+
1475
+ Otherwise, the following line sets YYVAL to garbage.
1476
+ This behavior is undocumented and Bison
1477
+ users should not rely upon it. Assigning to YYVAL
1478
+ unconditionally makes the parser a bit smaller, and it avoids a
1479
+ GCC warning that YYVAL may be used uninitialized. */
1480
+ yyval = yyvsp[1-yylen];
1481
+
1482
+
1483
+ YY_REDUCE_PRINT (yyn);
1484
+ switch (yyn)
1485
+ {
1486
+ case 2: /* bool_q: %empty */
1487
+ #line 226 "frt_q_parser.y"
1488
+ { qp->result = (yyval.query) = NULL; }
1489
+ #line 1490 "frt_q_parser.c"
1490
+ break;
1491
+
1492
+ case 3: /* bool_q: bool_clss */
1493
+ #line 227 "frt_q_parser.y"
1494
+ { T qp->result = (yyval.query) = get_bool_q((yyvsp[0].bclss)); E }
1495
+ #line 1496 "frt_q_parser.c"
1496
+ break;
1497
+
1498
+ case 4: /* bool_clss: bool_cls */
1499
+ #line 229 "frt_q_parser.y"
1500
+ { T (yyval.bclss) = first_cls((yyvsp[0].bcls)); E }
1501
+ #line 1502 "frt_q_parser.c"
1502
+ break;
1503
+
1504
+ case 5: /* bool_clss: bool_clss AND bool_cls */
1505
+ #line 230 "frt_q_parser.y"
1506
+ { T (yyval.bclss) = add_and_cls((yyvsp[-2].bclss), (yyvsp[0].bcls)); E }
1507
+ #line 1508 "frt_q_parser.c"
1508
+ break;
1509
+
1510
+ case 6: /* bool_clss: bool_clss OR bool_cls */
1511
+ #line 231 "frt_q_parser.y"
1512
+ { T (yyval.bclss) = add_or_cls((yyvsp[-2].bclss), (yyvsp[0].bcls)); E }
1513
+ #line 1514 "frt_q_parser.c"
1514
+ break;
1515
+
1516
+ case 7: /* bool_clss: bool_clss bool_cls */
1517
+ #line 232 "frt_q_parser.y"
1518
+ { T (yyval.bclss) = add_default_cls(qp, (yyvsp[-1].bclss), (yyvsp[0].bcls)); E }
1519
+ #line 1520 "frt_q_parser.c"
1520
+ break;
1521
+
1522
+ case 8: /* bool_cls: REQ boosted_q */
1523
+ #line 234 "frt_q_parser.y"
1524
+ { T (yyval.bcls) = get_bool_cls((yyvsp[0].query), FRT_BC_MUST); E }
1525
+ #line 1526 "frt_q_parser.c"
1526
+ break;
1527
+
1528
+ case 9: /* bool_cls: NOT boosted_q */
1529
+ #line 235 "frt_q_parser.y"
1530
+ { T (yyval.bcls) = get_bool_cls((yyvsp[0].query), FRT_BC_MUST_NOT); E }
1531
+ #line 1532 "frt_q_parser.c"
1532
+ break;
1533
+
1534
+ case 10: /* bool_cls: boosted_q */
1535
+ #line 236 "frt_q_parser.y"
1536
+ { T (yyval.bcls) = get_bool_cls((yyvsp[0].query), FRT_BC_SHOULD); E }
1537
+ #line 1538 "frt_q_parser.c"
1538
+ break;
1539
+
1540
+ case 12: /* boosted_q: q '^' QWRD */
1541
+ #line 239 "frt_q_parser.y"
1542
+ { T if ((yyvsp[-2].query)) sscanf((yyvsp[0].str),"%f",&((yyvsp[-2].query)->boost)); (yyval.query)=(yyvsp[-2].query); E }
1543
+ #line 1544 "frt_q_parser.c"
1544
+ break;
1545
+
1546
+ case 14: /* q: '(' ')' */
1547
+ #line 242 "frt_q_parser.y"
1548
+ { T (yyval.query) = frt_bq_new_max(true, qp->max_clauses); E }
1549
+ #line 1550 "frt_q_parser.c"
1550
+ break;
1551
+
1552
+ case 15: /* q: '(' bool_clss ')' */
1553
+ #line 243 "frt_q_parser.y"
1554
+ { T (yyval.query) = get_bool_q((yyvsp[-1].bclss)); E }
1555
+ #line 1556 "frt_q_parser.c"
1556
+ break;
1557
+
1558
+ case 20: /* term_q: QWRD */
1559
+ #line 249 "frt_q_parser.y"
1560
+ { FLDS((yyval.query), get_term_q(qp, field, (yyvsp[0].str), encoding)); Y}
1561
+ #line 1562 "frt_q_parser.c"
1562
+ break;
1563
+
1564
+ case 21: /* term_q: QWRD '~' QWRD */
1565
+ #line 250 "frt_q_parser.y"
1566
+ { FLDS((yyval.query), get_fuzzy_q(qp, field, (yyvsp[-2].str), (yyvsp[0].str), encoding)); Y}
1567
+ #line 1568 "frt_q_parser.c"
1568
+ break;
1569
+
1570
+ case 22: /* term_q: QWRD '~' */
1571
+ #line 251 "frt_q_parser.y"
1572
+ { FLDS((yyval.query), get_fuzzy_q(qp, field, (yyvsp[-1].str), NULL, encoding)); Y}
1573
+ #line 1574 "frt_q_parser.c"
1574
+ break;
1575
+
1576
+ case 23: /* wild_q: WILD_STR */
1577
+ #line 253 "frt_q_parser.y"
1578
+ { FLDS((yyval.query), get_wild_q(qp, field, (yyvsp[0].str), encoding)); Y}
1579
+ #line 1580 "frt_q_parser.c"
1580
+ break;
1581
+
1582
+ case 24: /* $@1: %empty */
1583
+ #line 255 "frt_q_parser.y"
1584
+ { qp_pop_fields(qp); }
1585
+ #line 1586 "frt_q_parser.c"
1586
+ break;
1587
+
1588
+ case 25: /* field_q: field ':' q $@1 */
1589
+ #line 256 "frt_q_parser.y"
1590
+ { (yyval.query) = (yyvsp[-1].query); }
1591
+ #line 1592 "frt_q_parser.c"
1592
+ break;
1593
+
1594
+ case 26: /* $@2: %empty */
1595
+ #line 257 "frt_q_parser.y"
1596
+ { qp_push_fields(qp, qp->all_fields, false); }
1597
+ #line 1598 "frt_q_parser.c"
1598
+ break;
1599
+
1600
+ case 27: /* $@3: %empty */
1601
+ #line 257 "frt_q_parser.y"
1602
+ { qp_pop_fields(qp); }
1603
+ #line 1604 "frt_q_parser.c"
1604
+ break;
1605
+
1606
+ case 28: /* field_q: '*' $@2 ':' q $@3 */
1607
+ #line 258 "frt_q_parser.y"
1608
+ { (yyval.query) = (yyvsp[-1].query); }
1609
+ #line 1610 "frt_q_parser.c"
1610
+ break;
1611
+
1612
+ case 29: /* field: QWRD */
1613
+ #line 260 "frt_q_parser.y"
1614
+ { (yyval.hashset) = first_field(qp, (yyvsp[0].str)); }
1615
+ #line 1616 "frt_q_parser.c"
1616
+ break;
1617
+
1618
+ case 30: /* field: field '|' QWRD */
1619
+ #line 261 "frt_q_parser.y"
1620
+ { (yyval.hashset) = add_field(qp, (yyvsp[0].str));}
1621
+ #line 1622 "frt_q_parser.c"
1622
+ break;
1623
+
1624
+ case 31: /* phrase_q: '"' ph_words '"' */
1625
+ #line 263 "frt_q_parser.y"
1626
+ { (yyval.query) = get_phrase_q(qp, (yyvsp[-1].phrase), NULL, encoding); }
1627
+ #line 1628 "frt_q_parser.c"
1628
+ break;
1629
+
1630
+ case 32: /* phrase_q: '"' ph_words '"' '~' QWRD */
1631
+ #line 264 "frt_q_parser.y"
1632
+ { (yyval.query) = get_phrase_q(qp, (yyvsp[-3].phrase), (yyvsp[0].str), encoding); }
1633
+ #line 1634 "frt_q_parser.c"
1634
+ break;
1635
+
1636
+ case 33: /* phrase_q: '"' '"' */
1637
+ #line 265 "frt_q_parser.y"
1638
+ { (yyval.query) = NULL; }
1639
+ #line 1640 "frt_q_parser.c"
1640
+ break;
1641
+
1642
+ case 34: /* phrase_q: '"' '"' '~' QWRD */
1643
+ #line 266 "frt_q_parser.y"
1644
+ { (yyval.query) = NULL; (void)(yyvsp[0].str);}
1645
+ #line 1646 "frt_q_parser.c"
1646
+ break;
1647
+
1648
+ case 35: /* ph_words: QWRD */
1649
+ #line 268 "frt_q_parser.y"
1650
+ { (yyval.phrase) = ph_first_word((yyvsp[0].str)); }
1651
+ #line 1652 "frt_q_parser.c"
1652
+ break;
1653
+
1654
+ case 36: /* ph_words: '<' '>' */
1655
+ #line 269 "frt_q_parser.y"
1656
+ { (yyval.phrase) = ph_first_word(NULL); }
1657
+ #line 1658 "frt_q_parser.c"
1658
+ break;
1659
+
1660
+ case 37: /* ph_words: ph_words QWRD */
1661
+ #line 270 "frt_q_parser.y"
1662
+ { (yyval.phrase) = ph_add_word((yyvsp[-1].phrase), (yyvsp[0].str)); }
1663
+ #line 1664 "frt_q_parser.c"
1664
+ break;
1665
+
1666
+ case 38: /* ph_words: ph_words '<' '>' */
1667
+ #line 271 "frt_q_parser.y"
1668
+ { (yyval.phrase) = ph_add_word((yyvsp[-2].phrase), NULL); }
1669
+ #line 1670 "frt_q_parser.c"
1670
+ break;
1671
+
1672
+ case 39: /* ph_words: ph_words '|' QWRD */
1673
+ #line 272 "frt_q_parser.y"
1674
+ { (yyval.phrase) = ph_add_multi_word((yyvsp[-2].phrase), (yyvsp[0].str)); }
1675
+ #line 1676 "frt_q_parser.c"
1676
+ break;
1677
+
1678
+ case 40: /* range_q: '[' QWRD QWRD ']' */
1679
+ #line 274 "frt_q_parser.y"
1680
+ { FLDS((yyval.query), get_r_q(qp, field, (yyvsp[-2].str), (yyvsp[-1].str), true, true, encoding)); Y}
1681
+ #line 1682 "frt_q_parser.c"
1682
+ break;
1683
+
1684
+ case 41: /* range_q: '[' QWRD QWRD '}' */
1685
+ #line 275 "frt_q_parser.y"
1686
+ { FLDS((yyval.query), get_r_q(qp, field, (yyvsp[-2].str), (yyvsp[-1].str), true, false, encoding)); Y}
1687
+ #line 1688 "frt_q_parser.c"
1688
+ break;
1689
+
1690
+ case 42: /* range_q: '{' QWRD QWRD ']' */
1691
+ #line 276 "frt_q_parser.y"
1692
+ { FLDS((yyval.query), get_r_q(qp, field, (yyvsp[-2].str), (yyvsp[-1].str), false, true, encoding)); Y}
1693
+ #line 1694 "frt_q_parser.c"
1694
+ break;
1695
+
1696
+ case 43: /* range_q: '{' QWRD QWRD '}' */
1697
+ #line 277 "frt_q_parser.y"
1698
+ { FLDS((yyval.query), get_r_q(qp, field, (yyvsp[-2].str), (yyvsp[-1].str), false, false, encoding)); Y}
1699
+ #line 1700 "frt_q_parser.c"
1700
+ break;
1701
+
1702
+ case 44: /* range_q: '<' QWRD '}' */
1703
+ #line 278 "frt_q_parser.y"
1704
+ { FLDS((yyval.query), get_r_q(qp, field, NULL,(yyvsp[-1].str), false, false, encoding)); Y}
1705
+ #line 1706 "frt_q_parser.c"
1706
+ break;
1707
+
1708
+ case 45: /* range_q: '<' QWRD ']' */
1709
+ #line 279 "frt_q_parser.y"
1710
+ { FLDS((yyval.query), get_r_q(qp, field, NULL,(yyvsp[-1].str), false, true, encoding)); Y}
1711
+ #line 1712 "frt_q_parser.c"
1712
+ break;
1713
+
1714
+ case 46: /* range_q: '[' QWRD '>' */
1715
+ #line 280 "frt_q_parser.y"
1716
+ { FLDS((yyval.query), get_r_q(qp, field, (yyvsp[-1].str), NULL,true, false, encoding)); Y}
1717
+ #line 1718 "frt_q_parser.c"
1718
+ break;
1719
+
1720
+ case 47: /* range_q: '{' QWRD '>' */
1721
+ #line 281 "frt_q_parser.y"
1722
+ { FLDS((yyval.query), get_r_q(qp, field, (yyvsp[-1].str), NULL,false, false, encoding)); Y}
1723
+ #line 1724 "frt_q_parser.c"
1724
+ break;
1725
+
1726
+ case 48: /* range_q: '<' QWRD */
1727
+ #line 282 "frt_q_parser.y"
1728
+ { FLDS((yyval.query), get_r_q(qp, field, NULL,(yyvsp[0].str), false, false, encoding)); Y}
1729
+ #line 1730 "frt_q_parser.c"
1730
+ break;
1731
+
1732
+ case 49: /* range_q: '<' '=' QWRD */
1733
+ #line 283 "frt_q_parser.y"
1734
+ { FLDS((yyval.query), get_r_q(qp, field, NULL,(yyvsp[0].str), false, true, encoding)); Y}
1735
+ #line 1736 "frt_q_parser.c"
1736
+ break;
1737
+
1738
+ case 50: /* range_q: '>' '=' QWRD */
1739
+ #line 284 "frt_q_parser.y"
1740
+ { FLDS((yyval.query), get_r_q(qp, field, (yyvsp[0].str), NULL,true, false, encoding)); Y}
1741
+ #line 1742 "frt_q_parser.c"
1742
+ break;
1743
+
1744
+ case 51: /* range_q: '>' QWRD */
1745
+ #line 285 "frt_q_parser.y"
1746
+ { FLDS((yyval.query), get_r_q(qp, field, (yyvsp[0].str), NULL,false, false, encoding)); Y}
1747
+ #line 1748 "frt_q_parser.c"
1748
+ break;
1749
+
1750
+
1751
+ #line 1752 "frt_q_parser.c"
1752
+
1753
+ default: break;
1754
+ }
1755
+ /* User semantic actions sometimes alter yychar, and that requires
1756
+ that yytoken be updated with the new translation. We take the
1757
+ approach of translating immediately before every use of yytoken.
1758
+ One alternative is translating here after every semantic action,
1759
+ but that translation would be missed if the semantic action invokes
1760
+ YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1761
+ if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
1762
+ incorrect destructor might then be invoked immediately. In the
1763
+ case of YYERROR or YYBACKUP, subsequent parser actions might lead
1764
+ to an incorrect destructor call or verbose syntax error message
1765
+ before the lookahead is translated. */
1766
+ YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc);
1767
+
1768
+ YYPOPSTACK (yylen);
1769
+ yylen = 0;
1770
+
1771
+ *++yyvsp = yyval;
1772
+
1773
+ /* Now 'shift' the result of the reduction. Determine what state
1774
+ that goes to, based on the state we popped back to and the rule
1775
+ number reduced by. */
1776
+ {
1777
+ const int yylhs = yyr1[yyn] - YYNTOKENS;
1778
+ const int yyi = yypgoto[yylhs] + *yyssp;
1779
+ yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
1780
+ ? yytable[yyi]
1781
+ : yydefgoto[yylhs]);
1782
+ }
1783
+
1784
+ goto yynewstate;
1785
+
1786
+
1787
+ /*--------------------------------------.
1788
+ | yyerrlab -- here on detecting error. |
1789
+ `--------------------------------------*/
1790
+ yyerrlab:
1791
+ /* Make sure we have latest lookahead translation. See comments at
1792
+ user semantic actions for why this is necessary. */
1793
+ yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar);
1794
+ /* If not already recovering from an error, report this error. */
1795
+ if (!yyerrstatus)
1796
+ {
1797
+ ++yynerrs;
1798
+ yyerror (qp, encoding, YY_("syntax error"));
1799
+ }
1800
+
1801
+ if (yyerrstatus == 3)
1802
+ {
1803
+ /* If just tried and failed to reuse lookahead token after an
1804
+ error, discard it. */
1805
+
1806
+ if (yychar <= YYEOF)
1807
+ {
1808
+ /* Return failure if at end of input. */
1809
+ if (yychar == YYEOF)
1810
+ YYABORT;
1811
+ }
1812
+ else
1813
+ {
1814
+ yydestruct ("Error: discarding",
1815
+ yytoken, &yylval, qp, encoding);
1816
+ yychar = YYEMPTY;
1817
+ }
1818
+ }
1819
+
1820
+ /* Else will try to reuse lookahead token after shifting the error
1821
+ token. */
1822
+ goto yyerrlab1;
1823
+
1824
+
1825
+ /*---------------------------------------------------.
1826
+ | yyerrorlab -- error raised explicitly by YYERROR. |
1827
+ `---------------------------------------------------*/
1828
+ yyerrorlab:
1829
+ /* Pacify compilers when the user code never invokes YYERROR and the
1830
+ label yyerrorlab therefore never appears in user code. */
1831
+ if (0)
1832
+ YYERROR;
1833
+ ++yynerrs;
1834
+
1835
+ /* Do not reclaim the symbols of the rule whose action triggered
1836
+ this YYERROR. */
1837
+ YYPOPSTACK (yylen);
1838
+ yylen = 0;
1839
+ YY_STACK_PRINT (yyss, yyssp);
1840
+ yystate = *yyssp;
1841
+ goto yyerrlab1;
1842
+
1843
+
1844
+ /*-------------------------------------------------------------.
1845
+ | yyerrlab1 -- common code for both syntax error and YYERROR. |
1846
+ `-------------------------------------------------------------*/
1847
+ yyerrlab1:
1848
+ yyerrstatus = 3; /* Each real token shifted decrements this. */
1849
+
1850
+ /* Pop stack until we find a state that shifts the error token. */
1851
+ for (;;)
1852
+ {
1853
+ yyn = yypact[yystate];
1854
+ if (!yypact_value_is_default (yyn))
1855
+ {
1856
+ yyn += YYSYMBOL_YYerror;
1857
+ if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
1858
+ {
1859
+ yyn = yytable[yyn];
1860
+ if (0 < yyn)
1861
+ break;
1862
+ }
1863
+ }
1864
+
1865
+ /* Pop the current state because it cannot handle the error token. */
1866
+ if (yyssp == yyss)
1867
+ YYABORT;
1868
+
1869
+
1870
+ yydestruct ("Error: popping",
1871
+ YY_ACCESSING_SYMBOL (yystate), yyvsp, qp, encoding);
1872
+ YYPOPSTACK (1);
1873
+ yystate = *yyssp;
1874
+ YY_STACK_PRINT (yyss, yyssp);
1875
+ }
1876
+
1877
+ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1878
+ *++yyvsp = yylval;
1879
+ YY_IGNORE_MAYBE_UNINITIALIZED_END
1880
+
1881
+
1882
+ /* Shift the error token. */
1883
+ YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp);
1884
+
1885
+ yystate = yyn;
1886
+ goto yynewstate;
1887
+
1888
+
1889
+ /*-------------------------------------.
1890
+ | yyacceptlab -- YYACCEPT comes here. |
1891
+ `-------------------------------------*/
1892
+ yyacceptlab:
1893
+ yyresult = 0;
1894
+ goto yyreturnlab;
1895
+
1896
+
1897
+ /*-----------------------------------.
1898
+ | yyabortlab -- YYABORT comes here. |
1899
+ `-----------------------------------*/
1900
+ yyabortlab:
1901
+ yyresult = 1;
1902
+ goto yyreturnlab;
1903
+
1904
+
1905
+ /*-----------------------------------------------------------.
1906
+ | yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. |
1907
+ `-----------------------------------------------------------*/
1908
+ yyexhaustedlab:
1909
+ yyerror (qp, encoding, YY_("memory exhausted"));
1910
+ yyresult = 2;
1911
+ goto yyreturnlab;
1912
+
1913
+
1914
+ /*----------------------------------------------------------.
1915
+ | yyreturnlab -- parsing is finished, clean up and return. |
1916
+ `----------------------------------------------------------*/
1917
+ yyreturnlab:
1918
+ if (yychar != YYEMPTY)
1919
+ {
1920
+ /* Make sure we have latest lookahead translation. See comments at
1921
+ user semantic actions for why this is necessary. */
1922
+ yytoken = YYTRANSLATE (yychar);
1923
+ yydestruct ("Cleanup: discarding lookahead",
1924
+ yytoken, &yylval, qp, encoding);
1925
+ }
1926
+ /* Do not reclaim the symbols of the rule whose action triggered
1927
+ this YYABORT or YYACCEPT. */
1928
+ YYPOPSTACK (yylen);
1929
+ YY_STACK_PRINT (yyss, yyssp);
1930
+ while (yyssp != yyss)
1931
+ {
1932
+ yydestruct ("Cleanup: popping",
1933
+ YY_ACCESSING_SYMBOL (+*yyssp), yyvsp, qp, encoding);
1934
+ YYPOPSTACK (1);
1935
+ }
1936
+ #ifndef yyoverflow
1937
+ if (yyss != yyssa)
1938
+ YYSTACK_FREE (yyss);
1939
+ #endif
1940
+
1941
+ return yyresult;
1942
+ }
1943
+
1944
+ #line 287 "frt_q_parser.y"
1945
1945
 
1946
1946
 
1947
1947
  static const char *special_char = "&:()[]{}!\"~^|<>=*?+-";
@@ -2801,6 +2801,7 @@ FrtQParser *frt_qp_init(FrtQParser *self, FrtAnalyzer *analyzer) {
2801
2801
  qp_push_fields(self, self->def_fields, false);
2802
2802
 
2803
2803
  self->analyzer = analyzer;
2804
+ if (analyzer) FRT_REF(analyzer);
2804
2805
  self->ts_cache = frt_h_new_ptr((frt_free_ft)&frt_ts_deref);
2805
2806
  self->buf_index = 0;
2806
2807
  self->dynbuf = NULL;