1 | /* A Bison parser, made by GNU Bison 3.0.2. */ |
---|
2 | |
---|
3 | /* Bison implementation for Yacc-like parsers in C |
---|
4 | |
---|
5 | Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. |
---|
6 | |
---|
7 | This program is free software: you can redistribute it and/or modify |
---|
8 | it under the terms of the GNU General Public License as published by |
---|
9 | the Free Software Foundation, either version 3 of the License, or |
---|
10 | (at your option) any later version. |
---|
11 | |
---|
12 | This program is distributed in the hope that it will be useful, |
---|
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
15 | GNU General Public License for more details. |
---|
16 | |
---|
17 | You should have received a copy of the GNU General Public License |
---|
18 | along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
---|
19 | |
---|
20 | /* As a special exception, you may create a larger work that contains |
---|
21 | part or all of the Bison parser skeleton and distribute that work |
---|
22 | under terms of your choice, so long as that work isn't itself a |
---|
23 | parser generator using the skeleton or a modified version thereof |
---|
24 | as a parser skeleton. Alternatively, if you modify or redistribute |
---|
25 | the parser skeleton itself, you may (at your option) remove this |
---|
26 | special exception, which will cause the skeleton and the resulting |
---|
27 | Bison output files to be licensed under the GNU General Public |
---|
28 | License without this special exception. |
---|
29 | |
---|
30 | This special exception was added by the Free Software Foundation in |
---|
31 | version 2.2 of Bison. */ |
---|
32 | |
---|
33 | /* C LALR(1) parser skeleton written by Richard Stallman, by |
---|
34 | simplifying the original so-called "semantic" parser. */ |
---|
35 | |
---|
36 | /* All symbols defined below should begin with yy or YY, to avoid |
---|
37 | infringing on user name space. This should be done even for local |
---|
38 | variables, as they might otherwise be expanded by user macros. |
---|
39 | There are some unavoidable exceptions within include files to |
---|
40 | define necessary library symbols; they are noted "INFRINGES ON |
---|
41 | USER NAME SPACE" below. */ |
---|
42 | |
---|
43 | /* Identify Bison output. */ |
---|
44 | #define YYBISON 1 |
---|
45 | |
---|
46 | /* Bison version. */ |
---|
47 | #define YYBISON_VERSION "3.0.2" |
---|
48 | |
---|
49 | /* Skeleton name. */ |
---|
50 | #define YYSKELETON_NAME "yacc.c" |
---|
51 | |
---|
52 | /* Pure parsers. */ |
---|
53 | #define YYPURE 0 |
---|
54 | |
---|
55 | /* Push parsers. */ |
---|
56 | #define YYPUSH 0 |
---|
57 | |
---|
58 | /* Pull parsers. */ |
---|
59 | #define YYPULL 1 |
---|
60 | |
---|
61 | |
---|
62 | |
---|
63 | |
---|
64 | /* Copy the first part of user declarations. */ |
---|
65 | #line 1 "yacc_parser.yacc" /* yacc.c:339 */ |
---|
66 | |
---|
67 | #include "filter_expr_node.hpp" |
---|
68 | #include <string> |
---|
69 | #include <iostream> |
---|
70 | #include "exception.hpp" |
---|
71 | |
---|
72 | using namespace std; |
---|
73 | using namespace xios; |
---|
74 | |
---|
75 | extern "C" |
---|
76 | { |
---|
77 | int yyparse(void); |
---|
78 | int yylex(void); |
---|
79 | int yyerror(const char *s); |
---|
80 | } |
---|
81 | |
---|
82 | IFilterExprNode* parsed; |
---|
83 | std::string globalInputText; |
---|
84 | size_t globalReadOffset = 0; |
---|
85 | |
---|
86 | int readInputForLexer(char* buffer, size_t* numBytesRead, size_t maxBytesToRead) |
---|
87 | { |
---|
88 | size_t numBytesToRead = maxBytesToRead; |
---|
89 | size_t bytesRemaining = globalInputText.length()-globalReadOffset; |
---|
90 | size_t i; |
---|
91 | if (numBytesToRead > bytesRemaining) numBytesToRead = bytesRemaining; |
---|
92 | for (i = 0; i < numBytesToRead; i++) buffer[i] = globalInputText.c_str()[globalReadOffset + i]; |
---|
93 | *numBytesRead = numBytesToRead; |
---|
94 | globalReadOffset += numBytesToRead; |
---|
95 | return 0; |
---|
96 | } |
---|
97 | |
---|
98 | #line 99 "yacc_parser.cpp" /* yacc.c:339 */ |
---|
99 | |
---|
100 | # ifndef YY_NULLPTR |
---|
101 | # if defined __cplusplus && 201103L <= __cplusplus |
---|
102 | # define YY_NULLPTR nullptr |
---|
103 | # else |
---|
104 | # define YY_NULLPTR 0 |
---|
105 | # endif |
---|
106 | # endif |
---|
107 | |
---|
108 | /* Enabling verbose error messages. */ |
---|
109 | #ifdef YYERROR_VERBOSE |
---|
110 | # undef YYERROR_VERBOSE |
---|
111 | # define YYERROR_VERBOSE 1 |
---|
112 | #else |
---|
113 | # define YYERROR_VERBOSE 0 |
---|
114 | #endif |
---|
115 | |
---|
116 | /* In a future release of Bison, this section will be replaced |
---|
117 | by #include "yacc_parser.hpp". */ |
---|
118 | #ifndef YY_YY_YACC_PARSER_HPP_INCLUDED |
---|
119 | # define YY_YY_YACC_PARSER_HPP_INCLUDED |
---|
120 | /* Debug traces. */ |
---|
121 | #ifndef YYDEBUG |
---|
122 | # define YYDEBUG 0 |
---|
123 | #endif |
---|
124 | #if YYDEBUG |
---|
125 | extern int yydebug; |
---|
126 | #endif |
---|
127 | |
---|
128 | /* Token type. */ |
---|
129 | #ifndef YYTOKENTYPE |
---|
130 | # define YYTOKENTYPE |
---|
131 | enum yytokentype |
---|
132 | { |
---|
133 | NUMBER = 258, |
---|
134 | VAR = 259, |
---|
135 | ID = 260, |
---|
136 | AVERAGE = 261, |
---|
137 | PLUS = 262, |
---|
138 | MINUS = 263, |
---|
139 | TIMES = 264, |
---|
140 | DIVIDE = 265, |
---|
141 | POWER = 266, |
---|
142 | EQ = 267, |
---|
143 | LT = 268, |
---|
144 | GT = 269, |
---|
145 | LE = 270, |
---|
146 | GE = 271, |
---|
147 | LEFT_PARENTHESIS = 272, |
---|
148 | RIGHT_PARENTHESIS = 273, |
---|
149 | END = 274, |
---|
150 | NEG = 275 |
---|
151 | }; |
---|
152 | #endif |
---|
153 | |
---|
154 | /* Value type. */ |
---|
155 | #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED |
---|
156 | typedef union YYSTYPE YYSTYPE; |
---|
157 | union YYSTYPE |
---|
158 | { |
---|
159 | #line 35 "yacc_parser.yacc" /* yacc.c:355 */ |
---|
160 | |
---|
161 | std::string* str; /* symbol table index */ |
---|
162 | xios::IScalarExprNode* scalarNode; |
---|
163 | xios::IFilterExprNode* filterNode; |
---|
164 | |
---|
165 | #line 166 "yacc_parser.cpp" /* yacc.c:355 */ |
---|
166 | }; |
---|
167 | # define YYSTYPE_IS_TRIVIAL 1 |
---|
168 | # define YYSTYPE_IS_DECLARED 1 |
---|
169 | #endif |
---|
170 | |
---|
171 | |
---|
172 | extern YYSTYPE yylval; |
---|
173 | |
---|
174 | int yyparse (void); |
---|
175 | |
---|
176 | #endif /* !YY_YY_YACC_PARSER_HPP_INCLUDED */ |
---|
177 | |
---|
178 | /* Copy the second part of user declarations. */ |
---|
179 | |
---|
180 | #line 181 "yacc_parser.cpp" /* yacc.c:358 */ |
---|
181 | |
---|
182 | #ifdef short |
---|
183 | # undef short |
---|
184 | #endif |
---|
185 | |
---|
186 | #ifdef YYTYPE_UINT8 |
---|
187 | typedef YYTYPE_UINT8 yytype_uint8; |
---|
188 | #else |
---|
189 | typedef unsigned char yytype_uint8; |
---|
190 | #endif |
---|
191 | |
---|
192 | #ifdef YYTYPE_INT8 |
---|
193 | typedef YYTYPE_INT8 yytype_int8; |
---|
194 | #else |
---|
195 | typedef signed char yytype_int8; |
---|
196 | #endif |
---|
197 | |
---|
198 | #ifdef YYTYPE_UINT16 |
---|
199 | typedef YYTYPE_UINT16 yytype_uint16; |
---|
200 | #else |
---|
201 | typedef unsigned short int yytype_uint16; |
---|
202 | #endif |
---|
203 | |
---|
204 | #ifdef YYTYPE_INT16 |
---|
205 | typedef YYTYPE_INT16 yytype_int16; |
---|
206 | #else |
---|
207 | typedef short int yytype_int16; |
---|
208 | #endif |
---|
209 | |
---|
210 | #ifndef YYSIZE_T |
---|
211 | # ifdef __SIZE_TYPE__ |
---|
212 | # define YYSIZE_T __SIZE_TYPE__ |
---|
213 | # elif defined size_t |
---|
214 | # define YYSIZE_T size_t |
---|
215 | # elif ! defined YYSIZE_T |
---|
216 | # include <stddef.h> /* INFRINGES ON USER NAME SPACE */ |
---|
217 | # define YYSIZE_T size_t |
---|
218 | # else |
---|
219 | # define YYSIZE_T unsigned int |
---|
220 | # endif |
---|
221 | #endif |
---|
222 | |
---|
223 | #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) |
---|
224 | |
---|
225 | #ifndef YY_ |
---|
226 | # if defined YYENABLE_NLS && YYENABLE_NLS |
---|
227 | # if ENABLE_NLS |
---|
228 | # include <libintl.h> /* INFRINGES ON USER NAME SPACE */ |
---|
229 | # define YY_(Msgid) dgettext ("bison-runtime", Msgid) |
---|
230 | # endif |
---|
231 | # endif |
---|
232 | # ifndef YY_ |
---|
233 | # define YY_(Msgid) Msgid |
---|
234 | # endif |
---|
235 | #endif |
---|
236 | |
---|
237 | #ifndef YY_ATTRIBUTE |
---|
238 | # if (defined __GNUC__ \ |
---|
239 | && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ |
---|
240 | || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C |
---|
241 | # define YY_ATTRIBUTE(Spec) __attribute__(Spec) |
---|
242 | # else |
---|
243 | # define YY_ATTRIBUTE(Spec) /* empty */ |
---|
244 | # endif |
---|
245 | #endif |
---|
246 | |
---|
247 | #ifndef YY_ATTRIBUTE_PURE |
---|
248 | # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) |
---|
249 | #endif |
---|
250 | |
---|
251 | #ifndef YY_ATTRIBUTE_UNUSED |
---|
252 | # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) |
---|
253 | #endif |
---|
254 | |
---|
255 | #if !defined _Noreturn \ |
---|
256 | && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112) |
---|
257 | # if defined _MSC_VER && 1200 <= _MSC_VER |
---|
258 | # define _Noreturn __declspec (noreturn) |
---|
259 | # else |
---|
260 | # define _Noreturn YY_ATTRIBUTE ((__noreturn__)) |
---|
261 | # endif |
---|
262 | #endif |
---|
263 | |
---|
264 | /* Suppress unused-variable warnings by "using" E. */ |
---|
265 | #if ! defined lint || defined __GNUC__ |
---|
266 | # define YYUSE(E) ((void) (E)) |
---|
267 | #else |
---|
268 | # define YYUSE(E) /* empty */ |
---|
269 | #endif |
---|
270 | |
---|
271 | #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ |
---|
272 | /* Suppress an incorrect diagnostic about yylval being uninitialized. */ |
---|
273 | # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ |
---|
274 | _Pragma ("GCC diagnostic push") \ |
---|
275 | _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ |
---|
276 | _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") |
---|
277 | # define YY_IGNORE_MAYBE_UNINITIALIZED_END \ |
---|
278 | _Pragma ("GCC diagnostic pop") |
---|
279 | #else |
---|
280 | # define YY_INITIAL_VALUE(Value) Value |
---|
281 | #endif |
---|
282 | #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
---|
283 | # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
---|
284 | # define YY_IGNORE_MAYBE_UNINITIALIZED_END |
---|
285 | #endif |
---|
286 | #ifndef YY_INITIAL_VALUE |
---|
287 | # define YY_INITIAL_VALUE(Value) /* Nothing. */ |
---|
288 | #endif |
---|
289 | |
---|
290 | |
---|
291 | #if ! defined yyoverflow || YYERROR_VERBOSE |
---|
292 | |
---|
293 | /* The parser invokes alloca or malloc; define the necessary symbols. */ |
---|
294 | |
---|
295 | # ifdef YYSTACK_USE_ALLOCA |
---|
296 | # if YYSTACK_USE_ALLOCA |
---|
297 | # ifdef __GNUC__ |
---|
298 | # define YYSTACK_ALLOC __builtin_alloca |
---|
299 | # elif defined __BUILTIN_VA_ARG_INCR |
---|
300 | # include <alloca.h> /* INFRINGES ON USER NAME SPACE */ |
---|
301 | # elif defined _AIX |
---|
302 | # define YYSTACK_ALLOC __alloca |
---|
303 | # elif defined _MSC_VER |
---|
304 | # include <malloc.h> /* INFRINGES ON USER NAME SPACE */ |
---|
305 | # define alloca _alloca |
---|
306 | # else |
---|
307 | # define YYSTACK_ALLOC alloca |
---|
308 | # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS |
---|
309 | # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ |
---|
310 | /* Use EXIT_SUCCESS as a witness for stdlib.h. */ |
---|
311 | # ifndef EXIT_SUCCESS |
---|
312 | # define EXIT_SUCCESS 0 |
---|
313 | # endif |
---|
314 | # endif |
---|
315 | # endif |
---|
316 | # endif |
---|
317 | # endif |
---|
318 | |
---|
319 | # ifdef YYSTACK_ALLOC |
---|
320 | /* Pacify GCC's 'empty if-body' warning. */ |
---|
321 | # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) |
---|
322 | # ifndef YYSTACK_ALLOC_MAXIMUM |
---|
323 | /* The OS might guarantee only one guard page at the bottom of the stack, |
---|
324 | and a page size can be as small as 4096 bytes. So we cannot safely |
---|
325 | invoke alloca (N) if N exceeds 4096. Use a slightly smaller number |
---|
326 | to allow for a few compiler-allocated temporary stack slots. */ |
---|
327 | # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ |
---|
328 | # endif |
---|
329 | # else |
---|
330 | # define YYSTACK_ALLOC YYMALLOC |
---|
331 | # define YYSTACK_FREE YYFREE |
---|
332 | # ifndef YYSTACK_ALLOC_MAXIMUM |
---|
333 | # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM |
---|
334 | # endif |
---|
335 | # if (defined __cplusplus && ! defined EXIT_SUCCESS \ |
---|
336 | && ! ((defined YYMALLOC || defined malloc) \ |
---|
337 | && (defined YYFREE || defined free))) |
---|
338 | # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ |
---|
339 | # ifndef EXIT_SUCCESS |
---|
340 | # define EXIT_SUCCESS 0 |
---|
341 | # endif |
---|
342 | # endif |
---|
343 | # ifndef YYMALLOC |
---|
344 | # define YYMALLOC malloc |
---|
345 | # if ! defined malloc && ! defined EXIT_SUCCESS |
---|
346 | void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ |
---|
347 | # endif |
---|
348 | # endif |
---|
349 | # ifndef YYFREE |
---|
350 | # define YYFREE free |
---|
351 | # if ! defined free && ! defined EXIT_SUCCESS |
---|
352 | void free (void *); /* INFRINGES ON USER NAME SPACE */ |
---|
353 | # endif |
---|
354 | # endif |
---|
355 | # endif |
---|
356 | #endif /* ! defined yyoverflow || YYERROR_VERBOSE */ |
---|
357 | |
---|
358 | |
---|
359 | #if (! defined yyoverflow \ |
---|
360 | && (! defined __cplusplus \ |
---|
361 | || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) |
---|
362 | |
---|
363 | /* A type that is properly aligned for any stack member. */ |
---|
364 | union yyalloc |
---|
365 | { |
---|
366 | yytype_int16 yyss_alloc; |
---|
367 | YYSTYPE yyvs_alloc; |
---|
368 | }; |
---|
369 | |
---|
370 | /* The size of the maximum gap between one aligned stack and the next. */ |
---|
371 | # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) |
---|
372 | |
---|
373 | /* The size of an array large to enough to hold all stacks, each with |
---|
374 | N elements. */ |
---|
375 | # define YYSTACK_BYTES(N) \ |
---|
376 | ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ |
---|
377 | + YYSTACK_GAP_MAXIMUM) |
---|
378 | |
---|
379 | # define YYCOPY_NEEDED 1 |
---|
380 | |
---|
381 | /* Relocate STACK from its old location to the new one. The |
---|
382 | local variables YYSIZE and YYSTACKSIZE give the old and new number of |
---|
383 | elements in the stack, and YYPTR gives the new location of the |
---|
384 | stack. Advance YYPTR to a properly aligned location for the next |
---|
385 | stack. */ |
---|
386 | # define YYSTACK_RELOCATE(Stack_alloc, Stack) \ |
---|
387 | do \ |
---|
388 | { \ |
---|
389 | YYSIZE_T yynewbytes; \ |
---|
390 | YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ |
---|
391 | Stack = &yyptr->Stack_alloc; \ |
---|
392 | yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ |
---|
393 | yyptr += yynewbytes / sizeof (*yyptr); \ |
---|
394 | } \ |
---|
395 | while (0) |
---|
396 | |
---|
397 | #endif |
---|
398 | |
---|
399 | #if defined YYCOPY_NEEDED && YYCOPY_NEEDED |
---|
400 | /* Copy COUNT objects from SRC to DST. The source and destination do |
---|
401 | not overlap. */ |
---|
402 | # ifndef YYCOPY |
---|
403 | # if defined __GNUC__ && 1 < __GNUC__ |
---|
404 | # define YYCOPY(Dst, Src, Count) \ |
---|
405 | __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) |
---|
406 | # else |
---|
407 | # define YYCOPY(Dst, Src, Count) \ |
---|
408 | do \ |
---|
409 | { \ |
---|
410 | YYSIZE_T yyi; \ |
---|
411 | for (yyi = 0; yyi < (Count); yyi++) \ |
---|
412 | (Dst)[yyi] = (Src)[yyi]; \ |
---|
413 | } \ |
---|
414 | while (0) |
---|
415 | # endif |
---|
416 | # endif |
---|
417 | #endif /* !YYCOPY_NEEDED */ |
---|
418 | |
---|
419 | /* YYFINAL -- State number of the termination state. */ |
---|
420 | #define YYFINAL 16 |
---|
421 | /* YYLAST -- Last index in YYTABLE. */ |
---|
422 | #define YYLAST 204 |
---|
423 | |
---|
424 | /* YYNTOKENS -- Number of terminals. */ |
---|
425 | #define YYNTOKENS 21 |
---|
426 | /* YYNNTS -- Number of nonterminals. */ |
---|
427 | #define YYNNTS 4 |
---|
428 | /* YYNRULES -- Number of rules. */ |
---|
429 | #define YYNRULES 52 |
---|
430 | /* YYNSTATES -- Number of states. */ |
---|
431 | #define YYNSTATES 108 |
---|
432 | |
---|
433 | /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned |
---|
434 | by yylex, with out-of-bounds checking. */ |
---|
435 | #define YYUNDEFTOK 2 |
---|
436 | #define YYMAXUTOK 275 |
---|
437 | |
---|
438 | #define YYTRANSLATE(YYX) \ |
---|
439 | ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) |
---|
440 | |
---|
441 | /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM |
---|
442 | as returned by yylex, without out-of-bounds checking. */ |
---|
443 | static const yytype_uint8 yytranslate[] = |
---|
444 | { |
---|
445 | 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
446 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
447 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
448 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
449 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
450 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
451 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
452 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
453 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
454 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
455 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
456 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
457 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
458 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
459 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
460 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
461 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
462 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
463 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
464 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
465 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
466 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
467 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
468 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
469 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
470 | 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, |
---|
471 | 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, |
---|
472 | 15, 16, 17, 18, 19, 20 |
---|
473 | }; |
---|
474 | |
---|
475 | #if YYDEBUG |
---|
476 | /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ |
---|
477 | static const yytype_uint8 yyrline[] = |
---|
478 | { |
---|
479 | 0, 61, 61, 62, 66, 67, 68, 69, 70, 71, |
---|
480 | 72, 73, 74, 75, 76, 77, 78, 79, 80, 84, |
---|
481 | 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, |
---|
482 | 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, |
---|
483 | 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, |
---|
484 | 115, 116, 117 |
---|
485 | }; |
---|
486 | #endif |
---|
487 | |
---|
488 | #if YYDEBUG || YYERROR_VERBOSE || 0 |
---|
489 | /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. |
---|
490 | First, the terminals, then, starting at YYNTOKENS, nonterminals. */ |
---|
491 | static const char *const yytname[] = |
---|
492 | { |
---|
493 | "$end", "error", "$undefined", "NUMBER", "VAR", "ID", "AVERAGE", "PLUS", |
---|
494 | "MINUS", "TIMES", "DIVIDE", "POWER", "EQ", "LT", "GT", "LE", "GE", |
---|
495 | "LEFT_PARENTHESIS", "RIGHT_PARENTHESIS", "END", "NEG", "$accept", "Line", |
---|
496 | "Expression", "Field_expr", YY_NULLPTR |
---|
497 | }; |
---|
498 | #endif |
---|
499 | |
---|
500 | # ifdef YYPRINT |
---|
501 | /* YYTOKNUM[NUM] -- (External) token number corresponding to the |
---|
502 | (internal) symbol number NUM (which must be that of a token). */ |
---|
503 | static const yytype_uint16 yytoknum[] = |
---|
504 | { |
---|
505 | 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, |
---|
506 | 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, |
---|
507 | 275 |
---|
508 | }; |
---|
509 | # endif |
---|
510 | |
---|
511 | #define YYPACT_NINF -13 |
---|
512 | |
---|
513 | #define yypact_value_is_default(Yystate) \ |
---|
514 | (!!((Yystate) == (-13))) |
---|
515 | |
---|
516 | #define YYTABLE_NINF -1 |
---|
517 | |
---|
518 | #define yytable_value_is_error(Yytable_value) \ |
---|
519 | 0 |
---|
520 | |
---|
521 | /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing |
---|
522 | STATE-NUM. */ |
---|
523 | static const yytype_int16 yypact[] = |
---|
524 | { |
---|
525 | 90, -13, -13, -12, -13, 35, 35, -13, 44, 188, |
---|
526 | 103, 35, 24, 34, 116, 128, -13, 35, 35, 35, |
---|
527 | 35, 65, 35, 35, 35, 35, 35, 35, 35, 35, |
---|
528 | 35, 35, 35, 35, 35, 35, 35, -13, 140, 152, |
---|
529 | -13, -13, -7, 23, -7, 23, 24, 34, 24, 34, |
---|
530 | 54, 65, 65, 24, 0, 67, 0, 67, 0, 67, |
---|
531 | 0, 67, 0, 67, -7, 23, -7, 23, 24, 34, |
---|
532 | 24, 34, 24, 34, 0, 67, 0, 67, 0, 67, |
---|
533 | 0, 67, 0, 67, -13, -13, 65, 24, 164, 65, |
---|
534 | 65, 65, 65, 65, 65, 65, 65, 65, 176, 95, |
---|
535 | 95, 24, 24, 92, 92, 92, 92, 92 |
---|
536 | }; |
---|
537 | |
---|
538 | /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. |
---|
539 | Performed when YYTABLE does not specify something else to do. Zero |
---|
540 | means the default is an error. */ |
---|
541 | static const yytype_uint8 yydefact[] = |
---|
542 | { |
---|
543 | 0, 4, 5, 19, 20, 0, 0, 2, 0, 0, |
---|
544 | 0, 0, 10, 25, 0, 0, 1, 0, 0, 0, |
---|
545 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
---|
546 | 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, |
---|
547 | 17, 32, 6, 34, 7, 36, 8, 38, 9, 40, |
---|
548 | 0, 0, 0, 11, 12, 43, 13, 45, 14, 47, |
---|
549 | 15, 49, 16, 51, 33, 21, 35, 22, 37, 23, |
---|
550 | 39, 24, 41, 26, 42, 27, 44, 28, 46, 29, |
---|
551 | 48, 30, 50, 31, 18, 52, 0, 10, 0, 0, |
---|
552 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, |
---|
553 | 7, 8, 9, 12, 13, 14, 15, 16 |
---|
554 | }; |
---|
555 | |
---|
556 | /* YYPGOTO[NTERM-NUM]. */ |
---|
557 | static const yytype_int8 yypgoto[] = |
---|
558 | { |
---|
559 | -13, -13, -5, 31 |
---|
560 | }; |
---|
561 | |
---|
562 | /* YYDEFGOTO[NTERM-NUM]. */ |
---|
563 | static const yytype_int8 yydefgoto[] = |
---|
564 | { |
---|
565 | -1, 8, 9, 10 |
---|
566 | }; |
---|
567 | |
---|
568 | /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If |
---|
569 | positive, shift that token. If negative, reduce the rule whose |
---|
570 | number is the opposite. If YYTABLE_NINF, syntax error. */ |
---|
571 | static const yytype_uint8 yytable[] = |
---|
572 | { |
---|
573 | 12, 14, 19, 20, 21, 11, 38, 17, 18, 19, |
---|
574 | 20, 21, 42, 44, 46, 48, 53, 54, 56, 58, |
---|
575 | 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, |
---|
576 | 80, 82, 29, 30, 31, 21, 13, 15, 1, 2, |
---|
577 | 3, 4, 39, 5, 16, 31, 87, 88, 43, 45, |
---|
578 | 47, 49, 6, 55, 57, 59, 61, 63, 65, 67, |
---|
579 | 69, 71, 73, 75, 77, 79, 81, 83, 1, 2, |
---|
580 | 50, 86, 0, 51, 27, 28, 29, 30, 31, 0, |
---|
581 | 0, 98, 52, 0, 99, 100, 101, 102, 103, 104, |
---|
582 | 105, 106, 107, 1, 2, 3, 4, 0, 5, 89, |
---|
583 | 90, 91, 92, 21, 91, 92, 21, 6, 0, 7, |
---|
584 | 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, |
---|
585 | 0, 0, 37, 17, 18, 19, 20, 21, 22, 23, |
---|
586 | 24, 25, 26, 0, 40, 27, 28, 29, 30, 31, |
---|
587 | 32, 33, 34, 35, 36, 0, 41, 17, 18, 19, |
---|
588 | 20, 21, 22, 23, 24, 25, 26, 0, 84, 27, |
---|
589 | 28, 29, 30, 31, 32, 33, 34, 35, 36, 0, |
---|
590 | 85, 89, 90, 91, 92, 21, 93, 94, 95, 96, |
---|
591 | 97, 0, 40, 89, 90, 91, 92, 21, 93, 94, |
---|
592 | 95, 96, 97, 0, 84, 17, 18, 19, 20, 21, |
---|
593 | 22, 23, 24, 25, 26 |
---|
594 | }; |
---|
595 | |
---|
596 | static const yytype_int8 yycheck[] = |
---|
597 | { |
---|
598 | 5, 6, 9, 10, 11, 17, 11, 7, 8, 9, |
---|
599 | 10, 11, 17, 18, 19, 20, 21, 22, 23, 24, |
---|
600 | 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, |
---|
601 | 35, 36, 9, 10, 11, 11, 5, 6, 3, 4, |
---|
602 | 5, 6, 11, 8, 0, 11, 51, 52, 17, 18, |
---|
603 | 19, 20, 17, 22, 23, 24, 25, 26, 27, 28, |
---|
604 | 29, 30, 31, 32, 33, 34, 35, 36, 3, 4, |
---|
605 | 5, 17, -1, 8, 7, 8, 9, 10, 11, -1, |
---|
606 | -1, 86, 17, -1, 89, 90, 91, 92, 93, 94, |
---|
607 | 95, 96, 97, 3, 4, 5, 6, -1, 8, 7, |
---|
608 | 8, 9, 10, 11, 9, 10, 11, 17, -1, 19, |
---|
609 | 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, |
---|
610 | -1, -1, 19, 7, 8, 9, 10, 11, 12, 13, |
---|
611 | 14, 15, 16, -1, 18, 7, 8, 9, 10, 11, |
---|
612 | 12, 13, 14, 15, 16, -1, 18, 7, 8, 9, |
---|
613 | 10, 11, 12, 13, 14, 15, 16, -1, 18, 7, |
---|
614 | 8, 9, 10, 11, 12, 13, 14, 15, 16, -1, |
---|
615 | 18, 7, 8, 9, 10, 11, 12, 13, 14, 15, |
---|
616 | 16, -1, 18, 7, 8, 9, 10, 11, 12, 13, |
---|
617 | 14, 15, 16, -1, 18, 7, 8, 9, 10, 11, |
---|
618 | 12, 13, 14, 15, 16 |
---|
619 | }; |
---|
620 | |
---|
621 | /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing |
---|
622 | symbol of state STATE-NUM. */ |
---|
623 | static const yytype_uint8 yystos[] = |
---|
624 | { |
---|
625 | 0, 3, 4, 5, 6, 8, 17, 19, 22, 23, |
---|
626 | 24, 17, 23, 24, 23, 24, 0, 7, 8, 9, |
---|
627 | 10, 11, 12, 13, 14, 15, 16, 7, 8, 9, |
---|
628 | 10, 11, 12, 13, 14, 15, 16, 19, 23, 24, |
---|
629 | 18, 18, 23, 24, 23, 24, 23, 24, 23, 24, |
---|
630 | 5, 8, 17, 23, 23, 24, 23, 24, 23, 24, |
---|
631 | 23, 24, 23, 24, 23, 24, 23, 24, 23, 24, |
---|
632 | 23, 24, 23, 24, 23, 24, 23, 24, 23, 24, |
---|
633 | 23, 24, 23, 24, 18, 18, 17, 23, 23, 7, |
---|
634 | 8, 9, 10, 12, 13, 14, 15, 16, 23, 23, |
---|
635 | 23, 23, 23, 23, 23, 23, 23, 23 |
---|
636 | }; |
---|
637 | |
---|
638 | /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ |
---|
639 | static const yytype_uint8 yyr1[] = |
---|
640 | { |
---|
641 | 0, 21, 22, 22, 23, 23, 23, 23, 23, 23, |
---|
642 | 23, 23, 23, 23, 23, 23, 23, 23, 23, 24, |
---|
643 | 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, |
---|
644 | 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, |
---|
645 | 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, |
---|
646 | 24, 24, 24 |
---|
647 | }; |
---|
648 | |
---|
649 | /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ |
---|
650 | static const yytype_uint8 yyr2[] = |
---|
651 | { |
---|
652 | 0, 2, 1, 2, 1, 1, 3, 3, 3, 3, |
---|
653 | 2, 3, 3, 3, 3, 3, 3, 3, 4, 1, |
---|
654 | 1, 3, 3, 3, 3, 2, 3, 3, 3, 3, |
---|
655 | 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, |
---|
656 | 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, |
---|
657 | 3, 3, 4 |
---|
658 | }; |
---|
659 | |
---|
660 | |
---|
661 | #define yyerrok (yyerrstatus = 0) |
---|
662 | #define yyclearin (yychar = YYEMPTY) |
---|
663 | #define YYEMPTY (-2) |
---|
664 | #define YYEOF 0 |
---|
665 | |
---|
666 | #define YYACCEPT goto yyacceptlab |
---|
667 | #define YYABORT goto yyabortlab |
---|
668 | #define YYERROR goto yyerrorlab |
---|
669 | |
---|
670 | |
---|
671 | #define YYRECOVERING() (!!yyerrstatus) |
---|
672 | |
---|
673 | #define YYBACKUP(Token, Value) \ |
---|
674 | do \ |
---|
675 | if (yychar == YYEMPTY) \ |
---|
676 | { \ |
---|
677 | yychar = (Token); \ |
---|
678 | yylval = (Value); \ |
---|
679 | YYPOPSTACK (yylen); \ |
---|
680 | yystate = *yyssp; \ |
---|
681 | goto yybackup; \ |
---|
682 | } \ |
---|
683 | else \ |
---|
684 | { \ |
---|
685 | yyerror (YY_("syntax error: cannot back up")); \ |
---|
686 | YYERROR; \ |
---|
687 | } \ |
---|
688 | while (0) |
---|
689 | |
---|
690 | /* Error token number */ |
---|
691 | #define YYTERROR 1 |
---|
692 | #define YYERRCODE 256 |
---|
693 | |
---|
694 | |
---|
695 | |
---|
696 | /* Enable debugging if requested. */ |
---|
697 | #if YYDEBUG |
---|
698 | |
---|
699 | # ifndef YYFPRINTF |
---|
700 | # include <stdio.h> /* INFRINGES ON USER NAME SPACE */ |
---|
701 | # define YYFPRINTF fprintf |
---|
702 | # endif |
---|
703 | |
---|
704 | # define YYDPRINTF(Args) \ |
---|
705 | do { \ |
---|
706 | if (yydebug) \ |
---|
707 | YYFPRINTF Args; \ |
---|
708 | } while (0) |
---|
709 | |
---|
710 | /* This macro is provided for backward compatibility. */ |
---|
711 | #ifndef YY_LOCATION_PRINT |
---|
712 | # define YY_LOCATION_PRINT(File, Loc) ((void) 0) |
---|
713 | #endif |
---|
714 | |
---|
715 | |
---|
716 | # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ |
---|
717 | do { \ |
---|
718 | if (yydebug) \ |
---|
719 | { \ |
---|
720 | YYFPRINTF (stderr, "%s ", Title); \ |
---|
721 | yy_symbol_print (stderr, \ |
---|
722 | Type, Value); \ |
---|
723 | YYFPRINTF (stderr, "\n"); \ |
---|
724 | } \ |
---|
725 | } while (0) |
---|
726 | |
---|
727 | |
---|
728 | /*----------------------------------------. |
---|
729 | | Print this symbol's value on YYOUTPUT. | |
---|
730 | `----------------------------------------*/ |
---|
731 | |
---|
732 | static void |
---|
733 | yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) |
---|
734 | { |
---|
735 | FILE *yyo = yyoutput; |
---|
736 | YYUSE (yyo); |
---|
737 | if (!yyvaluep) |
---|
738 | return; |
---|
739 | # ifdef YYPRINT |
---|
740 | if (yytype < YYNTOKENS) |
---|
741 | YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); |
---|
742 | # endif |
---|
743 | YYUSE (yytype); |
---|
744 | } |
---|
745 | |
---|
746 | |
---|
747 | /*--------------------------------. |
---|
748 | | Print this symbol on YYOUTPUT. | |
---|
749 | `--------------------------------*/ |
---|
750 | |
---|
751 | static void |
---|
752 | yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) |
---|
753 | { |
---|
754 | YYFPRINTF (yyoutput, "%s %s (", |
---|
755 | yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); |
---|
756 | |
---|
757 | yy_symbol_value_print (yyoutput, yytype, yyvaluep); |
---|
758 | YYFPRINTF (yyoutput, ")"); |
---|
759 | } |
---|
760 | |
---|
761 | /*------------------------------------------------------------------. |
---|
762 | | yy_stack_print -- Print the state stack from its BOTTOM up to its | |
---|
763 | | TOP (included). | |
---|
764 | `------------------------------------------------------------------*/ |
---|
765 | |
---|
766 | static void |
---|
767 | yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) |
---|
768 | { |
---|
769 | YYFPRINTF (stderr, "Stack now"); |
---|
770 | for (; yybottom <= yytop; yybottom++) |
---|
771 | { |
---|
772 | int yybot = *yybottom; |
---|
773 | YYFPRINTF (stderr, " %d", yybot); |
---|
774 | } |
---|
775 | YYFPRINTF (stderr, "\n"); |
---|
776 | } |
---|
777 | |
---|
778 | # define YY_STACK_PRINT(Bottom, Top) \ |
---|
779 | do { \ |
---|
780 | if (yydebug) \ |
---|
781 | yy_stack_print ((Bottom), (Top)); \ |
---|
782 | } while (0) |
---|
783 | |
---|
784 | |
---|
785 | /*------------------------------------------------. |
---|
786 | | Report that the YYRULE is going to be reduced. | |
---|
787 | `------------------------------------------------*/ |
---|
788 | |
---|
789 | static void |
---|
790 | yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule) |
---|
791 | { |
---|
792 | unsigned long int yylno = yyrline[yyrule]; |
---|
793 | int yynrhs = yyr2[yyrule]; |
---|
794 | int yyi; |
---|
795 | YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", |
---|
796 | yyrule - 1, yylno); |
---|
797 | /* The symbols being reduced. */ |
---|
798 | for (yyi = 0; yyi < yynrhs; yyi++) |
---|
799 | { |
---|
800 | YYFPRINTF (stderr, " $%d = ", yyi + 1); |
---|
801 | yy_symbol_print (stderr, |
---|
802 | yystos[yyssp[yyi + 1 - yynrhs]], |
---|
803 | &(yyvsp[(yyi + 1) - (yynrhs)]) |
---|
804 | ); |
---|
805 | YYFPRINTF (stderr, "\n"); |
---|
806 | } |
---|
807 | } |
---|
808 | |
---|
809 | # define YY_REDUCE_PRINT(Rule) \ |
---|
810 | do { \ |
---|
811 | if (yydebug) \ |
---|
812 | yy_reduce_print (yyssp, yyvsp, Rule); \ |
---|
813 | } while (0) |
---|
814 | |
---|
815 | /* Nonzero means print parse trace. It is left uninitialized so that |
---|
816 | multiple parsers can coexist. */ |
---|
817 | int yydebug; |
---|
818 | #else /* !YYDEBUG */ |
---|
819 | # define YYDPRINTF(Args) |
---|
820 | # define YY_SYMBOL_PRINT(Title, Type, Value, Location) |
---|
821 | # define YY_STACK_PRINT(Bottom, Top) |
---|
822 | # define YY_REDUCE_PRINT(Rule) |
---|
823 | #endif /* !YYDEBUG */ |
---|
824 | |
---|
825 | |
---|
826 | /* YYINITDEPTH -- initial size of the parser's stacks. */ |
---|
827 | #ifndef YYINITDEPTH |
---|
828 | # define YYINITDEPTH 200 |
---|
829 | #endif |
---|
830 | |
---|
831 | /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only |
---|
832 | if the built-in stack extension method is used). |
---|
833 | |
---|
834 | Do not make this value too large; the results are undefined if |
---|
835 | YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) |
---|
836 | evaluated with infinite-precision integer arithmetic. */ |
---|
837 | |
---|
838 | #ifndef YYMAXDEPTH |
---|
839 | # define YYMAXDEPTH 10000 |
---|
840 | #endif |
---|
841 | |
---|
842 | |
---|
843 | #if YYERROR_VERBOSE |
---|
844 | |
---|
845 | # ifndef yystrlen |
---|
846 | # if defined __GLIBC__ && defined _STRING_H |
---|
847 | # define yystrlen strlen |
---|
848 | # else |
---|
849 | /* Return the length of YYSTR. */ |
---|
850 | static YYSIZE_T |
---|
851 | yystrlen (const char *yystr) |
---|
852 | { |
---|
853 | YYSIZE_T yylen; |
---|
854 | for (yylen = 0; yystr[yylen]; yylen++) |
---|
855 | continue; |
---|
856 | return yylen; |
---|
857 | } |
---|
858 | # endif |
---|
859 | # endif |
---|
860 | |
---|
861 | # ifndef yystpcpy |
---|
862 | # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE |
---|
863 | # define yystpcpy stpcpy |
---|
864 | # else |
---|
865 | /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in |
---|
866 | YYDEST. */ |
---|
867 | static char * |
---|
868 | yystpcpy (char *yydest, const char *yysrc) |
---|
869 | { |
---|
870 | char *yyd = yydest; |
---|
871 | const char *yys = yysrc; |
---|
872 | |
---|
873 | while ((*yyd++ = *yys++) != '\0') |
---|
874 | continue; |
---|
875 | |
---|
876 | return yyd - 1; |
---|
877 | } |
---|
878 | # endif |
---|
879 | # endif |
---|
880 | |
---|
881 | # ifndef yytnamerr |
---|
882 | /* Copy to YYRES the contents of YYSTR after stripping away unnecessary |
---|
883 | quotes and backslashes, so that it's suitable for yyerror. The |
---|
884 | heuristic is that double-quoting is unnecessary unless the string |
---|
885 | contains an apostrophe, a comma, or backslash (other than |
---|
886 | backslash-backslash). YYSTR is taken from yytname. If YYRES is |
---|
887 | null, do not copy; instead, return the length of what the result |
---|
888 | would have been. */ |
---|
889 | static YYSIZE_T |
---|
890 | yytnamerr (char *yyres, const char *yystr) |
---|
891 | { |
---|
892 | if (*yystr == '"') |
---|
893 | { |
---|
894 | YYSIZE_T yyn = 0; |
---|
895 | char const *yyp = yystr; |
---|
896 | |
---|
897 | for (;;) |
---|
898 | switch (*++yyp) |
---|
899 | { |
---|
900 | case '\'': |
---|
901 | case ',': |
---|
902 | goto do_not_strip_quotes; |
---|
903 | |
---|
904 | case '\\': |
---|
905 | if (*++yyp != '\\') |
---|
906 | goto do_not_strip_quotes; |
---|
907 | /* Fall through. */ |
---|
908 | default: |
---|
909 | if (yyres) |
---|
910 | yyres[yyn] = *yyp; |
---|
911 | yyn++; |
---|
912 | break; |
---|
913 | |
---|
914 | case '"': |
---|
915 | if (yyres) |
---|
916 | yyres[yyn] = '\0'; |
---|
917 | return yyn; |
---|
918 | } |
---|
919 | do_not_strip_quotes: ; |
---|
920 | } |
---|
921 | |
---|
922 | if (! yyres) |
---|
923 | return yystrlen (yystr); |
---|
924 | |
---|
925 | return yystpcpy (yyres, yystr) - yyres; |
---|
926 | } |
---|
927 | # endif |
---|
928 | |
---|
929 | /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message |
---|
930 | about the unexpected token YYTOKEN for the state stack whose top is |
---|
931 | YYSSP. |
---|
932 | |
---|
933 | Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is |
---|
934 | not large enough to hold the message. In that case, also set |
---|
935 | *YYMSG_ALLOC to the required number of bytes. Return 2 if the |
---|
936 | required number of bytes is too large to store. */ |
---|
937 | static int |
---|
938 | yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, |
---|
939 | yytype_int16 *yyssp, int yytoken) |
---|
940 | { |
---|
941 | YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); |
---|
942 | YYSIZE_T yysize = yysize0; |
---|
943 | enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; |
---|
944 | /* Internationalized format string. */ |
---|
945 | const char *yyformat = YY_NULLPTR; |
---|
946 | /* Arguments of yyformat. */ |
---|
947 | char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; |
---|
948 | /* Number of reported tokens (one for the "unexpected", one per |
---|
949 | "expected"). */ |
---|
950 | int yycount = 0; |
---|
951 | |
---|
952 | /* There are many possibilities here to consider: |
---|
953 | - If this state is a consistent state with a default action, then |
---|
954 | the only way this function was invoked is if the default action |
---|
955 | is an error action. In that case, don't check for expected |
---|
956 | tokens because there are none. |
---|
957 | - The only way there can be no lookahead present (in yychar) is if |
---|
958 | this state is a consistent state with a default action. Thus, |
---|
959 | detecting the absence of a lookahead is sufficient to determine |
---|
960 | that there is no unexpected or expected token to report. In that |
---|
961 | case, just report a simple "syntax error". |
---|
962 | - Don't assume there isn't a lookahead just because this state is a |
---|
963 | consistent state with a default action. There might have been a |
---|
964 | previous inconsistent state, consistent state with a non-default |
---|
965 | action, or user semantic action that manipulated yychar. |
---|
966 | - Of course, the expected token list depends on states to have |
---|
967 | correct lookahead information, and it depends on the parser not |
---|
968 | to perform extra reductions after fetching a lookahead from the |
---|
969 | scanner and before detecting a syntax error. Thus, state merging |
---|
970 | (from LALR or IELR) and default reductions corrupt the expected |
---|
971 | token list. However, the list is correct for canonical LR with |
---|
972 | one exception: it will still contain any token that will not be |
---|
973 | accepted due to an error action in a later state. |
---|
974 | */ |
---|
975 | if (yytoken != YYEMPTY) |
---|
976 | { |
---|
977 | int yyn = yypact[*yyssp]; |
---|
978 | yyarg[yycount++] = yytname[yytoken]; |
---|
979 | if (!yypact_value_is_default (yyn)) |
---|
980 | { |
---|
981 | /* Start YYX at -YYN if negative to avoid negative indexes in |
---|
982 | YYCHECK. In other words, skip the first -YYN actions for |
---|
983 | this state because they are default actions. */ |
---|
984 | int yyxbegin = yyn < 0 ? -yyn : 0; |
---|
985 | /* Stay within bounds of both yycheck and yytname. */ |
---|
986 | int yychecklim = YYLAST - yyn + 1; |
---|
987 | int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; |
---|
988 | int yyx; |
---|
989 | |
---|
990 | for (yyx = yyxbegin; yyx < yyxend; ++yyx) |
---|
991 | if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR |
---|
992 | && !yytable_value_is_error (yytable[yyx + yyn])) |
---|
993 | { |
---|
994 | if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) |
---|
995 | { |
---|
996 | yycount = 1; |
---|
997 | yysize = yysize0; |
---|
998 | break; |
---|
999 | } |
---|
1000 | yyarg[yycount++] = yytname[yyx]; |
---|
1001 | { |
---|
1002 | YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); |
---|
1003 | if (! (yysize <= yysize1 |
---|
1004 | && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) |
---|
1005 | return 2; |
---|
1006 | yysize = yysize1; |
---|
1007 | } |
---|
1008 | } |
---|
1009 | } |
---|
1010 | } |
---|
1011 | |
---|
1012 | switch (yycount) |
---|
1013 | { |
---|
1014 | # define YYCASE_(N, S) \ |
---|
1015 | case N: \ |
---|
1016 | yyformat = S; \ |
---|
1017 | break |
---|
1018 | YYCASE_(0, YY_("syntax error")); |
---|
1019 | YYCASE_(1, YY_("syntax error, unexpected %s")); |
---|
1020 | YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); |
---|
1021 | YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); |
---|
1022 | YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); |
---|
1023 | YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); |
---|
1024 | # undef YYCASE_ |
---|
1025 | } |
---|
1026 | |
---|
1027 | { |
---|
1028 | YYSIZE_T yysize1 = yysize + yystrlen (yyformat); |
---|
1029 | if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) |
---|
1030 | return 2; |
---|
1031 | yysize = yysize1; |
---|
1032 | } |
---|
1033 | |
---|
1034 | if (*yymsg_alloc < yysize) |
---|
1035 | { |
---|
1036 | *yymsg_alloc = 2 * yysize; |
---|
1037 | if (! (yysize <= *yymsg_alloc |
---|
1038 | && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) |
---|
1039 | *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; |
---|
1040 | return 1; |
---|
1041 | } |
---|
1042 | |
---|
1043 | /* Avoid sprintf, as that infringes on the user's name space. |
---|
1044 | Don't have undefined behavior even if the translation |
---|
1045 | produced a string with the wrong number of "%s"s. */ |
---|
1046 | { |
---|
1047 | char *yyp = *yymsg; |
---|
1048 | int yyi = 0; |
---|
1049 | while ((*yyp = *yyformat) != '\0') |
---|
1050 | if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) |
---|
1051 | { |
---|
1052 | yyp += yytnamerr (yyp, yyarg[yyi++]); |
---|
1053 | yyformat += 2; |
---|
1054 | } |
---|
1055 | else |
---|
1056 | { |
---|
1057 | yyp++; |
---|
1058 | yyformat++; |
---|
1059 | } |
---|
1060 | } |
---|
1061 | return 0; |
---|
1062 | } |
---|
1063 | #endif /* YYERROR_VERBOSE */ |
---|
1064 | |
---|
1065 | /*-----------------------------------------------. |
---|
1066 | | Release the memory associated to this symbol. | |
---|
1067 | `-----------------------------------------------*/ |
---|
1068 | |
---|
1069 | static void |
---|
1070 | yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) |
---|
1071 | { |
---|
1072 | YYUSE (yyvaluep); |
---|
1073 | if (!yymsg) |
---|
1074 | yymsg = "Deleting"; |
---|
1075 | YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); |
---|
1076 | |
---|
1077 | YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
---|
1078 | YYUSE (yytype); |
---|
1079 | YY_IGNORE_MAYBE_UNINITIALIZED_END |
---|
1080 | } |
---|
1081 | |
---|
1082 | |
---|
1083 | |
---|
1084 | |
---|
1085 | /* The lookahead symbol. */ |
---|
1086 | int yychar; |
---|
1087 | |
---|
1088 | /* The semantic value of the lookahead symbol. */ |
---|
1089 | YYSTYPE yylval; |
---|
1090 | /* Number of syntax errors so far. */ |
---|
1091 | int yynerrs; |
---|
1092 | |
---|
1093 | |
---|
1094 | /*----------. |
---|
1095 | | yyparse. | |
---|
1096 | `----------*/ |
---|
1097 | |
---|
1098 | int |
---|
1099 | yyparse (void) |
---|
1100 | { |
---|
1101 | int yystate; |
---|
1102 | /* Number of tokens to shift before error messages enabled. */ |
---|
1103 | int yyerrstatus; |
---|
1104 | |
---|
1105 | /* The stacks and their tools: |
---|
1106 | 'yyss': related to states. |
---|
1107 | 'yyvs': related to semantic values. |
---|
1108 | |
---|
1109 | Refer to the stacks through separate pointers, to allow yyoverflow |
---|
1110 | to reallocate them elsewhere. */ |
---|
1111 | |
---|
1112 | /* The state stack. */ |
---|
1113 | yytype_int16 yyssa[YYINITDEPTH]; |
---|
1114 | yytype_int16 *yyss; |
---|
1115 | yytype_int16 *yyssp; |
---|
1116 | |
---|
1117 | /* The semantic value stack. */ |
---|
1118 | YYSTYPE yyvsa[YYINITDEPTH]; |
---|
1119 | YYSTYPE *yyvs; |
---|
1120 | YYSTYPE *yyvsp; |
---|
1121 | |
---|
1122 | YYSIZE_T yystacksize; |
---|
1123 | |
---|
1124 | int yyn; |
---|
1125 | int yyresult; |
---|
1126 | /* Lookahead token as an internal (translated) token number. */ |
---|
1127 | int yytoken = 0; |
---|
1128 | /* The variables used to return semantic value and location from the |
---|
1129 | action routines. */ |
---|
1130 | YYSTYPE yyval; |
---|
1131 | |
---|
1132 | #if YYERROR_VERBOSE |
---|
1133 | /* Buffer for error messages, and its allocated size. */ |
---|
1134 | char yymsgbuf[128]; |
---|
1135 | char *yymsg = yymsgbuf; |
---|
1136 | YYSIZE_T yymsg_alloc = sizeof yymsgbuf; |
---|
1137 | #endif |
---|
1138 | |
---|
1139 | #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) |
---|
1140 | |
---|
1141 | /* The number of symbols on the RHS of the reduced rule. |
---|
1142 | Keep to zero when no symbol should be popped. */ |
---|
1143 | int yylen = 0; |
---|
1144 | |
---|
1145 | yyssp = yyss = yyssa; |
---|
1146 | yyvsp = yyvs = yyvsa; |
---|
1147 | yystacksize = YYINITDEPTH; |
---|
1148 | |
---|
1149 | YYDPRINTF ((stderr, "Starting parse\n")); |
---|
1150 | |
---|
1151 | yystate = 0; |
---|
1152 | yyerrstatus = 0; |
---|
1153 | yynerrs = 0; |
---|
1154 | yychar = YYEMPTY; /* Cause a token to be read. */ |
---|
1155 | goto yysetstate; |
---|
1156 | |
---|
1157 | /*------------------------------------------------------------. |
---|
1158 | | yynewstate -- Push a new state, which is found in yystate. | |
---|
1159 | `------------------------------------------------------------*/ |
---|
1160 | yynewstate: |
---|
1161 | /* In all cases, when you get here, the value and location stacks |
---|
1162 | have just been pushed. So pushing a state here evens the stacks. */ |
---|
1163 | yyssp++; |
---|
1164 | |
---|
1165 | yysetstate: |
---|
1166 | *yyssp = yystate; |
---|
1167 | |
---|
1168 | if (yyss + yystacksize - 1 <= yyssp) |
---|
1169 | { |
---|
1170 | /* Get the current used size of the three stacks, in elements. */ |
---|
1171 | YYSIZE_T yysize = yyssp - yyss + 1; |
---|
1172 | |
---|
1173 | #ifdef yyoverflow |
---|
1174 | { |
---|
1175 | /* Give user a chance to reallocate the stack. Use copies of |
---|
1176 | these so that the &'s don't force the real ones into |
---|
1177 | memory. */ |
---|
1178 | YYSTYPE *yyvs1 = yyvs; |
---|
1179 | yytype_int16 *yyss1 = yyss; |
---|
1180 | |
---|
1181 | /* Each stack pointer address is followed by the size of the |
---|
1182 | data in use in that stack, in bytes. This used to be a |
---|
1183 | conditional around just the two extra args, but that might |
---|
1184 | be undefined if yyoverflow is a macro. */ |
---|
1185 | yyoverflow (YY_("memory exhausted"), |
---|
1186 | &yyss1, yysize * sizeof (*yyssp), |
---|
1187 | &yyvs1, yysize * sizeof (*yyvsp), |
---|
1188 | &yystacksize); |
---|
1189 | |
---|
1190 | yyss = yyss1; |
---|
1191 | yyvs = yyvs1; |
---|
1192 | } |
---|
1193 | #else /* no yyoverflow */ |
---|
1194 | # ifndef YYSTACK_RELOCATE |
---|
1195 | goto yyexhaustedlab; |
---|
1196 | # else |
---|
1197 | /* Extend the stack our own way. */ |
---|
1198 | if (YYMAXDEPTH <= yystacksize) |
---|
1199 | goto yyexhaustedlab; |
---|
1200 | yystacksize *= 2; |
---|
1201 | if (YYMAXDEPTH < yystacksize) |
---|
1202 | yystacksize = YYMAXDEPTH; |
---|
1203 | |
---|
1204 | { |
---|
1205 | yytype_int16 *yyss1 = yyss; |
---|
1206 | union yyalloc *yyptr = |
---|
1207 | (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); |
---|
1208 | if (! yyptr) |
---|
1209 | goto yyexhaustedlab; |
---|
1210 | YYSTACK_RELOCATE (yyss_alloc, yyss); |
---|
1211 | YYSTACK_RELOCATE (yyvs_alloc, yyvs); |
---|
1212 | # undef YYSTACK_RELOCATE |
---|
1213 | if (yyss1 != yyssa) |
---|
1214 | YYSTACK_FREE (yyss1); |
---|
1215 | } |
---|
1216 | # endif |
---|
1217 | #endif /* no yyoverflow */ |
---|
1218 | |
---|
1219 | yyssp = yyss + yysize - 1; |
---|
1220 | yyvsp = yyvs + yysize - 1; |
---|
1221 | |
---|
1222 | YYDPRINTF ((stderr, "Stack size increased to %lu\n", |
---|
1223 | (unsigned long int) yystacksize)); |
---|
1224 | |
---|
1225 | if (yyss + yystacksize - 1 <= yyssp) |
---|
1226 | YYABORT; |
---|
1227 | } |
---|
1228 | |
---|
1229 | YYDPRINTF ((stderr, "Entering state %d\n", yystate)); |
---|
1230 | |
---|
1231 | if (yystate == YYFINAL) |
---|
1232 | YYACCEPT; |
---|
1233 | |
---|
1234 | goto yybackup; |
---|
1235 | |
---|
1236 | /*-----------. |
---|
1237 | | yybackup. | |
---|
1238 | `-----------*/ |
---|
1239 | yybackup: |
---|
1240 | |
---|
1241 | /* Do appropriate processing given the current state. Read a |
---|
1242 | lookahead token if we need one and don't already have one. */ |
---|
1243 | |
---|
1244 | /* First try to decide what to do without reference to lookahead token. */ |
---|
1245 | yyn = yypact[yystate]; |
---|
1246 | if (yypact_value_is_default (yyn)) |
---|
1247 | goto yydefault; |
---|
1248 | |
---|
1249 | /* Not known => get a lookahead token if don't already have one. */ |
---|
1250 | |
---|
1251 | /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ |
---|
1252 | if (yychar == YYEMPTY) |
---|
1253 | { |
---|
1254 | YYDPRINTF ((stderr, "Reading a token: ")); |
---|
1255 | yychar = yylex (); |
---|
1256 | } |
---|
1257 | |
---|
1258 | if (yychar <= YYEOF) |
---|
1259 | { |
---|
1260 | yychar = yytoken = YYEOF; |
---|
1261 | YYDPRINTF ((stderr, "Now at end of input.\n")); |
---|
1262 | } |
---|
1263 | else |
---|
1264 | { |
---|
1265 | yytoken = YYTRANSLATE (yychar); |
---|
1266 | YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); |
---|
1267 | } |
---|
1268 | |
---|
1269 | /* If the proper action on seeing token YYTOKEN is to reduce or to |
---|
1270 | detect an error, take that action. */ |
---|
1271 | yyn += yytoken; |
---|
1272 | if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) |
---|
1273 | goto yydefault; |
---|
1274 | yyn = yytable[yyn]; |
---|
1275 | if (yyn <= 0) |
---|
1276 | { |
---|
1277 | if (yytable_value_is_error (yyn)) |
---|
1278 | goto yyerrlab; |
---|
1279 | yyn = -yyn; |
---|
1280 | goto yyreduce; |
---|
1281 | } |
---|
1282 | |
---|
1283 | /* Count tokens shifted since error; after three, turn off error |
---|
1284 | status. */ |
---|
1285 | if (yyerrstatus) |
---|
1286 | yyerrstatus--; |
---|
1287 | |
---|
1288 | /* Shift the lookahead token. */ |
---|
1289 | YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); |
---|
1290 | |
---|
1291 | /* Discard the shifted token. */ |
---|
1292 | yychar = YYEMPTY; |
---|
1293 | |
---|
1294 | yystate = yyn; |
---|
1295 | YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
---|
1296 | *++yyvsp = yylval; |
---|
1297 | YY_IGNORE_MAYBE_UNINITIALIZED_END |
---|
1298 | |
---|
1299 | goto yynewstate; |
---|
1300 | |
---|
1301 | |
---|
1302 | /*-----------------------------------------------------------. |
---|
1303 | | yydefault -- do the default action for the current state. | |
---|
1304 | `-----------------------------------------------------------*/ |
---|
1305 | yydefault: |
---|
1306 | yyn = yydefact[yystate]; |
---|
1307 | if (yyn == 0) |
---|
1308 | goto yyerrlab; |
---|
1309 | goto yyreduce; |
---|
1310 | |
---|
1311 | |
---|
1312 | /*-----------------------------. |
---|
1313 | | yyreduce -- Do a reduction. | |
---|
1314 | `-----------------------------*/ |
---|
1315 | yyreduce: |
---|
1316 | /* yyn is the number of a rule to reduce with. */ |
---|
1317 | yylen = yyr2[yyn]; |
---|
1318 | |
---|
1319 | /* If YYLEN is nonzero, implement the default value of the action: |
---|
1320 | '$$ = $1'. |
---|
1321 | |
---|
1322 | Otherwise, the following line sets YYVAL to garbage. |
---|
1323 | This behavior is undocumented and Bison |
---|
1324 | users should not rely upon it. Assigning to YYVAL |
---|
1325 | unconditionally makes the parser a bit smaller, and it avoids a |
---|
1326 | GCC warning that YYVAL may be used uninitialized. */ |
---|
1327 | yyval = yyvsp[1-yylen]; |
---|
1328 | |
---|
1329 | |
---|
1330 | YY_REDUCE_PRINT (yyn); |
---|
1331 | switch (yyn) |
---|
1332 | { |
---|
1333 | case 2: |
---|
1334 | #line 61 "yacc_parser.yacc" /* yacc.c:1646 */ |
---|
1335 | { /* Nothing to do */ } |
---|
1336 | #line 1337 "yacc_parser.cpp" /* yacc.c:1646 */ |
---|
1337 | break; |
---|
1338 | |
---|
1339 | case 3: |
---|
1340 | #line 62 "yacc_parser.yacc" /* yacc.c:1646 */ |
---|
1341 | { parsed = (yyvsp[-1].filterNode); } |
---|
1342 | #line 1343 "yacc_parser.cpp" /* yacc.c:1646 */ |
---|
1343 | break; |
---|
1344 | |
---|
1345 | case 4: |
---|
1346 | #line 66 "yacc_parser.yacc" /* yacc.c:1646 */ |
---|
1347 | { (yyval.scalarNode) = new CScalarValExprNode(*(yyvsp[0].str)); delete (yyvsp[0].str); } |
---|
1348 | #line 1349 "yacc_parser.cpp" /* yacc.c:1646 */ |
---|
1349 | break; |
---|
1350 | |
---|
1351 | case 5: |
---|
1352 | #line 67 "yacc_parser.yacc" /* yacc.c:1646 */ |
---|
1353 | { (yyval.scalarNode) = new CScalarVarExprNode(*(yyvsp[0].str)); delete (yyvsp[0].str); } |
---|
1354 | #line 1355 "yacc_parser.cpp" /* yacc.c:1646 */ |
---|
1355 | break; |
---|
1356 | |
---|
1357 | case 6: |
---|
1358 | #line 68 "yacc_parser.yacc" /* yacc.c:1646 */ |
---|
1359 | { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[-2].scalarNode), "add", (yyvsp[0].scalarNode)); } |
---|
1360 | #line 1361 "yacc_parser.cpp" /* yacc.c:1646 */ |
---|
1361 | break; |
---|
1362 | |
---|
1363 | case 7: |
---|
1364 | #line 69 "yacc_parser.yacc" /* yacc.c:1646 */ |
---|
1365 | { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[-2].scalarNode), "minus", (yyvsp[0].scalarNode)); } |
---|
1366 | #line 1367 "yacc_parser.cpp" /* yacc.c:1646 */ |
---|
1367 | break; |
---|
1368 | |
---|
1369 | case 8: |
---|
1370 | #line 70 "yacc_parser.yacc" /* yacc.c:1646 */ |
---|
1371 | { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[-2].scalarNode), "mult", (yyvsp[0].scalarNode)); } |
---|
1372 | #line 1373 "yacc_parser.cpp" /* yacc.c:1646 */ |
---|
1373 | break; |
---|
1374 | |
---|
1375 | case 9: |
---|
1376 | #line 71 "yacc_parser.yacc" /* yacc.c:1646 */ |
---|
1377 | { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[-2].scalarNode), "div", (yyvsp[0].scalarNode)); } |
---|
1378 | #line 1379 "yacc_parser.cpp" /* yacc.c:1646 */ |
---|
1379 | break; |
---|
1380 | |
---|
1381 | case 10: |
---|
1382 | #line 72 "yacc_parser.yacc" /* yacc.c:1646 */ |
---|
1383 | { (yyval.scalarNode) = new CScalarUnaryOpExprNode("neg", (yyvsp[0].scalarNode)); } |
---|
1384 | #line 1385 "yacc_parser.cpp" /* yacc.c:1646 */ |
---|
1385 | break; |
---|
1386 | |
---|
1387 | case 11: |
---|
1388 | #line 73 "yacc_parser.yacc" /* yacc.c:1646 */ |
---|
1389 | { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[-2].scalarNode), "pow", (yyvsp[0].scalarNode)); } |
---|
1390 | #line 1391 "yacc_parser.cpp" /* yacc.c:1646 */ |
---|
1391 | break; |
---|
1392 | |
---|
1393 | case 12: |
---|
1394 | #line 74 "yacc_parser.yacc" /* yacc.c:1646 */ |
---|
1395 | { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[-2].scalarNode), "eq", (yyvsp[0].scalarNode)); } |
---|
1396 | #line 1397 "yacc_parser.cpp" /* yacc.c:1646 */ |
---|
1397 | break; |
---|
1398 | |
---|
1399 | case 13: |
---|
1400 | #line 75 "yacc_parser.yacc" /* yacc.c:1646 */ |
---|
1401 | { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[-2].scalarNode), "lt", (yyvsp[0].scalarNode)); } |
---|
1402 | #line 1403 "yacc_parser.cpp" /* yacc.c:1646 */ |
---|
1403 | break; |
---|
1404 | |
---|
1405 | case 14: |
---|
1406 | #line 76 "yacc_parser.yacc" /* yacc.c:1646 */ |
---|
1407 | { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[-2].scalarNode), "gt", (yyvsp[0].scalarNode)); } |
---|
1408 | #line 1409 "yacc_parser.cpp" /* yacc.c:1646 */ |
---|
1409 | break; |
---|
1410 | |
---|
1411 | case 15: |
---|
1412 | #line 77 "yacc_parser.yacc" /* yacc.c:1646 */ |
---|
1413 | { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[-2].scalarNode), "le", (yyvsp[0].scalarNode)); } |
---|
1414 | #line 1415 "yacc_parser.cpp" /* yacc.c:1646 */ |
---|
1415 | break; |
---|
1416 | |
---|
1417 | case 16: |
---|
1418 | #line 78 "yacc_parser.yacc" /* yacc.c:1646 */ |
---|
1419 | { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[-2].scalarNode), "ge", (yyvsp[0].scalarNode)); } |
---|
1420 | #line 1421 "yacc_parser.cpp" /* yacc.c:1646 */ |
---|
1421 | break; |
---|
1422 | |
---|
1423 | case 17: |
---|
1424 | #line 79 "yacc_parser.yacc" /* yacc.c:1646 */ |
---|
1425 | { (yyval.scalarNode) = (yyvsp[-1].scalarNode); } |
---|
1426 | #line 1427 "yacc_parser.cpp" /* yacc.c:1646 */ |
---|
1427 | break; |
---|
1428 | |
---|
1429 | case 18: |
---|
1430 | #line 80 "yacc_parser.yacc" /* yacc.c:1646 */ |
---|
1431 | { (yyval.scalarNode) = new CScalarUnaryOpExprNode(*(yyvsp[-3].str), (yyvsp[-1].scalarNode)); delete (yyvsp[-3].str); } |
---|
1432 | #line 1433 "yacc_parser.cpp" /* yacc.c:1646 */ |
---|
1433 | break; |
---|
1434 | |
---|
1435 | case 19: |
---|
1436 | #line 84 "yacc_parser.yacc" /* yacc.c:1646 */ |
---|
1437 | { (yyval.filterNode) = new CFilterFieldExprNode(*(yyvsp[0].str)); delete (yyvsp[0].str); } |
---|
1438 | #line 1439 "yacc_parser.cpp" /* yacc.c:1646 */ |
---|
1439 | break; |
---|
1440 | |
---|
1441 | case 20: |
---|
1442 | #line 85 "yacc_parser.yacc" /* yacc.c:1646 */ |
---|
1443 | { (yyval.filterNode) = new CFilterTemporalFieldExprNode(*(yyvsp[0].str)); delete (yyvsp[0].str); } |
---|
1444 | #line 1445 "yacc_parser.cpp" /* yacc.c:1646 */ |
---|
1445 | break; |
---|
1446 | |
---|
1447 | case 21: |
---|
1448 | #line 86 "yacc_parser.yacc" /* yacc.c:1646 */ |
---|
1449 | { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[-2].filterNode), "add", (yyvsp[0].filterNode)); } |
---|
1450 | #line 1451 "yacc_parser.cpp" /* yacc.c:1646 */ |
---|
1451 | break; |
---|
1452 | |
---|
1453 | case 22: |
---|
1454 | #line 87 "yacc_parser.yacc" /* yacc.c:1646 */ |
---|
1455 | { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[-2].filterNode), "minus", (yyvsp[0].filterNode)); } |
---|
1456 | #line 1457 "yacc_parser.cpp" /* yacc.c:1646 */ |
---|
1457 | break; |
---|
1458 | |
---|
1459 | case 23: |
---|
1460 | #line 88 "yacc_parser.yacc" /* yacc.c:1646 */ |
---|
1461 | { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[-2].filterNode), "mult", (yyvsp[0].filterNode)); } |
---|
1462 | #line 1463 "yacc_parser.cpp" /* yacc.c:1646 */ |
---|
1463 | break; |
---|
1464 | |
---|
1465 | case 24: |
---|
1466 | #line 89 "yacc_parser.yacc" /* yacc.c:1646 */ |
---|
1467 | { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[-2].filterNode), "div", (yyvsp[0].filterNode)); } |
---|
1468 | #line 1469 "yacc_parser.cpp" /* yacc.c:1646 */ |
---|
1469 | break; |
---|
1470 | |
---|
1471 | case 25: |
---|
1472 | #line 90 "yacc_parser.yacc" /* yacc.c:1646 */ |
---|
1473 | { (yyval.filterNode) = new CFilterUnaryOpExprNode("neg", (yyvsp[0].filterNode)); } |
---|
1474 | #line 1475 "yacc_parser.cpp" /* yacc.c:1646 */ |
---|
1475 | break; |
---|
1476 | |
---|
1477 | case 26: |
---|
1478 | #line 91 "yacc_parser.yacc" /* yacc.c:1646 */ |
---|
1479 | { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[-2].filterNode), "pow", (yyvsp[0].filterNode)); } |
---|
1480 | #line 1481 "yacc_parser.cpp" /* yacc.c:1646 */ |
---|
1481 | break; |
---|
1482 | |
---|
1483 | case 27: |
---|
1484 | #line 92 "yacc_parser.yacc" /* yacc.c:1646 */ |
---|
1485 | { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[-2].filterNode), "eq", (yyvsp[0].filterNode)); } |
---|
1486 | #line 1487 "yacc_parser.cpp" /* yacc.c:1646 */ |
---|
1487 | break; |
---|
1488 | |
---|
1489 | case 28: |
---|
1490 | #line 93 "yacc_parser.yacc" /* yacc.c:1646 */ |
---|
1491 | { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[-2].filterNode), "lt", (yyvsp[0].filterNode)); } |
---|
1492 | #line 1493 "yacc_parser.cpp" /* yacc.c:1646 */ |
---|
1493 | break; |
---|
1494 | |
---|
1495 | case 29: |
---|
1496 | #line 94 "yacc_parser.yacc" /* yacc.c:1646 */ |
---|
1497 | { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[-2].filterNode), "gt", (yyvsp[0].filterNode)); } |
---|
1498 | #line 1499 "yacc_parser.cpp" /* yacc.c:1646 */ |
---|
1499 | break; |
---|
1500 | |
---|
1501 | case 30: |
---|
1502 | #line 95 "yacc_parser.yacc" /* yacc.c:1646 */ |
---|
1503 | { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[-2].filterNode), "le", (yyvsp[0].filterNode)); } |
---|
1504 | #line 1505 "yacc_parser.cpp" /* yacc.c:1646 */ |
---|
1505 | break; |
---|
1506 | |
---|
1507 | case 31: |
---|
1508 | #line 96 "yacc_parser.yacc" /* yacc.c:1646 */ |
---|
1509 | { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[-2].filterNode), "ge", (yyvsp[0].filterNode)); } |
---|
1510 | #line 1511 "yacc_parser.cpp" /* yacc.c:1646 */ |
---|
1511 | break; |
---|
1512 | |
---|
1513 | case 32: |
---|
1514 | #line 97 "yacc_parser.yacc" /* yacc.c:1646 */ |
---|
1515 | { (yyval.filterNode) = (yyvsp[-1].filterNode); } |
---|
1516 | #line 1517 "yacc_parser.cpp" /* yacc.c:1646 */ |
---|
1517 | break; |
---|
1518 | |
---|
1519 | case 33: |
---|
1520 | #line 98 "yacc_parser.yacc" /* yacc.c:1646 */ |
---|
1521 | { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[-2].filterNode), "add", (yyvsp[0].scalarNode)); } |
---|
1522 | #line 1523 "yacc_parser.cpp" /* yacc.c:1646 */ |
---|
1523 | break; |
---|
1524 | |
---|
1525 | case 34: |
---|
1526 | #line 99 "yacc_parser.yacc" /* yacc.c:1646 */ |
---|
1527 | { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[-2].scalarNode), "add", (yyvsp[0].filterNode)); } |
---|
1528 | #line 1529 "yacc_parser.cpp" /* yacc.c:1646 */ |
---|
1529 | break; |
---|
1530 | |
---|
1531 | case 35: |
---|
1532 | #line 100 "yacc_parser.yacc" /* yacc.c:1646 */ |
---|
1533 | { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[-2].filterNode), "minus", (yyvsp[0].scalarNode)); } |
---|
1534 | #line 1535 "yacc_parser.cpp" /* yacc.c:1646 */ |
---|
1535 | break; |
---|
1536 | |
---|
1537 | case 36: |
---|
1538 | #line 101 "yacc_parser.yacc" /* yacc.c:1646 */ |
---|
1539 | { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[-2].scalarNode), "minus", (yyvsp[0].filterNode)); } |
---|
1540 | #line 1541 "yacc_parser.cpp" /* yacc.c:1646 */ |
---|
1541 | break; |
---|
1542 | |
---|
1543 | case 37: |
---|
1544 | #line 102 "yacc_parser.yacc" /* yacc.c:1646 */ |
---|
1545 | { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[-2].filterNode), "mult", (yyvsp[0].scalarNode)); } |
---|
1546 | #line 1547 "yacc_parser.cpp" /* yacc.c:1646 */ |
---|
1547 | break; |
---|
1548 | |
---|
1549 | case 38: |
---|
1550 | #line 103 "yacc_parser.yacc" /* yacc.c:1646 */ |
---|
1551 | { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[-2].scalarNode), "mult", (yyvsp[0].filterNode)); } |
---|
1552 | #line 1553 "yacc_parser.cpp" /* yacc.c:1646 */ |
---|
1553 | break; |
---|
1554 | |
---|
1555 | case 39: |
---|
1556 | #line 104 "yacc_parser.yacc" /* yacc.c:1646 */ |
---|
1557 | { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[-2].filterNode), "div", (yyvsp[0].scalarNode)); } |
---|
1558 | #line 1559 "yacc_parser.cpp" /* yacc.c:1646 */ |
---|
1559 | break; |
---|
1560 | |
---|
1561 | case 40: |
---|
1562 | #line 105 "yacc_parser.yacc" /* yacc.c:1646 */ |
---|
1563 | { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[-2].scalarNode), "div", (yyvsp[0].filterNode)); } |
---|
1564 | #line 1565 "yacc_parser.cpp" /* yacc.c:1646 */ |
---|
1565 | break; |
---|
1566 | |
---|
1567 | case 41: |
---|
1568 | #line 106 "yacc_parser.yacc" /* yacc.c:1646 */ |
---|
1569 | { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[-2].filterNode), "pow", (yyvsp[0].scalarNode)); } |
---|
1570 | #line 1571 "yacc_parser.cpp" /* yacc.c:1646 */ |
---|
1571 | break; |
---|
1572 | |
---|
1573 | case 42: |
---|
1574 | #line 107 "yacc_parser.yacc" /* yacc.c:1646 */ |
---|
1575 | { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[-2].filterNode), "eq", (yyvsp[0].scalarNode)); } |
---|
1576 | #line 1577 "yacc_parser.cpp" /* yacc.c:1646 */ |
---|
1577 | break; |
---|
1578 | |
---|
1579 | case 43: |
---|
1580 | #line 108 "yacc_parser.yacc" /* yacc.c:1646 */ |
---|
1581 | { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[-2].scalarNode), "eq", (yyvsp[0].filterNode)); } |
---|
1582 | #line 1583 "yacc_parser.cpp" /* yacc.c:1646 */ |
---|
1583 | break; |
---|
1584 | |
---|
1585 | case 44: |
---|
1586 | #line 109 "yacc_parser.yacc" /* yacc.c:1646 */ |
---|
1587 | { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[-2].filterNode), "lt", (yyvsp[0].scalarNode)); } |
---|
1588 | #line 1589 "yacc_parser.cpp" /* yacc.c:1646 */ |
---|
1589 | break; |
---|
1590 | |
---|
1591 | case 45: |
---|
1592 | #line 110 "yacc_parser.yacc" /* yacc.c:1646 */ |
---|
1593 | { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[-2].scalarNode), "lt", (yyvsp[0].filterNode)); } |
---|
1594 | #line 1595 "yacc_parser.cpp" /* yacc.c:1646 */ |
---|
1595 | break; |
---|
1596 | |
---|
1597 | case 46: |
---|
1598 | #line 111 "yacc_parser.yacc" /* yacc.c:1646 */ |
---|
1599 | { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[-2].filterNode), "gt", (yyvsp[0].scalarNode)); } |
---|
1600 | #line 1601 "yacc_parser.cpp" /* yacc.c:1646 */ |
---|
1601 | break; |
---|
1602 | |
---|
1603 | case 47: |
---|
1604 | #line 112 "yacc_parser.yacc" /* yacc.c:1646 */ |
---|
1605 | { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[-2].scalarNode), "gt", (yyvsp[0].filterNode)); } |
---|
1606 | #line 1607 "yacc_parser.cpp" /* yacc.c:1646 */ |
---|
1607 | break; |
---|
1608 | |
---|
1609 | case 48: |
---|
1610 | #line 113 "yacc_parser.yacc" /* yacc.c:1646 */ |
---|
1611 | { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[-2].filterNode), "le", (yyvsp[0].scalarNode)); } |
---|
1612 | #line 1613 "yacc_parser.cpp" /* yacc.c:1646 */ |
---|
1613 | break; |
---|
1614 | |
---|
1615 | case 49: |
---|
1616 | #line 114 "yacc_parser.yacc" /* yacc.c:1646 */ |
---|
1617 | { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[-2].scalarNode), "le", (yyvsp[0].filterNode)); } |
---|
1618 | #line 1619 "yacc_parser.cpp" /* yacc.c:1646 */ |
---|
1619 | break; |
---|
1620 | |
---|
1621 | case 50: |
---|
1622 | #line 115 "yacc_parser.yacc" /* yacc.c:1646 */ |
---|
1623 | { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[-2].filterNode), "ge", (yyvsp[0].scalarNode)); } |
---|
1624 | #line 1625 "yacc_parser.cpp" /* yacc.c:1646 */ |
---|
1625 | break; |
---|
1626 | |
---|
1627 | case 51: |
---|
1628 | #line 116 "yacc_parser.yacc" /* yacc.c:1646 */ |
---|
1629 | { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[-2].scalarNode), "ge", (yyvsp[0].filterNode)); } |
---|
1630 | #line 1631 "yacc_parser.cpp" /* yacc.c:1646 */ |
---|
1631 | break; |
---|
1632 | |
---|
1633 | case 52: |
---|
1634 | #line 117 "yacc_parser.yacc" /* yacc.c:1646 */ |
---|
1635 | { (yyval.filterNode) = new CFilterUnaryOpExprNode(*(yyvsp[-3].str), (yyvsp[-1].filterNode)); delete (yyvsp[-3].str); } |
---|
1636 | #line 1637 "yacc_parser.cpp" /* yacc.c:1646 */ |
---|
1637 | break; |
---|
1638 | |
---|
1639 | |
---|
1640 | #line 1641 "yacc_parser.cpp" /* yacc.c:1646 */ |
---|
1641 | default: break; |
---|
1642 | } |
---|
1643 | /* User semantic actions sometimes alter yychar, and that requires |
---|
1644 | that yytoken be updated with the new translation. We take the |
---|
1645 | approach of translating immediately before every use of yytoken. |
---|
1646 | One alternative is translating here after every semantic action, |
---|
1647 | but that translation would be missed if the semantic action invokes |
---|
1648 | YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or |
---|
1649 | if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an |
---|
1650 | incorrect destructor might then be invoked immediately. In the |
---|
1651 | case of YYERROR or YYBACKUP, subsequent parser actions might lead |
---|
1652 | to an incorrect destructor call or verbose syntax error message |
---|
1653 | before the lookahead is translated. */ |
---|
1654 | YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); |
---|
1655 | |
---|
1656 | YYPOPSTACK (yylen); |
---|
1657 | yylen = 0; |
---|
1658 | YY_STACK_PRINT (yyss, yyssp); |
---|
1659 | |
---|
1660 | *++yyvsp = yyval; |
---|
1661 | |
---|
1662 | /* Now 'shift' the result of the reduction. Determine what state |
---|
1663 | that goes to, based on the state we popped back to and the rule |
---|
1664 | number reduced by. */ |
---|
1665 | |
---|
1666 | yyn = yyr1[yyn]; |
---|
1667 | |
---|
1668 | yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; |
---|
1669 | if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) |
---|
1670 | yystate = yytable[yystate]; |
---|
1671 | else |
---|
1672 | yystate = yydefgoto[yyn - YYNTOKENS]; |
---|
1673 | |
---|
1674 | goto yynewstate; |
---|
1675 | |
---|
1676 | |
---|
1677 | /*--------------------------------------. |
---|
1678 | | yyerrlab -- here on detecting error. | |
---|
1679 | `--------------------------------------*/ |
---|
1680 | yyerrlab: |
---|
1681 | /* Make sure we have latest lookahead translation. See comments at |
---|
1682 | user semantic actions for why this is necessary. */ |
---|
1683 | yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); |
---|
1684 | |
---|
1685 | /* If not already recovering from an error, report this error. */ |
---|
1686 | if (!yyerrstatus) |
---|
1687 | { |
---|
1688 | ++yynerrs; |
---|
1689 | #if ! YYERROR_VERBOSE |
---|
1690 | yyerror (YY_("syntax error")); |
---|
1691 | #else |
---|
1692 | # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ |
---|
1693 | yyssp, yytoken) |
---|
1694 | { |
---|
1695 | char const *yymsgp = YY_("syntax error"); |
---|
1696 | int yysyntax_error_status; |
---|
1697 | yysyntax_error_status = YYSYNTAX_ERROR; |
---|
1698 | if (yysyntax_error_status == 0) |
---|
1699 | yymsgp = yymsg; |
---|
1700 | else if (yysyntax_error_status == 1) |
---|
1701 | { |
---|
1702 | if (yymsg != yymsgbuf) |
---|
1703 | YYSTACK_FREE (yymsg); |
---|
1704 | yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); |
---|
1705 | if (!yymsg) |
---|
1706 | { |
---|
1707 | yymsg = yymsgbuf; |
---|
1708 | yymsg_alloc = sizeof yymsgbuf; |
---|
1709 | yysyntax_error_status = 2; |
---|
1710 | } |
---|
1711 | else |
---|
1712 | { |
---|
1713 | yysyntax_error_status = YYSYNTAX_ERROR; |
---|
1714 | yymsgp = yymsg; |
---|
1715 | } |
---|
1716 | } |
---|
1717 | yyerror (yymsgp); |
---|
1718 | if (yysyntax_error_status == 2) |
---|
1719 | goto yyexhaustedlab; |
---|
1720 | } |
---|
1721 | # undef YYSYNTAX_ERROR |
---|
1722 | #endif |
---|
1723 | } |
---|
1724 | |
---|
1725 | |
---|
1726 | |
---|
1727 | if (yyerrstatus == 3) |
---|
1728 | { |
---|
1729 | /* If just tried and failed to reuse lookahead token after an |
---|
1730 | error, discard it. */ |
---|
1731 | |
---|
1732 | if (yychar <= YYEOF) |
---|
1733 | { |
---|
1734 | /* Return failure if at end of input. */ |
---|
1735 | if (yychar == YYEOF) |
---|
1736 | YYABORT; |
---|
1737 | } |
---|
1738 | else |
---|
1739 | { |
---|
1740 | yydestruct ("Error: discarding", |
---|
1741 | yytoken, &yylval); |
---|
1742 | yychar = YYEMPTY; |
---|
1743 | } |
---|
1744 | } |
---|
1745 | |
---|
1746 | /* Else will try to reuse lookahead token after shifting the error |
---|
1747 | token. */ |
---|
1748 | goto yyerrlab1; |
---|
1749 | |
---|
1750 | |
---|
1751 | /*---------------------------------------------------. |
---|
1752 | | yyerrorlab -- error raised explicitly by YYERROR. | |
---|
1753 | `---------------------------------------------------*/ |
---|
1754 | yyerrorlab: |
---|
1755 | |
---|
1756 | /* Pacify compilers like GCC when the user code never invokes |
---|
1757 | YYERROR and the label yyerrorlab therefore never appears in user |
---|
1758 | code. */ |
---|
1759 | if (/*CONSTCOND*/ 0) |
---|
1760 | goto yyerrorlab; |
---|
1761 | |
---|
1762 | /* Do not reclaim the symbols of the rule whose action triggered |
---|
1763 | this YYERROR. */ |
---|
1764 | YYPOPSTACK (yylen); |
---|
1765 | yylen = 0; |
---|
1766 | YY_STACK_PRINT (yyss, yyssp); |
---|
1767 | yystate = *yyssp; |
---|
1768 | goto yyerrlab1; |
---|
1769 | |
---|
1770 | |
---|
1771 | /*-------------------------------------------------------------. |
---|
1772 | | yyerrlab1 -- common code for both syntax error and YYERROR. | |
---|
1773 | `-------------------------------------------------------------*/ |
---|
1774 | yyerrlab1: |
---|
1775 | yyerrstatus = 3; /* Each real token shifted decrements this. */ |
---|
1776 | |
---|
1777 | for (;;) |
---|
1778 | { |
---|
1779 | yyn = yypact[yystate]; |
---|
1780 | if (!yypact_value_is_default (yyn)) |
---|
1781 | { |
---|
1782 | yyn += YYTERROR; |
---|
1783 | if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) |
---|
1784 | { |
---|
1785 | yyn = yytable[yyn]; |
---|
1786 | if (0 < yyn) |
---|
1787 | break; |
---|
1788 | } |
---|
1789 | } |
---|
1790 | |
---|
1791 | /* Pop the current state because it cannot handle the error token. */ |
---|
1792 | if (yyssp == yyss) |
---|
1793 | YYABORT; |
---|
1794 | |
---|
1795 | |
---|
1796 | yydestruct ("Error: popping", |
---|
1797 | yystos[yystate], yyvsp); |
---|
1798 | YYPOPSTACK (1); |
---|
1799 | yystate = *yyssp; |
---|
1800 | YY_STACK_PRINT (yyss, yyssp); |
---|
1801 | } |
---|
1802 | |
---|
1803 | YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
---|
1804 | *++yyvsp = yylval; |
---|
1805 | YY_IGNORE_MAYBE_UNINITIALIZED_END |
---|
1806 | |
---|
1807 | |
---|
1808 | /* Shift the error token. */ |
---|
1809 | YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); |
---|
1810 | |
---|
1811 | yystate = yyn; |
---|
1812 | goto yynewstate; |
---|
1813 | |
---|
1814 | |
---|
1815 | /*-------------------------------------. |
---|
1816 | | yyacceptlab -- YYACCEPT comes here. | |
---|
1817 | `-------------------------------------*/ |
---|
1818 | yyacceptlab: |
---|
1819 | yyresult = 0; |
---|
1820 | goto yyreturn; |
---|
1821 | |
---|
1822 | /*-----------------------------------. |
---|
1823 | | yyabortlab -- YYABORT comes here. | |
---|
1824 | `-----------------------------------*/ |
---|
1825 | yyabortlab: |
---|
1826 | yyresult = 1; |
---|
1827 | goto yyreturn; |
---|
1828 | |
---|
1829 | #if !defined yyoverflow || YYERROR_VERBOSE |
---|
1830 | /*-------------------------------------------------. |
---|
1831 | | yyexhaustedlab -- memory exhaustion comes here. | |
---|
1832 | `-------------------------------------------------*/ |
---|
1833 | yyexhaustedlab: |
---|
1834 | yyerror (YY_("memory exhausted")); |
---|
1835 | yyresult = 2; |
---|
1836 | /* Fall through. */ |
---|
1837 | #endif |
---|
1838 | |
---|
1839 | yyreturn: |
---|
1840 | if (yychar != YYEMPTY) |
---|
1841 | { |
---|
1842 | /* Make sure we have latest lookahead translation. See comments at |
---|
1843 | user semantic actions for why this is necessary. */ |
---|
1844 | yytoken = YYTRANSLATE (yychar); |
---|
1845 | yydestruct ("Cleanup: discarding lookahead", |
---|
1846 | yytoken, &yylval); |
---|
1847 | } |
---|
1848 | /* Do not reclaim the symbols of the rule whose action triggered |
---|
1849 | this YYABORT or YYACCEPT. */ |
---|
1850 | YYPOPSTACK (yylen); |
---|
1851 | YY_STACK_PRINT (yyss, yyssp); |
---|
1852 | while (yyssp != yyss) |
---|
1853 | { |
---|
1854 | yydestruct ("Cleanup: popping", |
---|
1855 | yystos[*yyssp], yyvsp); |
---|
1856 | YYPOPSTACK (1); |
---|
1857 | } |
---|
1858 | #ifndef yyoverflow |
---|
1859 | if (yyss != yyssa) |
---|
1860 | YYSTACK_FREE (yyss); |
---|
1861 | #endif |
---|
1862 | #if YYERROR_VERBOSE |
---|
1863 | if (yymsg != yymsgbuf) |
---|
1864 | YYSTACK_FREE (yymsg); |
---|
1865 | #endif |
---|
1866 | return yyresult; |
---|
1867 | } |
---|
1868 | #line 119 "yacc_parser.yacc" /* yacc.c:1906 */ |
---|
1869 | |
---|
1870 | |
---|
1871 | extern "C" |
---|
1872 | { |
---|
1873 | int yyerror(const char *s) |
---|
1874 | { |
---|
1875 | ERROR("int yyerror(const char *s)", << "Parsing error: " << s << endl); |
---|
1876 | } |
---|
1877 | } |
---|
1878 | |
---|
1879 | namespace xios |
---|
1880 | { |
---|
1881 | IFilterExprNode* parseExpr(const string& strExpr) |
---|
1882 | { |
---|
1883 | globalInputText = strExpr; |
---|
1884 | globalReadOffset = 0; |
---|
1885 | yyparse(); |
---|
1886 | return parsed; |
---|
1887 | } |
---|
1888 | } |
---|
1889 | |
---|
1890 | |
---|