Moved ConfigDir from theApp to thePrefs
[amule.git] / src / Parser.cpp
blob80e6b839955ff597f5266d0ad317391e9572ae51
1 /* A Bison parser, made by GNU Bison 2.4.2. */
3 /* Skeleton implementation for Bison's Yacc-like parsers in C
5 Copyright (C) 1984, 1989-1990, 2000-2006, 2009-2010 Free Software
6 Foundation, Inc.
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.
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.
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>. */
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.
31 This special exception was added by the Free Software Foundation in
32 version 2.2 of Bison. */
34 /* C LALR(1) parser skeleton written by Richard Stallman, by
35 simplifying the original so-called "semantic" parser. */
37 /* All symbols defined below should begin with yy or YY, to avoid
38 infringing on user name space. This should be done even for local
39 variables, as they might otherwise be expanded by user macros.
40 There are some unavoidable exceptions within include files to
41 define necessary library symbols; they are noted "INFRINGES ON
42 USER NAME SPACE" below. */
44 /* Identify Bison output. */
45 #define YYBISON 1
47 /* Bison version. */
48 #define YYBISON_VERSION "2.4.2"
50 /* Skeleton name. */
51 #define YYSKELETON_NAME "yacc.c"
53 /* Pure parsers. */
54 #define YYPURE 0
56 /* Push parsers. */
57 #define YYPUSH 0
59 /* Pull parsers. */
60 #define YYPULL 1
62 /* Using locations. */
63 #define YYLSP_NEEDED 0
67 /* Copy the first part of user declarations. */
69 /* Line 189 of yacc.c */
70 #line 1 "./Parser.y"
72 #include "SearchExpr.h"
73 #include "Scanner.h.in"
74 #include "Scanner.h"
75 #include "OtherFunctions.h"
77 #include "libs/common/StringFunctions.h"
79 #ifdef _DEBUG
80 #undef THIS_FILE
81 static char THIS_FILE[] = __FILE__;
82 #endif
84 extern wxArrayString _astrParserErrors;
86 void ParsedSearchExpression(const CSearchExpr* pexpr);
87 int yyerror(const char* errstr);
88 int yyerror(wxString errstr);
92 /* Line 189 of yacc.c */
93 #line 94 "Parser.cpp"
95 /* Enabling traces. */
96 #ifndef YYDEBUG
97 # define YYDEBUG 1
98 #endif
100 /* Enabling verbose error messages. */
101 #ifdef YYERROR_VERBOSE
102 # undef YYERROR_VERBOSE
103 # define YYERROR_VERBOSE 1
104 #else
105 # define YYERROR_VERBOSE 0
106 #endif
108 /* Enabling the token table. */
109 #ifndef YYTOKEN_TABLE
110 # define YYTOKEN_TABLE 0
111 #endif
114 /* Tokens. */
115 #ifndef YYTOKENTYPE
116 # define YYTOKENTYPE
117 /* Put the tokens into the symbol table, so that GDB and other debuggers
118 know about them. */
119 enum yytokentype {
120 TOK_STRING = 258,
121 TOK_AND = 259,
122 TOK_OR = 260,
123 TOK_NOT = 261,
124 TOK_ED2K_LINK = 262
126 #endif
130 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
131 typedef union YYSTYPE
134 /* Line 214 of yacc.c */
135 #line 22 "./Parser.y"
137 wxString* pstr;
138 CSearchExpr* pexpr;
142 /* Line 214 of yacc.c */
143 #line 144 "Parser.cpp"
144 } YYSTYPE;
145 # define YYSTYPE_IS_TRIVIAL 1
146 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
147 # define YYSTYPE_IS_DECLARED 1
148 #endif
151 /* Copy the second part of user declarations. */
154 /* Line 264 of yacc.c */
155 #line 156 "Parser.cpp"
157 #ifdef short
158 # undef short
159 #endif
161 #ifdef YYTYPE_UINT8
162 typedef YYTYPE_UINT8 yytype_uint8;
163 #else
164 typedef unsigned char yytype_uint8;
165 #endif
167 #ifdef YYTYPE_INT8
168 typedef YYTYPE_INT8 yytype_int8;
169 #elif (defined __STDC__ || defined __C99__FUNC__ \
170 || defined __cplusplus || defined _MSC_VER)
171 typedef signed char yytype_int8;
172 #else
173 typedef short int yytype_int8;
174 #endif
176 #ifdef YYTYPE_UINT16
177 typedef YYTYPE_UINT16 yytype_uint16;
178 #else
179 typedef unsigned short int yytype_uint16;
180 #endif
182 #ifdef YYTYPE_INT16
183 typedef YYTYPE_INT16 yytype_int16;
184 #else
185 typedef short int yytype_int16;
186 #endif
188 #ifndef YYSIZE_T
189 # ifdef __SIZE_TYPE__
190 # define YYSIZE_T __SIZE_TYPE__
191 # elif defined size_t
192 # define YYSIZE_T size_t
193 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
194 || defined __cplusplus || defined _MSC_VER)
195 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
196 # define YYSIZE_T size_t
197 # else
198 # define YYSIZE_T unsigned int
199 # endif
200 #endif
202 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
204 #ifndef YY_
205 # if defined YYENABLE_NLS && YYENABLE_NLS
206 # if ENABLE_NLS
207 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
208 # define YY_(msgid) dgettext ("bison-runtime", msgid)
209 # endif
210 # endif
211 # ifndef YY_
212 # define YY_(msgid) msgid
213 # endif
214 #endif
216 /* Suppress unused-variable warnings by "using" E. */
217 #if ! defined lint || defined __GNUC__
218 # define YYUSE(e) ((void) (e))
219 #else
220 # define YYUSE(e) /* empty */
221 #endif
223 /* Identity function, used to suppress warnings about constant conditions. */
224 #ifndef lint
225 # define YYID(n) (n)
226 #else
227 #if (defined __STDC__ || defined __C99__FUNC__ \
228 || defined __cplusplus || defined _MSC_VER)
229 static int
230 YYID (int yyi)
231 #else
232 static int
233 YYID (yyi)
234 int yyi;
235 #endif
237 return yyi;
239 #endif
241 #if ! defined yyoverflow || YYERROR_VERBOSE
243 /* The parser invokes alloca or malloc; define the necessary symbols. */
245 # ifdef YYSTACK_USE_ALLOCA
246 # if YYSTACK_USE_ALLOCA
247 # ifdef __GNUC__
248 # define YYSTACK_ALLOC __builtin_alloca
249 # elif defined __BUILTIN_VA_ARG_INCR
250 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
251 # elif defined _AIX
252 # define YYSTACK_ALLOC __alloca
253 # elif defined _MSC_VER
254 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
255 # define alloca _alloca
256 # else
257 # define YYSTACK_ALLOC alloca
258 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
259 || defined __cplusplus || defined _MSC_VER)
260 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
261 # ifndef _STDLIB_H
262 # define _STDLIB_H 1
263 # endif
264 # endif
265 # endif
266 # endif
267 # endif
269 # ifdef YYSTACK_ALLOC
270 /* Pacify GCC's `empty if-body' warning. */
271 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
272 # ifndef YYSTACK_ALLOC_MAXIMUM
273 /* The OS might guarantee only one guard page at the bottom of the stack,
274 and a page size can be as small as 4096 bytes. So we cannot safely
275 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
276 to allow for a few compiler-allocated temporary stack slots. */
277 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
278 # endif
279 # else
280 # define YYSTACK_ALLOC YYMALLOC
281 # define YYSTACK_FREE YYFREE
282 # ifndef YYSTACK_ALLOC_MAXIMUM
283 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
284 # endif
285 # if (defined __cplusplus && ! defined _STDLIB_H \
286 && ! ((defined YYMALLOC || defined malloc) \
287 && (defined YYFREE || defined free)))
288 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
289 # ifndef _STDLIB_H
290 # define _STDLIB_H 1
291 # endif
292 # endif
293 # ifndef YYMALLOC
294 # define YYMALLOC malloc
295 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
296 || defined __cplusplus || defined _MSC_VER)
297 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
298 # endif
299 # endif
300 # ifndef YYFREE
301 # define YYFREE free
302 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
303 || defined __cplusplus || defined _MSC_VER)
304 void free (void *); /* INFRINGES ON USER NAME SPACE */
305 # endif
306 # endif
307 # endif
308 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
311 #if (! defined yyoverflow \
312 && (! defined __cplusplus \
313 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
315 /* A type that is properly aligned for any stack member. */
316 union yyalloc
318 yytype_int16 yyss_alloc;
319 YYSTYPE yyvs_alloc;
322 /* The size of the maximum gap between one aligned stack and the next. */
323 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
325 /* The size of an array large to enough to hold all stacks, each with
326 N elements. */
327 # define YYSTACK_BYTES(N) \
328 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
329 + YYSTACK_GAP_MAXIMUM)
331 /* Copy COUNT objects from FROM to TO. The source and destination do
332 not overlap. */
333 # ifndef YYCOPY
334 # if defined __GNUC__ && 1 < __GNUC__
335 # define YYCOPY(To, From, Count) \
336 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
337 # else
338 # define YYCOPY(To, From, Count) \
339 do \
341 YYSIZE_T yyi; \
342 for (yyi = 0; yyi < (Count); yyi++) \
343 (To)[yyi] = (From)[yyi]; \
345 while (YYID (0))
346 # endif
347 # endif
349 /* Relocate STACK from its old location to the new one. The
350 local variables YYSIZE and YYSTACKSIZE give the old and new number of
351 elements in the stack, and YYPTR gives the new location of the
352 stack. Advance YYPTR to a properly aligned location for the next
353 stack. */
354 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
355 do \
357 YYSIZE_T yynewbytes; \
358 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
359 Stack = &yyptr->Stack_alloc; \
360 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
361 yyptr += yynewbytes / sizeof (*yyptr); \
363 while (YYID (0))
365 #endif
367 /* YYFINAL -- State number of the termination state. */
368 #define YYFINAL 15
369 /* YYLAST -- Last index in YYTABLE. */
370 #define YYLAST 52
372 /* YYNTOKENS -- Number of terminals. */
373 #define YYNTOKENS 10
374 /* YYNNTS -- Number of nonterminals. */
375 #define YYNNTS 4
376 /* YYNRULES -- Number of rules. */
377 #define YYNRULES 18
378 /* YYNRULES -- Number of states. */
379 #define YYNSTATES 28
381 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
382 #define YYUNDEFTOK 2
383 #define YYMAXUTOK 262
385 #define YYTRANSLATE(YYX) \
386 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
388 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
389 static const yytype_uint8 yytranslate[] =
391 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
392 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
393 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
394 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
395 8, 9, 2, 2, 2, 2, 2, 2, 2, 2,
396 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
397 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
398 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
399 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
400 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
401 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
402 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
403 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
404 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
405 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
406 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
407 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
408 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
409 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
410 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
411 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
412 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
413 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
414 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
415 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
416 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
417 5, 6, 7
420 #if YYDEBUG
421 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
422 YYRHS. */
423 static const yytype_uint8 yyprhs[] =
425 0, 0, 3, 5, 7, 10, 12, 16, 20, 24,
426 28, 32, 36, 39, 43, 46, 49, 52, 54
429 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
430 static const yytype_int8 yyrhs[] =
432 11, 0, -1, 12, -1, 7, -1, 12, 1, -1,
433 13, -1, 12, 4, 12, -1, 12, 5, 12, -1,
434 12, 6, 12, -1, 8, 12, 9, -1, 12, 5,
435 1, -1, 12, 6, 1, -1, 8, 1, -1, 8,
436 12, 1, -1, 4, 1, -1, 5, 1, -1, 6,
437 1, -1, 3, -1, 13, 3, -1
440 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
441 static const yytype_uint8 yyrline[] =
443 0, 41, 41, 47, 56, 65, 66, 76, 86, 96,
444 101, 107, 113, 118, 124, 129, 134, 141, 146
446 #endif
448 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
449 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
450 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
451 static const char *const yytname[] =
453 "$end", "error", "$undefined", "TOK_STRING", "TOK_AND", "TOK_OR",
454 "TOK_NOT", "TOK_ED2K_LINK", "'('", "')'", "$accept", "action",
455 "searchexpr", "and_strings", 0
457 #endif
459 # ifdef YYPRINT
460 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
461 token YYLEX-NUM. */
462 static const yytype_uint16 yytoknum[] =
464 0, 256, 257, 258, 259, 260, 261, 262, 40, 41
466 # endif
468 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
469 static const yytype_uint8 yyr1[] =
471 0, 10, 11, 11, 11, 12, 12, 12, 12, 12,
472 12, 12, 12, 12, 12, 12, 12, 13, 13
475 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
476 static const yytype_uint8 yyr2[] =
478 0, 2, 1, 1, 2, 1, 3, 3, 3, 3,
479 3, 3, 2, 3, 2, 2, 2, 1, 2
482 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
483 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
484 means the default is an error. */
485 static const yytype_uint8 yydefact[] =
487 0, 17, 0, 0, 0, 3, 0, 0, 0, 5,
488 14, 15, 16, 12, 0, 1, 4, 0, 0, 0,
489 18, 13, 9, 6, 10, 7, 11, 8
492 /* YYDEFGOTO[NTERM-NUM]. */
493 static const yytype_int8 yydefgoto[] =
495 -1, 7, 8, 9
498 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
499 STATE-NUM. */
500 #define YYPACT_NINF -7
501 static const yytype_int8 yypact[] =
503 38, -7, 1, 2, 6, -7, 13, 15, 34, 29,
504 -7, -7, -7, -7, 0, -7, -7, 44, 19, 25,
505 -7, -7, -7, 30, -7, 4, -7, -7
508 /* YYPGOTO[NTERM-NUM]. */
509 static const yytype_int8 yypgoto[] =
511 -7, -7, -6, -7
514 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
515 positive, shift that token. If negative, reduce the rule which
516 number is the opposite. If zero, do what YYDEFACT says.
517 If YYTABLE_NINF, syntax error. */
518 #define YYTABLE_NINF -3
519 static const yytype_int8 yytable[] =
521 14, 21, 10, 11, 17, 18, 19, 12, 17, 22,
522 19, 23, 25, 27, 13, 15, 1, 2, 3, 4,
523 24, 6, 1, 2, 3, 4, 26, 6, 1, 2,
524 3, 4, 20, 6, -2, 16, 19, 0, 17, 18,
525 19, 1, 2, 3, 4, 5, 6, 1, 2, 3,
526 4, 0, 6
529 static const yytype_int8 yycheck[] =
531 6, 1, 1, 1, 4, 5, 6, 1, 4, 9,
532 6, 17, 18, 19, 1, 0, 3, 4, 5, 6,
533 1, 8, 3, 4, 5, 6, 1, 8, 3, 4,
534 5, 6, 3, 8, 0, 1, 6, -1, 4, 5,
535 6, 3, 4, 5, 6, 7, 8, 3, 4, 5,
536 6, -1, 8
539 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
540 symbol of state STATE-NUM. */
541 static const yytype_uint8 yystos[] =
543 0, 3, 4, 5, 6, 7, 8, 11, 12, 13,
544 1, 1, 1, 1, 12, 0, 1, 4, 5, 6,
545 3, 1, 9, 12, 1, 12, 1, 12
548 #define yyerrok (yyerrstatus = 0)
549 #define yyclearin (yychar = YYEMPTY)
550 #define YYEMPTY (-2)
551 #define YYEOF 0
553 #define YYACCEPT goto yyacceptlab
554 #define YYABORT goto yyabortlab
555 #define YYERROR goto yyerrorlab
558 /* Like YYERROR except do call yyerror. This remains here temporarily
559 to ease the transition to the new meaning of YYERROR, for GCC.
560 Once GCC version 2 has supplanted version 1, this can go. However,
561 YYFAIL appears to be in use. Nevertheless, it is formally deprecated
562 in Bison 2.4.2's NEWS entry, where a plan to phase it out is
563 discussed. */
565 #define YYFAIL goto yyerrlab
566 #if defined YYFAIL
567 /* This is here to suppress warnings from the GCC cpp's
568 -Wunused-macros. Normally we don't worry about that warning, but
569 some users do, and we want to make it easy for users to remove
570 YYFAIL uses, which will produce warnings from Bison 2.5. */
571 #endif
573 #define YYRECOVERING() (!!yyerrstatus)
575 #define YYBACKUP(Token, Value) \
576 do \
577 if (yychar == YYEMPTY && yylen == 1) \
579 yychar = (Token); \
580 yylval = (Value); \
581 yytoken = YYTRANSLATE (yychar); \
582 YYPOPSTACK (1); \
583 goto yybackup; \
585 else \
587 yyerror (YY_("syntax error: cannot back up")); \
588 YYERROR; \
590 while (YYID (0))
593 #define YYTERROR 1
594 #define YYERRCODE 256
597 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
598 If N is 0, then set CURRENT to the empty location which ends
599 the previous symbol: RHS[0] (always defined). */
601 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
602 #ifndef YYLLOC_DEFAULT
603 # define YYLLOC_DEFAULT(Current, Rhs, N) \
604 do \
605 if (YYID (N)) \
607 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
608 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
609 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
610 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
612 else \
614 (Current).first_line = (Current).last_line = \
615 YYRHSLOC (Rhs, 0).last_line; \
616 (Current).first_column = (Current).last_column = \
617 YYRHSLOC (Rhs, 0).last_column; \
619 while (YYID (0))
620 #endif
623 /* YY_LOCATION_PRINT -- Print the location on the stream.
624 This macro was not mandated originally: define only if we know
625 we won't break user code: when these are the locations we know. */
627 #ifndef YY_LOCATION_PRINT
628 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
629 # define YY_LOCATION_PRINT(File, Loc) \
630 fprintf (File, "%d.%d-%d.%d", \
631 (Loc).first_line, (Loc).first_column, \
632 (Loc).last_line, (Loc).last_column)
633 # else
634 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
635 # endif
636 #endif
639 /* YYLEX -- calling `yylex' with the right arguments. */
641 #ifdef YYLEX_PARAM
642 # define YYLEX yylex (YYLEX_PARAM)
643 #else
644 # define YYLEX yylex ()
645 #endif
647 /* Enable debugging if requested. */
648 #if YYDEBUG
650 # ifndef YYFPRINTF
651 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
652 # define YYFPRINTF fprintf
653 # endif
655 # define YYDPRINTF(Args) \
656 do { \
657 if (yydebug) \
658 YYFPRINTF Args; \
659 } while (YYID (0))
661 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
662 do { \
663 if (yydebug) \
665 YYFPRINTF (stderr, "%s ", Title); \
666 yy_symbol_print (stderr, \
667 Type, Value); \
668 YYFPRINTF (stderr, "\n"); \
670 } while (YYID (0))
673 /*--------------------------------.
674 | Print this symbol on YYOUTPUT. |
675 `--------------------------------*/
677 /*ARGSUSED*/
678 #if (defined __STDC__ || defined __C99__FUNC__ \
679 || defined __cplusplus || defined _MSC_VER)
680 static void
681 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
682 #else
683 static void
684 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
685 FILE *yyoutput;
686 int yytype;
687 YYSTYPE const * const yyvaluep;
688 #endif
690 if (!yyvaluep)
691 return;
692 # ifdef YYPRINT
693 if (yytype < YYNTOKENS)
694 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
695 # else
696 YYUSE (yyoutput);
697 # endif
698 switch (yytype)
700 default:
701 break;
706 /*--------------------------------.
707 | Print this symbol on YYOUTPUT. |
708 `--------------------------------*/
710 #if (defined __STDC__ || defined __C99__FUNC__ \
711 || defined __cplusplus || defined _MSC_VER)
712 static void
713 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
714 #else
715 static void
716 yy_symbol_print (yyoutput, yytype, yyvaluep)
717 FILE *yyoutput;
718 int yytype;
719 YYSTYPE const * const yyvaluep;
720 #endif
722 if (yytype < YYNTOKENS)
723 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
724 else
725 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
727 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
728 YYFPRINTF (yyoutput, ")");
731 /*------------------------------------------------------------------.
732 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
733 | TOP (included). |
734 `------------------------------------------------------------------*/
736 #if (defined __STDC__ || defined __C99__FUNC__ \
737 || defined __cplusplus || defined _MSC_VER)
738 static void
739 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
740 #else
741 static void
742 yy_stack_print (yybottom, yytop)
743 yytype_int16 *yybottom;
744 yytype_int16 *yytop;
745 #endif
747 YYFPRINTF (stderr, "Stack now");
748 for (; yybottom <= yytop; yybottom++)
750 int yybot = *yybottom;
751 YYFPRINTF (stderr, " %d", yybot);
753 YYFPRINTF (stderr, "\n");
756 # define YY_STACK_PRINT(Bottom, Top) \
757 do { \
758 if (yydebug) \
759 yy_stack_print ((Bottom), (Top)); \
760 } while (YYID (0))
763 /*------------------------------------------------.
764 | Report that the YYRULE is going to be reduced. |
765 `------------------------------------------------*/
767 #if (defined __STDC__ || defined __C99__FUNC__ \
768 || defined __cplusplus || defined _MSC_VER)
769 static void
770 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
771 #else
772 static void
773 yy_reduce_print (yyvsp, yyrule)
774 YYSTYPE *yyvsp;
775 int yyrule;
776 #endif
778 int yynrhs = yyr2[yyrule];
779 int yyi;
780 unsigned long int yylno = yyrline[yyrule];
781 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
782 yyrule - 1, yylno);
783 /* The symbols being reduced. */
784 for (yyi = 0; yyi < yynrhs; yyi++)
786 YYFPRINTF (stderr, " $%d = ", yyi + 1);
787 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
788 &(yyvsp[(yyi + 1) - (yynrhs)])
790 YYFPRINTF (stderr, "\n");
794 # define YY_REDUCE_PRINT(Rule) \
795 do { \
796 if (yydebug) \
797 yy_reduce_print (yyvsp, Rule); \
798 } while (YYID (0))
800 /* Nonzero means print parse trace. It is left uninitialized so that
801 multiple parsers can coexist. */
802 int yydebug;
803 #else /* !YYDEBUG */
804 # define YYDPRINTF(Args)
805 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
806 # define YY_STACK_PRINT(Bottom, Top)
807 # define YY_REDUCE_PRINT(Rule)
808 #endif /* !YYDEBUG */
811 /* YYINITDEPTH -- initial size of the parser's stacks. */
812 #ifndef YYINITDEPTH
813 # define YYINITDEPTH 200
814 #endif
816 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
817 if the built-in stack extension method is used).
819 Do not make this value too large; the results are undefined if
820 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
821 evaluated with infinite-precision integer arithmetic. */
823 #ifndef YYMAXDEPTH
824 # define YYMAXDEPTH 10000
825 #endif
829 #if YYERROR_VERBOSE
831 # ifndef yystrlen
832 # if defined __GLIBC__ && defined _STRING_H
833 # define yystrlen strlen
834 # else
835 /* Return the length of YYSTR. */
836 #if (defined __STDC__ || defined __C99__FUNC__ \
837 || defined __cplusplus || defined _MSC_VER)
838 static YYSIZE_T
839 yystrlen (const char *yystr)
840 #else
841 static YYSIZE_T
842 yystrlen (yystr)
843 const char *yystr;
844 #endif
846 YYSIZE_T yylen;
847 for (yylen = 0; yystr[yylen]; yylen++)
848 continue;
849 return yylen;
851 # endif
852 # endif
854 # ifndef yystpcpy
855 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
856 # define yystpcpy stpcpy
857 # else
858 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
859 YYDEST. */
860 #if (defined __STDC__ || defined __C99__FUNC__ \
861 || defined __cplusplus || defined _MSC_VER)
862 static char *
863 yystpcpy (char *yydest, const char *yysrc)
864 #else
865 static char *
866 yystpcpy (yydest, yysrc)
867 char *yydest;
868 const char *yysrc;
869 #endif
871 char *yyd = yydest;
872 const char *yys = yysrc;
874 while ((*yyd++ = *yys++) != '\0')
875 continue;
877 return yyd - 1;
879 # endif
880 # endif
882 # ifndef yytnamerr
883 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
884 quotes and backslashes, so that it's suitable for yyerror. The
885 heuristic is that double-quoting is unnecessary unless the string
886 contains an apostrophe, a comma, or backslash (other than
887 backslash-backslash). YYSTR is taken from yytname. If YYRES is
888 null, do not copy; instead, return the length of what the result
889 would have been. */
890 static YYSIZE_T
891 yytnamerr (char *yyres, const char *yystr)
893 if (*yystr == '"')
895 YYSIZE_T yyn = 0;
896 char const *yyp = yystr;
898 for (;;)
899 switch (*++yyp)
901 case '\'':
902 case ',':
903 goto do_not_strip_quotes;
905 case '\\':
906 if (*++yyp != '\\')
907 goto do_not_strip_quotes;
908 /* Fall through. */
909 default:
910 if (yyres)
911 yyres[yyn] = *yyp;
912 yyn++;
913 break;
915 case '"':
916 if (yyres)
917 yyres[yyn] = '\0';
918 return yyn;
920 do_not_strip_quotes: ;
923 if (! yyres)
924 return yystrlen (yystr);
926 return yystpcpy (yyres, yystr) - yyres;
928 # endif
930 /* Copy into YYRESULT an error message about the unexpected token
931 YYCHAR while in state YYSTATE. Return the number of bytes copied,
932 including the terminating null byte. If YYRESULT is null, do not
933 copy anything; just return the number of bytes that would be
934 copied. As a special case, return 0 if an ordinary "syntax error"
935 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
936 size calculation. */
937 static YYSIZE_T
938 yysyntax_error (char *yyresult, int yystate, int yychar)
940 int yyn = yypact[yystate];
942 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
943 return 0;
944 else
946 int yytype = YYTRANSLATE (yychar);
947 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
948 YYSIZE_T yysize = yysize0;
949 YYSIZE_T yysize1;
950 int yysize_overflow = 0;
951 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
952 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
953 int yyx;
955 # if 0
956 /* This is so xgettext sees the translatable formats that are
957 constructed on the fly. */
958 YY_("syntax error, unexpected %s");
959 YY_("syntax error, unexpected %s, expecting %s");
960 YY_("syntax error, unexpected %s, expecting %s or %s");
961 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
962 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
963 # endif
964 char *yyfmt;
965 char const *yyf;
966 static char const yyunexpected[] = "syntax error, unexpected %s";
967 static char const yyexpecting[] = ", expecting %s";
968 static char const yyor[] = " or %s";
969 char yyformat[sizeof yyunexpected
970 + sizeof yyexpecting - 1
971 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
972 * (sizeof yyor - 1))];
973 char const *yyprefix = yyexpecting;
975 /* Start YYX at -YYN if negative to avoid negative indexes in
976 YYCHECK. */
977 int yyxbegin = yyn < 0 ? -yyn : 0;
979 /* Stay within bounds of both yycheck and yytname. */
980 int yychecklim = YYLAST - yyn + 1;
981 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
982 int yycount = 1;
984 yyarg[0] = yytname[yytype];
985 yyfmt = yystpcpy (yyformat, yyunexpected);
987 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
988 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
990 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
992 yycount = 1;
993 yysize = yysize0;
994 yyformat[sizeof yyunexpected - 1] = '\0';
995 break;
997 yyarg[yycount++] = yytname[yyx];
998 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
999 yysize_overflow |= (yysize1 < yysize);
1000 yysize = yysize1;
1001 yyfmt = yystpcpy (yyfmt, yyprefix);
1002 yyprefix = yyor;
1005 yyf = YY_(yyformat);
1006 yysize1 = yysize + yystrlen (yyf);
1007 yysize_overflow |= (yysize1 < yysize);
1008 yysize = yysize1;
1010 if (yysize_overflow)
1011 return YYSIZE_MAXIMUM;
1013 if (yyresult)
1015 /* Avoid sprintf, as that infringes on the user's name space.
1016 Don't have undefined behavior even if the translation
1017 produced a string with the wrong number of "%s"s. */
1018 char *yyp = yyresult;
1019 int yyi = 0;
1020 while ((*yyp = *yyf) != '\0')
1022 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
1024 yyp += yytnamerr (yyp, yyarg[yyi++]);
1025 yyf += 2;
1027 else
1029 yyp++;
1030 yyf++;
1034 return yysize;
1037 #endif /* YYERROR_VERBOSE */
1040 /*-----------------------------------------------.
1041 | Release the memory associated to this symbol. |
1042 `-----------------------------------------------*/
1044 /*ARGSUSED*/
1045 #if (defined __STDC__ || defined __C99__FUNC__ \
1046 || defined __cplusplus || defined _MSC_VER)
1047 static void
1048 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1049 #else
1050 static void
1051 yydestruct (yymsg, yytype, yyvaluep)
1052 const char *yymsg;
1053 int yytype;
1054 YYSTYPE *yyvaluep;
1055 #endif
1057 YYUSE (yyvaluep);
1059 if (!yymsg)
1060 yymsg = "Deleting";
1061 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1063 switch (yytype)
1066 default:
1067 break;
1071 /* Prevent warnings from -Wmissing-prototypes. */
1072 #ifdef YYPARSE_PARAM
1073 #if defined __STDC__ || defined __cplusplus
1074 int yyparse (void *YYPARSE_PARAM);
1075 #else
1076 int yyparse ();
1077 #endif
1078 #else /* ! YYPARSE_PARAM */
1079 #if defined __STDC__ || defined __cplusplus
1080 int yyparse (void);
1081 #else
1082 int yyparse ();
1083 #endif
1084 #endif /* ! YYPARSE_PARAM */
1087 /* The lookahead symbol. */
1088 int yychar;
1090 /* The semantic value of the lookahead symbol. */
1091 YYSTYPE yylval;
1093 /* Number of syntax errors so far. */
1094 int yynerrs;
1098 /*-------------------------.
1099 | yyparse or yypush_parse. |
1100 `-------------------------*/
1102 #ifdef YYPARSE_PARAM
1103 #if (defined __STDC__ || defined __C99__FUNC__ \
1104 || defined __cplusplus || defined _MSC_VER)
1106 yyparse (void *YYPARSE_PARAM)
1107 #else
1109 yyparse (YYPARSE_PARAM)
1110 void *YYPARSE_PARAM;
1111 #endif
1112 #else /* ! YYPARSE_PARAM */
1113 #if (defined __STDC__ || defined __C99__FUNC__ \
1114 || defined __cplusplus || defined _MSC_VER)
1116 yyparse (void)
1117 #else
1119 yyparse ()
1121 #endif
1122 #endif
1126 int yystate;
1127 /* Number of tokens to shift before error messages enabled. */
1128 int yyerrstatus;
1130 /* The stacks and their tools:
1131 `yyss': related to states.
1132 `yyvs': related to semantic values.
1134 Refer to the stacks thru separate pointers, to allow yyoverflow
1135 to reallocate them elsewhere. */
1137 /* The state stack. */
1138 yytype_int16 yyssa[YYINITDEPTH];
1139 yytype_int16 *yyss;
1140 yytype_int16 *yyssp;
1142 /* The semantic value stack. */
1143 YYSTYPE yyvsa[YYINITDEPTH];
1144 YYSTYPE *yyvs;
1145 YYSTYPE *yyvsp;
1147 YYSIZE_T yystacksize;
1149 int yyn;
1150 int yyresult;
1151 /* Lookahead token as an internal (translated) token number. */
1152 int yytoken;
1153 /* The variables used to return semantic value and location from the
1154 action routines. */
1155 YYSTYPE yyval;
1157 #if YYERROR_VERBOSE
1158 /* Buffer for error messages, and its allocated size. */
1159 char yymsgbuf[128];
1160 char *yymsg = yymsgbuf;
1161 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1162 #endif
1164 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1166 /* The number of symbols on the RHS of the reduced rule.
1167 Keep to zero when no symbol should be popped. */
1168 int yylen = 0;
1170 yytoken = 0;
1171 yyss = yyssa;
1172 yyvs = yyvsa;
1173 yystacksize = YYINITDEPTH;
1175 YYDPRINTF ((stderr, "Starting parse\n"));
1177 yystate = 0;
1178 yyerrstatus = 0;
1179 yynerrs = 0;
1180 yychar = YYEMPTY; /* Cause a token to be read. */
1182 /* Initialize stack pointers.
1183 Waste one element of value and location stack
1184 so that they stay on the same level as the state stack.
1185 The wasted elements are never initialized. */
1186 yyssp = yyss;
1187 yyvsp = yyvs;
1189 goto yysetstate;
1191 /*------------------------------------------------------------.
1192 | yynewstate -- Push a new state, which is found in yystate. |
1193 `------------------------------------------------------------*/
1194 yynewstate:
1195 /* In all cases, when you get here, the value and location stacks
1196 have just been pushed. So pushing a state here evens the stacks. */
1197 yyssp++;
1199 yysetstate:
1200 *yyssp = yystate;
1202 if (yyss + yystacksize - 1 <= yyssp)
1204 /* Get the current used size of the three stacks, in elements. */
1205 YYSIZE_T yysize = yyssp - yyss + 1;
1207 #ifdef yyoverflow
1209 /* Give user a chance to reallocate the stack. Use copies of
1210 these so that the &'s don't force the real ones into
1211 memory. */
1212 YYSTYPE *yyvs1 = yyvs;
1213 yytype_int16 *yyss1 = yyss;
1215 /* Each stack pointer address is followed by the size of the
1216 data in use in that stack, in bytes. This used to be a
1217 conditional around just the two extra args, but that might
1218 be undefined if yyoverflow is a macro. */
1219 yyoverflow (YY_("memory exhausted"),
1220 &yyss1, yysize * sizeof (*yyssp),
1221 &yyvs1, yysize * sizeof (*yyvsp),
1222 &yystacksize);
1224 yyss = yyss1;
1225 yyvs = yyvs1;
1227 #else /* no yyoverflow */
1228 # ifndef YYSTACK_RELOCATE
1229 goto yyexhaustedlab;
1230 # else
1231 /* Extend the stack our own way. */
1232 if (YYMAXDEPTH <= yystacksize)
1233 goto yyexhaustedlab;
1234 yystacksize *= 2;
1235 if (YYMAXDEPTH < yystacksize)
1236 yystacksize = YYMAXDEPTH;
1239 yytype_int16 *yyss1 = yyss;
1240 union yyalloc *yyptr =
1241 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1242 if (! yyptr)
1243 goto yyexhaustedlab;
1244 YYSTACK_RELOCATE (yyss_alloc, yyss);
1245 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1246 # undef YYSTACK_RELOCATE
1247 if (yyss1 != yyssa)
1248 YYSTACK_FREE (yyss1);
1250 # endif
1251 #endif /* no yyoverflow */
1253 yyssp = yyss + yysize - 1;
1254 yyvsp = yyvs + yysize - 1;
1256 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1257 (unsigned long int) yystacksize));
1259 if (yyss + yystacksize - 1 <= yyssp)
1260 YYABORT;
1263 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1265 if (yystate == YYFINAL)
1266 YYACCEPT;
1268 goto yybackup;
1270 /*-----------.
1271 | yybackup. |
1272 `-----------*/
1273 yybackup:
1275 /* Do appropriate processing given the current state. Read a
1276 lookahead token if we need one and don't already have one. */
1278 /* First try to decide what to do without reference to lookahead token. */
1279 yyn = yypact[yystate];
1280 if (yyn == YYPACT_NINF)
1281 goto yydefault;
1283 /* Not known => get a lookahead token if don't already have one. */
1285 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1286 if (yychar == YYEMPTY)
1288 YYDPRINTF ((stderr, "Reading a token: "));
1289 yychar = YYLEX;
1292 if (yychar <= YYEOF)
1294 yychar = yytoken = YYEOF;
1295 YYDPRINTF ((stderr, "Now at end of input.\n"));
1297 else
1299 yytoken = YYTRANSLATE (yychar);
1300 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1303 /* If the proper action on seeing token YYTOKEN is to reduce or to
1304 detect an error, take that action. */
1305 yyn += yytoken;
1306 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1307 goto yydefault;
1308 yyn = yytable[yyn];
1309 if (yyn <= 0)
1311 if (yyn == 0 || yyn == YYTABLE_NINF)
1312 goto yyerrlab;
1313 yyn = -yyn;
1314 goto yyreduce;
1317 /* Count tokens shifted since error; after three, turn off error
1318 status. */
1319 if (yyerrstatus)
1320 yyerrstatus--;
1322 /* Shift the lookahead token. */
1323 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1325 /* Discard the shifted token. */
1326 yychar = YYEMPTY;
1328 yystate = yyn;
1329 *++yyvsp = yylval;
1331 goto yynewstate;
1334 /*-----------------------------------------------------------.
1335 | yydefault -- do the default action for the current state. |
1336 `-----------------------------------------------------------*/
1337 yydefault:
1338 yyn = yydefact[yystate];
1339 if (yyn == 0)
1340 goto yyerrlab;
1341 goto yyreduce;
1344 /*-----------------------------.
1345 | yyreduce -- Do a reduction. |
1346 `-----------------------------*/
1347 yyreduce:
1348 /* yyn is the number of a rule to reduce with. */
1349 yylen = yyr2[yyn];
1351 /* If YYLEN is nonzero, implement the default value of the action:
1352 `$$ = $1'.
1354 Otherwise, the following line sets YYVAL to garbage.
1355 This behavior is undocumented and Bison
1356 users should not rely upon it. Assigning to YYVAL
1357 unconditionally makes the parser a bit smaller, and it avoids a
1358 GCC warning that YYVAL may be used uninitialized. */
1359 yyval = yyvsp[1-yylen];
1362 YY_REDUCE_PRINT (yyn);
1363 switch (yyn)
1365 case 2:
1367 /* Line 1464 of yacc.c */
1368 #line 42 "./Parser.y"
1370 ParsedSearchExpression((yyvsp[(1) - (1)].pexpr));
1371 delete (yyvsp[(1) - (1)].pexpr);
1372 return 0;
1374 break;
1376 case 3:
1378 /* Line 1464 of yacc.c */
1379 #line 48 "./Parser.y"
1381 CSearchExpr* pexpr = new CSearchExpr(*(yyvsp[(1) - (1)].pstr));
1382 ParsedSearchExpression(pexpr);
1383 delete pexpr;
1384 delete (yyvsp[(1) - (1)].pstr);
1385 return 0;
1387 break;
1389 case 4:
1391 /* Line 1464 of yacc.c */
1392 #line 57 "./Parser.y"
1394 yyerror(wxT("Undefined search expression error"));
1395 delete (yyvsp[(1) - (2)].pexpr);
1396 return 1;
1398 break;
1400 case 6:
1402 /* Line 1464 of yacc.c */
1403 #line 67 "./Parser.y"
1405 CSearchExpr* pexpr = new CSearchExpr;
1406 pexpr->Add(SEARCHOP_AND);
1407 pexpr->Add((yyvsp[(1) - (3)].pexpr));
1408 pexpr->Add((yyvsp[(3) - (3)].pexpr));
1409 (yyval.pexpr) = pexpr;
1410 delete (yyvsp[(1) - (3)].pexpr);
1411 delete (yyvsp[(3) - (3)].pexpr);
1413 break;
1415 case 7:
1417 /* Line 1464 of yacc.c */
1418 #line 77 "./Parser.y"
1420 CSearchExpr* pexpr = new CSearchExpr;
1421 pexpr->Add(SEARCHOP_OR);
1422 pexpr->Add((yyvsp[(1) - (3)].pexpr));
1423 pexpr->Add((yyvsp[(3) - (3)].pexpr));
1424 (yyval.pexpr) = pexpr;
1425 delete (yyvsp[(1) - (3)].pexpr);
1426 delete (yyvsp[(3) - (3)].pexpr);
1428 break;
1430 case 8:
1432 /* Line 1464 of yacc.c */
1433 #line 87 "./Parser.y"
1435 CSearchExpr* pexpr = new CSearchExpr;
1436 pexpr->Add(SEARCHOP_NOT);
1437 pexpr->Add((yyvsp[(1) - (3)].pexpr));
1438 pexpr->Add((yyvsp[(3) - (3)].pexpr));
1439 (yyval.pexpr) = pexpr;
1440 delete (yyvsp[(1) - (3)].pexpr);
1441 delete (yyvsp[(3) - (3)].pexpr);
1443 break;
1445 case 9:
1447 /* Line 1464 of yacc.c */
1448 #line 97 "./Parser.y"
1450 (yyval.pexpr) = (yyvsp[(2) - (3)].pexpr);
1452 break;
1454 case 10:
1456 /* Line 1464 of yacc.c */
1457 #line 102 "./Parser.y"
1459 yyerror(wxT("Missing right operand for OR on search expression"));
1460 delete (yyvsp[(1) - (3)].pexpr);
1461 return 1;
1463 break;
1465 case 11:
1467 /* Line 1464 of yacc.c */
1468 #line 108 "./Parser.y"
1470 yyerror(wxT("Missing operand for NOT on search expression"));
1471 delete (yyvsp[(1) - (3)].pexpr);
1472 return 1;
1474 break;
1476 case 12:
1478 /* Line 1464 of yacc.c */
1479 #line 114 "./Parser.y"
1481 yyerror(wxT("Missing left parenthesis on search expression"));
1482 return 1;
1484 break;
1486 case 13:
1488 /* Line 1464 of yacc.c */
1489 #line 119 "./Parser.y"
1491 yyerror(wxT("Missing closing parenthesis on search expression"));
1492 delete (yyvsp[(2) - (3)].pexpr);
1493 return 1;
1495 break;
1497 case 14:
1499 /* Line 1464 of yacc.c */
1500 #line 125 "./Parser.y"
1502 yyerror(wxT("Missing left operand for AND on search expression"));
1503 return 1;
1505 break;
1507 case 15:
1509 /* Line 1464 of yacc.c */
1510 #line 130 "./Parser.y"
1512 yyerror(wxT("Missing left operand for OR on search expression"));
1513 return 1;
1515 break;
1517 case 16:
1519 /* Line 1464 of yacc.c */
1520 #line 135 "./Parser.y"
1522 yyerror(wxT("Missing left operand for NOT on search expression (?)"));
1523 return 1;
1525 break;
1527 case 17:
1529 /* Line 1464 of yacc.c */
1530 #line 142 "./Parser.y"
1532 (yyval.pexpr) = new CSearchExpr(*(yyvsp[(1) - (1)].pstr));
1533 delete (yyvsp[(1) - (1)].pstr);
1535 break;
1537 case 18:
1539 /* Line 1464 of yacc.c */
1540 #line 147 "./Parser.y"
1542 /*$1->Concatenate($2);
1543 delete $2;*/
1544 CSearchExpr* pexpr = new CSearchExpr;
1545 pexpr->Add(SEARCHOP_AND);
1546 pexpr->Add((yyvsp[(1) - (2)].pexpr));
1547 pexpr->Add(*(yyvsp[(2) - (2)].pstr));
1548 (yyval.pexpr) = pexpr;
1549 delete (yyvsp[(1) - (2)].pexpr);
1550 delete (yyvsp[(2) - (2)].pstr);
1552 break;
1556 /* Line 1464 of yacc.c */
1557 #line 1558 "Parser.cpp"
1558 default: break;
1560 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1562 YYPOPSTACK (yylen);
1563 yylen = 0;
1564 YY_STACK_PRINT (yyss, yyssp);
1566 *++yyvsp = yyval;
1568 /* Now `shift' the result of the reduction. Determine what state
1569 that goes to, based on the state we popped back to and the rule
1570 number reduced by. */
1572 yyn = yyr1[yyn];
1574 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1575 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1576 yystate = yytable[yystate];
1577 else
1578 yystate = yydefgoto[yyn - YYNTOKENS];
1580 goto yynewstate;
1583 /*------------------------------------.
1584 | yyerrlab -- here on detecting error |
1585 `------------------------------------*/
1586 yyerrlab:
1587 /* If not already recovering from an error, report this error. */
1588 if (!yyerrstatus)
1590 ++yynerrs;
1591 #if ! YYERROR_VERBOSE
1592 yyerror (YY_("syntax error"));
1593 #else
1595 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
1596 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
1598 YYSIZE_T yyalloc = 2 * yysize;
1599 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
1600 yyalloc = YYSTACK_ALLOC_MAXIMUM;
1601 if (yymsg != yymsgbuf)
1602 YYSTACK_FREE (yymsg);
1603 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
1604 if (yymsg)
1605 yymsg_alloc = yyalloc;
1606 else
1608 yymsg = yymsgbuf;
1609 yymsg_alloc = sizeof yymsgbuf;
1613 if (0 < yysize && yysize <= yymsg_alloc)
1615 (void) yysyntax_error (yymsg, yystate, yychar);
1616 yyerror (yymsg);
1618 else
1620 yyerror (YY_("syntax error"));
1621 if (yysize != 0)
1622 goto yyexhaustedlab;
1625 #endif
1630 if (yyerrstatus == 3)
1632 /* If just tried and failed to reuse lookahead token after an
1633 error, discard it. */
1635 if (yychar <= YYEOF)
1637 /* Return failure if at end of input. */
1638 if (yychar == YYEOF)
1639 YYABORT;
1641 else
1643 yydestruct ("Error: discarding",
1644 yytoken, &yylval);
1645 yychar = YYEMPTY;
1649 /* Else will try to reuse lookahead token after shifting the error
1650 token. */
1651 goto yyerrlab1;
1654 /*---------------------------------------------------.
1655 | yyerrorlab -- error raised explicitly by YYERROR. |
1656 `---------------------------------------------------*/
1657 yyerrorlab:
1659 /* Pacify compilers like GCC when the user code never invokes
1660 YYERROR and the label yyerrorlab therefore never appears in user
1661 code. */
1662 if (/*CONSTCOND*/ 0)
1663 goto yyerrorlab;
1665 /* Do not reclaim the symbols of the rule which action triggered
1666 this YYERROR. */
1667 YYPOPSTACK (yylen);
1668 yylen = 0;
1669 YY_STACK_PRINT (yyss, yyssp);
1670 yystate = *yyssp;
1671 goto yyerrlab1;
1674 /*-------------------------------------------------------------.
1675 | yyerrlab1 -- common code for both syntax error and YYERROR. |
1676 `-------------------------------------------------------------*/
1677 yyerrlab1:
1678 yyerrstatus = 3; /* Each real token shifted decrements this. */
1680 for (;;)
1682 yyn = yypact[yystate];
1683 if (yyn != YYPACT_NINF)
1685 yyn += YYTERROR;
1686 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1688 yyn = yytable[yyn];
1689 if (0 < yyn)
1690 break;
1694 /* Pop the current state because it cannot handle the error token. */
1695 if (yyssp == yyss)
1696 YYABORT;
1699 yydestruct ("Error: popping",
1700 yystos[yystate], yyvsp);
1701 YYPOPSTACK (1);
1702 yystate = *yyssp;
1703 YY_STACK_PRINT (yyss, yyssp);
1706 *++yyvsp = yylval;
1709 /* Shift the error token. */
1710 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1712 yystate = yyn;
1713 goto yynewstate;
1716 /*-------------------------------------.
1717 | yyacceptlab -- YYACCEPT comes here. |
1718 `-------------------------------------*/
1719 yyacceptlab:
1720 yyresult = 0;
1721 goto yyreturn;
1723 /*-----------------------------------.
1724 | yyabortlab -- YYABORT comes here. |
1725 `-----------------------------------*/
1726 yyabortlab:
1727 yyresult = 1;
1728 goto yyreturn;
1730 #if !defined(yyoverflow) || YYERROR_VERBOSE
1731 /*-------------------------------------------------.
1732 | yyexhaustedlab -- memory exhaustion comes here. |
1733 `-------------------------------------------------*/
1734 yyexhaustedlab:
1735 yyerror (YY_("memory exhausted"));
1736 yyresult = 2;
1737 /* Fall through. */
1738 #endif
1740 yyreturn:
1741 if (yychar != YYEMPTY)
1742 yydestruct ("Cleanup: discarding lookahead",
1743 yytoken, &yylval);
1744 /* Do not reclaim the symbols of the rule which action triggered
1745 this YYABORT or YYACCEPT. */
1746 YYPOPSTACK (yylen);
1747 YY_STACK_PRINT (yyss, yyssp);
1748 while (yyssp != yyss)
1750 yydestruct ("Cleanup: popping",
1751 yystos[*yyssp], yyvsp);
1752 YYPOPSTACK (1);
1754 #ifndef yyoverflow
1755 if (yyss != yyssa)
1756 YYSTACK_FREE (yyss);
1757 #endif
1758 #if YYERROR_VERBOSE
1759 if (yymsg != yymsgbuf)
1760 YYSTACK_FREE (yymsg);
1761 #endif
1762 /* Make sure YYID is used. */
1763 return YYID (yyresult);
1768 /* Line 1684 of yacc.c */
1769 #line 160 "./Parser.y"
1772 int yyerror(const char* errstr)
1774 // Errors created by yacc generated code
1775 //yyerror ("syntax error: cannot back up");
1776 //yyerror ("syntax error; also virtual memory exhausted");
1777 //yyerror ("syntax error");
1778 //yyerror ("parser stack overflow");
1780 _astrParserErrors.Add(char2unicode(errstr));
1781 return EXIT_FAILURE;
1784 int yyerror(wxString errstr)
1786 _astrParserErrors.Add(errstr);
1787 return EXIT_FAILURE;