ReactOS  0.4.14-dev-554-g2f8d847
wql.tab.c
Go to the documentation of this file.
1 /* A Bison parser, made by GNU Bison 3.4.1. */
2 
3 /* Bison implementation for Yacc-like parsers in C
4 
5  Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software Foundation,
6  Inc.
7 
8  This program is free software: you can redistribute it and/or modify
9  it under the terms of the GNU General Public License as published by
10  the Free Software Foundation, either version 3 of the License, or
11  (at your option) any later version.
12 
13  This program is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with this program. If not, see <http://www.gnu.org/licenses/>. */
20 
21 /* As a special exception, you may create a larger work that contains
22  part or all of the Bison parser skeleton and distribute that work
23  under terms of your choice, so long as that work isn't itself a
24  parser generator using the skeleton or a modified version thereof
25  as a parser skeleton. Alternatively, if you modify or redistribute
26  the parser skeleton itself, you may (at your option) remove this
27  special exception, which will cause the skeleton and the resulting
28  Bison output files to be licensed under the GNU General Public
29  License without this special exception.
30 
31  This special exception was added by the Free Software Foundation in
32  version 2.2 of Bison. */
33 
34 /* C LALR(1) parser skeleton written by Richard Stallman, by
35  simplifying the original so-called "semantic" parser. */
36 
37 /* 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. */
43 
44 /* Undocumented macros, especially those whose name start with YY_,
45  are private implementation details. Do not rely on them. */
46 
47 /* Identify Bison output. */
48 #define YYBISON 1
49 
50 /* Bison version. */
51 #define YYBISON_VERSION "3.4.1"
52 
53 /* Skeleton name. */
54 #define YYSKELETON_NAME "yacc.c"
55 
56 /* Pure parsers. */
57 #define YYPURE 1
58 
59 /* Push parsers. */
60 #define YYPUSH 0
61 
62 /* Pull parsers. */
63 #define YYPULL 1
64 
65 
66 /* Substitute the variable and function names. */
67 #define yyparse wql_parse
68 #define yylex wql_lex
69 #define yyerror wql_error
70 #define yydebug wql_debug
71 #define yynerrs wql_nerrs
72 
73 
74 /* First part of user prologue. */
75 #line 1 "wql.y"
76 
77 
78 /*
79  * Copyright 2012 Hans Leidekker for CodeWeavers
80  *
81  * This library is free software; you can redistribute it and/or
82  * modify it under the terms of the GNU Lesser General Public
83  * License as published by the Free Software Foundation; either
84  * version 2.1 of the License, or (at your option) any later version.
85  *
86  * This library is distributed in the hope that it will be useful,
87  * but WITHOUT ANY WARRANTY; without even the implied warranty of
88  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
89  * Lesser General Public License for more details.
90  *
91  * You should have received a copy of the GNU Lesser General Public
92  * License along with this library; if not, write to the Free Software
93  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
94  */
95 
96 #include <stdarg.h>
97 
98 #include "windef.h"
99 #include "winbase.h"
100 #include "wbemcli.h"
101 #include "wbemprox_private.h"
102 
103 #include "wine/list.h"
104 #include "wine/debug.h"
105 
107 
108 struct parser
109 {
110  const WCHAR *cmd;
114  struct view **view;
115  struct list *mem;
116 };
117 
118 struct string
119 {
120  const WCHAR *data;
121  int len;
122 };
123 
124 static void *alloc_mem( struct parser *parser, UINT size )
125 {
126  struct list *mem = heap_alloc( sizeof(struct list) + size );
128  return &mem[1];
129 }
130 
131 static struct property *alloc_property( struct parser *parser, const WCHAR *class, const WCHAR *name )
132 {
133  struct property *prop = alloc_mem( parser, sizeof(*prop) );
134  if (prop)
135  {
136  prop->name = name;
137  prop->class = class;
138  prop->next = NULL;
139  }
140  return prop;
141 }
142 
143 static struct keyword *alloc_keyword( struct parser *parser, const WCHAR *name, const WCHAR *value )
144 {
145  struct keyword *keyword = alloc_mem( parser, sizeof(*keyword) );
146  if (keyword)
147  {
148  keyword->name = name;
149  keyword->value = value;
150  keyword->next = NULL;
151  }
152  return keyword;
153 }
154 
155 static WCHAR *get_string( struct parser *parser, const struct string *str )
156 {
157  const WCHAR *p = str->data;
158  int len = str->len;
159  WCHAR *ret;
160 
161  if ((p[0] == '\"' && p[len - 1] != '\"') ||
162  (p[0] == '\'' && p[len - 1] != '\'')) return NULL;
163  if ((p[0] == '\"' && p[len - 1] == '\"') ||
164  (p[0] == '\'' && p[len - 1] == '\''))
165  {
166  p++;
167  len -= 2;
168  }
169  if (!(ret = alloc_mem( parser, (len + 1) * sizeof(WCHAR) ))) return NULL;
170  memcpy( ret, p, len * sizeof(WCHAR) );
171  ret[len] = 0;
172  return ret;
173 }
174 
175 static WCHAR *get_path( struct parser *parser, const struct string *str )
176 {
177  const WCHAR *p = str->data;
178  int len = str->len;
179  WCHAR *ret;
180 
181  if (p[0] == '{' && p[len - 1] == '}')
182  {
183  p++;
184  len -= 2;
185  }
186 
187  if (!(ret = alloc_mem( parser, (len + 1) * sizeof(WCHAR) ))) return NULL;
188  memcpy( ret, p, len * sizeof(WCHAR) );
189  ret[len] = 0;
190  return ret;
191 }
192 
193 static int get_int( struct parser *parser )
194 {
195  const WCHAR *p = &parser->cmd[parser->idx];
196  int i, ret = 0;
197 
198  for (i = 0; i < parser->len; i++)
199  {
200  if (p[i] < '0' || p[i] > '9')
201  {
202  ERR("should only be numbers here!\n");
203  break;
204  }
205  ret = (p[i] - '0') + ret * 10;
206  }
207  return ret;
208 }
209 
210 static struct expr *expr_complex( struct parser *parser, struct expr *l, UINT op, struct expr *r )
211 {
212  struct expr *e = alloc_mem( parser, sizeof(*e) );
213  if (e)
214  {
215  e->type = EXPR_COMPLEX;
216  e->u.expr.left = l;
217  e->u.expr.op = op;
218  e->u.expr.right = r;
219  }
220  return e;
221 }
222 
223 static struct expr *expr_unary( struct parser *parser, struct expr *l, UINT op )
224 {
225  struct expr *e = alloc_mem( parser, sizeof(*e) );
226  if (e)
227  {
228  e->type = EXPR_UNARY;
229  e->u.expr.left = l;
230  e->u.expr.op = op;
231  e->u.expr.right = NULL;
232  }
233  return e;
234 }
235 
236 static struct expr *expr_ival( struct parser *parser, int val )
237 {
238  struct expr *e = alloc_mem( parser, sizeof *e );
239  if (e)
240  {
241  e->type = EXPR_IVAL;
242  e->u.ival = val;
243  }
244  return e;
245 }
246 
247 static struct expr *expr_sval( struct parser *parser, const struct string *str )
248 {
249  struct expr *e = alloc_mem( parser, sizeof *e );
250  if (e)
251  {
252  e->type = EXPR_SVAL;
253  e->u.sval = get_string( parser, str );
254  if (!e->u.sval)
255  return NULL; /* e will be freed by query destructor */
256  }
257  return e;
258 }
259 
260 static struct expr *expr_bval( struct parser *parser, int val )
261 {
262  struct expr *e = alloc_mem( parser, sizeof *e );
263  if (e)
264  {
265  e->type = EXPR_BVAL;
266  e->u.ival = val;
267  }
268  return e;
269 }
270 
271 static struct expr *expr_propval( struct parser *parser, const struct property *prop )
272 {
273  struct expr *e = alloc_mem( parser, sizeof *e );
274  if (e)
275  {
276  e->type = EXPR_PROPVAL;
277  e->u.propval = prop;
278  }
279  return e;
280 }
281 
282 static int wql_error( struct parser *parser, const char *str );
283 static int wql_lex( void *val, struct parser *parser );
284 
285 #define PARSER_BUBBLE_UP_VIEW( parser, result, current_view ) \
286  *parser->view = current_view; \
287  result = current_view
288 
289 
290 #line 291 "wql.tab.c"
291 
292 # ifndef YY_NULLPTR
293 # if defined __cplusplus
294 # if 201103L <= __cplusplus
295 # define YY_NULLPTR nullptr
296 # else
297 # define YY_NULLPTR 0
298 # endif
299 # else
300 # define YY_NULLPTR ((void*)0)
301 # endif
302 # endif
303 
304 /* Enabling verbose error messages. */
305 #ifdef YYERROR_VERBOSE
306 # undef YYERROR_VERBOSE
307 # define YYERROR_VERBOSE 1
308 #else
309 # define YYERROR_VERBOSE 1
310 #endif
311 
312 /* Use api.header.include to #include this header
313  instead of duplicating it here. */
314 #ifndef YY_WQL_E_REACTOSSYNC_GCC_DLL_WIN32_WBEMPROX_WQL_TAB_H_INCLUDED
315 # define YY_WQL_E_REACTOSSYNC_GCC_DLL_WIN32_WBEMPROX_WQL_TAB_H_INCLUDED
316 /* Debug traces. */
317 #ifndef YYDEBUG
318 # define YYDEBUG 0
319 #endif
320 #if YYDEBUG
321 extern int wql_debug;
322 #endif
323 
324 /* Token type. */
325 #ifndef YYTOKENTYPE
326 # define YYTOKENTYPE
328  {
329  TK_SELECT = 258,
330  TK_FROM = 259,
331  TK_STAR = 260,
332  TK_COMMA = 261,
333  TK_DOT = 262,
334  TK_IS = 263,
335  TK_LP = 264,
336  TK_RP = 265,
337  TK_NULL = 266,
338  TK_FALSE = 267,
339  TK_TRUE = 268,
340  TK_INTEGER = 269,
341  TK_WHERE = 270,
342  TK_SPACE = 271,
343  TK_MINUS = 272,
344  TK_ILLEGAL = 273,
345  TK_BY = 274,
347  TK_OF = 276,
348  TK_STRING = 277,
349  TK_ID = 278,
350  TK_PATH = 279,
351  TK_OR = 280,
352  TK_AND = 281,
353  TK_NOT = 282,
354  TK_EQ = 283,
355  TK_NE = 284,
356  TK_LT = 285,
357  TK_GT = 286,
358  TK_LE = 287,
359  TK_GE = 288,
360  TK_LIKE = 289
361  };
362 #endif
363 
364 /* Value type. */
365 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
366 union YYSTYPE
367 {
368 #line 222 "wql.y"
369 
370  struct string str;
374  struct view *view;
375  struct expr *expr;
376  int integer;
377 
378 #line 379 "wql.tab.c"
379 
380 };
381 typedef union YYSTYPE YYSTYPE;
382 # define YYSTYPE_IS_TRIVIAL 1
383 # define YYSTYPE_IS_DECLARED 1
384 #endif
385 
386 
387 
388 int wql_parse (struct parser *ctx);
389 
390 #endif /* !YY_WQL_E_REACTOSSYNC_GCC_DLL_WIN32_WBEMPROX_WQL_TAB_H_INCLUDED */
391 
392 
393 
394 #ifdef short
395 # undef short
396 #endif
397 
398 #ifdef YYTYPE_UINT8
399 typedef YYTYPE_UINT8 yytype_uint8;
400 #else
401 typedef unsigned char yytype_uint8;
402 #endif
403 
404 #ifdef YYTYPE_INT8
405 typedef YYTYPE_INT8 yytype_int8;
406 #else
407 typedef signed char yytype_int8;
408 #endif
409 
410 #ifdef YYTYPE_UINT16
411 typedef YYTYPE_UINT16 yytype_uint16;
412 #else
413 typedef unsigned short yytype_uint16;
414 #endif
415 
416 #ifdef YYTYPE_INT16
417 typedef YYTYPE_INT16 yytype_int16;
418 #else
419 typedef short yytype_int16;
420 #endif
421 
422 #ifndef YYSIZE_T
423 # ifdef __SIZE_TYPE__
424 # define YYSIZE_T __SIZE_TYPE__
425 # elif defined size_t
426 # define YYSIZE_T size_t
427 # elif ! defined YYSIZE_T
428 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
429 # define YYSIZE_T size_t
430 # else
431 # define YYSIZE_T unsigned
432 # endif
433 #endif
434 
435 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
436 
437 #ifndef YY_
438 # if defined YYENABLE_NLS && YYENABLE_NLS
439 # if ENABLE_NLS
440 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
441 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
442 # endif
443 # endif
444 # ifndef YY_
445 # define YY_(Msgid) Msgid
446 # endif
447 #endif
448 
449 #ifndef YY_ATTRIBUTE
450 # if (defined __GNUC__ \
451  && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
452  || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
453 # define YY_ATTRIBUTE(Spec) __attribute__(Spec)
454 # else
455 # define YY_ATTRIBUTE(Spec) /* empty */
456 # endif
457 #endif
458 
459 #ifndef YY_ATTRIBUTE_PURE
460 # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
461 #endif
462 
463 #ifndef YY_ATTRIBUTE_UNUSED
464 # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
465 #endif
466 
467 /* Suppress unused-variable warnings by "using" E. */
468 #if ! defined lint || defined __GNUC__
469 # define YYUSE(E) ((void) (E))
470 #else
471 # define YYUSE(E) /* empty */
472 #endif
473 
474 #if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
475 /* Suppress an incorrect diagnostic about yylval being uninitialized. */
476 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
477  _Pragma ("GCC diagnostic push") \
478  _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
479  _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
480 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
481  _Pragma ("GCC diagnostic pop")
482 #else
483 # define YY_INITIAL_VALUE(Value) Value
484 #endif
485 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
486 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
487 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
488 #endif
489 #ifndef YY_INITIAL_VALUE
490 # define YY_INITIAL_VALUE(Value) /* Nothing. */
491 #endif
492 
493 
494 #define YY_ASSERT(E) ((void) (0 && (E)))
495 
496 #if ! defined yyoverflow || YYERROR_VERBOSE
497 
498 /* The parser invokes alloca or malloc; define the necessary symbols. */
499 
500 # ifdef YYSTACK_USE_ALLOCA
501 # if YYSTACK_USE_ALLOCA
502 # ifdef __GNUC__
503 # define YYSTACK_ALLOC __builtin_alloca
504 # elif defined __BUILTIN_VA_ARG_INCR
505 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
506 # elif defined _AIX
507 # define YYSTACK_ALLOC __alloca
508 # elif defined _MSC_VER
509 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
510 # define alloca _alloca
511 # else
512 # define YYSTACK_ALLOC alloca
513 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
514 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
515  /* Use EXIT_SUCCESS as a witness for stdlib.h. */
516 # ifndef EXIT_SUCCESS
517 # define EXIT_SUCCESS 0
518 # endif
519 # endif
520 # endif
521 # endif
522 # endif
523 
524 # ifdef YYSTACK_ALLOC
525  /* Pacify GCC's 'empty if-body' warning. */
526 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
527 # ifndef YYSTACK_ALLOC_MAXIMUM
528  /* The OS might guarantee only one guard page at the bottom of the stack,
529  and a page size can be as small as 4096 bytes. So we cannot safely
530  invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
531  to allow for a few compiler-allocated temporary stack slots. */
532 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
533 # endif
534 # else
535 # define YYSTACK_ALLOC YYMALLOC
536 # define YYSTACK_FREE YYFREE
537 # ifndef YYSTACK_ALLOC_MAXIMUM
538 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
539 # endif
540 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
541  && ! ((defined YYMALLOC || defined malloc) \
542  && (defined YYFREE || defined free)))
543 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
544 # ifndef EXIT_SUCCESS
545 # define EXIT_SUCCESS 0
546 # endif
547 # endif
548 # ifndef YYMALLOC
549 # define YYMALLOC malloc
550 # if ! defined malloc && ! defined EXIT_SUCCESS
551 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
552 # endif
553 # endif
554 # ifndef YYFREE
555 # define YYFREE free
556 # if ! defined free && ! defined EXIT_SUCCESS
557 void free (void *); /* INFRINGES ON USER NAME SPACE */
558 # endif
559 # endif
560 # endif
561 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
562 
563 
564 #if (! defined yyoverflow \
565  && (! defined __cplusplus \
566  || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
567 
568 /* A type that is properly aligned for any stack member. */
569 union yyalloc
570 {
573 };
574 
575 /* The size of the maximum gap between one aligned stack and the next. */
576 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
577 
578 /* The size of an array large to enough to hold all stacks, each with
579  N elements. */
580 # define YYSTACK_BYTES(N) \
581  ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
582  + YYSTACK_GAP_MAXIMUM)
583 
584 # define YYCOPY_NEEDED 1
585 
586 /* Relocate STACK from its old location to the new one. The
587  local variables YYSIZE and YYSTACKSIZE give the old and new number of
588  elements in the stack, and YYPTR gives the new location of the
589  stack. Advance YYPTR to a properly aligned location for the next
590  stack. */
591 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
592  do \
593  { \
594  YYSIZE_T yynewbytes; \
595  YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
596  Stack = &yyptr->Stack_alloc; \
597  yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
598  yyptr += yynewbytes / sizeof (*yyptr); \
599  } \
600  while (0)
601 
602 #endif
603 
604 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
605 /* Copy COUNT objects from SRC to DST. The source and destination do
606  not overlap. */
607 # ifndef YYCOPY
608 # if defined __GNUC__ && 1 < __GNUC__
609 # define YYCOPY(Dst, Src, Count) \
610  __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
611 # else
612 # define YYCOPY(Dst, Src, Count) \
613  do \
614  { \
615  YYSIZE_T yyi; \
616  for (yyi = 0; yyi < (Count); yyi++) \
617  (Dst)[yyi] = (Src)[yyi]; \
618  } \
619  while (0)
620 # endif
621 # endif
622 #endif /* !YYCOPY_NEEDED */
623 
624 /* YYFINAL -- State number of the termination state. */
625 #define YYFINAL 13
626 /* YYLAST -- Last index in YYTABLE. */
627 #define YYLAST 91
628 
629 /* YYNTOKENS -- Number of terminals. */
630 #define YYNTOKENS 35
631 /* YYNNTS -- Number of nonterminals. */
632 #define YYNNTS 15
633 /* YYNRULES -- Number of rules. */
634 #define YYNRULES 49
635 /* YYNSTATES -- Number of states. */
636 #define YYNSTATES 87
637 
638 #define YYUNDEFTOK 2
639 #define YYMAXUTOK 289
640 
641 /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
642  as returned by yylex, with out-of-bounds checking. */
643 #define YYTRANSLATE(YYX) \
644  ((unsigned) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
645 
646 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
647  as returned by yylex. */
648 static const yytype_uint8 yytranslate[] =
649 {
650  0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
651  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
652  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
653  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
654  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
655  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
656  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
657  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
658  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
659  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
660  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
661  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
662  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
663  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
664  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
665  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
666  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
667  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
668  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
669  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
670  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
671  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
672  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
673  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
674  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
675  2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
676  5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
677  15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
678  25, 26, 27, 28, 29, 30, 31, 32, 33, 34
679 };
680 
681 #if YYDEBUG
682  /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
683 static const yytype_uint16 yyrline[] =
684 {
685  0, 248, 248, 250, 254, 263, 269, 278, 279, 286,
686  298, 313, 325, 337, 352, 353, 357, 364, 370, 379,
687  388, 395, 401, 407, 413, 419, 425, 431, 437, 443,
688  449, 455, 461, 467, 473, 479, 485, 491, 497, 503,
689  509, 515, 521, 527, 536, 545, 554, 560, 566, 572
690 };
691 #endif
692 
693 #if YYDEBUG || YYERROR_VERBOSE || 1
694 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
695  First, the terminals, then, starting at YYNTOKENS, nonterminals. */
696 static const char *const yytname[] =
697 {
698  "$end", "error", "$undefined", "TK_SELECT", "TK_FROM", "TK_STAR",
699  "TK_COMMA", "TK_DOT", "TK_IS", "TK_LP", "TK_RP", "TK_NULL", "TK_FALSE",
700  "TK_TRUE", "TK_INTEGER", "TK_WHERE", "TK_SPACE", "TK_MINUS",
701  "TK_ILLEGAL", "TK_BY", "TK_ASSOCIATORS", "TK_OF", "TK_STRING", "TK_ID",
702  "TK_PATH", "TK_OR", "TK_AND", "TK_NOT", "TK_EQ", "TK_NE", "TK_LT",
703  "TK_GT", "TK_LE", "TK_GE", "TK_LIKE", "$accept", "query", "path",
704  "keyword", "keywordlist", "associatorsof", "select", "proplist", "prop",
705  "id", "number", "expr", "string_val", "prop_val", "const_val", YY_NULLPTR
706 };
707 #endif
708 
709 # ifdef YYPRINT
710 /* YYTOKNUM[NUM] -- (External) token number corresponding to the
711  (internal) symbol number NUM (which must be that of a token). */
712 static const yytype_uint16 yytoknum[] =
713 {
714  0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
715  265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
716  275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
717  285, 286, 287, 288, 289
718 };
719 # endif
720 
721 #define YYPACT_NINF -25
722 
723 #define yypact_value_is_default(Yystate) \
724  (!!((Yystate) == (-25)))
725 
726 #define YYTABLE_NINF -1
727 
728 #define yytable_value_is_error(Yytable_value) \
729  0
730 
731  /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
732  STATE-NUM. */
733 static const yytype_int8 yypact[] =
734 {
735  0, 8, -13, 15, -25, -25, 10, -25, -25, 38,
736  37, 42, 26, -25, -25, 10, 9, 10, -25, 57,
737  58, -25, -25, 10, 25, 10, -25, 23, 25, -24,
738  -25, -25, -25, -25, 25, -25, -25, -19, -7, 51,
739  -25, 10, 20, 10, 10, -25, 25, 25, -9, 49,
740  53, 56, 56, 56, 56, 52, 10, 10, 10, 10,
741  10, 10, -25, -25, -25, -25, -25, -25, -25, 65,
742  -25, -25, -25, -25, -25, -25, -25, -25, -25, -25,
743  -25, -25, -25, -25, -25, -25, -25
744 };
745 
746  /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
747  Performed when YYTABLE does not specify something else to do. Zero
748  means the default is an error. */
749 static const yytype_uint8 yydefact[] =
750 {
751  0, 0, 0, 0, 3, 2, 0, 16, 19, 0,
752  14, 18, 0, 1, 11, 0, 0, 0, 4, 9,
753  12, 15, 17, 0, 0, 7, 10, 5, 0, 0,
754  49, 48, 20, 47, 0, 45, 46, 13, 0, 0,
755  8, 0, 0, 0, 0, 24, 0, 0, 0, 0,
756  0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
757  0, 0, 6, 21, 41, 43, 23, 22, 38, 0,
758  40, 25, 42, 30, 27, 26, 28, 29, 44, 37,
759  31, 36, 33, 32, 34, 35, 39
760 };
761 
762  /* YYPGOTO[NTERM-NUM]. */
763 static const yytype_int8 yypgoto[] =
764 {
765  -25, -25, -25, -25, 66, -25, -25, 61, 43, -6,
766  -25, -18, -25, -3, 36
767 };
768 
769  /* YYDEFGOTO[NTERM-NUM]. */
770 static const yytype_int8 yydefgoto[] =
771 {
772  -1, 3, 19, 25, 26, 4, 5, 9, 35, 11,
773  36, 37, 79, 38, 39
774 };
775 
776  /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
777  positive, shift that token. If negative, reduce the rule whose
778  number is the opposite. If YYTABLE_NINF, syntax error. */
779 static const yytype_uint8 yytable[] =
780 {
781  14, 48, 68, 1, 43, 44, 46, 47, 12, 20,
782  42, 22, 6, 7, 7, 13, 45, 27, 69, 27,
783  2, 49, 50, 51, 52, 53, 54, 55, 66, 67,
784  63, 8, 8, 8, 28, 62, 29, 30, 31, 32,
785  64, 65, 15, 16, 10, 46, 47, 33, 8, 17,
786  18, 41, 34, 80, 81, 82, 83, 84, 85, 10,
787  70, 30, 31, 32, 72, 30, 31, 32, 30, 31,
788  32, 33, 23, 24, 78, 33, 86, 21, 33, 56,
789  57, 58, 59, 60, 61, 71, 73, 74, 75, 76,
790  77, 40
791 };
792 
793 static const yytype_uint8 yycheck[] =
794 {
795  6, 8, 11, 3, 28, 29, 25, 26, 21, 15,
796  28, 17, 4, 5, 5, 0, 34, 23, 27, 25,
797  20, 28, 29, 30, 31, 32, 33, 34, 46, 47,
798  10, 23, 23, 23, 9, 41, 11, 12, 13, 14,
799  43, 44, 4, 6, 1, 25, 26, 22, 23, 7,
800  24, 28, 27, 56, 57, 58, 59, 60, 61, 16,
801  11, 12, 13, 14, 11, 12, 13, 14, 12, 13,
802  14, 22, 15, 15, 22, 22, 11, 16, 22, 28,
803  29, 30, 31, 32, 33, 49, 50, 51, 52, 53,
804  54, 25
805 };
806 
807  /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
808  symbol of state STATE-NUM. */
809 static const yytype_uint8 yystos[] =
810 {
811  0, 3, 20, 36, 40, 41, 4, 5, 23, 42,
812  43, 44, 21, 0, 44, 4, 6, 7, 24, 37,
813  44, 42, 44, 15, 15, 38, 39, 44, 9, 11,
814  12, 13, 14, 22, 27, 43, 45, 46, 48, 49,
815  39, 28, 46, 28, 29, 46, 25, 26, 8, 28,
816  29, 30, 31, 32, 33, 34, 28, 29, 30, 31,
817  32, 33, 44, 10, 48, 48, 46, 46, 11, 27,
818  11, 49, 11, 49, 49, 49, 49, 49, 22, 47,
819  48, 48, 48, 48, 48, 48, 11
820 };
821 
822  /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
823 static const yytype_uint8 yyr1[] =
824 {
825  0, 35, 36, 36, 37, 38, 38, 39, 39, 40,
826  40, 41, 41, 41, 42, 42, 42, 43, 43, 44,
827  45, 46, 46, 46, 46, 46, 46, 46, 46, 46,
828  46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
829  46, 46, 46, 46, 47, 48, 49, 49, 49, 49
830 };
831 
832  /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
833 static const yytype_uint8 yyr2[] =
834 {
835  0, 2, 1, 1, 1, 1, 3, 1, 2, 3,
836  5, 3, 4, 6, 1, 3, 1, 3, 1, 1,
837  1, 3, 3, 3, 2, 3, 3, 3, 3, 3,
838  3, 3, 3, 3, 3, 3, 3, 3, 3, 4,
839  3, 3, 3, 3, 1, 1, 1, 1, 1, 1
840 };
841 
842 
843 #define yyerrok (yyerrstatus = 0)
844 #define yyclearin (yychar = YYEMPTY)
845 #define YYEMPTY (-2)
846 #define YYEOF 0
847 
848 #define YYACCEPT goto yyacceptlab
849 #define YYABORT goto yyabortlab
850 #define YYERROR goto yyerrorlab
851 
852 
853 #define YYRECOVERING() (!!yyerrstatus)
854 
855 #define YYBACKUP(Token, Value) \
856  do \
857  if (yychar == YYEMPTY) \
858  { \
859  yychar = (Token); \
860  yylval = (Value); \
861  YYPOPSTACK (yylen); \
862  yystate = *yyssp; \
863  goto yybackup; \
864  } \
865  else \
866  { \
867  yyerror (ctx, YY_("syntax error: cannot back up")); \
868  YYERROR; \
869  } \
870  while (0)
871 
872 /* Error token number */
873 #define YYTERROR 1
874 #define YYERRCODE 256
875 
876 
877 
878 /* Enable debugging if requested. */
879 #if YYDEBUG
880 
881 # ifndef YYFPRINTF
882 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
883 # define YYFPRINTF fprintf
884 # endif
885 
886 # define YYDPRINTF(Args) \
887 do { \
888  if (yydebug) \
889  YYFPRINTF Args; \
890 } while (0)
891 
892 /* This macro is provided for backward compatibility. */
893 #ifndef YY_LOCATION_PRINT
894 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
895 #endif
896 
897 
898 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
899 do { \
900  if (yydebug) \
901  { \
902  YYFPRINTF (stderr, "%s ", Title); \
903  yy_symbol_print (stderr, \
904  Type, Value, ctx); \
905  YYFPRINTF (stderr, "\n"); \
906  } \
907 } while (0)
908 
909 
910 /*-----------------------------------.
911 | Print this symbol's value on YYO. |
912 `-----------------------------------*/
913 
914 static void
915 yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep, struct parser *ctx)
916 {
917  FILE *yyoutput = yyo;
918  YYUSE (yyoutput);
919  YYUSE (ctx);
920  if (!yyvaluep)
921  return;
922 # ifdef YYPRINT
923  if (yytype < YYNTOKENS)
924  YYPRINT (yyo, yytoknum[yytype], *yyvaluep);
925 # endif
926  YYUSE (yytype);
927 }
928 
929 
930 /*---------------------------.
931 | Print this symbol on YYO. |
932 `---------------------------*/
933 
934 static void
935 yy_symbol_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep, struct parser *ctx)
936 {
937  YYFPRINTF (yyo, "%s %s (",
938  yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
939 
940  yy_symbol_value_print (yyo, yytype, yyvaluep, ctx);
941  YYFPRINTF (yyo, ")");
942 }
943 
944 /*------------------------------------------------------------------.
945 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
946 | TOP (included). |
947 `------------------------------------------------------------------*/
948 
949 static void
950 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
951 {
952  YYFPRINTF (stderr, "Stack now");
953  for (; yybottom <= yytop; yybottom++)
954  {
955  int yybot = *yybottom;
956  YYFPRINTF (stderr, " %d", yybot);
957  }
958  YYFPRINTF (stderr, "\n");
959 }
960 
961 # define YY_STACK_PRINT(Bottom, Top) \
962 do { \
963  if (yydebug) \
964  yy_stack_print ((Bottom), (Top)); \
965 } while (0)
966 
967 
968 /*------------------------------------------------.
969 | Report that the YYRULE is going to be reduced. |
970 `------------------------------------------------*/
971 
972 static void
973 yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule, struct parser *ctx)
974 {
975  unsigned long yylno = yyrline[yyrule];
976  int yynrhs = yyr2[yyrule];
977  int yyi;
978  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
979  yyrule - 1, yylno);
980  /* The symbols being reduced. */
981  for (yyi = 0; yyi < yynrhs; yyi++)
982  {
983  YYFPRINTF (stderr, " $%d = ", yyi + 1);
984  yy_symbol_print (stderr,
985  yystos[yyssp[yyi + 1 - yynrhs]],
986  &yyvsp[(yyi + 1) - (yynrhs)]
987  , ctx);
988  YYFPRINTF (stderr, "\n");
989  }
990 }
991 
992 # define YY_REDUCE_PRINT(Rule) \
993 do { \
994  if (yydebug) \
995  yy_reduce_print (yyssp, yyvsp, Rule, ctx); \
996 } while (0)
997 
998 /* Nonzero means print parse trace. It is left uninitialized so that
999  multiple parsers can coexist. */
1000 int yydebug;
1001 #else /* !YYDEBUG */
1002 # define YYDPRINTF(Args)
1003 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1004 # define YY_STACK_PRINT(Bottom, Top)
1005 # define YY_REDUCE_PRINT(Rule)
1006 #endif /* !YYDEBUG */
1007 
1008 
1009 /* YYINITDEPTH -- initial size of the parser's stacks. */
1010 #ifndef YYINITDEPTH
1011 # define YYINITDEPTH 200
1012 #endif
1013 
1014 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1015  if the built-in stack extension method is used).
1016 
1017  Do not make this value too large; the results are undefined if
1018  YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1019  evaluated with infinite-precision integer arithmetic. */
1020 
1021 #ifndef YYMAXDEPTH
1022 # define YYMAXDEPTH 10000
1023 #endif
1024 
1025 
1026 #if YYERROR_VERBOSE
1027 
1028 # ifndef yystrlen
1029 # if defined __GLIBC__ && defined _STRING_H
1030 # define yystrlen strlen
1031 # else
1032 /* Return the length of YYSTR. */
1033 static YYSIZE_T
1034 yystrlen (const char *yystr)
1035 {
1036  YYSIZE_T yylen;
1037  for (yylen = 0; yystr[yylen]; yylen++)
1038  continue;
1039  return yylen;
1040 }
1041 # endif
1042 # endif
1043 
1044 # ifndef yystpcpy
1045 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1046 # define yystpcpy stpcpy
1047 # else
1048 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1049  YYDEST. */
1050 static char *
1051 yystpcpy (char *yydest, const char *yysrc)
1052 {
1053  char *yyd = yydest;
1054  const char *yys = yysrc;
1055 
1056  while ((*yyd++ = *yys++) != '\0')
1057  continue;
1058 
1059  return yyd - 1;
1060 }
1061 # endif
1062 # endif
1063 
1064 # ifndef yytnamerr
1065 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1066  quotes and backslashes, so that it's suitable for yyerror. The
1067  heuristic is that double-quoting is unnecessary unless the string
1068  contains an apostrophe, a comma, or backslash (other than
1069  backslash-backslash). YYSTR is taken from yytname. If YYRES is
1070  null, do not copy; instead, return the length of what the result
1071  would have been. */
1072 static YYSIZE_T
1073 yytnamerr (char *yyres, const char *yystr)
1074 {
1075  if (*yystr == '"')
1076  {
1077  YYSIZE_T yyn = 0;
1078  char const *yyp = yystr;
1079 
1080  for (;;)
1081  switch (*++yyp)
1082  {
1083  case '\'':
1084  case ',':
1085  goto do_not_strip_quotes;
1086 
1087  case '\\':
1088  if (*++yyp != '\\')
1089  goto do_not_strip_quotes;
1090  else
1091  goto append;
1092 
1093  append:
1094  default:
1095  if (yyres)
1096  yyres[yyn] = *yyp;
1097  yyn++;
1098  break;
1099 
1100  case '"':
1101  if (yyres)
1102  yyres[yyn] = '\0';
1103  return yyn;
1104  }
1105  do_not_strip_quotes: ;
1106  }
1107 
1108  if (! yyres)
1109  return yystrlen (yystr);
1110 
1111  return (YYSIZE_T) (yystpcpy (yyres, yystr) - yyres);
1112 }
1113 # endif
1114 
1115 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1116  about the unexpected token YYTOKEN for the state stack whose top is
1117  YYSSP.
1118 
1119  Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1120  not large enough to hold the message. In that case, also set
1121  *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1122  required number of bytes is too large to store. */
1123 static int
1124 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
1125  yytype_int16 *yyssp, int yytoken)
1126 {
1127  YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
1128  YYSIZE_T yysize = yysize0;
1129  enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1130  /* Internationalized format string. */
1131  const char *yyformat = YY_NULLPTR;
1132  /* Arguments of yyformat. */
1133  char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1134  /* Number of reported tokens (one for the "unexpected", one per
1135  "expected"). */
1136  int yycount = 0;
1137 
1138  /* There are many possibilities here to consider:
1139  - If this state is a consistent state with a default action, then
1140  the only way this function was invoked is if the default action
1141  is an error action. In that case, don't check for expected
1142  tokens because there are none.
1143  - The only way there can be no lookahead present (in yychar) is if
1144  this state is a consistent state with a default action. Thus,
1145  detecting the absence of a lookahead is sufficient to determine
1146  that there is no unexpected or expected token to report. In that
1147  case, just report a simple "syntax error".
1148  - Don't assume there isn't a lookahead just because this state is a
1149  consistent state with a default action. There might have been a
1150  previous inconsistent state, consistent state with a non-default
1151  action, or user semantic action that manipulated yychar.
1152  - Of course, the expected token list depends on states to have
1153  correct lookahead information, and it depends on the parser not
1154  to perform extra reductions after fetching a lookahead from the
1155  scanner and before detecting a syntax error. Thus, state merging
1156  (from LALR or IELR) and default reductions corrupt the expected
1157  token list. However, the list is correct for canonical LR with
1158  one exception: it will still contain any token that will not be
1159  accepted due to an error action in a later state.
1160  */
1161  if (yytoken != YYEMPTY)
1162  {
1163  int yyn = yypact[*yyssp];
1164  yyarg[yycount++] = yytname[yytoken];
1165  if (!yypact_value_is_default (yyn))
1166  {
1167  /* Start YYX at -YYN if negative to avoid negative indexes in
1168  YYCHECK. In other words, skip the first -YYN actions for
1169  this state because they are default actions. */
1170  int yyxbegin = yyn < 0 ? -yyn : 0;
1171  /* Stay within bounds of both yycheck and yytname. */
1172  int yychecklim = YYLAST - yyn + 1;
1173  int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1174  int yyx;
1175 
1176  for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1177  if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1178  && !yytable_value_is_error (yytable[yyx + yyn]))
1179  {
1180  if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1181  {
1182  yycount = 1;
1183  yysize = yysize0;
1184  break;
1185  }
1186  yyarg[yycount++] = yytname[yyx];
1187  {
1188  YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
1189  if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
1190  yysize = yysize1;
1191  else
1192  return 2;
1193  }
1194  }
1195  }
1196  }
1197 
1198  switch (yycount)
1199  {
1200 # define YYCASE_(N, S) \
1201  case N: \
1202  yyformat = S; \
1203  break
1204  default: /* Avoid compiler warnings. */
1205  YYCASE_(0, YY_("syntax error"));
1206  YYCASE_(1, YY_("syntax error, unexpected %s"));
1207  YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1208  YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1209  YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1210  YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1211 # undef YYCASE_
1212  }
1213 
1214  {
1215  YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
1216  if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
1217  yysize = yysize1;
1218  else
1219  return 2;
1220  }
1221 
1222  if (*yymsg_alloc < yysize)
1223  {
1224  *yymsg_alloc = 2 * yysize;
1225  if (! (yysize <= *yymsg_alloc
1226  && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1227  *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1228  return 1;
1229  }
1230 
1231  /* Avoid sprintf, as that infringes on the user's name space.
1232  Don't have undefined behavior even if the translation
1233  produced a string with the wrong number of "%s"s. */
1234  {
1235  char *yyp = *yymsg;
1236  int yyi = 0;
1237  while ((*yyp = *yyformat) != '\0')
1238  if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1239  {
1240  yyp += yytnamerr (yyp, yyarg[yyi++]);
1241  yyformat += 2;
1242  }
1243  else
1244  {
1245  yyp++;
1246  yyformat++;
1247  }
1248  }
1249  return 0;
1250 }
1251 #endif /* YYERROR_VERBOSE */
1252 
1253 /*-----------------------------------------------.
1254 | Release the memory associated to this symbol. |
1255 `-----------------------------------------------*/
1256 
1257 static void
1258 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, struct parser *ctx)
1259 {
1260  YYUSE (yyvaluep);
1261  YYUSE (ctx);
1262  if (!yymsg)
1263  yymsg = "Deleting";
1264  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1265 
1267  YYUSE (yytype);
1269 }
1270 
1271 
1272 
1273 
1274 /*----------.
1275 | yyparse. |
1276 `----------*/
1277 
1278 int
1279 yyparse (struct parser *ctx)
1280 {
1281 /* The lookahead symbol. */
1282 int yychar;
1283 
1284 
1285 /* The semantic value of the lookahead symbol. */
1286 /* Default value used for initialization, for pacifying older GCCs
1287  or non-GCC compilers. */
1288 YY_INITIAL_VALUE (static YYSTYPE yyval_default;)
1289 YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
1290 
1291  /* Number of syntax errors so far. */
1292  int yynerrs;
1293 
1294  int yystate;
1295  /* Number of tokens to shift before error messages enabled. */
1296  int yyerrstatus;
1297 
1298  /* The stacks and their tools:
1299  'yyss': related to states.
1300  'yyvs': related to semantic values.
1301 
1302  Refer to the stacks through separate pointers, to allow yyoverflow
1303  to reallocate them elsewhere. */
1304 
1305  /* The state stack. */
1306  yytype_int16 yyssa[YYINITDEPTH];
1307  yytype_int16 *yyss;
1308  yytype_int16 *yyssp;
1309 
1310  /* The semantic value stack. */
1311  YYSTYPE yyvsa[YYINITDEPTH];
1312  YYSTYPE *yyvs;
1313  YYSTYPE *yyvsp;
1314 
1315  YYSIZE_T yystacksize;
1316 
1317  int yyn;
1318  int yyresult;
1319  /* Lookahead token as an internal (translated) token number. */
1320  int yytoken = 0;
1321  /* The variables used to return semantic value and location from the
1322  action routines. */
1323  YYSTYPE yyval;
1324 
1325 #if YYERROR_VERBOSE
1326  /* Buffer for error messages, and its allocated size. */
1327  char yymsgbuf[128];
1328  char *yymsg = yymsgbuf;
1329  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1330 #endif
1331 
1332 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1333 
1334  /* The number of symbols on the RHS of the reduced rule.
1335  Keep to zero when no symbol should be popped. */
1336  int yylen = 0;
1337 
1338  yyssp = yyss = yyssa;
1339  yyvsp = yyvs = yyvsa;
1340  yystacksize = YYINITDEPTH;
1341 
1342  YYDPRINTF ((stderr, "Starting parse\n"));
1343 
1344  yystate = 0;
1345  yyerrstatus = 0;
1346  yynerrs = 0;
1347  yychar = YYEMPTY; /* Cause a token to be read. */
1348  goto yysetstate;
1349 
1350 
1351 /*------------------------------------------------------------.
1352 | yynewstate -- push a new state, which is found in yystate. |
1353 `------------------------------------------------------------*/
1354 yynewstate:
1355  /* In all cases, when you get here, the value and location stacks
1356  have just been pushed. So pushing a state here evens the stacks. */
1357  yyssp++;
1358 
1359 
1360 /*--------------------------------------------------------------------.
1361 | yynewstate -- set current state (the top of the stack) to yystate. |
1362 `--------------------------------------------------------------------*/
1363 yysetstate:
1364  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1365  YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
1366  *yyssp = (yytype_int16) yystate;
1367 
1368  if (yyss + yystacksize - 1 <= yyssp)
1369 #if !defined yyoverflow && !defined YYSTACK_RELOCATE
1370  goto yyexhaustedlab;
1371 #else
1372  {
1373  /* Get the current used size of the three stacks, in elements. */
1374  YYSIZE_T yysize = (YYSIZE_T) (yyssp - yyss + 1);
1375 
1376 # if defined yyoverflow
1377  {
1378  /* Give user a chance to reallocate the stack. Use copies of
1379  these so that the &'s don't force the real ones into
1380  memory. */
1381  YYSTYPE *yyvs1 = yyvs;
1382  yytype_int16 *yyss1 = yyss;
1383 
1384  /* Each stack pointer address is followed by the size of the
1385  data in use in that stack, in bytes. This used to be a
1386  conditional around just the two extra args, but that might
1387  be undefined if yyoverflow is a macro. */
1388  yyoverflow (YY_("memory exhausted"),
1389  &yyss1, yysize * sizeof (*yyssp),
1390  &yyvs1, yysize * sizeof (*yyvsp),
1391  &yystacksize);
1392  yyss = yyss1;
1393  yyvs = yyvs1;
1394  }
1395 # else /* defined YYSTACK_RELOCATE */
1396  /* Extend the stack our own way. */
1397  if (YYMAXDEPTH <= yystacksize)
1398  goto yyexhaustedlab;
1399  yystacksize *= 2;
1400  if (YYMAXDEPTH < yystacksize)
1401  yystacksize = YYMAXDEPTH;
1402 
1403  {
1404  yytype_int16 *yyss1 = yyss;
1405  union yyalloc *yyptr =
1406  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1407  if (! yyptr)
1408  goto yyexhaustedlab;
1409  YYSTACK_RELOCATE (yyss_alloc, yyss);
1410  YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1411 # undef YYSTACK_RELOCATE
1412  if (yyss1 != yyssa)
1413  YYSTACK_FREE (yyss1);
1414  }
1415 # endif
1416 
1417  yyssp = yyss + yysize - 1;
1418  yyvsp = yyvs + yysize - 1;
1419 
1420  YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1421  (unsigned long) yystacksize));
1422 
1423  if (yyss + yystacksize - 1 <= yyssp)
1424  YYABORT;
1425  }
1426 #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
1427 
1428  if (yystate == YYFINAL)
1429  YYACCEPT;
1430 
1431  goto yybackup;
1432 
1433 
1434 /*-----------.
1435 | yybackup. |
1436 `-----------*/
1437 yybackup:
1438  /* Do appropriate processing given the current state. Read a
1439  lookahead token if we need one and don't already have one. */
1440 
1441  /* First try to decide what to do without reference to lookahead token. */
1442  yyn = yypact[yystate];
1443  if (yypact_value_is_default (yyn))
1444  goto yydefault;
1445 
1446  /* Not known => get a lookahead token if don't already have one. */
1447 
1448  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1449  if (yychar == YYEMPTY)
1450  {
1451  YYDPRINTF ((stderr, "Reading a token: "));
1452  yychar = yylex (&yylval, ctx);
1453  }
1454 
1455  if (yychar <= YYEOF)
1456  {
1457  yychar = yytoken = YYEOF;
1458  YYDPRINTF ((stderr, "Now at end of input.\n"));
1459  }
1460  else
1461  {
1462  yytoken = YYTRANSLATE (yychar);
1463  YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1464  }
1465 
1466  /* If the proper action on seeing token YYTOKEN is to reduce or to
1467  detect an error, take that action. */
1468  yyn += yytoken;
1469  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1470  goto yydefault;
1471  yyn = yytable[yyn];
1472  if (yyn <= 0)
1473  {
1474  if (yytable_value_is_error (yyn))
1475  goto yyerrlab;
1476  yyn = -yyn;
1477  goto yyreduce;
1478  }
1479 
1480  /* Count tokens shifted since error; after three, turn off error
1481  status. */
1482  if (yyerrstatus)
1483  yyerrstatus--;
1484 
1485  /* Shift the lookahead token. */
1486  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1487 
1488  /* Discard the shifted token. */
1489  yychar = YYEMPTY;
1490 
1491  yystate = yyn;
1493  *++yyvsp = yylval;
1495  goto yynewstate;
1496 
1497 
1498 /*-----------------------------------------------------------.
1499 | yydefault -- do the default action for the current state. |
1500 `-----------------------------------------------------------*/
1501 yydefault:
1502  yyn = yydefact[yystate];
1503  if (yyn == 0)
1504  goto yyerrlab;
1505  goto yyreduce;
1506 
1507 
1508 /*-----------------------------.
1509 | yyreduce -- do a reduction. |
1510 `-----------------------------*/
1511 yyreduce:
1512  /* yyn is the number of a rule to reduce with. */
1513  yylen = yyr2[yyn];
1514 
1515  /* If YYLEN is nonzero, implement the default value of the action:
1516  '$$ = $1'.
1517 
1518  Otherwise, the following line sets YYVAL to garbage.
1519  This behavior is undocumented and Bison
1520  users should not rely upon it. Assigning to YYVAL
1521  unconditionally makes the parser a bit smaller, and it avoids a
1522  GCC warning that YYVAL may be used uninitialized. */
1523  yyval = yyvsp[1-yylen];
1524 
1525 
1526  YY_REDUCE_PRINT (yyn);
1527  switch (yyn)
1528  {
1529  case 4:
1530 #line 255 "wql.y"
1531  {
1532  (yyval.string) = get_path( ctx, &(yyvsp[0].str) );
1533  if (!(yyval.string))
1534  YYABORT;
1535  }
1536 #line 1537 "wql.tab.c"
1537  break;
1538 
1539  case 5:
1540 #line 264 "wql.y"
1541  {
1542  (yyval.keywordlist) = alloc_keyword( ctx, (yyvsp[0].string), NULL );
1543  if (!(yyval.keywordlist))
1544  YYABORT;
1545  }
1546 #line 1547 "wql.tab.c"
1547  break;
1548 
1549  case 6:
1550 #line 270 "wql.y"
1551  {
1552  (yyval.keywordlist) = alloc_keyword( ctx, (yyvsp[-2].string), (yyvsp[0].string) );
1553  if (!(yyval.keywordlist))
1554  YYABORT;
1555  }
1556 #line 1557 "wql.tab.c"
1557  break;
1558 
1559  case 8:
1560 #line 280 "wql.y"
1561  {
1562  (yyvsp[-1].keywordlist)->next = (yyvsp[0].keywordlist);
1563  }
1564 #line 1565 "wql.tab.c"
1565  break;
1566 
1567  case 9:
1568 #line 287 "wql.y"
1569  {
1570  HRESULT hr;
1571  struct parser *parser = ctx;
1572  struct view *view;
1573 
1574  hr = create_view( VIEW_TYPE_ASSOCIATORS, (yyvsp[0].string), NULL, NULL, NULL, NULL, &view );
1575  if (hr != S_OK)
1576  YYABORT;
1577 
1578  PARSER_BUBBLE_UP_VIEW( parser, (yyval.view), view );
1579  }
1580 #line 1581 "wql.tab.c"
1581  break;
1582 
1583  case 10:
1584 #line 299 "wql.y"
1585  {
1586  HRESULT hr;
1587  struct parser *parser = ctx;
1588  struct view *view;
1589 
1590  hr = create_view( VIEW_TYPE_ASSOCIATORS, (yyvsp[-2].string), (yyvsp[0].keywordlist), NULL, NULL, NULL, &view );
1591  if (hr != S_OK)
1592  YYABORT;
1593 
1594  PARSER_BUBBLE_UP_VIEW( parser, (yyval.view), view );
1595  }
1596 #line 1597 "wql.tab.c"
1597  break;
1598 
1599  case 11:
1600 #line 314 "wql.y"
1601  {
1602  HRESULT hr;
1603  struct parser *parser = ctx;
1604  struct view *view;
1605 
1606  hr = create_view( VIEW_TYPE_SELECT, NULL, NULL, (yyvsp[0].string), NULL, NULL, &view );
1607  if (hr != S_OK)
1608  YYABORT;
1609 
1610  PARSER_BUBBLE_UP_VIEW( parser, (yyval.view), view );
1611  }
1612 #line 1613 "wql.tab.c"
1613  break;
1614 
1615  case 12:
1616 #line 326 "wql.y"
1617  {
1618  HRESULT hr;
1619  struct parser *parser = ctx;
1620  struct view *view;
1621 
1622  hr = create_view( VIEW_TYPE_SELECT, NULL, NULL, (yyvsp[0].string), (yyvsp[-2].proplist), NULL, &view );
1623  if (hr != S_OK)
1624  YYABORT;
1625 
1626  PARSER_BUBBLE_UP_VIEW( parser, (yyval.view), view );
1627  }
1628 #line 1629 "wql.tab.c"
1629  break;
1630 
1631  case 13:
1632 #line 338 "wql.y"
1633  {
1634  HRESULT hr;
1635  struct parser *parser = ctx;
1636  struct view *view;
1637 
1638  hr = create_view( VIEW_TYPE_SELECT, NULL, NULL, (yyvsp[-2].string), (yyvsp[-4].proplist), (yyvsp[0].expr), &view );
1639  if (hr != S_OK)
1640  YYABORT;
1641 
1642  PARSER_BUBBLE_UP_VIEW( parser, (yyval.view), view );
1643  }
1644 #line 1645 "wql.tab.c"
1645  break;
1646 
1647  case 15:
1648 #line 354 "wql.y"
1649  {
1650  (yyvsp[-2].proplist)->next = (yyvsp[0].proplist);
1651  }
1652 #line 1653 "wql.tab.c"
1653  break;
1654 
1655  case 16:
1656 #line 358 "wql.y"
1657  {
1658  (yyval.proplist) = NULL;
1659  }
1660 #line 1661 "wql.tab.c"
1661  break;
1662 
1663  case 17:
1664 #line 365 "wql.y"
1665  {
1666  (yyval.proplist) = alloc_property( ctx, (yyvsp[-2].string), (yyvsp[0].string) );
1667  if (!(yyval.proplist))
1668  YYABORT;
1669  }
1670 #line 1671 "wql.tab.c"
1671  break;
1672 
1673  case 18:
1674 #line 371 "wql.y"
1675  {
1676  (yyval.proplist) = alloc_property( ctx, NULL, (yyvsp[0].string) );
1677  if (!(yyval.proplist))
1678  YYABORT;
1679  }
1680 #line 1681 "wql.tab.c"
1681  break;
1682 
1683  case 19:
1684 #line 380 "wql.y"
1685  {
1686  (yyval.string) = get_string( ctx, &(yyvsp[0].str) );
1687  if (!(yyval.string))
1688  YYABORT;
1689  }
1690 #line 1691 "wql.tab.c"
1691  break;
1692 
1693  case 20:
1694 #line 389 "wql.y"
1695  {
1696  (yyval.integer) = get_int( ctx );
1697  }
1698 #line 1699 "wql.tab.c"
1699  break;
1700 
1701  case 21:
1702 #line 396 "wql.y"
1703  {
1704  (yyval.expr) = (yyvsp[-1].expr);
1705  if (!(yyval.expr))
1706  YYABORT;
1707  }
1708 #line 1709 "wql.tab.c"
1709  break;
1710 
1711  case 22:
1712 #line 402 "wql.y"
1713  {
1714  (yyval.expr) = expr_complex( ctx, (yyvsp[-2].expr), OP_AND, (yyvsp[0].expr) );
1715  if (!(yyval.expr))
1716  YYABORT;
1717  }
1718 #line 1719 "wql.tab.c"
1719  break;
1720 
1721  case 23:
1722 #line 408 "wql.y"
1723  {
1724  (yyval.expr) = expr_complex( ctx, (yyvsp[-2].expr), OP_OR, (yyvsp[0].expr) );
1725  if (!(yyval.expr))
1726  YYABORT;
1727  }
1728 #line 1729 "wql.tab.c"
1729  break;
1730 
1731  case 24:
1732 #line 414 "wql.y"
1733  {
1734  (yyval.expr) = expr_unary( ctx, (yyvsp[0].expr), OP_NOT );
1735  if (!(yyval.expr))
1736  YYABORT;
1737  }
1738 #line 1739 "wql.tab.c"
1739  break;
1740 
1741  case 25:
1742 #line 420 "wql.y"
1743  {
1744  (yyval.expr) = expr_complex( ctx, (yyvsp[-2].expr), OP_EQ, (yyvsp[0].expr) );
1745  if (!(yyval.expr))
1746  YYABORT;
1747  }
1748 #line 1749 "wql.tab.c"
1749  break;
1750 
1751  case 26:
1752 #line 426 "wql.y"
1753  {
1754  (yyval.expr) = expr_complex( ctx, (yyvsp[-2].expr), OP_GT, (yyvsp[0].expr) );
1755  if (!(yyval.expr))
1756  YYABORT;
1757  }
1758 #line 1759 "wql.tab.c"
1759  break;
1760 
1761  case 27:
1762 #line 432 "wql.y"
1763  {
1764  (yyval.expr) = expr_complex( ctx, (yyvsp[-2].expr), OP_LT, (yyvsp[0].expr) );
1765  if (!(yyval.expr))
1766  YYABORT;
1767  }
1768 #line 1769 "wql.tab.c"
1769  break;
1770 
1771  case 28:
1772 #line 438 "wql.y"
1773  {
1774  (yyval.expr) = expr_complex( ctx, (yyvsp[-2].expr), OP_LE, (yyvsp[0].expr) );
1775  if (!(yyval.expr))
1776  YYABORT;
1777  }
1778 #line 1779 "wql.tab.c"
1779  break;
1780 
1781  case 29:
1782 #line 444 "wql.y"
1783  {
1784  (yyval.expr) = expr_complex( ctx, (yyvsp[-2].expr), OP_GE, (yyvsp[0].expr) );
1785  if (!(yyval.expr))
1786  YYABORT;
1787  }
1788 #line 1789 "wql.tab.c"
1789  break;
1790 
1791  case 30:
1792 #line 450 "wql.y"
1793  {
1794  (yyval.expr) = expr_complex( ctx, (yyvsp[-2].expr), OP_NE, (yyvsp[0].expr) );
1795  if (!(yyval.expr))
1796  YYABORT;
1797  }
1798 #line 1799 "wql.tab.c"
1799  break;
1800 
1801  case 31:
1802 #line 456 "wql.y"
1803  {
1804  (yyval.expr) = expr_complex( ctx, (yyvsp[-2].expr), OP_EQ, (yyvsp[0].expr) );
1805  if (!(yyval.expr))
1806  YYABORT;
1807  }
1808 #line 1809 "wql.tab.c"
1809  break;
1810 
1811  case 32:
1812 #line 462 "wql.y"
1813  {
1814  (yyval.expr) = expr_complex( ctx, (yyvsp[-2].expr), OP_GT, (yyvsp[0].expr) );
1815  if (!(yyval.expr))
1816  YYABORT;
1817  }
1818 #line 1819 "wql.tab.c"
1819  break;
1820 
1821  case 33:
1822 #line 468 "wql.y"
1823  {
1824  (yyval.expr) = expr_complex( ctx, (yyvsp[-2].expr), OP_LT, (yyvsp[0].expr) );
1825  if (!(yyval.expr))
1826  YYABORT;
1827  }
1828 #line 1829 "wql.tab.c"
1829  break;
1830 
1831  case 34:
1832 #line 474 "wql.y"
1833  {
1834  (yyval.expr) = expr_complex( ctx, (yyvsp[-2].expr), OP_LE, (yyvsp[0].expr) );
1835  if (!(yyval.expr))
1836  YYABORT;
1837  }
1838 #line 1839 "wql.tab.c"
1839  break;
1840 
1841  case 35:
1842 #line 480 "wql.y"
1843  {
1844  (yyval.expr) = expr_complex( ctx, (yyvsp[-2].expr), OP_GE, (yyvsp[0].expr) );
1845  if (!(yyval.expr))
1846  YYABORT;
1847  }
1848 #line 1849 "wql.tab.c"
1849  break;
1850 
1851  case 36:
1852 #line 486 "wql.y"
1853  {
1854  (yyval.expr) = expr_complex( ctx, (yyvsp[-2].expr), OP_NE, (yyvsp[0].expr) );
1855  if (!(yyval.expr))
1856  YYABORT;
1857  }
1858 #line 1859 "wql.tab.c"
1859  break;
1860 
1861  case 37:
1862 #line 492 "wql.y"
1863  {
1864  (yyval.expr) = expr_complex( ctx, (yyvsp[-2].expr), OP_LIKE, (yyvsp[0].expr) );
1865  if (!(yyval.expr))
1866  YYABORT;
1867  }
1868 #line 1869 "wql.tab.c"
1869  break;
1870 
1871  case 38:
1872 #line 498 "wql.y"
1873  {
1874  (yyval.expr) = expr_unary( ctx, (yyvsp[-2].expr), OP_ISNULL );
1875  if (!(yyval.expr))
1876  YYABORT;
1877  }
1878 #line 1879 "wql.tab.c"
1879  break;
1880 
1881  case 39:
1882 #line 504 "wql.y"
1883  {
1884  (yyval.expr) = expr_unary( ctx, (yyvsp[-3].expr), OP_NOTNULL );
1885  if (!(yyval.expr))
1886  YYABORT;
1887  }
1888 #line 1889 "wql.tab.c"
1889  break;
1890 
1891  case 40:
1892 #line 510 "wql.y"
1893  {
1894  (yyval.expr) = expr_unary( ctx, (yyvsp[-2].expr), OP_ISNULL );
1895  if (!(yyval.expr))
1896  YYABORT;
1897  }
1898 #line 1899 "wql.tab.c"
1899  break;
1900 
1901  case 41:
1902 #line 516 "wql.y"
1903  {
1904  (yyval.expr) = expr_unary( ctx, (yyvsp[0].expr), OP_ISNULL );
1905  if (!(yyval.expr))
1906  YYABORT;
1907  }
1908 #line 1909 "wql.tab.c"
1909  break;
1910 
1911  case 42:
1912 #line 522 "wql.y"
1913  {
1914  (yyval.expr) = expr_unary( ctx, (yyvsp[-2].expr), OP_NOTNULL );
1915  if (!(yyval.expr))
1916  YYABORT;
1917  }
1918 #line 1919 "wql.tab.c"
1919  break;
1920 
1921  case 43:
1922 #line 528 "wql.y"
1923  {
1924  (yyval.expr) = expr_unary( ctx, (yyvsp[0].expr), OP_NOTNULL );
1925  if (!(yyval.expr))
1926  YYABORT;
1927  }
1928 #line 1929 "wql.tab.c"
1929  break;
1930 
1931  case 44:
1932 #line 537 "wql.y"
1933  {
1934  (yyval.expr) = expr_sval( ctx, &(yyvsp[0].str) );
1935  if (!(yyval.expr))
1936  YYABORT;
1937  }
1938 #line 1939 "wql.tab.c"
1939  break;
1940 
1941  case 45:
1942 #line 546 "wql.y"
1943  {
1944  (yyval.expr) = expr_propval( ctx, (yyvsp[0].proplist) );
1945  if (!(yyval.expr))
1946  YYABORT;
1947  }
1948 #line 1949 "wql.tab.c"
1949  break;
1950 
1951  case 46:
1952 #line 555 "wql.y"
1953  {
1954  (yyval.expr) = expr_ival( ctx, (yyvsp[0].integer) );
1955  if (!(yyval.expr))
1956  YYABORT;
1957  }
1958 #line 1959 "wql.tab.c"
1959  break;
1960 
1961  case 47:
1962 #line 561 "wql.y"
1963  {
1964  (yyval.expr) = expr_sval( ctx, &(yyvsp[0].str) );
1965  if (!(yyval.expr))
1966  YYABORT;
1967  }
1968 #line 1969 "wql.tab.c"
1969  break;
1970 
1971  case 48:
1972 #line 567 "wql.y"
1973  {
1974  (yyval.expr) = expr_bval( ctx, -1 );
1975  if (!(yyval.expr))
1976  YYABORT;
1977  }
1978 #line 1979 "wql.tab.c"
1979  break;
1980 
1981  case 49:
1982 #line 573 "wql.y"
1983  {
1984  (yyval.expr) = expr_bval( ctx, 0 );
1985  if (!(yyval.expr))
1986  YYABORT;
1987  }
1988 #line 1989 "wql.tab.c"
1989  break;
1990 
1991 
1992 #line 1993 "wql.tab.c"
1993 
1994  default: break;
1995  }
1996  /* User semantic actions sometimes alter yychar, and that requires
1997  that yytoken be updated with the new translation. We take the
1998  approach of translating immediately before every use of yytoken.
1999  One alternative is translating here after every semantic action,
2000  but that translation would be missed if the semantic action invokes
2001  YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2002  if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
2003  incorrect destructor might then be invoked immediately. In the
2004  case of YYERROR or YYBACKUP, subsequent parser actions might lead
2005  to an incorrect destructor call or verbose syntax error message
2006  before the lookahead is translated. */
2007  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
2008 
2009  YYPOPSTACK (yylen);
2010  yylen = 0;
2011  YY_STACK_PRINT (yyss, yyssp);
2012 
2013  *++yyvsp = yyval;
2014 
2015  /* Now 'shift' the result of the reduction. Determine what state
2016  that goes to, based on the state we popped back to and the rule
2017  number reduced by. */
2018  {
2019  const int yylhs = yyr1[yyn] - YYNTOKENS;
2020  const int yyi = yypgoto[yylhs] + *yyssp;
2021  yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
2022  ? yytable[yyi]
2023  : yydefgoto[yylhs]);
2024  }
2025 
2026  goto yynewstate;
2027 
2028 
2029 /*--------------------------------------.
2030 | yyerrlab -- here on detecting error. |
2031 `--------------------------------------*/
2032 yyerrlab:
2033  /* Make sure we have latest lookahead translation. See comments at
2034  user semantic actions for why this is necessary. */
2035  yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
2036 
2037  /* If not already recovering from an error, report this error. */
2038  if (!yyerrstatus)
2039  {
2040  ++yynerrs;
2041 #if ! YYERROR_VERBOSE
2042  yyerror (ctx, YY_("syntax error"));
2043 #else
2044 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
2045  yyssp, yytoken)
2046  {
2047  char const *yymsgp = YY_("syntax error");
2048  int yysyntax_error_status;
2049  yysyntax_error_status = YYSYNTAX_ERROR;
2050  if (yysyntax_error_status == 0)
2051  yymsgp = yymsg;
2052  else if (yysyntax_error_status == 1)
2053  {
2054  if (yymsg != yymsgbuf)
2055  YYSTACK_FREE (yymsg);
2056  yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
2057  if (!yymsg)
2058  {
2059  yymsg = yymsgbuf;
2060  yymsg_alloc = sizeof yymsgbuf;
2061  yysyntax_error_status = 2;
2062  }
2063  else
2064  {
2065  yysyntax_error_status = YYSYNTAX_ERROR;
2066  yymsgp = yymsg;
2067  }
2068  }
2069  yyerror (ctx, yymsgp);
2070  if (yysyntax_error_status == 2)
2071  goto yyexhaustedlab;
2072  }
2073 # undef YYSYNTAX_ERROR
2074 #endif
2075  }
2076 
2077 
2078 
2079  if (yyerrstatus == 3)
2080  {
2081  /* If just tried and failed to reuse lookahead token after an
2082  error, discard it. */
2083 
2084  if (yychar <= YYEOF)
2085  {
2086  /* Return failure if at end of input. */
2087  if (yychar == YYEOF)
2088  YYABORT;
2089  }
2090  else
2091  {
2092  yydestruct ("Error: discarding",
2093  yytoken, &yylval, ctx);
2094  yychar = YYEMPTY;
2095  }
2096  }
2097 
2098  /* Else will try to reuse lookahead token after shifting the error
2099  token. */
2100  goto yyerrlab1;
2101 
2102 
2103 /*---------------------------------------------------.
2104 | yyerrorlab -- error raised explicitly by YYERROR. |
2105 `---------------------------------------------------*/
2106 yyerrorlab:
2107  /* Pacify compilers when the user code never invokes YYERROR and the
2108  label yyerrorlab therefore never appears in user code. */
2109  if (0)
2110  YYERROR;
2111 
2112  /* Do not reclaim the symbols of the rule whose action triggered
2113  this YYERROR. */
2114  YYPOPSTACK (yylen);
2115  yylen = 0;
2116  YY_STACK_PRINT (yyss, yyssp);
2117  yystate = *yyssp;
2118  goto yyerrlab1;
2119 
2120 
2121 /*-------------------------------------------------------------.
2122 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2123 `-------------------------------------------------------------*/
2124 yyerrlab1:
2125  yyerrstatus = 3; /* Each real token shifted decrements this. */
2126 
2127  for (;;)
2128  {
2129  yyn = yypact[yystate];
2130  if (!yypact_value_is_default (yyn))
2131  {
2132  yyn += YYTERROR;
2133  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2134  {
2135  yyn = yytable[yyn];
2136  if (0 < yyn)
2137  break;
2138  }
2139  }
2140 
2141  /* Pop the current state because it cannot handle the error token. */
2142  if (yyssp == yyss)
2143  YYABORT;
2144 
2145 
2146  yydestruct ("Error: popping",
2147  yystos[yystate], yyvsp, ctx);
2148  YYPOPSTACK (1);
2149  yystate = *yyssp;
2150  YY_STACK_PRINT (yyss, yyssp);
2151  }
2152 
2154  *++yyvsp = yylval;
2156 
2157 
2158  /* Shift the error token. */
2159  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2160 
2161  yystate = yyn;
2162  goto yynewstate;
2163 
2164 
2165 /*-------------------------------------.
2166 | yyacceptlab -- YYACCEPT comes here. |
2167 `-------------------------------------*/
2168 yyacceptlab:
2169  yyresult = 0;
2170  goto yyreturn;
2171 
2172 
2173 /*-----------------------------------.
2174 | yyabortlab -- YYABORT comes here. |
2175 `-----------------------------------*/
2176 yyabortlab:
2177  yyresult = 1;
2178  goto yyreturn;
2179 
2180 
2181 #if !defined yyoverflow || YYERROR_VERBOSE
2182 /*-------------------------------------------------.
2183 | yyexhaustedlab -- memory exhaustion comes here. |
2184 `-------------------------------------------------*/
2185 yyexhaustedlab:
2186  yyerror (ctx, YY_("memory exhausted"));
2187  yyresult = 2;
2188  /* Fall through. */
2189 #endif
2190 
2191 
2192 /*-----------------------------------------------------.
2193 | yyreturn -- parsing is finished, return the result. |
2194 `-----------------------------------------------------*/
2195 yyreturn:
2196  if (yychar != YYEMPTY)
2197  {
2198  /* Make sure we have latest lookahead translation. See comments at
2199  user semantic actions for why this is necessary. */
2200  yytoken = YYTRANSLATE (yychar);
2201  yydestruct ("Cleanup: discarding lookahead",
2202  yytoken, &yylval, ctx);
2203  }
2204  /* Do not reclaim the symbols of the rule whose action triggered
2205  this YYABORT or YYACCEPT. */
2206  YYPOPSTACK (yylen);
2207  YY_STACK_PRINT (yyss, yyssp);
2208  while (yyssp != yyss)
2209  {
2210  yydestruct ("Cleanup: popping",
2211  yystos[*yyssp], yyvsp, ctx);
2212  YYPOPSTACK (1);
2213  }
2214 #ifndef yyoverflow
2215  if (yyss != yyssa)
2216  YYSTACK_FREE (yyss);
2217 #endif
2218 #if YYERROR_VERBOSE
2219  if (yymsg != yymsgbuf)
2220  YYSTACK_FREE (yymsg);
2221 #endif
2222  return yyresult;
2223 }
2224 #line 580 "wql.y"
2225 
2226 
2227 HRESULT parse_query( const WCHAR *str, struct view **view, struct list *mem )
2228 {
2229  struct parser parser;
2230  int ret;
2231 
2232  *view = NULL;
2233 
2234  parser.cmd = str;
2235  parser.idx = 0;
2236  parser.len = 0;
2238  parser.view = view;
2239  parser.mem = mem;
2240 
2241  ret = wql_parse( &parser );
2242  TRACE("wql_parse returned %d\n", ret);
2243  if (ret)
2244  {
2245  if (*parser.view)
2246  {
2247  destroy_view( *parser.view );
2248  *parser.view = NULL;
2249  }
2250  return parser.error;
2251  }
2252  return S_OK;
2253 }
2254 
2255 static const char id_char[] =
2256 {
2257  0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2258  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2259  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,
2260  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
2261  0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2262  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1,
2263  0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2264  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0,
2265  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2266  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2267  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2268  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2269  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2270  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2271  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2272  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2273 };
2274 
2276 {
2277  const WCHAR *name;
2278  unsigned int len;
2279  int type;
2280 };
2281 
2282 #define MIN_TOKEN_LEN 2
2283 #define MAX_TOKEN_LEN 11
2284 
2285 static const WCHAR andW[] = {'A','N','D'};
2286 static const WCHAR associatorsW[] = {'A','S','S','O','C','I','A','T','O','R','S'};
2287 static const WCHAR byW[] = {'B','Y'};
2288 static const WCHAR falseW[] = {'F','A','L','S','E'};
2289 static const WCHAR fromW[] = {'F','R','O','M'};
2290 static const WCHAR isW[] = {'I','S'};
2291 static const WCHAR likeW[] = {'L','I','K','E'};
2292 static const WCHAR notW[] = {'N','O','T'};
2293 static const WCHAR nullW[] = {'N','U','L','L'};
2294 static const WCHAR ofW[] = {'O','F'};
2295 static const WCHAR orW[] = {'O','R'};
2296 static const WCHAR selectW[] = {'S','E','L','E','C','T'};
2297 static const WCHAR trueW[] = {'T','R','U','E'};
2298 static const WCHAR whereW[] = {'W','H','E','R','E'};
2299 
2300 static const struct wql_keyword keyword_table[] =
2301 {
2302  { andW, ARRAY_SIZE(andW), TK_AND },
2304  { byW, ARRAY_SIZE(byW), TK_BY },
2306  { fromW, ARRAY_SIZE(fromW), TK_FROM },
2307  { isW, ARRAY_SIZE(isW), TK_IS },
2308  { likeW, ARRAY_SIZE(likeW), TK_LIKE },
2309  { notW, ARRAY_SIZE(notW), TK_NOT },
2310  { nullW, ARRAY_SIZE(nullW), TK_NULL },
2311  { ofW, ARRAY_SIZE(ofW), TK_OF },
2312  { orW, ARRAY_SIZE(orW), TK_OR },
2314  { trueW, ARRAY_SIZE(trueW), TK_TRUE },
2316 };
2317 
2318 static int __cdecl cmp_keyword( const void *arg1, const void *arg2 )
2319 {
2320  const struct wql_keyword *key1 = arg1, *key2 = arg2;
2321  int len = min( key1->len, key2->len );
2322  int ret;
2323 
2324  if ((ret = _wcsnicmp( key1->name, key2->name, len ))) return ret;
2325  if (key1->len < key2->len) return -1;
2326  else if (key1->len > key2->len) return 1;
2327  return 0;
2328 }
2329 
2330 static int keyword_type( const WCHAR *str, unsigned int len )
2331 {
2332  struct wql_keyword key, *ret;
2333 
2335 
2336  key.name = str;
2337  key.len = len;
2338  key.type = 0;
2340  if (ret) return ret->type;
2341  return TK_ID;
2342 }
2343 
2344 static int get_token( const WCHAR *s, int *token )
2345 {
2346  int i;
2347 
2348  switch (*s)
2349  {
2350  case ' ':
2351  case '\t':
2352  case '\r':
2353  case '\n':
2354  for (i = 1; iswspace( s[i] ); i++) {}
2355  *token = TK_SPACE;
2356  return i;
2357  case '-':
2358  if (!s[1]) return -1;
2359  *token = TK_MINUS;
2360  return 1;
2361  case '(':
2362  *token = TK_LP;
2363  return 1;
2364  case ')':
2365  *token = TK_RP;
2366  return 1;
2367  case '{':
2368  for (i = 1; s[i] && s[i] != '}'; i++) {}
2369  if (s[i] != '}')
2370  {
2371  *token = TK_ILLEGAL;
2372  return i;
2373  }
2374  *token = TK_PATH;
2375  return i + 1;
2376  case '*':
2377  *token = TK_STAR;
2378  return 1;
2379  case '=':
2380  *token = TK_EQ;
2381  return 1;
2382  case '<':
2383  if (s[1] == '=' )
2384  {
2385  *token = TK_LE;
2386  return 2;
2387  }
2388  else if (s[1] == '>')
2389  {
2390  *token = TK_NE;
2391  return 2;
2392  }
2393  else
2394  {
2395  *token = TK_LT;
2396  return 1;
2397  }
2398  case '>':
2399  if (s[1] == '=')
2400  {
2401  *token = TK_GE;
2402  return 2;
2403  }
2404  else
2405  {
2406  *token = TK_GT;
2407  return 1;
2408  }
2409  case '!':
2410  if (s[1] != '=')
2411  {
2412  *token = TK_ILLEGAL;
2413  return 2;
2414  }
2415  else
2416  {
2417  *token = TK_NE;
2418  return 2;
2419  }
2420  case ',':
2421  *token = TK_COMMA;
2422  return 1;
2423  case '\"':
2424  case '\'':
2425  for (i = 1; s[i]; i++)
2426  {
2427  if (s[i] == s[0]) break;
2428  }
2429  if (s[i]) i++;
2430  *token = TK_STRING;
2431  return i;
2432  case '.':
2433  if (!iswdigit( s[1] ))
2434  {
2435  *token = TK_DOT;
2436  return 1;
2437  }
2438  /* fall through */
2439  case '0': case '1': case '2': case '3': case '4':
2440  case '5': case '6': case '7': case '8': case '9':
2441  *token = TK_INTEGER;
2442  for (i = 1; iswdigit( s[i] ); i++) {}
2443  return i;
2444  default:
2445  if (!id_char[*s]) break;
2446 
2447  for (i = 1; id_char[s[i]]; i++) {}
2448  *token = keyword_type( s, i );
2449  return i;
2450  }
2451  *token = TK_ILLEGAL;
2452  return 1;
2453 }
2454 
2455 static int wql_lex( void *p, struct parser *parser )
2456 {
2457  struct string *str = p;
2458  int token = -1;
2459  do
2460  {
2461  parser->idx += parser->len;
2462  if (!parser->cmd[parser->idx]) return 0;
2463  parser->len = get_token( &parser->cmd[parser->idx], &token );
2464  if (!parser->len) break;
2465 
2466  str->data = &parser->cmd[parser->idx];
2467  str->len = parser->len;
2468  } while (token == TK_SPACE);
2469  return token;
2470 }
2471 
2472 static int wql_error( struct parser *parser, const char *str )
2473 {
2474  ERR("%s\n", str);
2475  return 0;
2476 }
Definition: wql.tab.c:356
void * malloc(YYSIZE_T)
#define PARSER_BUBBLE_UP_VIEW(parser, result, current_view)
Definition: wql.tab.c:285
#define YYINITDEPTH
Definition: wql.tab.c:1011
const WCHAR * value
#define YYSTACK_ALLOC
Definition: wql.tab.c:535
static struct expr * expr_bval(struct parser *parser, int val)
Definition: wql.tab.c:260
GLuint64EXT GLuint GLuint GLenum GLenum GLuint GLuint GLenum GLuint GLuint key1
Definition: glext.h:10608
#define OP_EQ
Definition: query.h:36
#define OP_GE
Definition: query.h:42
#define yyerror
Definition: wql.tab.c:69
static WCHAR * get_path(struct parser *parser, const struct string *str)
Definition: wql.tab.c:175
UINT idx
Definition: wql.tab.c:111
HRESULT hr
Definition: shlfolder.c:183
#define __cdecl
Definition: accygwin.h:79
WCHAR * name
Definition: path.c:44
static const WCHAR selectW[]
Definition: wql.tab.c:2296
#define YY_IGNORE_MAYBE_UNINITIALIZED_END
Definition: wql.tab.c:487
static const yytype_uint8 yyr1[]
Definition: wql.tab.c:823
#define YY_SYMBOL_PRINT(Title, Type, Value, Location)
Definition: wql.tab.c:1003
YYLTYPE yylloc
Definition: hlsl.tab.c:2413
#define YYPOPSTACK(N)
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define YYEOF
Definition: wql.tab.c:846
#define YY_REDUCE_PRINT(Rule)
Definition: wql.tab.c:1005
#define yychar
Definition: asmshader.tab.c:74
LPWSTR string
Definition: sql.tab.c:240
#define iswdigit(_c)
Definition: ctype.h:667
unsigned short yytype_uint16
Definition: wql.tab.c:413
_Check_return_ _CRTIMP int __cdecl _wcsnicmp(_In_reads_or_z_(_MaxCount) const wchar_t *_Str1, _In_reads_or_z_(_MaxCount) const wchar_t *_Str2, _In_ size_t _MaxCount)
#define yynerrs
Definition: wql.tab.c:71
static int yysyntax_error(YYSIZE_T *yymsg_alloc, char **yymsg, yytype_int16 *yyssp, int yytoken)
Definition: wql.tab.c:1124
#define yylex
Definition: wql.tab.c:68
static const yytype_uint8 yytable[]
Definition: wql.tab.c:779
static struct expr * expr_ival(struct parser *parser, int val)
Definition: wql.tab.c:236
#define YY_(Msgid)
Definition: wql.tab.c:445
Definition: wql.tab.c:336
Definition: wql.tab.c:357
short yytype_int16
#define YYSTACK_BYTES(N)
Definition: wql.tab.c:580
static void append(struct dump_context *dc, const void *data, unsigned size)
Definition: minidump.c:380
static void yydestruct(const char *yymsg, int yytype, YYSTYPE *yyvaluep, struct parser *ctx)
Definition: wql.tab.c:1258
static const WCHAR andW[]
Definition: wql.tab.c:2285
const WCHAR * data
Definition: wql.tab.c:120
Definition: query.h:86
WCHAR * string
Definition: wql.tab.c:371
static int get_int(struct parser *parser)
Definition: wql.tab.c:193
BOOL integer
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
#define yyparse
Definition: wql.tab.c:67
#define OP_AND
Definition: query.h:37
const struct keyword * keywordlist
#define yylval
Definition: asmshader.tab.c:73
#define YYDPRINTF(Args)
Definition: wql.tab.c:1002
GLuint GLuint GLuint GLuint GLuint GLuint GLuint arg2
Definition: glext.h:9514
#define YYSTACK_ALLOC_MAXIMUM
Definition: wql.tab.c:538
static struct expr * expr_unary(struct parser *parser, struct expr *l, UINT op)
Definition: wql.tab.c:223
__WINE_SERVER_LIST_INLINE void list_add_tail(struct list *list, struct list *elem)
Definition: list.h:102
static const WCHAR fromW[]
Definition: wql.tab.c:2289
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static struct keyword * alloc_keyword(struct parser *parser, const WCHAR *name, const WCHAR *value)
Definition: wql.tab.c:143
#define YY_INITIAL_VALUE(Value)
Definition: wql.tab.c:483
#define YYACCEPT
Definition: wql.tab.c:848
static int wql_lex(void *val, struct parser *parser)
Definition: wql.tab.c:2455
jsstr_t * str
Definition: parser.tab.c:295
static const yytype_int8 yypgoto[]
Definition: wql.tab.c:763
static const yytype_int8 yypact[]
Definition: wql.tab.c:733
#define e
Definition: ke_i.h:82
#define YYEMPTY
Definition: wql.tab.c:845
GLuint GLuint GLuint GLuint arg1
Definition: glext.h:9513
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat token
Definition: glfuncs.h:210
const struct property * next
struct list * mem
Definition: wql.tab.c:115
LPCWSTR keyword
Definition: htmlbody.c:47
const WCHAR * str
#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
Definition: wql.tab.c:486
static const yytype_uint8 yystos[]
Definition: wql.tab.c:809
#define yytable_value_is_error(Yytable_value)
Definition: wql.tab.c:728
smooth NULL
Definition: ftsmooth.c:416
static struct expr * expr_sval(struct parser *parser, const struct string *str)
Definition: wql.tab.c:247
#define OP_NE
Definition: query.h:43
static const WCHAR notW[]
Definition: wql.tab.c:2292
static const WCHAR orW[]
Definition: wql.tab.c:2295
static const WCHAR likeW[]
Definition: wql.tab.c:2291
signed char yytype_int8
Definition: wql.tab.c:407
static const WCHAR ofW[]
Definition: wql.tab.c:2294
GLuint GLfloat * val
Definition: glext.h:7180
static const yytype_uint8 yydefact[]
Definition: wql.tab.c:749
r l[0]
Definition: byte_order.h:167
static char * yystpcpy(char *yydest, const char *yysrc)
Definition: wql.tab.c:1051
static struct expr * expr_complex(struct parser *parser, struct expr *l, UINT op, struct expr *r)
Definition: wql.tab.c:210
Definition: wql.tab.c:347
Definition: wql.tab.c:358
const struct property * proplist
yytype_int16 yyss_alloc
const struct keyword * next
static const yytype_uint8 yyr2[]
Definition: wql.tab.c:833
const WCHAR * cmd
Definition: wql.tab.c:110
const WCHAR * name
Definition: wql.tab.c:2277
yytokentype
#define TRACE(s)
Definition: solgame.cpp:4
static const char id_char[]
Definition: wql.tab.c:2255
static int wql_error(struct parser *parser, const char *str)
Definition: wql.tab.c:2472
GLsizeiptr size
Definition: glext.h:5919
static const WCHAR whereW[]
Definition: wql.tab.c:2298
__wchar_t WCHAR
Definition: xmlstorage.h:180
static int get_token(const WCHAR *s, int *token)
Definition: wql.tab.c:2344
unsigned short yytype_uint16
LONG HRESULT
Definition: typedefs.h:77
static const WCHAR byW[]
Definition: wql.tab.c:2287
#define YYSTACK_RELOCATE(Stack_alloc, Stack)
Definition: wql.tab.c:591
YYSTYPE yyvs_alloc
#define YYMAXDEPTH
Definition: wql.tab.c:1022
void destroy_view(struct view *view)
Definition: query.c:83
#define YYUSE(E)
Definition: wql.tab.c:469
#define YYERROR
Definition: wql.tab.c:850
int wql_parse(struct parser *ctx)
unsigned int error
Definition: inffile.c:97
int len
Definition: wql.tab.c:121
#define MAX_TOKEN_LEN
Definition: wql.tab.c:2283
static struct property * alloc_property(struct parser *parser, const WCHAR *class, const WCHAR *name)
Definition: wql.tab.c:131
#define OP_LE
Definition: query.h:41
HRESULT parse_query(const WCHAR *str, struct view **view, struct list *mem)
Definition: wql.tab.c:2227
#define YYNSTATES
Definition: wql.tab.c:636
#define iswspace(_c)
Definition: ctype.h:669
Definition: wql.tab.c:354
int ret
Definition: wql.tab.c:345
short yytype_int16
Definition: wql.tab.c:419
WINE_DEFAULT_DEBUG_CHANNEL(wbemprox)
Definition: wql.tab.c:349
static const yytype_uint8 yycheck[]
Definition: wql.tab.c:793
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
void free(void *)
Definition: cabinet.c:147
GLdouble s
Definition: gl.h:2039
Definition: _list.h:228
static const WCHAR isW[]
Definition: wql.tab.c:2290
#define yydebug
Definition: wql.tab.c:70
static const struct wql_keyword keyword_table[]
Definition: wql.tab.c:2300
#define YY_NULLPTR
Definition: wql.tab.c:300
GLsizei const GLfloat * value
Definition: glext.h:6069
static const yytype_int8 yydefgoto[]
Definition: wql.tab.c:770
const WCHAR * name
#define YY_ASSERT(E)
Definition: wql.tab.c:494
struct keyword * keywordlist
Definition: wql.tab.c:373
#define YYSIZE_T
Definition: wql.tab.c:429
#define YYSTACK_FREE
Definition: wql.tab.c:536
#define ERR(fmt,...)
Definition: debug.h:109
BSTR name
Definition: locator.c:107
unsigned char yytype_uint8
Definition: wql.tab.c:401
#define S_OK
Definition: intsafe.h:59
static WCHAR * get_string(struct parser *parser, const struct string *str)
Definition: wql.tab.c:155
static unsigned __int64 next
Definition: rand_nt.c:6
Definition: wql.tab.c:351
static YYSIZE_T yytnamerr(char *yyres, const char *yystr)
Definition: wql.tab.c:1073
#define ARRAY_SIZE(a)
Definition: main.h:24
unsigned int len
Definition: wql.tab.c:2278
Definition: wql.tab.c:335
static const WCHAR falseW[]
Definition: wql.tab.c:2288
#define YYTRANSLATE(YYX)
Definition: wql.tab.c:643
signed char yytype_int8
Definition: wql.tab.c:334
#define min(a, b)
Definition: monoChain.cc:55
UINT len
Definition: wql.tab.c:112
static void * alloc_mem(struct parser *parser, UINT size)
Definition: wql.tab.c:124
unsigned int UINT
Definition: ndis.h:50
expression_t * expr
Definition: parser.tab.c:302
static struct expr * expr_propval(struct parser *parser, const struct property *prop)
Definition: wql.tab.c:271
#define OP_OR
Definition: query.h:38
#define YYTERROR
Definition: wql.tab.c:873
Definition: import.c:86
Definition: mem.c:156
#define YYABORT
Definition: wql.tab.c:849
Definition: name.c:38
Definition: wql.tab.c:355
#define yypact_value_is_default(Yystate)
Definition: wql.tab.c:723
FILE * stderr
Definition: wql.tab.c:359
static IOleDocumentView * view
Definition: activex.c:1749
HRESULT error
Definition: wql.tab.c:113
static int keyword_type(const WCHAR *str, unsigned int len)
Definition: wql.tab.c:2330
UINT op
Definition: effect.c:223
struct view ** view
Definition: wql.tab.c:114
static const WCHAR associatorsW[]
Definition: wql.tab.c:2286
#define YYLAST
Definition: wql.tab.c:627
GLfloat GLfloat p
Definition: glext.h:8902
static const WCHAR trueW[]
Definition: wql.tab.c:2297
#define YYSYNTAX_ERROR
const WCHAR * class
struct view * view
Definition: wql.tab.c:374
struct property * proplist
Definition: wql.tab.c:372
static YYSIZE_T yystrlen(const char *yystr)
Definition: wql.tab.c:1034
static const char *const yytname[]
Definition: wql.tab.c:696
static const WCHAR nullW[]
Definition: wql.tab.c:2293
#define YYFINAL
Definition: wql.tab.c:625
#define YYNTOKENS
Definition: wql.tab.c:630
#define YYCASE_(N, S)
unsigned char yytype_uint8
#define YY_STACK_PRINT(Bottom, Top)
Definition: wql.tab.c:1004
static const yytype_uint8 yytranslate[]
Definition: wql.tab.c:648
Definition: path.c:42
static int __cdecl cmp_keyword(const void *arg1, const void *arg2)
Definition: wql.tab.c:2318
#define bsearch
GLuint const GLchar * name
Definition: glext.h:6031
static HRESULT create_view(MSIHANDLE, IDispatch **)
Definition: automation.c:2511