isomorfeus-ferret 0.12.2 → 0.12.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +612 -612
- data/README.md +80 -44
- data/ext/isomorfeus_ferret_ext/bm_hash.c +9 -6
- data/ext/isomorfeus_ferret_ext/bm_micro_string.c +4 -2
- data/ext/isomorfeus_ferret_ext/frb_search.c +14 -2
- data/ext/isomorfeus_ferret_ext/frb_store.c +34 -5
- data/ext/isomorfeus_ferret_ext/frt_posh.h +11 -19
- data/ext/isomorfeus_ferret_ext/frt_q_parser.c +1844 -1911
- data/ext/isomorfeus_ferret_ext/frt_q_phrase.c +12 -15
- data/ext/isomorfeus_ferret_ext/frt_scanner.c +1 -0
- data/ext/isomorfeus_ferret_ext/frt_scanner_mb.c +1 -0
- data/ext/isomorfeus_ferret_ext/frt_scanner_utf8.c +1 -0
- data/ext/isomorfeus_ferret_ext/frt_search.h +1 -1
- data/ext/isomorfeus_ferret_ext/libstemmer.c +14 -11
- data/ext/isomorfeus_ferret_ext/libstemmer.h +4 -9
- data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_basque.c +1167 -0
- data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_basque.h +6 -0
- data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_catalan.c +1433 -0
- data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_catalan.h +6 -0
- data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_danish.c +120 -143
- data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_danish.h +1 -2
- data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_dutch.c +217 -237
- data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_dutch.h +1 -1
- data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_english.c +377 -432
- data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_english.h +1 -1
- data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_finnish.c +298 -342
- data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_finnish.h +1 -2
- data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_french.c +530 -524
- data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_french.h +1 -1
- data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_german.c +201 -214
- data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_german.h +1 -1
- data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_hungarian.c +1 -1
- data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_indonesian.c +394 -0
- data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_indonesian.h +6 -0
- data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_irish.c +457 -0
- data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_irish.h +6 -0
- data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_italian.c +396 -439
- data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_italian.h +1 -1
- data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_norwegian.c +104 -128
- data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_norwegian.h +1 -1
- data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_porter.c +242 -273
- data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_porter.h +1 -1
- data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_portuguese.c +406 -461
- data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_portuguese.h +1 -2
- data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_spanish.c +405 -456
- data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_spanish.h +1 -1
- data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_swedish.c +108 -126
- data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_swedish.h +1 -1
- data/ext/isomorfeus_ferret_ext/stem_ISO_8859_2_hungarian.c +849 -0
- data/ext/isomorfeus_ferret_ext/stem_ISO_8859_2_hungarian.h +6 -0
- data/ext/isomorfeus_ferret_ext/stem_ISO_8859_2_romanian.c +373 -405
- data/ext/isomorfeus_ferret_ext/stem_ISO_8859_2_romanian.h +1 -1
- data/ext/isomorfeus_ferret_ext/stem_KOI8_R_russian.c +288 -305
- data/ext/isomorfeus_ferret_ext/stem_KOI8_R_russian.h +1 -1
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_arabic.c +1651 -0
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_arabic.h +6 -0
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_armenian.c +546 -0
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_armenian.h +6 -0
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_basque.c +1171 -0
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_basque.h +6 -0
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_catalan.c +1436 -0
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_catalan.h +6 -0
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_danish.c +121 -141
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_danish.h +1 -1
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_dutch.c +221 -241
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_dutch.h +1 -1
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_english.c +381 -431
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_english.h +1 -1
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_finnish.c +300 -345
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_finnish.h +1 -1
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_french.c +518 -511
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_french.h +1 -1
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_german.c +201 -209
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_german.h +1 -1
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_greek.c +3660 -0
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_greek.h +6 -0
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_hindi.c +309 -0
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_hindi.h +6 -0
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_hungarian.c +306 -671
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_hungarian.h +1 -1
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_indonesian.c +394 -0
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_indonesian.h +6 -0
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_irish.c +457 -0
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_irish.h +6 -0
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_italian.c +400 -442
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_italian.h +1 -1
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_lithuanian.c +824 -0
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_lithuanian.h +6 -0
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_nepali.c +408 -0
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_nepali.h +6 -0
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_norwegian.c +105 -127
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_norwegian.h +1 -1
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_porter.c +245 -276
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_porter.h +1 -1
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_portuguese.c +409 -464
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_portuguese.h +1 -1
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_romanian.c +376 -408
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_romanian.h +1 -1
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_russian.c +272 -287
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_russian.h +1 -1
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_serbian.c +6530 -0
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_serbian.h +6 -0
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_spanish.c +407 -458
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_spanish.h +1 -1
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_swedish.c +110 -125
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_swedish.h +1 -1
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_tamil.c +1865 -0
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_tamil.h +6 -0
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_turkish.c +698 -806
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_turkish.h +1 -1
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_yiddish.c +1220 -0
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_yiddish.h +6 -0
- data/ext/isomorfeus_ferret_ext/stem_api.c +1 -9
- data/ext/isomorfeus_ferret_ext/stem_api.h +1 -3
- data/ext/isomorfeus_ferret_ext/stem_header.h +30 -26
- data/ext/isomorfeus_ferret_ext/stem_modules.h +113 -26
- data/ext/isomorfeus_ferret_ext/stem_modules.txt +18 -5
- data/ext/isomorfeus_ferret_ext/stem_utilities.c +167 -132
- data/ext/isomorfeus_ferret_ext/test.c +7 -1
- data/ext/isomorfeus_ferret_ext/test_search.c +0 -1
- data/lib/isomorfeus/ferret/index/index.rb +1 -1
- data/lib/isomorfeus/ferret/version.rb +1 -1
- metadata +43 -7
- data/ext/isomorfeus_ferret_ext/q_parser.y +0 -1366
@@ -1,91 +1,157 @@
|
|
1
|
-
/* A Bison parser, made by GNU Bison 2.
|
2
|
-
|
3
|
-
/*
|
4
|
-
|
5
|
-
Copyright (C) 1984, 1989
|
6
|
-
|
7
|
-
|
8
|
-
This program is free software
|
9
|
-
it under the terms of the GNU General Public License as published by
|
10
|
-
the Free Software Foundation
|
11
|
-
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
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
parser
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
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
|
+
|
72
|
+
/*****************************************************************************
|
73
|
+
* QueryParser
|
74
|
+
* ===========
|
75
|
+
*
|
76
|
+
* Brief Overview
|
77
|
+
* --------------
|
78
|
+
*
|
79
|
+
* === Creating a QueryParser
|
80
|
+
*
|
81
|
+
* +qp_new+ allocates a new QueryParser and assigns three very important
|
82
|
+
* HashSets; +qp->def_fields+, +qp->tkz_fields+ and +qp->all_fields+. The
|
83
|
+
* query language allows you to assign a field or a set of fields to each
|
84
|
+
* part of the query.
|
85
|
+
*
|
86
|
+
* - +qp->def_fields+ is the set of fields that a query is applied to by
|
87
|
+
* default when no fields are specified.
|
88
|
+
* - +qp->all_fields+ is the set of fields that gets searched when the user
|
89
|
+
* requests a search of all fields.
|
90
|
+
* - +qp->tkz_fields+ is the set of fields that gets tokenized before being
|
91
|
+
* added to the query parser.
|
92
|
+
*
|
93
|
+
* === qp_parse
|
94
|
+
*
|
95
|
+
* The main QueryParser method is +qp_parse+. It gets called with a the query
|
96
|
+
* string and returns a Query object which can then be passed to the
|
97
|
+
* IndexSearcher. The first thing it does is to clean the query string if
|
98
|
+
* +qp->clean_str+ is set to true. The cleaning is done with the
|
99
|
+
* +qp_clean_str+.
|
100
|
+
*
|
101
|
+
* It then calls the yacc parser which will set +qp->result+ to the parsed
|
102
|
+
* query. If parsing fails in any way, +qp->result+ should be set to NULL, in
|
103
|
+
* which case qp_parse does one of two things depending on the value of
|
104
|
+
* +qp->handle_parse_errors+;
|
105
|
+
*
|
106
|
+
* - If it is set to true, qp_parse attempts to do a very basic parsing of
|
107
|
+
* the query by ignoring all special characters and parsing the query as
|
108
|
+
* a plain boolean query.
|
109
|
+
* - If it is set to false, qp_parse will raise a PARSE_ERROR and hopefully
|
110
|
+
* free all allocated memory.
|
111
|
+
*
|
112
|
+
* === The Lexer
|
113
|
+
*
|
114
|
+
* +yylex+ is the lexing method called by the QueryParser. It breaks the
|
115
|
+
* query up into special characters;
|
116
|
+
*
|
117
|
+
* ( "&:()[]{}!\"~^|<>=*?+-" )
|
118
|
+
*
|
119
|
+
* and tokens;
|
120
|
+
*
|
121
|
+
* - QWRD
|
122
|
+
* - WILD_STR
|
123
|
+
* - AND['AND', '&&']
|
124
|
+
* - OR['OR', '||']
|
125
|
+
* - REQ['REQ', '+']
|
126
|
+
* - NOT['NOT', '-', '~']
|
127
|
+
*
|
128
|
+
* QWRD tokens are query word tokens which are made up of characters other
|
129
|
+
* than the special characters. They can also contain special characters when
|
130
|
+
* escaped with a backslash '\'. WILD_STR is the same as QWRD except that it
|
131
|
+
* may also contain '?' and '*' characters.
|
132
|
+
*
|
133
|
+
* === The Parser
|
134
|
+
*
|
135
|
+
* For a better understanding of the how the query parser works, it is a good
|
136
|
+
* idea to study the Ferret Query Language (FQL) described below. Once you
|
137
|
+
* understand FQL the one tricky part that needs to be mentioned is how
|
138
|
+
* fields are handled. This is where +qp->def_fields+ and +qp->all_fields
|
139
|
+
* come into play. When no fields are specified then the default fields are
|
140
|
+
* used. The '*:' field specifier will search all fields contained in the
|
141
|
+
* all_fields set. Otherwise all fields specified in the field descripter
|
142
|
+
* separated by '|' will be searched. For example 'title|content:' will
|
143
|
+
* search the title and content fields. When fields are specified like this,
|
144
|
+
* the parser will push the fields onto a stack and all queries modified by
|
145
|
+
* the field specifier will be applied to the fields on top of the stack.
|
146
|
+
* The parser uses the FLDS macro to handle the current fields. It takes the
|
147
|
+
* current query building function in the parser and calls it for all the
|
148
|
+
* current search fields (on top of the stack).
|
149
|
+
*
|
150
|
+
* Ferret Query Language (FQL)
|
151
|
+
* ---------------------------
|
152
|
+
*
|
153
|
+
* FIXME to be continued...
|
154
|
+
*****************************************************************************/
|
89
155
|
|
90
156
|
#include <string.h>
|
91
157
|
#include <ctype.h>
|
@@ -104,71 +170,162 @@ typedef struct Phrase {
|
|
104
170
|
} Phrase;
|
105
171
|
|
106
172
|
#define BCA_INIT_CAPA 4
|
107
|
-
typedef struct
|
173
|
+
typedef struct FrtBCArray {
|
108
174
|
int size;
|
109
175
|
int capa;
|
110
176
|
FrtBooleanClause **clauses;
|
111
|
-
}
|
177
|
+
} FrtBCArray;
|
112
178
|
|
113
179
|
float frt_qp_default_fuzzy_min_sim = 0.5;
|
114
180
|
int frt_qp_default_fuzzy_pre_len = 0;
|
115
181
|
|
182
|
+
|
183
|
+
#line 184 "frt_q_parser.c"
|
184
|
+
|
185
|
+
# ifndef YY_CAST
|
186
|
+
# ifdef __cplusplus
|
187
|
+
# define YY_CAST(Type, Val) static_cast<Type> (Val)
|
188
|
+
# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
|
189
|
+
# else
|
190
|
+
# define YY_CAST(Type, Val) ((Type) (Val))
|
191
|
+
# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
|
192
|
+
# endif
|
193
|
+
# endif
|
194
|
+
# ifndef YY_NULLPTR
|
195
|
+
# if defined __cplusplus
|
196
|
+
# if 201103L <= __cplusplus
|
197
|
+
# define YY_NULLPTR nullptr
|
198
|
+
# else
|
199
|
+
# define YY_NULLPTR 0
|
200
|
+
# endif
|
201
|
+
# else
|
202
|
+
# define YY_NULLPTR ((void*)0)
|
203
|
+
# endif
|
204
|
+
# endif
|
205
|
+
|
206
|
+
|
207
|
+
/* Debug traces. */
|
208
|
+
#ifndef YYDEBUG
|
209
|
+
# define YYDEBUG 0
|
210
|
+
#endif
|
211
|
+
#if YYDEBUG
|
212
|
+
extern int yydebug;
|
213
|
+
#endif
|
214
|
+
|
215
|
+
/* Token kinds. */
|
216
|
+
#ifndef YYTOKENTYPE
|
217
|
+
# define YYTOKENTYPE
|
218
|
+
enum yytokentype
|
219
|
+
{
|
220
|
+
YYEMPTY = -2,
|
221
|
+
YYEOF = 0, /* "end of file" */
|
222
|
+
YYerror = 256, /* error */
|
223
|
+
YYUNDEF = 257, /* "invalid token" */
|
224
|
+
QWRD = 258, /* QWRD */
|
225
|
+
WILD_STR = 259, /* WILD_STR */
|
226
|
+
LOW = 260, /* LOW */
|
227
|
+
AND = 261, /* AND */
|
228
|
+
OR = 262, /* OR */
|
229
|
+
REQ = 263, /* REQ */
|
230
|
+
NOT = 264, /* NOT */
|
231
|
+
HIGH = 265 /* HIGH */
|
232
|
+
};
|
233
|
+
typedef enum yytokentype yytoken_kind_t;
|
234
|
+
#endif
|
235
|
+
|
236
|
+
/* Value type. */
|
237
|
+
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
|
238
|
+
union YYSTYPE
|
239
|
+
{
|
240
|
+
#line 113 "frt_q_parser.y"
|
116
241
|
|
117
|
-
|
118
|
-
/* Enabling traces. */
|
119
|
-
#ifndef YYDEBUG
|
120
|
-
# define YYDEBUG 0
|
121
|
-
#endif
|
122
|
-
|
123
|
-
/* Enabling verbose error messages. */
|
124
|
-
#ifdef YYERROR_VERBOSE
|
125
|
-
# undef YYERROR_VERBOSE
|
126
|
-
# define YYERROR_VERBOSE 1
|
127
|
-
#else
|
128
|
-
# define YYERROR_VERBOSE 0
|
129
|
-
#endif
|
130
|
-
|
131
|
-
/* Enabling the token table. */
|
132
|
-
#ifndef YYTOKEN_TABLE
|
133
|
-
# define YYTOKEN_TABLE 0
|
134
|
-
#endif
|
135
|
-
|
136
|
-
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
|
137
|
-
typedef union YYSTYPE
|
138
|
-
#line 113 "src/q_parser.y"
|
139
|
-
{
|
140
242
|
FrtQuery *query;
|
141
243
|
FrtBooleanClause *bcls;
|
142
|
-
|
244
|
+
FrtBCArray *bclss;
|
143
245
|
FrtHashSet *hashset;
|
144
246
|
Phrase *phrase;
|
145
247
|
char *str;
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
# define
|
152
|
-
# define
|
153
|
-
#endif
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
248
|
+
|
249
|
+
#line 250 "frt_q_parser.c"
|
250
|
+
|
251
|
+
};
|
252
|
+
typedef union YYSTYPE YYSTYPE;
|
253
|
+
# define YYSTYPE_IS_TRIVIAL 1
|
254
|
+
# define YYSTYPE_IS_DECLARED 1
|
255
|
+
#endif
|
256
|
+
|
257
|
+
|
258
|
+
|
259
|
+
|
260
|
+
int yyparse (FrtQParser *qp);
|
261
|
+
|
262
|
+
|
263
|
+
|
264
|
+
/* Symbol kind. */
|
265
|
+
enum yysymbol_kind_t
|
266
|
+
{
|
267
|
+
YYSYMBOL_YYEMPTY = -2,
|
268
|
+
YYSYMBOL_YYEOF = 0, /* "end of file" */
|
269
|
+
YYSYMBOL_YYerror = 1, /* error */
|
270
|
+
YYSYMBOL_YYUNDEF = 2, /* "invalid token" */
|
271
|
+
YYSYMBOL_QWRD = 3, /* QWRD */
|
272
|
+
YYSYMBOL_WILD_STR = 4, /* WILD_STR */
|
273
|
+
YYSYMBOL_LOW = 5, /* LOW */
|
274
|
+
YYSYMBOL_AND = 6, /* AND */
|
275
|
+
YYSYMBOL_OR = 7, /* OR */
|
276
|
+
YYSYMBOL_REQ = 8, /* REQ */
|
277
|
+
YYSYMBOL_NOT = 9, /* NOT */
|
278
|
+
YYSYMBOL_10_ = 10, /* ':' */
|
279
|
+
YYSYMBOL_HIGH = 11, /* HIGH */
|
280
|
+
YYSYMBOL_12_ = 12, /* '^' */
|
281
|
+
YYSYMBOL_13_ = 13, /* '(' */
|
282
|
+
YYSYMBOL_14_ = 14, /* ')' */
|
283
|
+
YYSYMBOL_15_ = 15, /* '~' */
|
284
|
+
YYSYMBOL_16_ = 16, /* '*' */
|
285
|
+
YYSYMBOL_17_ = 17, /* '|' */
|
286
|
+
YYSYMBOL_18_ = 18, /* '"' */
|
287
|
+
YYSYMBOL_19_ = 19, /* '<' */
|
288
|
+
YYSYMBOL_20_ = 20, /* '>' */
|
289
|
+
YYSYMBOL_21_ = 21, /* '[' */
|
290
|
+
YYSYMBOL_22_ = 22, /* ']' */
|
291
|
+
YYSYMBOL_23_ = 23, /* '}' */
|
292
|
+
YYSYMBOL_24_ = 24, /* '{' */
|
293
|
+
YYSYMBOL_25_ = 25, /* '=' */
|
294
|
+
YYSYMBOL_YYACCEPT = 26, /* $accept */
|
295
|
+
YYSYMBOL_bool_q = 27, /* bool_q */
|
296
|
+
YYSYMBOL_bool_clss = 28, /* bool_clss */
|
297
|
+
YYSYMBOL_bool_cls = 29, /* bool_cls */
|
298
|
+
YYSYMBOL_boosted_q = 30, /* boosted_q */
|
299
|
+
YYSYMBOL_q = 31, /* q */
|
300
|
+
YYSYMBOL_term_q = 32, /* term_q */
|
301
|
+
YYSYMBOL_wild_q = 33, /* wild_q */
|
302
|
+
YYSYMBOL_field_q = 34, /* field_q */
|
303
|
+
YYSYMBOL_35_1 = 35, /* $@1 */
|
304
|
+
YYSYMBOL_36_2 = 36, /* $@2 */
|
305
|
+
YYSYMBOL_37_3 = 37, /* $@3 */
|
306
|
+
YYSYMBOL_field = 38, /* field */
|
307
|
+
YYSYMBOL_phrase_q = 39, /* phrase_q */
|
308
|
+
YYSYMBOL_ph_words = 40, /* ph_words */
|
309
|
+
YYSYMBOL_range_q = 41 /* range_q */
|
310
|
+
};
|
311
|
+
typedef enum yysymbol_kind_t yysymbol_kind_t;
|
312
|
+
|
313
|
+
|
314
|
+
/* Second part of user prologue. */
|
315
|
+
#line 121 "frt_q_parser.y"
|
159
316
|
|
160
317
|
static int yylex(YYSTYPE *lvalp, FrtQParser *qp);
|
161
318
|
static int yyerror(FrtQParser *qp, char const *msg);
|
162
319
|
|
163
320
|
#define PHRASE_INIT_CAPA 4
|
164
|
-
static FrtQuery *get_bool_q(
|
321
|
+
static FrtQuery *get_bool_q(FrtBCArray *bca);
|
165
322
|
|
166
|
-
static
|
167
|
-
static
|
168
|
-
static
|
169
|
-
static
|
323
|
+
static FrtBCArray *first_cls(FrtBooleanClause *boolean_clause);
|
324
|
+
static FrtBCArray *add_and_cls(FrtBCArray *bca, FrtBooleanClause *clause);
|
325
|
+
static FrtBCArray *add_or_cls(FrtBCArray *bca, FrtBooleanClause *clause);
|
326
|
+
static FrtBCArray *add_default_cls(FrtQParser *qp, FrtBCArray *bca,
|
170
327
|
FrtBooleanClause *clause);
|
171
|
-
static void bca_destroy(
|
328
|
+
static void bca_destroy(FrtBCArray *bca);
|
172
329
|
|
173
330
|
static FrtBooleanClause *get_bool_cls(FrtQuery *q, FrtBCType occur);
|
174
331
|
|
@@ -240,1773 +397,1549 @@ static void qp_pop_fields(FrtQParser *self);
|
|
240
397
|
FRT_HANDLED();\
|
241
398
|
FRT_XENDTRY\
|
242
399
|
if (qp->destruct) Y;
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
#
|
249
|
-
#
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
#
|
257
|
-
|
258
|
-
#
|
259
|
-
|
260
|
-
#
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
#
|
281
|
-
|
282
|
-
#
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
#
|
290
|
-
#
|
291
|
-
#
|
292
|
-
|
293
|
-
#define
|
294
|
-
|
295
|
-
|
296
|
-
#
|
297
|
-
|
298
|
-
#
|
299
|
-
|
300
|
-
|
301
|
-
#
|
302
|
-
|
303
|
-
#
|
304
|
-
|
305
|
-
#endif
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
#
|
310
|
-
|
311
|
-
|
312
|
-
#
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
#
|
317
|
-
|
318
|
-
#
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
#
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
#
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
#
|
331
|
-
|
332
|
-
#
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
#
|
337
|
-
#
|
338
|
-
#
|
339
|
-
#
|
340
|
-
#
|
341
|
-
#
|
342
|
-
#
|
343
|
-
#
|
344
|
-
#
|
345
|
-
#
|
346
|
-
|
347
|
-
#
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
#
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
#
|
363
|
-
#
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
#
|
369
|
-
#
|
370
|
-
#
|
371
|
-
#
|
372
|
-
#
|
373
|
-
|
374
|
-
|
375
|
-
#
|
376
|
-
#
|
377
|
-
|
378
|
-
|
379
|
-
#
|
380
|
-
#
|
381
|
-
#
|
382
|
-
|
383
|
-
#
|
384
|
-
#
|
385
|
-
#
|
386
|
-
#
|
387
|
-
|
388
|
-
|
389
|
-
#
|
390
|
-
|
391
|
-
|
392
|
-
#
|
393
|
-
#
|
394
|
-
|
395
|
-
|
396
|
-
#
|
397
|
-
|
398
|
-
|
399
|
-
#
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
#
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
#
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
#
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
#
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
#
|
439
|
-
|
440
|
-
/*
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
#
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
#
|
457
|
-
|
458
|
-
|
459
|
-
#define
|
460
|
-
|
461
|
-
#
|
462
|
-
|
463
|
-
|
464
|
-
#
|
465
|
-
|
466
|
-
#
|
467
|
-
/*
|
468
|
-
#define
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
#define
|
475
|
-
|
476
|
-
#
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
/*
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
#
|
572
|
-
/*
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
#
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
|
594
|
-
|
595
|
-
|
596
|
-
|
597
|
-
|
598
|
-
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
2,
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
|
621
|
-
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
|
628
|
-
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
|
633
|
-
|
634
|
-
|
635
|
-
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
|
641
|
-
|
642
|
-
static const
|
643
|
-
|
644
|
-
|
645
|
-
|
646
|
-
|
647
|
-
|
648
|
-
|
649
|
-
|
650
|
-
|
651
|
-
|
652
|
-
|
653
|
-
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
|
660
|
-
|
661
|
-
|
662
|
-
|
663
|
-
|
664
|
-
|
665
|
-
|
666
|
-
|
667
|
-
|
668
|
-
|
669
|
-
|
670
|
-
|
671
|
-
|
672
|
-
|
673
|
-
|
674
|
-
|
675
|
-
|
676
|
-
|
677
|
-
|
678
|
-
|
679
|
-
|
680
|
-
|
681
|
-
|
682
|
-
|
683
|
-
|
684
|
-
|
685
|
-
};
|
686
|
-
|
687
|
-
/*
|
688
|
-
|
689
|
-
|
690
|
-
|
691
|
-
|
692
|
-
|
693
|
-
|
694
|
-
|
695
|
-
|
696
|
-
|
697
|
-
|
698
|
-
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
|
705
|
-
|
706
|
-
|
707
|
-
|
708
|
-
|
709
|
-
|
710
|
-
|
711
|
-
|
712
|
-
|
713
|
-
|
714
|
-
|
715
|
-
|
716
|
-
|
717
|
-
|
718
|
-
|
719
|
-
|
720
|
-
|
721
|
-
|
722
|
-
|
723
|
-
|
724
|
-
|
725
|
-
|
726
|
-
|
727
|
-
|
728
|
-
|
729
|
-
|
730
|
-
|
731
|
-
|
732
|
-
|
733
|
-
|
734
|
-
|
735
|
-
|
736
|
-
|
737
|
-
|
738
|
-
|
739
|
-
|
740
|
-
|
741
|
-
|
742
|
-
|
743
|
-
|
744
|
-
|
745
|
-
|
746
|
-
|
747
|
-
|
748
|
-
|
749
|
-
|
750
|
-
|
751
|
-
|
752
|
-
|
753
|
-
|
754
|
-
|
755
|
-
|
756
|
-
|
757
|
-
|
758
|
-
|
759
|
-
|
760
|
-
|
761
|
-
|
762
|
-
|
763
|
-
|
764
|
-
|
765
|
-
|
766
|
-
|
767
|
-
/*
|
768
|
-
|
769
|
-
|
770
|
-
|
771
|
-
|
772
|
-
|
773
|
-
|
774
|
-
|
775
|
-
|
776
|
-
|
777
|
-
|
778
|
-
|
779
|
-
|
780
|
-
|
781
|
-
|
782
|
-
|
783
|
-
|
784
|
-
|
785
|
-
|
786
|
-
|
787
|
-
|
788
|
-
|
789
|
-
|
790
|
-
|
791
|
-
|
792
|
-
#
|
793
|
-
|
794
|
-
|
795
|
-
#
|
796
|
-
#
|
797
|
-
#
|
798
|
-
|
799
|
-
|
800
|
-
|
801
|
-
|
802
|
-
|
803
|
-
|
804
|
-
|
805
|
-
|
806
|
-
|
807
|
-
|
808
|
-
|
809
|
-
|
810
|
-
|
811
|
-
|
812
|
-
|
813
|
-
|
814
|
-
|
815
|
-
|
816
|
-
|
817
|
-
|
818
|
-
|
819
|
-
|
820
|
-
|
821
|
-
|
822
|
-
#
|
823
|
-
|
824
|
-
|
825
|
-
|
826
|
-
#
|
827
|
-
|
828
|
-
|
829
|
-
|
830
|
-
|
831
|
-
|
832
|
-
|
833
|
-
#
|
834
|
-
{
|
835
|
-
if (
|
836
|
-
|
837
|
-
|
838
|
-
|
839
|
-
|
840
|
-
|
841
|
-
|
842
|
-
|
843
|
-
|
844
|
-
|
845
|
-
{
|
846
|
-
|
847
|
-
|
848
|
-
|
849
|
-
|
850
|
-
|
851
|
-
|
852
|
-
|
853
|
-
|
854
|
-
|
855
|
-
|
856
|
-
|
857
|
-
|
858
|
-
static void
|
859
|
-
|
860
|
-
|
861
|
-
|
862
|
-
|
863
|
-
|
864
|
-
|
865
|
-
|
866
|
-
|
867
|
-
|
868
|
-
|
869
|
-
|
870
|
-
|
871
|
-
|
872
|
-
|
873
|
-
|
874
|
-
|
875
|
-
|
876
|
-
|
877
|
-
|
878
|
-
|
879
|
-
|
880
|
-
|
881
|
-
|
882
|
-
|
883
|
-
|
884
|
-
|
885
|
-
|
886
|
-
|
887
|
-
|
888
|
-
|
889
|
-
yy_stack_print
|
890
|
-
|
891
|
-
|
892
|
-
|
893
|
-
|
894
|
-
|
895
|
-
|
896
|
-
|
897
|
-
|
898
|
-
|
899
|
-
|
900
|
-
|
901
|
-
|
902
|
-
|
903
|
-
|
904
|
-
|
905
|
-
|
906
|
-
|
907
|
-
|
908
|
-
|
909
|
-
|
910
|
-
|
911
|
-
|
912
|
-
|
913
|
-
|
914
|
-
|
915
|
-
|
916
|
-
static void
|
917
|
-
yy_reduce_print (
|
918
|
-
|
919
|
-
|
920
|
-
|
921
|
-
|
922
|
-
|
923
|
-
|
924
|
-
|
925
|
-
|
926
|
-
|
927
|
-
|
928
|
-
|
929
|
-
|
930
|
-
|
931
|
-
|
932
|
-
|
933
|
-
|
934
|
-
|
935
|
-
|
936
|
-
|
937
|
-
|
938
|
-
|
939
|
-
|
940
|
-
|
941
|
-
|
942
|
-
|
943
|
-
|
944
|
-
|
945
|
-
/*
|
946
|
-
|
947
|
-
|
948
|
-
#
|
949
|
-
# define
|
950
|
-
#
|
951
|
-
|
952
|
-
|
953
|
-
|
954
|
-
|
955
|
-
|
956
|
-
|
957
|
-
|
958
|
-
|
959
|
-
|
960
|
-
|
961
|
-
|
962
|
-
|
963
|
-
|
964
|
-
|
965
|
-
|
966
|
-
|
967
|
-
|
968
|
-
|
969
|
-
|
970
|
-
|
971
|
-
|
972
|
-
|
973
|
-
|
974
|
-
|
975
|
-
|
976
|
-
|
977
|
-
|
978
|
-
|
979
|
-
|
980
|
-
|
981
|
-
|
982
|
-
|
983
|
-
|
984
|
-
|
985
|
-
|
986
|
-
|
987
|
-
|
988
|
-
|
989
|
-
|
990
|
-
{
|
991
|
-
|
992
|
-
|
993
|
-
|
994
|
-
|
995
|
-
|
996
|
-
|
997
|
-
|
998
|
-
|
999
|
-
|
1000
|
-
#
|
1001
|
-
|
1002
|
-
|
1003
|
-
|
1004
|
-
|
1005
|
-
|
1006
|
-
|
1007
|
-
|
1008
|
-
|
1009
|
-
|
1010
|
-
|
1011
|
-
|
1012
|
-
|
1013
|
-
|
1014
|
-
|
1015
|
-
|
1016
|
-
|
1017
|
-
|
1018
|
-
|
1019
|
-
|
1020
|
-
|
1021
|
-
|
1022
|
-
|
1023
|
-
}
|
1024
|
-
#
|
1025
|
-
|
1026
|
-
|
1027
|
-
|
1028
|
-
|
1029
|
-
|
1030
|
-
|
1031
|
-
|
1032
|
-
|
1033
|
-
|
1034
|
-
|
1035
|
-
|
1036
|
-
|
1037
|
-
|
1038
|
-
|
1039
|
-
|
1040
|
-
|
1041
|
-
|
1042
|
-
|
1043
|
-
|
1044
|
-
|
1045
|
-
|
1046
|
-
|
1047
|
-
|
1048
|
-
|
1049
|
-
|
1050
|
-
|
1051
|
-
|
1052
|
-
|
1053
|
-
|
1054
|
-
|
1055
|
-
|
1056
|
-
|
1057
|
-
|
1058
|
-
|
1059
|
-
|
1060
|
-
|
1061
|
-
|
1062
|
-
|
1063
|
-
|
1064
|
-
|
1065
|
-
|
1066
|
-
|
1067
|
-
|
1068
|
-
|
1069
|
-
|
1070
|
-
|
1071
|
-
|
1072
|
-
|
1073
|
-
|
1074
|
-
|
1075
|
-
/*
|
1076
|
-
|
1077
|
-
|
1078
|
-
|
1079
|
-
|
1080
|
-
|
1081
|
-
|
1082
|
-
static
|
1083
|
-
|
1084
|
-
|
1085
|
-
|
1086
|
-
|
1087
|
-
|
1088
|
-
|
1089
|
-
|
1090
|
-
|
1091
|
-
|
1092
|
-
|
1093
|
-
|
1094
|
-
|
1095
|
-
|
1096
|
-
|
1097
|
-
|
1098
|
-
|
1099
|
-
|
1100
|
-
|
1101
|
-
|
1102
|
-
|
1103
|
-
|
1104
|
-
|
1105
|
-
|
1106
|
-
|
1107
|
-
|
1108
|
-
|
1109
|
-
|
1110
|
-
|
1111
|
-
|
1112
|
-
|
1113
|
-
|
1114
|
-
|
1115
|
-
|
1116
|
-
|
1117
|
-
|
1118
|
-
|
1119
|
-
|
1120
|
-
|
1121
|
-
|
1122
|
-
|
1123
|
-
|
1124
|
-
|
1125
|
-
|
1126
|
-
|
1127
|
-
|
1128
|
-
|
1129
|
-
|
1130
|
-
|
1131
|
-
|
1132
|
-
|
1133
|
-
|
1134
|
-
|
1135
|
-
|
1136
|
-
|
1137
|
-
|
1138
|
-
|
1139
|
-
|
1140
|
-
|
1141
|
-
|
1142
|
-
|
1143
|
-
|
1144
|
-
|
1145
|
-
|
1146
|
-
|
1147
|
-
|
1148
|
-
|
1149
|
-
|
1150
|
-
|
1151
|
-
|
1152
|
-
|
1153
|
-
|
1154
|
-
|
1155
|
-
|
1156
|
-
|
1157
|
-
|
1158
|
-
|
1159
|
-
|
1160
|
-
|
1161
|
-
|
1162
|
-
|
1163
|
-
|
1164
|
-
|
1165
|
-
|
1166
|
-
|
1167
|
-
|
1168
|
-
|
1169
|
-
|
1170
|
-
|
1171
|
-
|
1172
|
-
|
1173
|
-
|
1174
|
-
|
1175
|
-
|
1176
|
-
|
1177
|
-
|
1178
|
-
|
1179
|
-
|
1180
|
-
|
1181
|
-
|
1182
|
-
|
1183
|
-
|
1184
|
-
|
1185
|
-
|
1186
|
-
|
1187
|
-
|
1188
|
-
|
1189
|
-
|
1190
|
-
|
1191
|
-
|
1192
|
-
|
1193
|
-
|
1194
|
-
|
1195
|
-
|
1196
|
-
|
1197
|
-
|
1198
|
-
|
1199
|
-
|
1200
|
-
|
1201
|
-
|
1202
|
-
|
1203
|
-
|
1204
|
-
|
1205
|
-
|
1206
|
-
|
1207
|
-
|
1208
|
-
|
1209
|
-
|
1210
|
-
|
1211
|
-
|
1212
|
-
|
1213
|
-
#
|
1214
|
-
|
1215
|
-
|
1216
|
-
|
1217
|
-
|
1218
|
-
|
1219
|
-
|
1220
|
-
|
1221
|
-
|
1222
|
-
|
1223
|
-
|
1224
|
-
|
1225
|
-
|
1226
|
-
|
1227
|
-
|
1228
|
-
|
1229
|
-
|
1230
|
-
|
1231
|
-
|
1232
|
-
|
1233
|
-
|
1234
|
-
|
1235
|
-
|
1236
|
-
|
1237
|
-
|
1238
|
-
|
1239
|
-
|
1240
|
-
|
1241
|
-
|
1242
|
-
|
1243
|
-
|
1244
|
-
|
1245
|
-
|
1246
|
-
|
1247
|
-
|
1248
|
-
|
1249
|
-
|
1250
|
-
|
1251
|
-
|
1252
|
-
|
1253
|
-
|
1254
|
-
|
1255
|
-
|
1256
|
-
|
1257
|
-
|
1258
|
-
|
1259
|
-
|
1260
|
-
|
1261
|
-
|
1262
|
-
|
1263
|
-
|
1264
|
-
|
1265
|
-
|
1266
|
-
|
1267
|
-
|
1268
|
-
|
1269
|
-
|
1270
|
-
|
1271
|
-
|
1272
|
-
|
1273
|
-
|
1274
|
-
|
1275
|
-
|
1276
|
-
|
1277
|
-
|
1278
|
-
|
1279
|
-
|
1280
|
-
|
1281
|
-
|
1282
|
-
|
1283
|
-
|
1284
|
-
|
1285
|
-
|
1286
|
-
|
1287
|
-
|
1288
|
-
|
1289
|
-
|
1290
|
-
|
1291
|
-
|
1292
|
-
|
1293
|
-
|
1294
|
-
|
1295
|
-
|
1296
|
-
|
1297
|
-
|
1298
|
-
|
1299
|
-
|
1300
|
-
|
1301
|
-
|
1302
|
-
|
1303
|
-
|
1304
|
-
|
1305
|
-
|
1306
|
-
|
1307
|
-
|
1308
|
-
|
1309
|
-
|
1310
|
-
|
1311
|
-
|
1312
|
-
|
1313
|
-
|
1314
|
-
|
1315
|
-
|
1316
|
-
|
1317
|
-
|
1318
|
-
|
1319
|
-
|
1320
|
-
|
1321
|
-
|
1322
|
-
|
1323
|
-
|
1324
|
-
|
1325
|
-
|
1326
|
-
|
1327
|
-
|
1328
|
-
|
1329
|
-
|
1330
|
-
|
1331
|
-
|
1332
|
-
|
1333
|
-
|
1334
|
-
|
1335
|
-
|
1336
|
-
|
1337
|
-
|
1338
|
-
|
1339
|
-
|
1340
|
-
|
1341
|
-
|
1342
|
-
#
|
1343
|
-
|
1344
|
-
|
1345
|
-
|
1346
|
-
|
1347
|
-
|
1348
|
-
|
1349
|
-
|
1350
|
-
|
1351
|
-
|
1352
|
-
|
1353
|
-
|
1354
|
-
|
1355
|
-
|
1356
|
-
|
1357
|
-
/*
|
1358
|
-
|
1359
|
-
|
1360
|
-
|
1361
|
-
|
1362
|
-
|
1363
|
-
|
1364
|
-
#
|
1365
|
-
|
1366
|
-
|
1367
|
-
|
1368
|
-
|
1369
|
-
|
1370
|
-
|
1371
|
-
|
1372
|
-
|
1373
|
-
|
1374
|
-
|
1375
|
-
|
1376
|
-
|
1377
|
-
|
1378
|
-
|
1379
|
-
|
1380
|
-
|
1381
|
-
|
1382
|
-
|
1383
|
-
|
1384
|
-
|
1385
|
-
|
1386
|
-
|
1387
|
-
|
1388
|
-
|
1389
|
-
|
1390
|
-
|
1391
|
-
|
1392
|
-
|
1393
|
-
|
1394
|
-
|
1395
|
-
|
1396
|
-
|
1397
|
-
|
1398
|
-
|
1399
|
-
|
1400
|
-
|
1401
|
-
|
1402
|
-
|
1403
|
-
|
1404
|
-
|
1405
|
-
|
1406
|
-
|
1407
|
-
|
1408
|
-
|
1409
|
-
|
1410
|
-
|
1411
|
-
|
1412
|
-
|
1413
|
-
|
1414
|
-
|
1415
|
-
|
1416
|
-
|
1417
|
-
|
1418
|
-
|
1419
|
-
|
1420
|
-
|
1421
|
-
|
1422
|
-
|
1423
|
-
|
1424
|
-
|
1425
|
-
|
1426
|
-
|
1427
|
-
|
1428
|
-
|
1429
|
-
|
1430
|
-
|
1431
|
-
|
1432
|
-
#
|
1433
|
-
|
1434
|
-
|
1435
|
-
|
1436
|
-
|
1437
|
-
|
1438
|
-
|
1439
|
-
|
1440
|
-
|
1441
|
-
|
1442
|
-
|
1443
|
-
|
1444
|
-
|
1445
|
-
|
1446
|
-
|
1447
|
-
|
1448
|
-
|
1449
|
-
|
1450
|
-
|
1451
|
-
|
1452
|
-
|
1453
|
-
|
1454
|
-
|
1455
|
-
|
1456
|
-
#
|
1457
|
-
|
1458
|
-
|
1459
|
-
|
1460
|
-
|
1461
|
-
|
1462
|
-
|
1463
|
-
|
1464
|
-
|
1465
|
-
|
1466
|
-
|
1467
|
-
|
1468
|
-
|
1469
|
-
|
1470
|
-
|
1471
|
-
|
1472
|
-
|
1473
|
-
|
1474
|
-
|
1475
|
-
|
1476
|
-
|
1477
|
-
|
1478
|
-
|
1479
|
-
|
1480
|
-
|
1481
|
-
|
1482
|
-
|
1483
|
-
|
1484
|
-
|
1485
|
-
|
1486
|
-
|
1487
|
-
|
1488
|
-
|
1489
|
-
|
1490
|
-
|
1491
|
-
|
1492
|
-
|
1493
|
-
|
1494
|
-
|
1495
|
-
|
1496
|
-
|
1497
|
-
|
1498
|
-
|
1499
|
-
|
1500
|
-
|
1501
|
-
|
1502
|
-
|
1503
|
-
|
1504
|
-
|
1505
|
-
|
1506
|
-
|
1507
|
-
|
1508
|
-
|
1509
|
-
|
1510
|
-
|
1511
|
-
|
1512
|
-
|
1513
|
-
|
1514
|
-
|
1515
|
-
|
1516
|
-
|
1517
|
-
|
1518
|
-
|
1519
|
-
|
1520
|
-
|
1521
|
-
|
1522
|
-
|
1523
|
-
|
1524
|
-
|
1525
|
-
|
1526
|
-
|
1527
|
-
|
1528
|
-
|
1529
|
-
|
1530
|
-
|
1531
|
-
|
1532
|
-
|
1533
|
-
|
1534
|
-
|
1535
|
-
|
1536
|
-
|
1537
|
-
|
1538
|
-
|
1539
|
-
|
1540
|
-
|
1541
|
-
|
1542
|
-
|
1543
|
-
|
1544
|
-
|
1545
|
-
|
1546
|
-
|
1547
|
-
|
1548
|
-
|
1549
|
-
|
1550
|
-
|
1551
|
-
|
1552
|
-
|
1553
|
-
|
1554
|
-
|
1555
|
-
|
1556
|
-
|
1557
|
-
|
1558
|
-
|
1559
|
-
|
1560
|
-
|
1561
|
-
|
1562
|
-
|
1563
|
-
|
1564
|
-
|
1565
|
-
|
1566
|
-
|
1567
|
-
|
1568
|
-
|
1569
|
-
|
1570
|
-
|
1571
|
-
|
1572
|
-
|
1573
|
-
|
1574
|
-
#line
|
1575
|
-
|
1576
|
-
|
1577
|
-
|
1578
|
-
|
1579
|
-
|
1580
|
-
|
1581
|
-
|
1582
|
-
|
1583
|
-
|
1584
|
-
|
1585
|
-
|
1586
|
-
|
1587
|
-
|
1588
|
-
|
1589
|
-
|
1590
|
-
|
1591
|
-
|
1592
|
-
|
1593
|
-
|
1594
|
-
|
1595
|
-
|
1596
|
-
|
1597
|
-
|
1598
|
-
|
1599
|
-
|
1600
|
-
|
1601
|
-
|
1602
|
-
|
1603
|
-
|
1604
|
-
|
1605
|
-
|
1606
|
-
|
1607
|
-
|
1608
|
-
|
1609
|
-
|
1610
|
-
|
1611
|
-
|
1612
|
-
|
1613
|
-
|
1614
|
-
|
1615
|
-
|
1616
|
-
|
1617
|
-
|
1618
|
-
|
1619
|
-
|
1620
|
-
|
1621
|
-
|
1622
|
-
|
1623
|
-
|
1624
|
-
|
1625
|
-
|
1626
|
-
|
1627
|
-
|
1628
|
-
|
1629
|
-
|
1630
|
-
|
1631
|
-
|
1632
|
-
|
1633
|
-
|
1634
|
-
|
1635
|
-
|
1636
|
-
|
1637
|
-
|
1638
|
-
|
1639
|
-
|
1640
|
-
|
1641
|
-
|
1642
|
-
|
1643
|
-
|
1644
|
-
|
1645
|
-
|
1646
|
-
|
1647
|
-
|
1648
|
-
|
1649
|
-
|
1650
|
-
|
1651
|
-
|
1652
|
-
|
1653
|
-
|
1654
|
-
|
1655
|
-
|
1656
|
-
|
1657
|
-
|
1658
|
-
|
1659
|
-
|
1660
|
-
|
1661
|
-
|
1662
|
-
|
1663
|
-
|
1664
|
-
|
1665
|
-
|
1666
|
-
|
1667
|
-
|
1668
|
-
|
1669
|
-
|
1670
|
-
|
1671
|
-
|
1672
|
-
|
1673
|
-
|
1674
|
-
|
1675
|
-
|
1676
|
-
|
1677
|
-
|
1678
|
-
|
1679
|
-
|
1680
|
-
|
1681
|
-
|
1682
|
-
|
1683
|
-
|
1684
|
-
|
1685
|
-
|
1686
|
-
|
1687
|
-
|
1688
|
-
|
1689
|
-
|
1690
|
-
|
1691
|
-
|
1692
|
-
|
1693
|
-
|
1694
|
-
|
1695
|
-
|
1696
|
-
|
1697
|
-
|
1698
|
-
|
1699
|
-
|
1700
|
-
|
1701
|
-
|
1702
|
-
|
1703
|
-
|
1704
|
-
|
1705
|
-
|
1706
|
-
|
1707
|
-
|
1708
|
-
|
1709
|
-
|
1710
|
-
|
1711
|
-
|
1712
|
-
|
1713
|
-
|
1714
|
-
|
1715
|
-
|
1716
|
-
|
1717
|
-
|
1718
|
-
|
1719
|
-
|
1720
|
-
|
1721
|
-
|
1722
|
-
|
1723
|
-
|
1724
|
-
|
1725
|
-
|
1726
|
-
|
1727
|
-
|
1728
|
-
|
1729
|
-
|
1730
|
-
|
1731
|
-
|
1732
|
-
|
1733
|
-
|
1734
|
-
|
1735
|
-
|
1736
|
-
|
1737
|
-
|
1738
|
-
|
1739
|
-
|
1740
|
-
|
1741
|
-
|
1742
|
-
|
1743
|
-
|
1744
|
-
|
1745
|
-
|
1746
|
-
|
1747
|
-
|
1748
|
-
|
1749
|
-
|
1750
|
-
|
1751
|
-
|
1752
|
-
|
1753
|
-
|
1754
|
-
|
1755
|
-
|
1756
|
-
|
1757
|
-
|
1758
|
-
|
1759
|
-
|
1760
|
-
{
|
1761
|
-
|
1762
|
-
|
1763
|
-
|
1764
|
-
|
1765
|
-
|
1766
|
-
|
1767
|
-
|
1768
|
-
|
1769
|
-
|
1770
|
-
|
1771
|
-
|
1772
|
-
|
1773
|
-
|
1774
|
-
|
1775
|
-
|
1776
|
-
|
1777
|
-
|
1778
|
-
|
1779
|
-
|
1780
|
-
|
1781
|
-
|
1782
|
-
|
1783
|
-
|
1784
|
-
|
1785
|
-
|
1786
|
-
break;
|
1787
|
-
|
1788
|
-
case 51:
|
1789
|
-
#line 285 "src/q_parser.y"
|
1790
|
-
{ FLDS((yyval.query), get_r_q(qp, field, (yyvsp[(2) - (2)].str), NULL, false, false)); Y }
|
1791
|
-
break;
|
1792
|
-
|
1793
|
-
|
1794
|
-
/* Line 1267 of yacc.c. */
|
1795
|
-
#line 1810 "src/q_parser.c"
|
1796
|
-
default: break;
|
1797
|
-
}
|
1798
|
-
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
|
1799
|
-
|
1800
|
-
YYPOPSTACK (yylen);
|
1801
|
-
yylen = 0;
|
1802
|
-
YY_STACK_PRINT (yyss, yyssp);
|
1803
|
-
|
1804
|
-
*++yyvsp = yyval;
|
1805
|
-
|
1806
|
-
|
1807
|
-
/* Now `shift' the result of the reduction. Determine what state
|
1808
|
-
that goes to, based on the state we popped back to and the rule
|
1809
|
-
number reduced by. */
|
1810
|
-
|
1811
|
-
yyn = yyr1[yyn];
|
1812
|
-
|
1813
|
-
yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
|
1814
|
-
if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
|
1815
|
-
yystate = yytable[yystate];
|
1816
|
-
else
|
1817
|
-
yystate = yydefgoto[yyn - YYNTOKENS];
|
1818
|
-
|
1819
|
-
goto yynewstate;
|
1820
|
-
|
1821
|
-
|
1822
|
-
/*------------------------------------.
|
1823
|
-
| yyerrlab -- here on detecting error |
|
1824
|
-
`------------------------------------*/
|
1825
|
-
yyerrlab:
|
1826
|
-
/* If not already recovering from an error, report this error. */
|
1827
|
-
if (!yyerrstatus)
|
1828
|
-
{
|
1829
|
-
++yynerrs;
|
1830
|
-
#if ! YYERROR_VERBOSE
|
1831
|
-
yyerror (qp, YY_("syntax error"));
|
1832
|
-
#else
|
1833
|
-
{
|
1834
|
-
YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
|
1835
|
-
if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
|
1836
|
-
{
|
1837
|
-
YYSIZE_T yyalloc = 2 * yysize;
|
1838
|
-
if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
|
1839
|
-
yyalloc = YYSTACK_ALLOC_MAXIMUM;
|
1840
|
-
if (yymsg != yymsgbuf)
|
1841
|
-
YYSTACK_FREE (yymsg);
|
1842
|
-
yymsg = (char *) YYSTACK_ALLOC (yyalloc);
|
1843
|
-
if (yymsg)
|
1844
|
-
yymsg_alloc = yyalloc;
|
1845
|
-
else
|
1846
|
-
{
|
1847
|
-
yymsg = yymsgbuf;
|
1848
|
-
yymsg_alloc = sizeof yymsgbuf;
|
1849
|
-
}
|
1850
|
-
}
|
1851
|
-
|
1852
|
-
if (0 < yysize && yysize <= yymsg_alloc)
|
1853
|
-
{
|
1854
|
-
(void) yysyntax_error (yymsg, yystate, yychar);
|
1855
|
-
yyerror (qp, yymsg);
|
1856
|
-
}
|
1857
|
-
else
|
1858
|
-
{
|
1859
|
-
yyerror (qp, YY_("syntax error"));
|
1860
|
-
if (yysize != 0)
|
1861
|
-
goto yyexhaustedlab;
|
1862
|
-
}
|
1863
|
-
}
|
1864
|
-
#endif
|
1865
|
-
}
|
1866
|
-
|
1867
|
-
|
1868
|
-
|
1869
|
-
if (yyerrstatus == 3)
|
1870
|
-
{
|
1871
|
-
/* If just tried and failed to reuse look-ahead token after an
|
1872
|
-
error, discard it. */
|
1873
|
-
|
1874
|
-
if (yychar <= YYEOF)
|
1875
|
-
{
|
1876
|
-
/* Return failure if at end of input. */
|
1877
|
-
if (yychar == YYEOF)
|
1878
|
-
YYABORT;
|
1879
|
-
}
|
1880
|
-
else
|
1881
|
-
{
|
1882
|
-
yydestruct ("Error: discarding",
|
1883
|
-
yytoken, &yylval, qp);
|
1884
|
-
yychar = YYEMPTY;
|
1885
|
-
}
|
1886
|
-
}
|
1887
|
-
|
1888
|
-
/* Else will try to reuse look-ahead token after shifting the error
|
1889
|
-
token. */
|
1890
|
-
goto yyerrlab1;
|
1891
|
-
|
1892
|
-
|
1893
|
-
/*---------------------------------------------------.
|
1894
|
-
| yyerrorlab -- error raised explicitly by YYERROR. |
|
1895
|
-
`---------------------------------------------------*/
|
1896
|
-
yyerrorlab:
|
1897
|
-
|
1898
|
-
/* Pacify compilers like GCC when the user code never invokes
|
1899
|
-
YYERROR and the label yyerrorlab therefore never appears in user
|
1900
|
-
code. */
|
1901
|
-
if (/*CONSTCOND*/ 0)
|
1902
|
-
goto yyerrorlab;
|
1903
|
-
|
1904
|
-
/* Do not reclaim the symbols of the rule which action triggered
|
1905
|
-
this YYERROR. */
|
1906
|
-
YYPOPSTACK (yylen);
|
1907
|
-
yylen = 0;
|
1908
|
-
YY_STACK_PRINT (yyss, yyssp);
|
1909
|
-
yystate = *yyssp;
|
1910
|
-
goto yyerrlab1;
|
1911
|
-
|
1912
|
-
|
1913
|
-
/*-------------------------------------------------------------.
|
1914
|
-
| yyerrlab1 -- common code for both syntax error and YYERROR. |
|
1915
|
-
`-------------------------------------------------------------*/
|
1916
|
-
yyerrlab1:
|
1917
|
-
yyerrstatus = 3; /* Each real token shifted decrements this. */
|
1918
|
-
|
1919
|
-
for (;;)
|
1920
|
-
{
|
1921
|
-
yyn = yypact[yystate];
|
1922
|
-
if (yyn != YYPACT_NINF)
|
1923
|
-
{
|
1924
|
-
yyn += YYTERROR;
|
1925
|
-
if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
|
1926
|
-
{
|
1927
|
-
yyn = yytable[yyn];
|
1928
|
-
if (0 < yyn)
|
1929
|
-
break;
|
1930
|
-
}
|
1931
|
-
}
|
1932
|
-
|
1933
|
-
/* Pop the current state because it cannot handle the error token. */
|
1934
|
-
if (yyssp == yyss)
|
1935
|
-
YYABORT;
|
1936
|
-
|
1937
|
-
|
1938
|
-
yydestruct ("Error: popping",
|
1939
|
-
yystos[yystate], yyvsp, qp);
|
1940
|
-
YYPOPSTACK (1);
|
1941
|
-
yystate = *yyssp;
|
1942
|
-
YY_STACK_PRINT (yyss, yyssp);
|
1943
|
-
}
|
1944
|
-
|
1945
|
-
if (yyn == YYFINAL)
|
1946
|
-
YYACCEPT;
|
1947
|
-
|
1948
|
-
*++yyvsp = yylval;
|
1949
|
-
|
1950
|
-
|
1951
|
-
/* Shift the error token. */
|
1952
|
-
YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
|
1953
|
-
|
1954
|
-
yystate = yyn;
|
1955
|
-
goto yynewstate;
|
1956
|
-
|
1957
|
-
|
1958
|
-
/*-------------------------------------.
|
1959
|
-
| yyacceptlab -- YYACCEPT comes here. |
|
1960
|
-
`-------------------------------------*/
|
1961
|
-
yyacceptlab:
|
1962
|
-
yyresult = 0;
|
1963
|
-
goto yyreturn;
|
1964
|
-
|
1965
|
-
/*-----------------------------------.
|
1966
|
-
| yyabortlab -- YYABORT comes here. |
|
1967
|
-
`-----------------------------------*/
|
1968
|
-
yyabortlab:
|
1969
|
-
yyresult = 1;
|
1970
|
-
goto yyreturn;
|
1971
|
-
|
1972
|
-
#ifndef yyoverflow
|
1973
|
-
/*-------------------------------------------------.
|
1974
|
-
| yyexhaustedlab -- memory exhaustion comes here. |
|
1975
|
-
`-------------------------------------------------*/
|
1976
|
-
yyexhaustedlab:
|
1977
|
-
yyerror (qp, YY_("memory exhausted"));
|
1978
|
-
yyresult = 2;
|
1979
|
-
/* Fall through. */
|
1980
|
-
#endif
|
1981
|
-
|
1982
|
-
yyreturn:
|
1983
|
-
if (yychar != YYEOF && yychar != YYEMPTY)
|
1984
|
-
yydestruct ("Cleanup: discarding lookahead",
|
1985
|
-
yytoken, &yylval, qp);
|
1986
|
-
/* Do not reclaim the symbols of the rule which action triggered
|
1987
|
-
this YYABORT or YYACCEPT. */
|
1988
|
-
YYPOPSTACK (yylen);
|
1989
|
-
YY_STACK_PRINT (yyss, yyssp);
|
1990
|
-
while (yyssp != yyss)
|
1991
|
-
{
|
1992
|
-
yydestruct ("Cleanup: popping",
|
1993
|
-
yystos[*yyssp], yyvsp, qp);
|
1994
|
-
YYPOPSTACK (1);
|
1995
|
-
}
|
1996
|
-
#ifndef yyoverflow
|
1997
|
-
if (yyss != yyssa)
|
1998
|
-
YYSTACK_FREE (yyss);
|
1999
|
-
#endif
|
2000
|
-
#if YYERROR_VERBOSE
|
2001
|
-
if (yymsg != yymsgbuf)
|
2002
|
-
YYSTACK_FREE (yymsg);
|
2003
|
-
#endif
|
2004
|
-
/* Make sure YYID is used. */
|
2005
|
-
return YYID (yyresult);
|
2006
|
-
}
|
2007
|
-
|
2008
|
-
|
2009
|
-
#line 287 "src/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, 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); \
|
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)
|
1018
|
+
{
|
1019
|
+
FILE *yyoutput = yyo;
|
1020
|
+
YY_USE (yyoutput);
|
1021
|
+
YY_USE (qp);
|
1022
|
+
if (!yyvaluep)
|
1023
|
+
return;
|
1024
|
+
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
|
1025
|
+
YY_USE (yykind);
|
1026
|
+
YY_IGNORE_MAYBE_UNINITIALIZED_END
|
1027
|
+
}
|
1028
|
+
|
1029
|
+
|
1030
|
+
/*---------------------------.
|
1031
|
+
| Print this symbol on YYO. |
|
1032
|
+
`---------------------------*/
|
1033
|
+
|
1034
|
+
static void
|
1035
|
+
yy_symbol_print (FILE *yyo,
|
1036
|
+
yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, FrtQParser *qp)
|
1037
|
+
{
|
1038
|
+
YYFPRINTF (yyo, "%s %s (",
|
1039
|
+
yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));
|
1040
|
+
|
1041
|
+
yy_symbol_value_print (yyo, yykind, yyvaluep, qp);
|
1042
|
+
YYFPRINTF (yyo, ")");
|
1043
|
+
}
|
1044
|
+
|
1045
|
+
/*------------------------------------------------------------------.
|
1046
|
+
| yy_stack_print -- Print the state stack from its BOTTOM up to its |
|
1047
|
+
| TOP (included). |
|
1048
|
+
`------------------------------------------------------------------*/
|
1049
|
+
|
1050
|
+
static void
|
1051
|
+
yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)
|
1052
|
+
{
|
1053
|
+
YYFPRINTF (stderr, "Stack now");
|
1054
|
+
for (; yybottom <= yytop; yybottom++)
|
1055
|
+
{
|
1056
|
+
int yybot = *yybottom;
|
1057
|
+
YYFPRINTF (stderr, " %d", yybot);
|
1058
|
+
}
|
1059
|
+
YYFPRINTF (stderr, "\n");
|
1060
|
+
}
|
1061
|
+
|
1062
|
+
# define YY_STACK_PRINT(Bottom, Top) \
|
1063
|
+
do { \
|
1064
|
+
if (yydebug) \
|
1065
|
+
yy_stack_print ((Bottom), (Top)); \
|
1066
|
+
} while (0)
|
1067
|
+
|
1068
|
+
|
1069
|
+
/*------------------------------------------------.
|
1070
|
+
| Report that the YYRULE is going to be reduced. |
|
1071
|
+
`------------------------------------------------*/
|
1072
|
+
|
1073
|
+
static void
|
1074
|
+
yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp,
|
1075
|
+
int yyrule, FrtQParser *qp)
|
1076
|
+
{
|
1077
|
+
int yylno = yyrline[yyrule];
|
1078
|
+
int yynrhs = yyr2[yyrule];
|
1079
|
+
int yyi;
|
1080
|
+
YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
|
1081
|
+
yyrule - 1, yylno);
|
1082
|
+
/* The symbols being reduced. */
|
1083
|
+
for (yyi = 0; yyi < yynrhs; yyi++)
|
1084
|
+
{
|
1085
|
+
YYFPRINTF (stderr, " $%d = ", yyi + 1);
|
1086
|
+
yy_symbol_print (stderr,
|
1087
|
+
YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
|
1088
|
+
&yyvsp[(yyi + 1) - (yynrhs)], qp);
|
1089
|
+
YYFPRINTF (stderr, "\n");
|
1090
|
+
}
|
1091
|
+
}
|
1092
|
+
|
1093
|
+
# define YY_REDUCE_PRINT(Rule) \
|
1094
|
+
do { \
|
1095
|
+
if (yydebug) \
|
1096
|
+
yy_reduce_print (yyssp, yyvsp, Rule, qp); \
|
1097
|
+
} while (0)
|
1098
|
+
|
1099
|
+
/* Nonzero means print parse trace. It is left uninitialized so that
|
1100
|
+
multiple parsers can coexist. */
|
1101
|
+
int yydebug;
|
1102
|
+
#else /* !YYDEBUG */
|
1103
|
+
# define YYDPRINTF(Args) ((void) 0)
|
1104
|
+
# define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
|
1105
|
+
# define YY_STACK_PRINT(Bottom, Top)
|
1106
|
+
# define YY_REDUCE_PRINT(Rule)
|
1107
|
+
#endif /* !YYDEBUG */
|
1108
|
+
|
1109
|
+
|
1110
|
+
/* YYINITDEPTH -- initial size of the parser's stacks. */
|
1111
|
+
#ifndef YYINITDEPTH
|
1112
|
+
# define YYINITDEPTH 200
|
1113
|
+
#endif
|
1114
|
+
|
1115
|
+
/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
|
1116
|
+
if the built-in stack extension method is used).
|
1117
|
+
|
1118
|
+
Do not make this value too large; the results are undefined if
|
1119
|
+
YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
|
1120
|
+
evaluated with infinite-precision integer arithmetic. */
|
1121
|
+
|
1122
|
+
#ifndef YYMAXDEPTH
|
1123
|
+
# define YYMAXDEPTH 10000
|
1124
|
+
#endif
|
1125
|
+
|
1126
|
+
|
1127
|
+
|
1128
|
+
|
1129
|
+
|
1130
|
+
|
1131
|
+
/*-----------------------------------------------.
|
1132
|
+
| Release the memory associated to this symbol. |
|
1133
|
+
`-----------------------------------------------*/
|
1134
|
+
|
1135
|
+
static void
|
1136
|
+
yydestruct (const char *yymsg,
|
1137
|
+
yysymbol_kind_t yykind, YYSTYPE *yyvaluep, FrtQParser *qp)
|
1138
|
+
{
|
1139
|
+
YY_USE (yyvaluep);
|
1140
|
+
YY_USE (qp);
|
1141
|
+
if (!yymsg)
|
1142
|
+
yymsg = "Deleting";
|
1143
|
+
YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
|
1144
|
+
|
1145
|
+
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
|
1146
|
+
switch (yykind)
|
1147
|
+
{
|
1148
|
+
case YYSYMBOL_bool_q: /* bool_q */
|
1149
|
+
#line 221 "frt_q_parser.y"
|
1150
|
+
{ if (((*yyvaluep).query) && qp->destruct) frt_q_deref(((*yyvaluep).query)); }
|
1151
|
+
#line 1152 "frt_q_parser.c"
|
1152
|
+
break;
|
1153
|
+
|
1154
|
+
case YYSYMBOL_bool_clss: /* bool_clss */
|
1155
|
+
#line 223 "frt_q_parser.y"
|
1156
|
+
{ if (((*yyvaluep).bclss) && qp->destruct) bca_destroy(((*yyvaluep).bclss)); }
|
1157
|
+
#line 1158 "frt_q_parser.c"
|
1158
|
+
break;
|
1159
|
+
|
1160
|
+
case YYSYMBOL_bool_cls: /* bool_cls */
|
1161
|
+
#line 222 "frt_q_parser.y"
|
1162
|
+
{ if (((*yyvaluep).bcls) && qp->destruct) frt_bc_deref(((*yyvaluep).bcls)); }
|
1163
|
+
#line 1164 "frt_q_parser.c"
|
1164
|
+
break;
|
1165
|
+
|
1166
|
+
case YYSYMBOL_boosted_q: /* boosted_q */
|
1167
|
+
#line 221 "frt_q_parser.y"
|
1168
|
+
{ if (((*yyvaluep).query) && qp->destruct) frt_q_deref(((*yyvaluep).query)); }
|
1169
|
+
#line 1170 "frt_q_parser.c"
|
1170
|
+
break;
|
1171
|
+
|
1172
|
+
case YYSYMBOL_q: /* q */
|
1173
|
+
#line 221 "frt_q_parser.y"
|
1174
|
+
{ if (((*yyvaluep).query) && qp->destruct) frt_q_deref(((*yyvaluep).query)); }
|
1175
|
+
#line 1176 "frt_q_parser.c"
|
1176
|
+
break;
|
1177
|
+
|
1178
|
+
case YYSYMBOL_term_q: /* term_q */
|
1179
|
+
#line 221 "frt_q_parser.y"
|
1180
|
+
{ if (((*yyvaluep).query) && qp->destruct) frt_q_deref(((*yyvaluep).query)); }
|
1181
|
+
#line 1182 "frt_q_parser.c"
|
1182
|
+
break;
|
1183
|
+
|
1184
|
+
case YYSYMBOL_wild_q: /* wild_q */
|
1185
|
+
#line 221 "frt_q_parser.y"
|
1186
|
+
{ if (((*yyvaluep).query) && qp->destruct) frt_q_deref(((*yyvaluep).query)); }
|
1187
|
+
#line 1188 "frt_q_parser.c"
|
1188
|
+
break;
|
1189
|
+
|
1190
|
+
case YYSYMBOL_field_q: /* field_q */
|
1191
|
+
#line 221 "frt_q_parser.y"
|
1192
|
+
{ if (((*yyvaluep).query) && qp->destruct) frt_q_deref(((*yyvaluep).query)); }
|
1193
|
+
#line 1194 "frt_q_parser.c"
|
1194
|
+
break;
|
1195
|
+
|
1196
|
+
case YYSYMBOL_phrase_q: /* phrase_q */
|
1197
|
+
#line 221 "frt_q_parser.y"
|
1198
|
+
{ if (((*yyvaluep).query) && qp->destruct) frt_q_deref(((*yyvaluep).query)); }
|
1199
|
+
#line 1200 "frt_q_parser.c"
|
1200
|
+
break;
|
1201
|
+
|
1202
|
+
case YYSYMBOL_ph_words: /* ph_words */
|
1203
|
+
#line 224 "frt_q_parser.y"
|
1204
|
+
{ if (((*yyvaluep).phrase) && qp->destruct) ph_destroy(((*yyvaluep).phrase)); }
|
1205
|
+
#line 1206 "frt_q_parser.c"
|
1206
|
+
break;
|
1207
|
+
|
1208
|
+
case YYSYMBOL_range_q: /* range_q */
|
1209
|
+
#line 221 "frt_q_parser.y"
|
1210
|
+
{ if (((*yyvaluep).query) && qp->destruct) frt_q_deref(((*yyvaluep).query)); }
|
1211
|
+
#line 1212 "frt_q_parser.c"
|
1212
|
+
break;
|
1213
|
+
|
1214
|
+
default:
|
1215
|
+
break;
|
1216
|
+
}
|
1217
|
+
YY_IGNORE_MAYBE_UNINITIALIZED_END
|
1218
|
+
}
|
1219
|
+
|
1220
|
+
|
1221
|
+
|
1222
|
+
|
1223
|
+
|
1224
|
+
|
1225
|
+
/*----------.
|
1226
|
+
| yyparse. |
|
1227
|
+
`----------*/
|
1228
|
+
|
1229
|
+
int
|
1230
|
+
yyparse (FrtQParser *qp)
|
1231
|
+
{
|
1232
|
+
/* Lookahead token kind. */
|
1233
|
+
int yychar;
|
1234
|
+
|
1235
|
+
|
1236
|
+
/* The semantic value of the lookahead symbol. */
|
1237
|
+
/* Default value used for initialization, for pacifying older GCCs
|
1238
|
+
or non-GCC compilers. */
|
1239
|
+
YY_INITIAL_VALUE (static YYSTYPE yyval_default;)
|
1240
|
+
YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
|
1241
|
+
|
1242
|
+
/* Number of syntax errors so far. */
|
1243
|
+
int yynerrs = 0;
|
1244
|
+
|
1245
|
+
yy_state_fast_t yystate = 0;
|
1246
|
+
/* Number of tokens to shift before error messages enabled. */
|
1247
|
+
int yyerrstatus = 0;
|
1248
|
+
|
1249
|
+
/* Refer to the stacks through separate pointers, to allow yyoverflow
|
1250
|
+
to reallocate them elsewhere. */
|
1251
|
+
|
1252
|
+
/* Their size. */
|
1253
|
+
YYPTRDIFF_T yystacksize = YYINITDEPTH;
|
1254
|
+
|
1255
|
+
/* The state stack: array, bottom, top. */
|
1256
|
+
yy_state_t yyssa[YYINITDEPTH];
|
1257
|
+
yy_state_t *yyss = yyssa;
|
1258
|
+
yy_state_t *yyssp = yyss;
|
1259
|
+
|
1260
|
+
/* The semantic value stack: array, bottom, top. */
|
1261
|
+
YYSTYPE yyvsa[YYINITDEPTH];
|
1262
|
+
YYSTYPE *yyvs = yyvsa;
|
1263
|
+
YYSTYPE *yyvsp = yyvs;
|
1264
|
+
|
1265
|
+
int yyn;
|
1266
|
+
/* The return value of yyparse. */
|
1267
|
+
int yyresult;
|
1268
|
+
/* Lookahead symbol kind. */
|
1269
|
+
yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY;
|
1270
|
+
/* The variables used to return semantic value and location from the
|
1271
|
+
action routines. */
|
1272
|
+
YYSTYPE yyval;
|
1273
|
+
|
1274
|
+
|
1275
|
+
|
1276
|
+
#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
|
1277
|
+
|
1278
|
+
/* The number of symbols on the RHS of the reduced rule.
|
1279
|
+
Keep to zero when no symbol should be popped. */
|
1280
|
+
int yylen = 0;
|
1281
|
+
|
1282
|
+
YYDPRINTF ((stderr, "Starting parse\n"));
|
1283
|
+
|
1284
|
+
yychar = YYEMPTY; /* Cause a token to be read. */
|
1285
|
+
|
1286
|
+
goto yysetstate;
|
1287
|
+
|
1288
|
+
|
1289
|
+
/*------------------------------------------------------------.
|
1290
|
+
| yynewstate -- push a new state, which is found in yystate. |
|
1291
|
+
`------------------------------------------------------------*/
|
1292
|
+
yynewstate:
|
1293
|
+
/* In all cases, when you get here, the value and location stacks
|
1294
|
+
have just been pushed. So pushing a state here evens the stacks. */
|
1295
|
+
yyssp++;
|
1296
|
+
|
1297
|
+
|
1298
|
+
/*--------------------------------------------------------------------.
|
1299
|
+
| yysetstate -- set current state (the top of the stack) to yystate. |
|
1300
|
+
`--------------------------------------------------------------------*/
|
1301
|
+
yysetstate:
|
1302
|
+
YYDPRINTF ((stderr, "Entering state %d\n", yystate));
|
1303
|
+
YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
|
1304
|
+
YY_IGNORE_USELESS_CAST_BEGIN
|
1305
|
+
*yyssp = YY_CAST (yy_state_t, yystate);
|
1306
|
+
YY_IGNORE_USELESS_CAST_END
|
1307
|
+
YY_STACK_PRINT (yyss, yyssp);
|
1308
|
+
|
1309
|
+
if (yyss + yystacksize - 1 <= yyssp)
|
1310
|
+
#if !defined yyoverflow && !defined YYSTACK_RELOCATE
|
1311
|
+
YYNOMEM;
|
1312
|
+
#else
|
1313
|
+
{
|
1314
|
+
/* Get the current used size of the three stacks, in elements. */
|
1315
|
+
YYPTRDIFF_T yysize = yyssp - yyss + 1;
|
1316
|
+
|
1317
|
+
# if defined yyoverflow
|
1318
|
+
{
|
1319
|
+
/* Give user a chance to reallocate the stack. Use copies of
|
1320
|
+
these so that the &'s don't force the real ones into
|
1321
|
+
memory. */
|
1322
|
+
yy_state_t *yyss1 = yyss;
|
1323
|
+
YYSTYPE *yyvs1 = yyvs;
|
1324
|
+
|
1325
|
+
/* Each stack pointer address is followed by the size of the
|
1326
|
+
data in use in that stack, in bytes. This used to be a
|
1327
|
+
conditional around just the two extra args, but that might
|
1328
|
+
be undefined if yyoverflow is a macro. */
|
1329
|
+
yyoverflow (YY_("memory exhausted"),
|
1330
|
+
&yyss1, yysize * YYSIZEOF (*yyssp),
|
1331
|
+
&yyvs1, yysize * YYSIZEOF (*yyvsp),
|
1332
|
+
&yystacksize);
|
1333
|
+
yyss = yyss1;
|
1334
|
+
yyvs = yyvs1;
|
1335
|
+
}
|
1336
|
+
# else /* defined YYSTACK_RELOCATE */
|
1337
|
+
/* Extend the stack our own way. */
|
1338
|
+
if (YYMAXDEPTH <= yystacksize)
|
1339
|
+
YYNOMEM;
|
1340
|
+
yystacksize *= 2;
|
1341
|
+
if (YYMAXDEPTH < yystacksize)
|
1342
|
+
yystacksize = YYMAXDEPTH;
|
1343
|
+
|
1344
|
+
{
|
1345
|
+
yy_state_t *yyss1 = yyss;
|
1346
|
+
union yyalloc *yyptr =
|
1347
|
+
YY_CAST (union yyalloc *,
|
1348
|
+
YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
|
1349
|
+
if (! yyptr)
|
1350
|
+
YYNOMEM;
|
1351
|
+
YYSTACK_RELOCATE (yyss_alloc, yyss);
|
1352
|
+
YYSTACK_RELOCATE (yyvs_alloc, yyvs);
|
1353
|
+
# undef YYSTACK_RELOCATE
|
1354
|
+
if (yyss1 != yyssa)
|
1355
|
+
YYSTACK_FREE (yyss1);
|
1356
|
+
}
|
1357
|
+
# endif
|
1358
|
+
|
1359
|
+
yyssp = yyss + yysize - 1;
|
1360
|
+
yyvsp = yyvs + yysize - 1;
|
1361
|
+
|
1362
|
+
YY_IGNORE_USELESS_CAST_BEGIN
|
1363
|
+
YYDPRINTF ((stderr, "Stack size increased to %ld\n",
|
1364
|
+
YY_CAST (long, yystacksize)));
|
1365
|
+
YY_IGNORE_USELESS_CAST_END
|
1366
|
+
|
1367
|
+
if (yyss + yystacksize - 1 <= yyssp)
|
1368
|
+
YYABORT;
|
1369
|
+
}
|
1370
|
+
#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
|
1371
|
+
|
1372
|
+
|
1373
|
+
if (yystate == YYFINAL)
|
1374
|
+
YYACCEPT;
|
1375
|
+
|
1376
|
+
goto yybackup;
|
1377
|
+
|
1378
|
+
|
1379
|
+
/*-----------.
|
1380
|
+
| yybackup. |
|
1381
|
+
`-----------*/
|
1382
|
+
yybackup:
|
1383
|
+
/* Do appropriate processing given the current state. Read a
|
1384
|
+
lookahead token if we need one and don't already have one. */
|
1385
|
+
|
1386
|
+
/* First try to decide what to do without reference to lookahead token. */
|
1387
|
+
yyn = yypact[yystate];
|
1388
|
+
if (yypact_value_is_default (yyn))
|
1389
|
+
goto yydefault;
|
1390
|
+
|
1391
|
+
/* Not known => get a lookahead token if don't already have one. */
|
1392
|
+
|
1393
|
+
/* YYCHAR is either empty, or end-of-input, or a valid lookahead. */
|
1394
|
+
if (yychar == YYEMPTY)
|
1395
|
+
{
|
1396
|
+
YYDPRINTF ((stderr, "Reading a token\n"));
|
1397
|
+
yychar = yylex (&yylval, qp);
|
1398
|
+
}
|
1399
|
+
|
1400
|
+
if (yychar <= YYEOF)
|
1401
|
+
{
|
1402
|
+
yychar = YYEOF;
|
1403
|
+
yytoken = YYSYMBOL_YYEOF;
|
1404
|
+
YYDPRINTF ((stderr, "Now at end of input.\n"));
|
1405
|
+
}
|
1406
|
+
else if (yychar == YYerror)
|
1407
|
+
{
|
1408
|
+
/* The scanner already issued an error message, process directly
|
1409
|
+
to error recovery. But do not keep the error token as
|
1410
|
+
lookahead, it is too special and may lead us to an endless
|
1411
|
+
loop in error recovery. */
|
1412
|
+
yychar = YYUNDEF;
|
1413
|
+
yytoken = YYSYMBOL_YYerror;
|
1414
|
+
goto yyerrlab1;
|
1415
|
+
}
|
1416
|
+
else
|
1417
|
+
{
|
1418
|
+
yytoken = YYTRANSLATE (yychar);
|
1419
|
+
YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
|
1420
|
+
}
|
1421
|
+
|
1422
|
+
/* If the proper action on seeing token YYTOKEN is to reduce or to
|
1423
|
+
detect an error, take that action. */
|
1424
|
+
yyn += yytoken;
|
1425
|
+
if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
|
1426
|
+
goto yydefault;
|
1427
|
+
yyn = yytable[yyn];
|
1428
|
+
if (yyn <= 0)
|
1429
|
+
{
|
1430
|
+
if (yytable_value_is_error (yyn))
|
1431
|
+
goto yyerrlab;
|
1432
|
+
yyn = -yyn;
|
1433
|
+
goto yyreduce;
|
1434
|
+
}
|
1435
|
+
|
1436
|
+
/* Count tokens shifted since error; after three, turn off error
|
1437
|
+
status. */
|
1438
|
+
if (yyerrstatus)
|
1439
|
+
yyerrstatus--;
|
1440
|
+
|
1441
|
+
/* Shift the lookahead token. */
|
1442
|
+
YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
|
1443
|
+
yystate = yyn;
|
1444
|
+
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
|
1445
|
+
*++yyvsp = yylval;
|
1446
|
+
YY_IGNORE_MAYBE_UNINITIALIZED_END
|
1447
|
+
|
1448
|
+
/* Discard the shifted token. */
|
1449
|
+
yychar = YYEMPTY;
|
1450
|
+
goto yynewstate;
|
1451
|
+
|
1452
|
+
|
1453
|
+
/*-----------------------------------------------------------.
|
1454
|
+
| yydefault -- do the default action for the current state. |
|
1455
|
+
`-----------------------------------------------------------*/
|
1456
|
+
yydefault:
|
1457
|
+
yyn = yydefact[yystate];
|
1458
|
+
if (yyn == 0)
|
1459
|
+
goto yyerrlab;
|
1460
|
+
goto yyreduce;
|
1461
|
+
|
1462
|
+
|
1463
|
+
/*-----------------------------.
|
1464
|
+
| yyreduce -- do a reduction. |
|
1465
|
+
`-----------------------------*/
|
1466
|
+
yyreduce:
|
1467
|
+
/* yyn is the number of a rule to reduce with. */
|
1468
|
+
yylen = yyr2[yyn];
|
1469
|
+
|
1470
|
+
/* If YYLEN is nonzero, implement the default value of the action:
|
1471
|
+
'$$ = $1'.
|
1472
|
+
|
1473
|
+
Otherwise, the following line sets YYVAL to garbage.
|
1474
|
+
This behavior is undocumented and Bison
|
1475
|
+
users should not rely upon it. Assigning to YYVAL
|
1476
|
+
unconditionally makes the parser a bit smaller, and it avoids a
|
1477
|
+
GCC warning that YYVAL may be used uninitialized. */
|
1478
|
+
yyval = yyvsp[1-yylen];
|
1479
|
+
|
1480
|
+
|
1481
|
+
YY_REDUCE_PRINT (yyn);
|
1482
|
+
switch (yyn)
|
1483
|
+
{
|
1484
|
+
case 2: /* bool_q: %empty */
|
1485
|
+
#line 226 "frt_q_parser.y"
|
1486
|
+
{ qp->result = (yyval.query) = NULL; }
|
1487
|
+
#line 1488 "frt_q_parser.c"
|
1488
|
+
break;
|
1489
|
+
|
1490
|
+
case 3: /* bool_q: bool_clss */
|
1491
|
+
#line 227 "frt_q_parser.y"
|
1492
|
+
{ T qp->result = (yyval.query) = get_bool_q((yyvsp[0].bclss)); E }
|
1493
|
+
#line 1494 "frt_q_parser.c"
|
1494
|
+
break;
|
1495
|
+
|
1496
|
+
case 4: /* bool_clss: bool_cls */
|
1497
|
+
#line 229 "frt_q_parser.y"
|
1498
|
+
{ T (yyval.bclss) = first_cls((yyvsp[0].bcls)); E }
|
1499
|
+
#line 1500 "frt_q_parser.c"
|
1500
|
+
break;
|
1501
|
+
|
1502
|
+
case 5: /* bool_clss: bool_clss AND bool_cls */
|
1503
|
+
#line 230 "frt_q_parser.y"
|
1504
|
+
{ T (yyval.bclss) = add_and_cls((yyvsp[-2].bclss), (yyvsp[0].bcls)); E }
|
1505
|
+
#line 1506 "frt_q_parser.c"
|
1506
|
+
break;
|
1507
|
+
|
1508
|
+
case 6: /* bool_clss: bool_clss OR bool_cls */
|
1509
|
+
#line 231 "frt_q_parser.y"
|
1510
|
+
{ T (yyval.bclss) = add_or_cls((yyvsp[-2].bclss), (yyvsp[0].bcls)); E }
|
1511
|
+
#line 1512 "frt_q_parser.c"
|
1512
|
+
break;
|
1513
|
+
|
1514
|
+
case 7: /* bool_clss: bool_clss bool_cls */
|
1515
|
+
#line 232 "frt_q_parser.y"
|
1516
|
+
{ T (yyval.bclss) = add_default_cls(qp, (yyvsp[-1].bclss), (yyvsp[0].bcls)); E }
|
1517
|
+
#line 1518 "frt_q_parser.c"
|
1518
|
+
break;
|
1519
|
+
|
1520
|
+
case 8: /* bool_cls: REQ boosted_q */
|
1521
|
+
#line 234 "frt_q_parser.y"
|
1522
|
+
{ T (yyval.bcls) = get_bool_cls((yyvsp[0].query), FRT_BC_MUST); E }
|
1523
|
+
#line 1524 "frt_q_parser.c"
|
1524
|
+
break;
|
1525
|
+
|
1526
|
+
case 9: /* bool_cls: NOT boosted_q */
|
1527
|
+
#line 235 "frt_q_parser.y"
|
1528
|
+
{ T (yyval.bcls) = get_bool_cls((yyvsp[0].query), FRT_BC_MUST_NOT); E }
|
1529
|
+
#line 1530 "frt_q_parser.c"
|
1530
|
+
break;
|
1531
|
+
|
1532
|
+
case 10: /* bool_cls: boosted_q */
|
1533
|
+
#line 236 "frt_q_parser.y"
|
1534
|
+
{ T (yyval.bcls) = get_bool_cls((yyvsp[0].query), FRT_BC_SHOULD); E }
|
1535
|
+
#line 1536 "frt_q_parser.c"
|
1536
|
+
break;
|
1537
|
+
|
1538
|
+
case 12: /* boosted_q: q '^' QWRD */
|
1539
|
+
#line 239 "frt_q_parser.y"
|
1540
|
+
{ T if ((yyvsp[-2].query)) sscanf((yyvsp[0].str),"%f",&((yyvsp[-2].query)->boost)); (yyval.query)=(yyvsp[-2].query); E }
|
1541
|
+
#line 1542 "frt_q_parser.c"
|
1542
|
+
break;
|
1543
|
+
|
1544
|
+
case 14: /* q: '(' ')' */
|
1545
|
+
#line 242 "frt_q_parser.y"
|
1546
|
+
{ T (yyval.query) = frt_bq_new_max(true, qp->max_clauses); E }
|
1547
|
+
#line 1548 "frt_q_parser.c"
|
1548
|
+
break;
|
1549
|
+
|
1550
|
+
case 15: /* q: '(' bool_clss ')' */
|
1551
|
+
#line 243 "frt_q_parser.y"
|
1552
|
+
{ T (yyval.query) = get_bool_q((yyvsp[-1].bclss)); E }
|
1553
|
+
#line 1554 "frt_q_parser.c"
|
1554
|
+
break;
|
1555
|
+
|
1556
|
+
case 20: /* term_q: QWRD */
|
1557
|
+
#line 249 "frt_q_parser.y"
|
1558
|
+
{ FLDS((yyval.query), get_term_q(qp, field, (yyvsp[0].str))); Y}
|
1559
|
+
#line 1560 "frt_q_parser.c"
|
1560
|
+
break;
|
1561
|
+
|
1562
|
+
case 21: /* term_q: QWRD '~' QWRD */
|
1563
|
+
#line 250 "frt_q_parser.y"
|
1564
|
+
{ FLDS((yyval.query), get_fuzzy_q(qp, field, (yyvsp[-2].str), (yyvsp[0].str))); Y}
|
1565
|
+
#line 1566 "frt_q_parser.c"
|
1566
|
+
break;
|
1567
|
+
|
1568
|
+
case 22: /* term_q: QWRD '~' */
|
1569
|
+
#line 251 "frt_q_parser.y"
|
1570
|
+
{ FLDS((yyval.query), get_fuzzy_q(qp, field, (yyvsp[-1].str), NULL)); Y}
|
1571
|
+
#line 1572 "frt_q_parser.c"
|
1572
|
+
break;
|
1573
|
+
|
1574
|
+
case 23: /* wild_q: WILD_STR */
|
1575
|
+
#line 253 "frt_q_parser.y"
|
1576
|
+
{ FLDS((yyval.query), get_wild_q(qp, field, (yyvsp[0].str))); Y}
|
1577
|
+
#line 1578 "frt_q_parser.c"
|
1578
|
+
break;
|
1579
|
+
|
1580
|
+
case 24: /* $@1: %empty */
|
1581
|
+
#line 255 "frt_q_parser.y"
|
1582
|
+
{ qp_pop_fields(qp); }
|
1583
|
+
#line 1584 "frt_q_parser.c"
|
1584
|
+
break;
|
1585
|
+
|
1586
|
+
case 25: /* field_q: field ':' q $@1 */
|
1587
|
+
#line 256 "frt_q_parser.y"
|
1588
|
+
{ (yyval.query) = (yyvsp[-1].query); }
|
1589
|
+
#line 1590 "frt_q_parser.c"
|
1590
|
+
break;
|
1591
|
+
|
1592
|
+
case 26: /* $@2: %empty */
|
1593
|
+
#line 257 "frt_q_parser.y"
|
1594
|
+
{ qp_push_fields(qp, qp->all_fields, false); }
|
1595
|
+
#line 1596 "frt_q_parser.c"
|
1596
|
+
break;
|
1597
|
+
|
1598
|
+
case 27: /* $@3: %empty */
|
1599
|
+
#line 257 "frt_q_parser.y"
|
1600
|
+
{ qp_pop_fields(qp); }
|
1601
|
+
#line 1602 "frt_q_parser.c"
|
1602
|
+
break;
|
1603
|
+
|
1604
|
+
case 28: /* field_q: '*' $@2 ':' q $@3 */
|
1605
|
+
#line 258 "frt_q_parser.y"
|
1606
|
+
{ (yyval.query) = (yyvsp[-1].query); }
|
1607
|
+
#line 1608 "frt_q_parser.c"
|
1608
|
+
break;
|
1609
|
+
|
1610
|
+
case 29: /* field: QWRD */
|
1611
|
+
#line 260 "frt_q_parser.y"
|
1612
|
+
{ (yyval.hashset) = first_field(qp, (yyvsp[0].str)); }
|
1613
|
+
#line 1614 "frt_q_parser.c"
|
1614
|
+
break;
|
1615
|
+
|
1616
|
+
case 30: /* field: field '|' QWRD */
|
1617
|
+
#line 261 "frt_q_parser.y"
|
1618
|
+
{ (yyval.hashset) = add_field(qp, (yyvsp[0].str));}
|
1619
|
+
#line 1620 "frt_q_parser.c"
|
1620
|
+
break;
|
1621
|
+
|
1622
|
+
case 31: /* phrase_q: '"' ph_words '"' */
|
1623
|
+
#line 263 "frt_q_parser.y"
|
1624
|
+
{ (yyval.query) = get_phrase_q(qp, (yyvsp[-1].phrase), NULL); }
|
1625
|
+
#line 1626 "frt_q_parser.c"
|
1626
|
+
break;
|
1627
|
+
|
1628
|
+
case 32: /* phrase_q: '"' ph_words '"' '~' QWRD */
|
1629
|
+
#line 264 "frt_q_parser.y"
|
1630
|
+
{ (yyval.query) = get_phrase_q(qp, (yyvsp[-3].phrase), (yyvsp[0].str)); }
|
1631
|
+
#line 1632 "frt_q_parser.c"
|
1632
|
+
break;
|
1633
|
+
|
1634
|
+
case 33: /* phrase_q: '"' '"' */
|
1635
|
+
#line 265 "frt_q_parser.y"
|
1636
|
+
{ (yyval.query) = NULL; }
|
1637
|
+
#line 1638 "frt_q_parser.c"
|
1638
|
+
break;
|
1639
|
+
|
1640
|
+
case 34: /* phrase_q: '"' '"' '~' QWRD */
|
1641
|
+
#line 266 "frt_q_parser.y"
|
1642
|
+
{ (yyval.query) = NULL; (void)(yyvsp[0].str);}
|
1643
|
+
#line 1644 "frt_q_parser.c"
|
1644
|
+
break;
|
1645
|
+
|
1646
|
+
case 35: /* ph_words: QWRD */
|
1647
|
+
#line 268 "frt_q_parser.y"
|
1648
|
+
{ (yyval.phrase) = ph_first_word((yyvsp[0].str)); }
|
1649
|
+
#line 1650 "frt_q_parser.c"
|
1650
|
+
break;
|
1651
|
+
|
1652
|
+
case 36: /* ph_words: '<' '>' */
|
1653
|
+
#line 269 "frt_q_parser.y"
|
1654
|
+
{ (yyval.phrase) = ph_first_word(NULL); }
|
1655
|
+
#line 1656 "frt_q_parser.c"
|
1656
|
+
break;
|
1657
|
+
|
1658
|
+
case 37: /* ph_words: ph_words QWRD */
|
1659
|
+
#line 270 "frt_q_parser.y"
|
1660
|
+
{ (yyval.phrase) = ph_add_word((yyvsp[-1].phrase), (yyvsp[0].str)); }
|
1661
|
+
#line 1662 "frt_q_parser.c"
|
1662
|
+
break;
|
1663
|
+
|
1664
|
+
case 38: /* ph_words: ph_words '<' '>' */
|
1665
|
+
#line 271 "frt_q_parser.y"
|
1666
|
+
{ (yyval.phrase) = ph_add_word((yyvsp[-2].phrase), NULL); }
|
1667
|
+
#line 1668 "frt_q_parser.c"
|
1668
|
+
break;
|
1669
|
+
|
1670
|
+
case 39: /* ph_words: ph_words '|' QWRD */
|
1671
|
+
#line 272 "frt_q_parser.y"
|
1672
|
+
{ (yyval.phrase) = ph_add_multi_word((yyvsp[-2].phrase), (yyvsp[0].str)); }
|
1673
|
+
#line 1674 "frt_q_parser.c"
|
1674
|
+
break;
|
1675
|
+
|
1676
|
+
case 40: /* range_q: '[' QWRD QWRD ']' */
|
1677
|
+
#line 274 "frt_q_parser.y"
|
1678
|
+
{ FLDS((yyval.query), get_r_q(qp, field, (yyvsp[-2].str), (yyvsp[-1].str), true, true)); Y}
|
1679
|
+
#line 1680 "frt_q_parser.c"
|
1680
|
+
break;
|
1681
|
+
|
1682
|
+
case 41: /* range_q: '[' QWRD QWRD '}' */
|
1683
|
+
#line 275 "frt_q_parser.y"
|
1684
|
+
{ FLDS((yyval.query), get_r_q(qp, field, (yyvsp[-2].str), (yyvsp[-1].str), true, false)); Y}
|
1685
|
+
#line 1686 "frt_q_parser.c"
|
1686
|
+
break;
|
1687
|
+
|
1688
|
+
case 42: /* range_q: '{' QWRD QWRD ']' */
|
1689
|
+
#line 276 "frt_q_parser.y"
|
1690
|
+
{ FLDS((yyval.query), get_r_q(qp, field, (yyvsp[-2].str), (yyvsp[-1].str), false, true)); Y}
|
1691
|
+
#line 1692 "frt_q_parser.c"
|
1692
|
+
break;
|
1693
|
+
|
1694
|
+
case 43: /* range_q: '{' QWRD QWRD '}' */
|
1695
|
+
#line 277 "frt_q_parser.y"
|
1696
|
+
{ FLDS((yyval.query), get_r_q(qp, field, (yyvsp[-2].str), (yyvsp[-1].str), false, false)); Y}
|
1697
|
+
#line 1698 "frt_q_parser.c"
|
1698
|
+
break;
|
1699
|
+
|
1700
|
+
case 44: /* range_q: '<' QWRD '}' */
|
1701
|
+
#line 278 "frt_q_parser.y"
|
1702
|
+
{ FLDS((yyval.query), get_r_q(qp, field, NULL,(yyvsp[-1].str), false, false)); Y}
|
1703
|
+
#line 1704 "frt_q_parser.c"
|
1704
|
+
break;
|
1705
|
+
|
1706
|
+
case 45: /* range_q: '<' QWRD ']' */
|
1707
|
+
#line 279 "frt_q_parser.y"
|
1708
|
+
{ FLDS((yyval.query), get_r_q(qp, field, NULL,(yyvsp[-1].str), false, true)); Y}
|
1709
|
+
#line 1710 "frt_q_parser.c"
|
1710
|
+
break;
|
1711
|
+
|
1712
|
+
case 46: /* range_q: '[' QWRD '>' */
|
1713
|
+
#line 280 "frt_q_parser.y"
|
1714
|
+
{ FLDS((yyval.query), get_r_q(qp, field, (yyvsp[-1].str), NULL,true, false)); Y}
|
1715
|
+
#line 1716 "frt_q_parser.c"
|
1716
|
+
break;
|
1717
|
+
|
1718
|
+
case 47: /* range_q: '{' QWRD '>' */
|
1719
|
+
#line 281 "frt_q_parser.y"
|
1720
|
+
{ FLDS((yyval.query), get_r_q(qp, field, (yyvsp[-1].str), NULL,false, false)); Y}
|
1721
|
+
#line 1722 "frt_q_parser.c"
|
1722
|
+
break;
|
1723
|
+
|
1724
|
+
case 48: /* range_q: '<' QWRD */
|
1725
|
+
#line 282 "frt_q_parser.y"
|
1726
|
+
{ FLDS((yyval.query), get_r_q(qp, field, NULL,(yyvsp[0].str), false, false)); Y}
|
1727
|
+
#line 1728 "frt_q_parser.c"
|
1728
|
+
break;
|
1729
|
+
|
1730
|
+
case 49: /* range_q: '<' '=' QWRD */
|
1731
|
+
#line 283 "frt_q_parser.y"
|
1732
|
+
{ FLDS((yyval.query), get_r_q(qp, field, NULL,(yyvsp[0].str), false, true)); Y}
|
1733
|
+
#line 1734 "frt_q_parser.c"
|
1734
|
+
break;
|
1735
|
+
|
1736
|
+
case 50: /* range_q: '>' '=' QWRD */
|
1737
|
+
#line 284 "frt_q_parser.y"
|
1738
|
+
{ FLDS((yyval.query), get_r_q(qp, field, (yyvsp[0].str), NULL,true, false)); Y}
|
1739
|
+
#line 1740 "frt_q_parser.c"
|
1740
|
+
break;
|
1741
|
+
|
1742
|
+
case 51: /* range_q: '>' QWRD */
|
1743
|
+
#line 285 "frt_q_parser.y"
|
1744
|
+
{ FLDS((yyval.query), get_r_q(qp, field, (yyvsp[0].str), NULL,false, false)); Y}
|
1745
|
+
#line 1746 "frt_q_parser.c"
|
1746
|
+
break;
|
1747
|
+
|
1748
|
+
|
1749
|
+
#line 1750 "frt_q_parser.c"
|
1750
|
+
|
1751
|
+
default: break;
|
1752
|
+
}
|
1753
|
+
/* User semantic actions sometimes alter yychar, and that requires
|
1754
|
+
that yytoken be updated with the new translation. We take the
|
1755
|
+
approach of translating immediately before every use of yytoken.
|
1756
|
+
One alternative is translating here after every semantic action,
|
1757
|
+
but that translation would be missed if the semantic action invokes
|
1758
|
+
YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
|
1759
|
+
if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
|
1760
|
+
incorrect destructor might then be invoked immediately. In the
|
1761
|
+
case of YYERROR or YYBACKUP, subsequent parser actions might lead
|
1762
|
+
to an incorrect destructor call or verbose syntax error message
|
1763
|
+
before the lookahead is translated. */
|
1764
|
+
YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc);
|
1765
|
+
|
1766
|
+
YYPOPSTACK (yylen);
|
1767
|
+
yylen = 0;
|
1768
|
+
|
1769
|
+
*++yyvsp = yyval;
|
1770
|
+
|
1771
|
+
/* Now 'shift' the result of the reduction. Determine what state
|
1772
|
+
that goes to, based on the state we popped back to and the rule
|
1773
|
+
number reduced by. */
|
1774
|
+
{
|
1775
|
+
const int yylhs = yyr1[yyn] - YYNTOKENS;
|
1776
|
+
const int yyi = yypgoto[yylhs] + *yyssp;
|
1777
|
+
yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
|
1778
|
+
? yytable[yyi]
|
1779
|
+
: yydefgoto[yylhs]);
|
1780
|
+
}
|
1781
|
+
|
1782
|
+
goto yynewstate;
|
1783
|
+
|
1784
|
+
|
1785
|
+
/*--------------------------------------.
|
1786
|
+
| yyerrlab -- here on detecting error. |
|
1787
|
+
`--------------------------------------*/
|
1788
|
+
yyerrlab:
|
1789
|
+
/* Make sure we have latest lookahead translation. See comments at
|
1790
|
+
user semantic actions for why this is necessary. */
|
1791
|
+
yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar);
|
1792
|
+
/* If not already recovering from an error, report this error. */
|
1793
|
+
if (!yyerrstatus)
|
1794
|
+
{
|
1795
|
+
++yynerrs;
|
1796
|
+
yyerror (qp, YY_("syntax error"));
|
1797
|
+
}
|
1798
|
+
|
1799
|
+
if (yyerrstatus == 3)
|
1800
|
+
{
|
1801
|
+
/* If just tried and failed to reuse lookahead token after an
|
1802
|
+
error, discard it. */
|
1803
|
+
|
1804
|
+
if (yychar <= YYEOF)
|
1805
|
+
{
|
1806
|
+
/* Return failure if at end of input. */
|
1807
|
+
if (yychar == YYEOF)
|
1808
|
+
YYABORT;
|
1809
|
+
}
|
1810
|
+
else
|
1811
|
+
{
|
1812
|
+
yydestruct ("Error: discarding",
|
1813
|
+
yytoken, &yylval, qp);
|
1814
|
+
yychar = YYEMPTY;
|
1815
|
+
}
|
1816
|
+
}
|
1817
|
+
|
1818
|
+
/* Else will try to reuse lookahead token after shifting the error
|
1819
|
+
token. */
|
1820
|
+
goto yyerrlab1;
|
1821
|
+
|
1822
|
+
|
1823
|
+
/*---------------------------------------------------.
|
1824
|
+
| yyerrorlab -- error raised explicitly by YYERROR. |
|
1825
|
+
`---------------------------------------------------*/
|
1826
|
+
yyerrorlab:
|
1827
|
+
/* Pacify compilers when the user code never invokes YYERROR and the
|
1828
|
+
label yyerrorlab therefore never appears in user code. */
|
1829
|
+
if (0)
|
1830
|
+
YYERROR;
|
1831
|
+
++yynerrs;
|
1832
|
+
|
1833
|
+
/* Do not reclaim the symbols of the rule whose action triggered
|
1834
|
+
this YYERROR. */
|
1835
|
+
YYPOPSTACK (yylen);
|
1836
|
+
yylen = 0;
|
1837
|
+
YY_STACK_PRINT (yyss, yyssp);
|
1838
|
+
yystate = *yyssp;
|
1839
|
+
goto yyerrlab1;
|
1840
|
+
|
1841
|
+
|
1842
|
+
/*-------------------------------------------------------------.
|
1843
|
+
| yyerrlab1 -- common code for both syntax error and YYERROR. |
|
1844
|
+
`-------------------------------------------------------------*/
|
1845
|
+
yyerrlab1:
|
1846
|
+
yyerrstatus = 3; /* Each real token shifted decrements this. */
|
1847
|
+
|
1848
|
+
/* Pop stack until we find a state that shifts the error token. */
|
1849
|
+
for (;;)
|
1850
|
+
{
|
1851
|
+
yyn = yypact[yystate];
|
1852
|
+
if (!yypact_value_is_default (yyn))
|
1853
|
+
{
|
1854
|
+
yyn += YYSYMBOL_YYerror;
|
1855
|
+
if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
|
1856
|
+
{
|
1857
|
+
yyn = yytable[yyn];
|
1858
|
+
if (0 < yyn)
|
1859
|
+
break;
|
1860
|
+
}
|
1861
|
+
}
|
1862
|
+
|
1863
|
+
/* Pop the current state because it cannot handle the error token. */
|
1864
|
+
if (yyssp == yyss)
|
1865
|
+
YYABORT;
|
1866
|
+
|
1867
|
+
|
1868
|
+
yydestruct ("Error: popping",
|
1869
|
+
YY_ACCESSING_SYMBOL (yystate), yyvsp, qp);
|
1870
|
+
YYPOPSTACK (1);
|
1871
|
+
yystate = *yyssp;
|
1872
|
+
YY_STACK_PRINT (yyss, yyssp);
|
1873
|
+
}
|
1874
|
+
|
1875
|
+
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
|
1876
|
+
*++yyvsp = yylval;
|
1877
|
+
YY_IGNORE_MAYBE_UNINITIALIZED_END
|
1878
|
+
|
1879
|
+
|
1880
|
+
/* Shift the error token. */
|
1881
|
+
YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp);
|
1882
|
+
|
1883
|
+
yystate = yyn;
|
1884
|
+
goto yynewstate;
|
1885
|
+
|
1886
|
+
|
1887
|
+
/*-------------------------------------.
|
1888
|
+
| yyacceptlab -- YYACCEPT comes here. |
|
1889
|
+
`-------------------------------------*/
|
1890
|
+
yyacceptlab:
|
1891
|
+
yyresult = 0;
|
1892
|
+
goto yyreturnlab;
|
1893
|
+
|
1894
|
+
|
1895
|
+
/*-----------------------------------.
|
1896
|
+
| yyabortlab -- YYABORT comes here. |
|
1897
|
+
`-----------------------------------*/
|
1898
|
+
yyabortlab:
|
1899
|
+
yyresult = 1;
|
1900
|
+
goto yyreturnlab;
|
1901
|
+
|
1902
|
+
|
1903
|
+
/*-----------------------------------------------------------.
|
1904
|
+
| yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. |
|
1905
|
+
`-----------------------------------------------------------*/
|
1906
|
+
yyexhaustedlab:
|
1907
|
+
yyerror (qp, YY_("memory exhausted"));
|
1908
|
+
yyresult = 2;
|
1909
|
+
goto yyreturnlab;
|
1910
|
+
|
1911
|
+
|
1912
|
+
/*----------------------------------------------------------.
|
1913
|
+
| yyreturnlab -- parsing is finished, clean up and return. |
|
1914
|
+
`----------------------------------------------------------*/
|
1915
|
+
yyreturnlab:
|
1916
|
+
if (yychar != YYEMPTY)
|
1917
|
+
{
|
1918
|
+
/* Make sure we have latest lookahead translation. See comments at
|
1919
|
+
user semantic actions for why this is necessary. */
|
1920
|
+
yytoken = YYTRANSLATE (yychar);
|
1921
|
+
yydestruct ("Cleanup: discarding lookahead",
|
1922
|
+
yytoken, &yylval, qp);
|
1923
|
+
}
|
1924
|
+
/* Do not reclaim the symbols of the rule whose action triggered
|
1925
|
+
this YYABORT or YYACCEPT. */
|
1926
|
+
YYPOPSTACK (yylen);
|
1927
|
+
YY_STACK_PRINT (yyss, yyssp);
|
1928
|
+
while (yyssp != yyss)
|
1929
|
+
{
|
1930
|
+
yydestruct ("Cleanup: popping",
|
1931
|
+
YY_ACCESSING_SYMBOL (+*yyssp), yyvsp, qp);
|
1932
|
+
YYPOPSTACK (1);
|
1933
|
+
}
|
1934
|
+
#ifndef yyoverflow
|
1935
|
+
if (yyss != yyssa)
|
1936
|
+
YYSTACK_FREE (yyss);
|
1937
|
+
#endif
|
1938
|
+
|
1939
|
+
return yyresult;
|
1940
|
+
}
|
1941
|
+
|
1942
|
+
#line 287 "frt_q_parser.y"
|
2010
1943
|
|
2011
1944
|
|
2012
1945
|
static const char *special_char = "&:()[]{}!\"~^|<>=*?+-";
|
@@ -2225,7 +2158,7 @@ static FrtTokenStream *get_cached_ts(FrtQParser *qp, FrtSymbol field, char *text
|
|
2225
2158
|
* if 0 or 1 clauses are present to NULL or the actual query in the clause
|
2226
2159
|
* respectively.
|
2227
2160
|
*/
|
2228
|
-
static FrtQuery *get_bool_q(
|
2161
|
+
static FrtQuery *get_bool_q(FrtBCArray *bca)
|
2229
2162
|
{
|
2230
2163
|
FrtQuery *q;
|
2231
2164
|
const int clause_count = bca->size;
|
@@ -2261,10 +2194,10 @@ static FrtQuery *get_bool_q(BCArray *bca)
|
|
2261
2194
|
}
|
2262
2195
|
|
2263
2196
|
/**
|
2264
|
-
* Base method for appending BooleanClauses to a
|
2197
|
+
* Base method for appending BooleanClauses to a FrtBooleanClause array. This
|
2265
2198
|
* method doesn't care about the type of clause (MUST, SHOULD, MUST_NOT).
|
2266
2199
|
*/
|
2267
|
-
static void bca_add_clause(
|
2200
|
+
static void bca_add_clause(FrtBCArray *bca, FrtBooleanClause *clause)
|
2268
2201
|
{
|
2269
2202
|
if (bca->size >= bca->capa) {
|
2270
2203
|
bca->capa <<= 1;
|
@@ -2278,9 +2211,9 @@ static void bca_add_clause(BCArray *bca, FrtBooleanClause *clause)
|
|
2278
2211
|
* Add the first clause to a BooleanClause array. This method is also
|
2279
2212
|
* responsible for allocating a new BooleanClause array.
|
2280
2213
|
*/
|
2281
|
-
static
|
2214
|
+
static FrtBCArray *first_cls(FrtBooleanClause *clause)
|
2282
2215
|
{
|
2283
|
-
|
2216
|
+
FrtBCArray *bca = FRT_ALLOC_AND_ZERO(FrtBCArray);
|
2284
2217
|
bca->capa = BCA_INIT_CAPA;
|
2285
2218
|
bca->clauses = FRT_ALLOC_N(FrtBooleanClause *, BCA_INIT_CAPA);
|
2286
2219
|
if (clause) {
|
@@ -2295,7 +2228,7 @@ static BCArray *first_cls(FrtBooleanClause *clause)
|
|
2295
2228
|
* MUST clauses. (If they are currently MUST_NOT clauses they stay as they
|
2296
2229
|
* are.)
|
2297
2230
|
*/
|
2298
|
-
static
|
2231
|
+
static FrtBCArray *add_and_cls(FrtBCArray *bca, FrtBooleanClause *clause)
|
2299
2232
|
{
|
2300
2233
|
if (clause) {
|
2301
2234
|
if (bca->size == 1) {
|
@@ -2314,7 +2247,7 @@ static BCArray *add_and_cls(BCArray *bca, FrtBooleanClause *clause)
|
|
2314
2247
|
/**
|
2315
2248
|
* Add SHOULD clause to the BooleanClause array.
|
2316
2249
|
*/
|
2317
|
-
static
|
2250
|
+
static FrtBCArray *add_or_cls(FrtBCArray *bca, FrtBooleanClause *clause)
|
2318
2251
|
{
|
2319
2252
|
if (clause) {
|
2320
2253
|
bca_add_clause(bca, clause);
|
@@ -2326,7 +2259,7 @@ static BCArray *add_or_cls(BCArray *bca, FrtBooleanClause *clause)
|
|
2326
2259
|
* Add AND or OR clause to the BooleanClause array, depending on the default
|
2327
2260
|
* clause type.
|
2328
2261
|
*/
|
2329
|
-
static
|
2262
|
+
static FrtBCArray *add_default_cls(FrtQParser *qp, FrtBCArray *bca,
|
2330
2263
|
FrtBooleanClause *clause)
|
2331
2264
|
{
|
2332
2265
|
if (qp->or_default) {
|
@@ -2341,7 +2274,7 @@ static BCArray *add_default_cls(FrtQParser *qp, BCArray *bca,
|
|
2341
2274
|
/**
|
2342
2275
|
* destroy array of BooleanClauses
|
2343
2276
|
*/
|
2344
|
-
static void bca_destroy(
|
2277
|
+
static void bca_destroy(FrtBCArray *bca)
|
2345
2278
|
{
|
2346
2279
|
int i;
|
2347
2280
|
for (i = 0; i < bca->size; i++) {
|
@@ -2885,6 +2818,7 @@ FrtQParser *frt_qp_new(FrtAnalyzer *analyzer)
|
|
2885
2818
|
self->tokenized_fields = frt_hs_new_ptr(NULL);
|
2886
2819
|
self->fields_top = NULL;
|
2887
2820
|
|
2821
|
+
/* make sure all_fields contains the default fields */
|
2888
2822
|
qp_push_fields(self, self->def_fields, false);
|
2889
2823
|
|
2890
2824
|
self->analyzer = analyzer;
|
@@ -3061,10 +2995,10 @@ FrtQuery *qp_parse(FrtQParser *self, char *qstr)
|
|
3061
2995
|
}
|
3062
2996
|
self->fields = self->def_fields;
|
3063
2997
|
self->result = NULL;
|
2998
|
+
|
3064
2999
|
if (0 == yyparse(self)) {
|
3065
3000
|
result = self->result;
|
3066
3001
|
}
|
3067
|
-
|
3068
3002
|
if (!result && self->handle_parse_errors) {
|
3069
3003
|
self->destruct = false;
|
3070
3004
|
result = qp_get_bad_query(self, self->qstr);
|
@@ -3081,4 +3015,3 @@ FrtQuery *qp_parse(FrtQParser *self, char *qstr)
|
|
3081
3015
|
frt_mutex_unlock(&self->mutex);
|
3082
3016
|
return result;
|
3083
3017
|
}
|
3084
|
-
|