1 /* A Bison parser, made by GNU Bison 2.3. */
3 /* Skeleton implementation for Bison's Yacc-like parsers in C
5 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
6 Free Software 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 2, or (at your option)
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, write to the Free Software
20 Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 Boston, MA 02110-1301, USA. */
23 /* As a special exception, you may create a larger work that contains
24 part or all of the Bison parser skeleton and distribute that work
25 under terms of your choice, so long as that work isn't itself a
26 parser generator using the skeleton or a modified version thereof
27 as a parser skeleton. Alternatively, if you modify or redistribute
28 the parser skeleton itself, you may (at your option) remove this
29 special exception, which will cause the skeleton and the resulting
30 Bison output files to be licensed under the GNU General Public
31 License without this special exception.
33 This special exception was added by the Free Software Foundation in
34 version 2.2 of Bison. */
36 /* C LALR(1) parser skeleton written by Richard Stallman, by
37 simplifying the original so-called "semantic" parser. */
39 /* All symbols defined below should begin with yy or YY, to avoid
40 infringing on user name space. This should be done even for local
41 variables, as they might otherwise be expanded by user macros.
42 There are some unavoidable exceptions within include files to
43 define necessary library symbols; they are noted "INFRINGES ON
44 USER NAME SPACE" below. */
46 /* Identify Bison output. */
50 #define YYBISON_VERSION "2.3"
53 #define YYSKELETON_NAME "yacc.c"
58 /* Using locations. */
59 #define YYLSP_NEEDED 0
61 /* Substitute the variable and function names. */
62 #define yyparse cql_parse
64 #define yyerror cql_error
65 #define yylval cql_lval
66 #define yychar cql_char
67 #define yydebug cql_debug
68 #define yynerrs cql_nerrs
74 /* Put the tokens into the symbol table, so that GDB and other debuggers
100 /* Copy the first part of user declarations. */
105 * \brief Implements CQL parser.
107 * This is a YACC parser, but since it must be reentrant, Bison is required.
108 * The original source file is cql.y.
114 #include <yaz/xmalloc.h>
115 #include <yaz/nmem.h>
118 /** Node in the LALR parse tree. */
120 /** Inhereted attribute: relation */
121 struct cql_node *rel;
122 /** Synthesized attribute: CQL node */
123 struct cql_node *cql;
124 /** string buffer with token */
126 /** length of token */
128 /** size of buffer (len <= size) */
133 int (*getbyte)(void *client_data);
134 void (*ungetbyte)(int b, void *client_data);
138 struct cql_node *top;
142 #define YYSTYPE token
144 #define YYPARSE_PARAM parm
145 #define YYLEX_PARAM parm
147 int yylex(YYSTYPE *lval, void *vp);
148 int yyerror(char *s);
151 /* Enabling traces. */
156 /* Enabling verbose error messages. */
157 #ifdef YYERROR_VERBOSE
158 # undef YYERROR_VERBOSE
159 # define YYERROR_VERBOSE 1
161 # define YYERROR_VERBOSE 0
164 /* Enabling the token table. */
165 #ifndef YYTOKEN_TABLE
166 # define YYTOKEN_TABLE 0
169 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
171 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
172 # define YYSTYPE_IS_DECLARED 1
173 # define YYSTYPE_IS_TRIVIAL 1
178 /* Copy the second part of user declarations. */
181 /* Line 216 of yacc.c. */
189 typedef YYTYPE_UINT8 yytype_uint8;
191 typedef unsigned char yytype_uint8;
195 typedef YYTYPE_INT8 yytype_int8;
196 #elif (defined __STDC__ || defined __C99__FUNC__ \
197 || defined __cplusplus || defined _MSC_VER)
198 typedef signed char yytype_int8;
200 typedef short int yytype_int8;
204 typedef YYTYPE_UINT16 yytype_uint16;
206 typedef unsigned short int yytype_uint16;
210 typedef YYTYPE_INT16 yytype_int16;
212 typedef short int yytype_int16;
216 # ifdef __SIZE_TYPE__
217 # define YYSIZE_T __SIZE_TYPE__
218 # elif defined size_t
219 # define YYSIZE_T size_t
220 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
221 || defined __cplusplus || defined _MSC_VER)
222 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
223 # define YYSIZE_T size_t
225 # define YYSIZE_T unsigned int
229 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
234 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
235 # define YY_(msgid) dgettext ("bison-runtime", msgid)
239 # define YY_(msgid) msgid
243 /* Suppress unused-variable warnings by "using" E. */
244 #if ! defined lint || defined __GNUC__
245 # define YYUSE(e) ((void) (e))
247 # define YYUSE(e) /* empty */
250 /* Identity function, used to suppress warnings about constant conditions. */
254 #if (defined __STDC__ || defined __C99__FUNC__ \
255 || defined __cplusplus || defined _MSC_VER)
268 #if ! defined yyoverflow || YYERROR_VERBOSE
270 /* The parser invokes alloca or malloc; define the necessary symbols. */
272 # ifdef YYSTACK_USE_ALLOCA
273 # if YYSTACK_USE_ALLOCA
275 # define YYSTACK_ALLOC __builtin_alloca
276 # elif defined __BUILTIN_VA_ARG_INCR
277 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
279 # define YYSTACK_ALLOC __alloca
280 # elif defined _MSC_VER
281 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
282 # define alloca _alloca
284 # define YYSTACK_ALLOC alloca
285 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
286 || defined __cplusplus || defined _MSC_VER)
287 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
296 # ifdef YYSTACK_ALLOC
297 /* Pacify GCC's `empty if-body' warning. */
298 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
299 # ifndef YYSTACK_ALLOC_MAXIMUM
300 /* The OS might guarantee only one guard page at the bottom of the stack,
301 and a page size can be as small as 4096 bytes. So we cannot safely
302 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
303 to allow for a few compiler-allocated temporary stack slots. */
304 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
307 # define YYSTACK_ALLOC YYMALLOC
308 # define YYSTACK_FREE YYFREE
309 # ifndef YYSTACK_ALLOC_MAXIMUM
310 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
312 # if (defined __cplusplus && ! defined _STDLIB_H \
313 && ! ((defined YYMALLOC || defined malloc) \
314 && (defined YYFREE || defined free)))
315 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
321 # define YYMALLOC malloc
322 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
323 || defined __cplusplus || defined _MSC_VER)
324 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
329 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
330 || defined __cplusplus || defined _MSC_VER)
331 void free (void *); /* INFRINGES ON USER NAME SPACE */
335 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
338 #if (! defined yyoverflow \
339 && (! defined __cplusplus \
340 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
342 /* A type that is properly aligned for any stack member. */
349 /* The size of the maximum gap between one aligned stack and the next. */
350 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
352 /* The size of an array large to enough to hold all stacks, each with
354 # define YYSTACK_BYTES(N) \
355 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
356 + YYSTACK_GAP_MAXIMUM)
358 /* Copy COUNT objects from FROM to TO. The source and destination do
361 # if defined __GNUC__ && 1 < __GNUC__
362 # define YYCOPY(To, From, Count) \
363 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
365 # define YYCOPY(To, From, Count) \
369 for (yyi = 0; yyi < (Count); yyi++) \
370 (To)[yyi] = (From)[yyi]; \
376 /* Relocate STACK from its old location to the new one. The
377 local variables YYSIZE and YYSTACKSIZE give the old and new number of
378 elements in the stack, and YYPTR gives the new location of the
379 stack. Advance YYPTR to a properly aligned location for the next
381 # define YYSTACK_RELOCATE(Stack) \
384 YYSIZE_T yynewbytes; \
385 YYCOPY (&yyptr->Stack, Stack, yysize); \
386 Stack = &yyptr->Stack; \
387 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
388 yyptr += yynewbytes / sizeof (*yyptr); \
394 /* YYFINAL -- State number of the termination state. */
396 /* YYLAST -- Last index in YYTABLE. */
399 /* YYNTOKENS -- Number of terminals. */
401 /* YYNNTS -- Number of nonterminals. */
403 /* YYNRULES -- Number of rules. */
405 /* YYNRULES -- Number of states. */
408 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
410 #define YYMAXUTOK 265
412 #define YYTRANSLATE(YYX) \
413 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
415 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
416 static const yytype_uint8 yytranslate[] =
418 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
419 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
420 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
421 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
422 11, 12, 2, 2, 2, 2, 2, 15, 2, 2,
423 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
424 16, 14, 13, 2, 2, 2, 2, 2, 2, 2,
425 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
426 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
427 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
428 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
429 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
430 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
431 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
432 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
433 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
434 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
435 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
436 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
437 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
438 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
439 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
440 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
441 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
442 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
443 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
448 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
450 static const yytype_uint8 yyprhs[] =
452 0, 0, 3, 4, 7, 9, 12, 14, 15, 21,
453 22, 27, 29, 30, 36, 37, 44, 45, 50, 52,
454 54, 56, 58, 62, 68, 69, 71, 73, 75, 77,
455 79, 81, 83, 85, 87, 89, 91, 93, 95, 97,
459 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
460 static const yytype_int8 yyrhs[] =
462 18, 0, -1, -1, 19, 20, -1, 21, -1, 21,
463 1, -1, 23, -1, -1, 21, 28, 29, 22, 23,
464 -1, -1, 11, 24, 21, 12, -1, 33, -1, -1,
465 32, 31, 29, 25, 23, -1, -1, 13, 33, 14,
466 33, 26, 21, -1, -1, 13, 33, 27, 21, -1,
467 4, -1, 5, -1, 6, -1, 7, -1, 29, 15,
468 33, -1, 29, 15, 33, 30, 33, -1, -1, 14,
469 -1, 13, -1, 16, -1, 8, -1, 9, -1, 10,
470 -1, 14, -1, 13, -1, 16, -1, 8, -1, 9,
471 -1, 10, -1, 3, -1, 33, -1, 3, -1, 4,
472 -1, 5, -1, 6, -1, 7, -1
475 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
476 static const yytype_uint8 yyrline[] =
478 0, 66, 66, 66, 76, 77, 84, 86, 86, 101,
479 101, 108, 114, 114, 121, 121, 127, 127, 138, 138,
480 138, 138, 140, 149, 158, 164, 165, 166, 167, 168,
481 169, 173, 174, 175, 176, 177, 178, 179, 183, 186,
486 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
487 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
488 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
489 static const char *const yytname[] =
491 "$end", "error", "$undefined", "TERM", "AND", "OR", "NOT", "PROX", "GE",
492 "LE", "NE", "'('", "')'", "'>'", "'='", "'/'", "'<'", "$accept", "top",
493 "@1", "cqlQuery1", "cqlQuery", "@2", "searchClause", "@3", "@4", "@5",
494 "@6", "boolean", "modifiers", "mrelation", "relation", "index",
500 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
502 static const yytype_uint16 yytoknum[] =
504 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
505 265, 40, 41, 62, 61, 47, 60
509 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
510 static const yytype_uint8 yyr1[] =
512 0, 17, 19, 18, 20, 20, 21, 22, 21, 24,
513 23, 23, 25, 23, 26, 23, 27, 23, 28, 28,
514 28, 28, 29, 29, 29, 30, 30, 30, 30, 30,
515 30, 31, 31, 31, 31, 31, 31, 31, 32, 33,
519 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
520 static const yytype_uint8 yyr2[] =
522 0, 2, 0, 2, 1, 2, 1, 0, 5, 0,
523 4, 1, 0, 5, 0, 6, 0, 4, 1, 1,
524 1, 1, 3, 5, 0, 1, 1, 1, 1, 1,
525 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
529 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
530 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
531 means the default is an error. */
532 static const yytype_uint8 yydefact[] =
534 2, 0, 0, 1, 39, 40, 41, 42, 43, 9,
535 0, 3, 0, 6, 0, 11, 0, 16, 5, 18,
536 19, 20, 21, 24, 37, 34, 35, 36, 32, 31,
537 33, 24, 0, 0, 0, 7, 12, 10, 14, 17,
538 0, 0, 0, 0, 22, 8, 13, 15, 28, 29,
539 30, 26, 25, 27, 0, 23
542 /* YYDEFGOTO[NTERM-NUM]. */
543 static const yytype_int8 yydefgoto[] =
545 -1, 1, 2, 11, 12, 41, 13, 16, 42, 43,
546 34, 23, 35, 54, 31, 14, 15
549 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
551 #define YYPACT_NINF -39
552 static const yytype_int8 yypact[] =
554 -39, 5, 28, -39, -39, -39, -39, -39, -39, -39,
555 64, -39, 59, -39, -1, 8, 28, -8, -39, -39,
556 -39, -39, -39, -39, -39, -39, -39, -39, -39, -39,
557 -39, -39, 50, 64, 28, -5, -5, -39, -39, 68,
558 64, 28, 28, 28, 37, -39, -39, 68, -39, -39,
559 -39, -39, -39, -39, 64, -39
562 /* YYPGOTO[NTERM-NUM]. */
563 static const yytype_int8 yypgoto[] =
565 -39, -39, -39, -39, -15, -39, -38, -39, -39, -39,
566 -39, -39, -17, -39, -39, -39, -10
569 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
570 positive, shift that token. If negative, reduce the rule which
571 number is the opposite. If zero, do what YYDEFACT says.
572 If YYTABLE_NINF, syntax error. */
573 #define YYTABLE_NINF -39
574 static const yytype_int8 yytable[] =
576 17, 32, 24, 45, 46, 3, 33, 25, 26, 27,
577 40, -38, 28, 29, 36, 30, -38, -38, -38, 39,
578 0, -38, -38, 38, -38, 0, 0, 0, 47, 0,
579 44, 4, 5, 6, 7, 8, 0, 0, 0, 9,
580 0, 10, 0, 0, 55, 48, 49, 50, 0, 0,
581 51, 52, 0, 53, 19, 20, 21, 22, 0, -4,
582 18, 0, 37, 19, 20, 21, 22, 4, 5, 6,
586 static const yytype_int8 yycheck[] =
588 10, 16, 3, 41, 42, 0, 14, 8, 9, 10,
589 15, 3, 13, 14, 31, 16, 8, 9, 10, 34,
590 -1, 13, 14, 33, 16, -1, -1, -1, 43, -1,
591 40, 3, 4, 5, 6, 7, -1, -1, -1, 11,
592 -1, 13, -1, -1, 54, 8, 9, 10, -1, -1,
593 13, 14, -1, 16, 4, 5, 6, 7, -1, 0,
594 1, -1, 12, 4, 5, 6, 7, 3, 4, 5,
598 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
599 symbol of state STATE-NUM. */
600 static const yytype_uint8 yystos[] =
602 0, 18, 19, 0, 3, 4, 5, 6, 7, 11,
603 13, 20, 21, 23, 32, 33, 24, 33, 1, 4,
604 5, 6, 7, 28, 3, 8, 9, 10, 13, 14,
605 16, 31, 21, 14, 27, 29, 29, 12, 33, 21,
606 15, 22, 25, 26, 33, 23, 23, 21, 8, 9,
607 10, 13, 14, 16, 30, 33
610 #define yyerrok (yyerrstatus = 0)
611 #define yyclearin (yychar = YYEMPTY)
615 #define YYACCEPT goto yyacceptlab
616 #define YYABORT goto yyabortlab
617 #define YYERROR goto yyerrorlab
620 /* Like YYERROR except do call yyerror. This remains here temporarily
621 to ease the transition to the new meaning of YYERROR, for GCC.
622 Once GCC version 2 has supplanted version 1, this can go. */
624 #define YYFAIL goto yyerrlab
626 #define YYRECOVERING() (!!yyerrstatus)
628 #define YYBACKUP(Token, Value) \
630 if (yychar == YYEMPTY && yylen == 1) \
634 yytoken = YYTRANSLATE (yychar); \
640 yyerror (YY_("syntax error: cannot back up")); \
647 #define YYERRCODE 256
650 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
651 If N is 0, then set CURRENT to the empty location which ends
652 the previous symbol: RHS[0] (always defined). */
654 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
655 #ifndef YYLLOC_DEFAULT
656 # define YYLLOC_DEFAULT(Current, Rhs, N) \
660 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
661 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
662 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
663 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
667 (Current).first_line = (Current).last_line = \
668 YYRHSLOC (Rhs, 0).last_line; \
669 (Current).first_column = (Current).last_column = \
670 YYRHSLOC (Rhs, 0).last_column; \
676 /* YY_LOCATION_PRINT -- Print the location on the stream.
677 This macro was not mandated originally: define only if we know
678 we won't break user code: when these are the locations we know. */
680 #ifndef YY_LOCATION_PRINT
681 # if YYLTYPE_IS_TRIVIAL
682 # define YY_LOCATION_PRINT(File, Loc) \
683 fprintf (File, "%d.%d-%d.%d", \
684 (Loc).first_line, (Loc).first_column, \
685 (Loc).last_line, (Loc).last_column)
687 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
692 /* YYLEX -- calling `yylex' with the right arguments. */
695 # define YYLEX yylex (&yylval, YYLEX_PARAM)
697 # define YYLEX yylex (&yylval)
700 /* Enable debugging if requested. */
704 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
705 # define YYFPRINTF fprintf
708 # define YYDPRINTF(Args) \
714 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
718 YYFPRINTF (stderr, "%s ", Title); \
719 yy_symbol_print (stderr, \
721 YYFPRINTF (stderr, "\n"); \
726 /*--------------------------------.
727 | Print this symbol on YYOUTPUT. |
728 `--------------------------------*/
731 #if (defined __STDC__ || defined __C99__FUNC__ \
732 || defined __cplusplus || defined _MSC_VER)
734 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
737 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
740 YYSTYPE const * const yyvaluep;
746 if (yytype < YYNTOKENS)
747 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
759 /*--------------------------------.
760 | Print this symbol on YYOUTPUT. |
761 `--------------------------------*/
763 #if (defined __STDC__ || defined __C99__FUNC__ \
764 || defined __cplusplus || defined _MSC_VER)
766 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
769 yy_symbol_print (yyoutput, yytype, yyvaluep)
772 YYSTYPE const * const yyvaluep;
775 if (yytype < YYNTOKENS)
776 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
778 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
780 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
781 YYFPRINTF (yyoutput, ")");
784 /*------------------------------------------------------------------.
785 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
787 `------------------------------------------------------------------*/
789 #if (defined __STDC__ || defined __C99__FUNC__ \
790 || defined __cplusplus || defined _MSC_VER)
792 yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
795 yy_stack_print (bottom, top)
796 yytype_int16 *bottom;
800 YYFPRINTF (stderr, "Stack now");
801 for (; bottom <= top; ++bottom)
802 YYFPRINTF (stderr, " %d", *bottom);
803 YYFPRINTF (stderr, "\n");
806 # define YY_STACK_PRINT(Bottom, Top) \
809 yy_stack_print ((Bottom), (Top)); \
813 /*------------------------------------------------.
814 | Report that the YYRULE is going to be reduced. |
815 `------------------------------------------------*/
817 #if (defined __STDC__ || defined __C99__FUNC__ \
818 || defined __cplusplus || defined _MSC_VER)
820 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
823 yy_reduce_print (yyvsp, yyrule)
828 int yynrhs = yyr2[yyrule];
830 unsigned long int yylno = yyrline[yyrule];
831 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
833 /* The symbols being reduced. */
834 for (yyi = 0; yyi < yynrhs; yyi++)
836 fprintf (stderr, " $%d = ", yyi + 1);
837 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
838 &(yyvsp[(yyi + 1) - (yynrhs)])
840 fprintf (stderr, "\n");
844 # define YY_REDUCE_PRINT(Rule) \
847 yy_reduce_print (yyvsp, Rule); \
850 /* Nonzero means print parse trace. It is left uninitialized so that
851 multiple parsers can coexist. */
854 # define YYDPRINTF(Args)
855 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
856 # define YY_STACK_PRINT(Bottom, Top)
857 # define YY_REDUCE_PRINT(Rule)
858 #endif /* !YYDEBUG */
861 /* YYINITDEPTH -- initial size of the parser's stacks. */
863 # define YYINITDEPTH 200
866 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
867 if the built-in stack extension method is used).
869 Do not make this value too large; the results are undefined if
870 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
871 evaluated with infinite-precision integer arithmetic. */
874 # define YYMAXDEPTH 10000
882 # if defined __GLIBC__ && defined _STRING_H
883 # define yystrlen strlen
885 /* Return the length of YYSTR. */
886 #if (defined __STDC__ || defined __C99__FUNC__ \
887 || defined __cplusplus || defined _MSC_VER)
889 yystrlen (const char *yystr)
897 for (yylen = 0; yystr[yylen]; yylen++)
905 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
906 # define yystpcpy stpcpy
908 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
910 #if (defined __STDC__ || defined __C99__FUNC__ \
911 || defined __cplusplus || defined _MSC_VER)
913 yystpcpy (char *yydest, const char *yysrc)
916 yystpcpy (yydest, yysrc)
922 const char *yys = yysrc;
924 while ((*yyd++ = *yys++) != '\0')
933 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
934 quotes and backslashes, so that it's suitable for yyerror. The
935 heuristic is that double-quoting is unnecessary unless the string
936 contains an apostrophe, a comma, or backslash (other than
937 backslash-backslash). YYSTR is taken from yytname. If YYRES is
938 null, do not copy; instead, return the length of what the result
941 yytnamerr (char *yyres, const char *yystr)
946 char const *yyp = yystr;
953 goto do_not_strip_quotes;
957 goto do_not_strip_quotes;
970 do_not_strip_quotes: ;
974 return yystrlen (yystr);
976 return yystpcpy (yyres, yystr) - yyres;
980 /* Copy into YYRESULT an error message about the unexpected token
981 YYCHAR while in state YYSTATE. Return the number of bytes copied,
982 including the terminating null byte. If YYRESULT is null, do not
983 copy anything; just return the number of bytes that would be
984 copied. As a special case, return 0 if an ordinary "syntax error"
985 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
988 yysyntax_error (char *yyresult, int yystate, int yychar)
990 int yyn = yypact[yystate];
992 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
996 int yytype = YYTRANSLATE (yychar);
997 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
998 YYSIZE_T yysize = yysize0;
1000 int yysize_overflow = 0;
1001 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1002 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1006 /* This is so xgettext sees the translatable formats that are
1007 constructed on the fly. */
1008 YY_("syntax error, unexpected %s");
1009 YY_("syntax error, unexpected %s, expecting %s");
1010 YY_("syntax error, unexpected %s, expecting %s or %s");
1011 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1012 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1016 static char const yyunexpected[] = "syntax error, unexpected %s";
1017 static char const yyexpecting[] = ", expecting %s";
1018 static char const yyor[] = " or %s";
1019 char yyformat[sizeof yyunexpected
1020 + sizeof yyexpecting - 1
1021 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
1022 * (sizeof yyor - 1))];
1023 char const *yyprefix = yyexpecting;
1025 /* Start YYX at -YYN if negative to avoid negative indexes in
1027 int yyxbegin = yyn < 0 ? -yyn : 0;
1029 /* Stay within bounds of both yycheck and yytname. */
1030 int yychecklim = YYLAST - yyn + 1;
1031 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1034 yyarg[0] = yytname[yytype];
1035 yyfmt = yystpcpy (yyformat, yyunexpected);
1037 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1038 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1040 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1044 yyformat[sizeof yyunexpected - 1] = '\0';
1047 yyarg[yycount++] = yytname[yyx];
1048 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1049 yysize_overflow |= (yysize1 < yysize);
1051 yyfmt = yystpcpy (yyfmt, yyprefix);
1055 yyf = YY_(yyformat);
1056 yysize1 = yysize + yystrlen (yyf);
1057 yysize_overflow |= (yysize1 < yysize);
1060 if (yysize_overflow)
1061 return YYSIZE_MAXIMUM;
1065 /* Avoid sprintf, as that infringes on the user's name space.
1066 Don't have undefined behavior even if the translation
1067 produced a string with the wrong number of "%s"s. */
1068 char *yyp = yyresult;
1070 while ((*yyp = *yyf) != '\0')
1072 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
1074 yyp += yytnamerr (yyp, yyarg[yyi++]);
1087 #endif /* YYERROR_VERBOSE */
1090 /*-----------------------------------------------.
1091 | Release the memory associated to this symbol. |
1092 `-----------------------------------------------*/
1095 #if (defined __STDC__ || defined __C99__FUNC__ \
1096 || defined __cplusplus || defined _MSC_VER)
1098 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1101 yydestruct (yymsg, yytype, yyvaluep)
1111 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1122 /* Prevent warnings from -Wmissing-prototypes. */
1124 #ifdef YYPARSE_PARAM
1125 #if defined __STDC__ || defined __cplusplus
1126 int yyparse (void *YYPARSE_PARAM);
1130 #else /* ! YYPARSE_PARAM */
1131 #if defined __STDC__ || defined __cplusplus
1136 #endif /* ! YYPARSE_PARAM */
1147 #ifdef YYPARSE_PARAM
1148 #if (defined __STDC__ || defined __C99__FUNC__ \
1149 || defined __cplusplus || defined _MSC_VER)
1151 yyparse (void *YYPARSE_PARAM)
1154 yyparse (YYPARSE_PARAM)
1155 void *YYPARSE_PARAM;
1157 #else /* ! YYPARSE_PARAM */
1158 #if (defined __STDC__ || defined __C99__FUNC__ \
1159 || defined __cplusplus || defined _MSC_VER)
1169 /* The look-ahead symbol. */
1172 /* The semantic value of the look-ahead symbol. */
1175 /* Number of syntax errors so far. */
1181 /* Number of tokens to shift before error messages enabled. */
1183 /* Look-ahead token as an internal (translated) token number. */
1186 /* Buffer for error messages, and its allocated size. */
1188 char *yymsg = yymsgbuf;
1189 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1192 /* Three stacks and their tools:
1193 `yyss': related to states,
1194 `yyvs': related to semantic values,
1195 `yyls': related to locations.
1197 Refer to the stacks thru separate pointers, to allow yyoverflow
1198 to reallocate them elsewhere. */
1200 /* The state stack. */
1201 yytype_int16 yyssa[YYINITDEPTH];
1202 yytype_int16 *yyss = yyssa;
1203 yytype_int16 *yyssp;
1205 /* The semantic value stack. */
1206 YYSTYPE yyvsa[YYINITDEPTH];
1207 YYSTYPE *yyvs = yyvsa;
1212 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1214 YYSIZE_T yystacksize = YYINITDEPTH;
1216 /* The variables used to return semantic value and location from the
1221 /* The number of symbols on the RHS of the reduced rule.
1222 Keep to zero when no symbol should be popped. */
1225 YYDPRINTF ((stderr, "Starting parse\n"));
1230 yychar = YYEMPTY; /* Cause a token to be read. */
1232 /* Initialize stack pointers.
1233 Waste one element of value and location stack
1234 so that they stay on the same level as the state stack.
1235 The wasted elements are never initialized. */
1242 /*------------------------------------------------------------.
1243 | yynewstate -- Push a new state, which is found in yystate. |
1244 `------------------------------------------------------------*/
1246 /* In all cases, when you get here, the value and location stacks
1247 have just been pushed. So pushing a state here evens the stacks. */
1253 if (yyss + yystacksize - 1 <= yyssp)
1255 /* Get the current used size of the three stacks, in elements. */
1256 YYSIZE_T yysize = yyssp - yyss + 1;
1260 /* Give user a chance to reallocate the stack. Use copies of
1261 these so that the &'s don't force the real ones into
1263 YYSTYPE *yyvs1 = yyvs;
1264 yytype_int16 *yyss1 = yyss;
1267 /* Each stack pointer address is followed by the size of the
1268 data in use in that stack, in bytes. This used to be a
1269 conditional around just the two extra args, but that might
1270 be undefined if yyoverflow is a macro. */
1271 yyoverflow (YY_("memory exhausted"),
1272 &yyss1, yysize * sizeof (*yyssp),
1273 &yyvs1, yysize * sizeof (*yyvsp),
1280 #else /* no yyoverflow */
1281 # ifndef YYSTACK_RELOCATE
1282 goto yyexhaustedlab;
1284 /* Extend the stack our own way. */
1285 if (YYMAXDEPTH <= yystacksize)
1286 goto yyexhaustedlab;
1288 if (YYMAXDEPTH < yystacksize)
1289 yystacksize = YYMAXDEPTH;
1292 yytype_int16 *yyss1 = yyss;
1293 union yyalloc *yyptr =
1294 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1296 goto yyexhaustedlab;
1297 YYSTACK_RELOCATE (yyss);
1298 YYSTACK_RELOCATE (yyvs);
1300 # undef YYSTACK_RELOCATE
1302 YYSTACK_FREE (yyss1);
1305 #endif /* no yyoverflow */
1307 yyssp = yyss + yysize - 1;
1308 yyvsp = yyvs + yysize - 1;
1311 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1312 (unsigned long int) yystacksize));
1314 if (yyss + yystacksize - 1 <= yyssp)
1318 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1327 /* Do appropriate processing given the current state. Read a
1328 look-ahead token if we need one and don't already have one. */
1330 /* First try to decide what to do without reference to look-ahead token. */
1331 yyn = yypact[yystate];
1332 if (yyn == YYPACT_NINF)
1335 /* Not known => get a look-ahead token if don't already have one. */
1337 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
1338 if (yychar == YYEMPTY)
1340 YYDPRINTF ((stderr, "Reading a token: "));
1344 if (yychar <= YYEOF)
1346 yychar = yytoken = YYEOF;
1347 YYDPRINTF ((stderr, "Now at end of input.\n"));
1351 yytoken = YYTRANSLATE (yychar);
1352 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1355 /* If the proper action on seeing token YYTOKEN is to reduce or to
1356 detect an error, take that action. */
1358 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1363 if (yyn == 0 || yyn == YYTABLE_NINF)
1372 /* Count tokens shifted since error; after three, turn off error
1377 /* Shift the look-ahead token. */
1378 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1380 /* Discard the shifted token unless it is eof. */
1381 if (yychar != YYEOF)
1390 /*-----------------------------------------------------------.
1391 | yydefault -- do the default action for the current state. |
1392 `-----------------------------------------------------------*/
1394 yyn = yydefact[yystate];
1400 /*-----------------------------.
1401 | yyreduce -- Do a reduction. |
1402 `-----------------------------*/
1404 /* yyn is the number of a rule to reduce with. */
1407 /* If YYLEN is nonzero, implement the default value of the action:
1410 Otherwise, the following line sets YYVAL to garbage.
1411 This behavior is undocumented and Bison
1412 users should not rely upon it. Assigning to YYVAL
1413 unconditionally makes the parser a bit smaller, and it avoids a
1414 GCC warning that YYVAL may be used uninitialized. */
1415 yyval = yyvsp[1-yylen];
1418 YY_REDUCE_PRINT (yyn);
1424 (yyval).rel = cql_node_mk_sc(((CQL_parser) parm)->nmem,
1425 "cql.serverChoice", "scr", 0);
1426 ((CQL_parser) parm)->top = 0;
1433 cql_node_destroy((yyval).rel);
1434 ((CQL_parser) parm)->top = (yyvsp[(2) - (2)]).cql;
1441 cql_node_destroy((yyvsp[(1) - (2)]).cql);
1449 (yyval).rel = (yyvsp[(0) - (3)]).rel;
1456 struct cql_node *cn = cql_node_mk_boolean(((CQL_parser) parm)->nmem,
1457 (yyvsp[(2) - (5)]).buf);
1459 cn->u.boolean.modifiers = (yyvsp[(3) - (5)]).cql;
1460 cn->u.boolean.left = (yyvsp[(1) - (5)]).cql;
1461 cn->u.boolean.right = (yyvsp[(5) - (5)]).cql;
1470 (yyval).rel = (yyvsp[(0) - (1)]).rel;
1478 (yyval).cql = (yyvsp[(3) - (4)]).cql;
1485 struct cql_node *st = cql_node_dup (((CQL_parser) parm)->nmem, (yyvsp[(0) - (1)]).rel);
1486 st->u.st.term = nmem_strdup(((CQL_parser)parm)->nmem, (yyvsp[(1) - (1)]).buf);
1494 (yyval).rel = cql_node_mk_sc(((CQL_parser) parm)->nmem, (yyvsp[(1) - (3)]).buf, (yyvsp[(2) - (3)]).buf, 0);
1495 (yyval).rel->u.st.modifiers = (yyvsp[(3) - (3)]).cql;
1502 (yyval).cql = (yyvsp[(5) - (5)]).cql;
1503 cql_node_destroy((yyvsp[(4) - (5)]).rel);
1510 (yyval).rel = (yyvsp[(0) - (4)]).rel;
1517 (yyval).cql = cql_apply_prefix(((CQL_parser) parm)->nmem,
1518 (yyvsp[(6) - (6)]).cql, (yyvsp[(2) - (6)]).buf, (yyvsp[(4) - (6)]).buf);
1525 (yyval).rel = (yyvsp[(0) - (2)]).rel;
1532 (yyval).cql = cql_apply_prefix(((CQL_parser) parm)->nmem,
1533 (yyvsp[(4) - (4)]).cql, 0, (yyvsp[(2) - (4)]).buf);
1540 struct cql_node *mod = cql_node_mk_sc(((CQL_parser)parm)->nmem,
1541 (yyvsp[(3) - (3)]).buf, 0, 0);
1543 mod->u.st.modifiers = (yyvsp[(1) - (3)]).cql;
1551 struct cql_node *mod = cql_node_mk_sc(((CQL_parser)parm)->nmem,
1552 (yyvsp[(3) - (5)]).buf, (yyvsp[(4) - (5)]).buf, (yyvsp[(5) - (5)]).buf);
1554 mod->u.st.modifiers = (yyvsp[(1) - (5)]).cql;
1567 /* Line 1267 of yacc.c. */
1571 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1575 YY_STACK_PRINT (yyss, yyssp);
1580 /* Now `shift' the result of the reduction. Determine what state
1581 that goes to, based on the state we popped back to and the rule
1582 number reduced by. */
1586 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1587 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1588 yystate = yytable[yystate];
1590 yystate = yydefgoto[yyn - YYNTOKENS];
1595 /*------------------------------------.
1596 | yyerrlab -- here on detecting error |
1597 `------------------------------------*/
1599 /* If not already recovering from an error, report this error. */
1603 #if ! YYERROR_VERBOSE
1604 yyerror (YY_("syntax error"));
1607 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
1608 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
1610 YYSIZE_T yyalloc = 2 * yysize;
1611 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
1612 yyalloc = YYSTACK_ALLOC_MAXIMUM;
1613 if (yymsg != yymsgbuf)
1614 YYSTACK_FREE (yymsg);
1615 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
1617 yymsg_alloc = yyalloc;
1621 yymsg_alloc = sizeof yymsgbuf;
1625 if (0 < yysize && yysize <= yymsg_alloc)
1627 (void) yysyntax_error (yymsg, yystate, yychar);
1632 yyerror (YY_("syntax error"));
1634 goto yyexhaustedlab;
1642 if (yyerrstatus == 3)
1644 /* If just tried and failed to reuse look-ahead token after an
1645 error, discard it. */
1647 if (yychar <= YYEOF)
1649 /* Return failure if at end of input. */
1650 if (yychar == YYEOF)
1655 yydestruct ("Error: discarding",
1661 /* Else will try to reuse look-ahead token after shifting the error
1666 /*---------------------------------------------------.
1667 | yyerrorlab -- error raised explicitly by YYERROR. |
1668 `---------------------------------------------------*/
1671 /* Pacify compilers like GCC when the user code never invokes
1672 YYERROR and the label yyerrorlab therefore never appears in user
1674 if (/*CONSTCOND*/ 0)
1677 /* Do not reclaim the symbols of the rule which action triggered
1681 YY_STACK_PRINT (yyss, yyssp);
1686 /*-------------------------------------------------------------.
1687 | yyerrlab1 -- common code for both syntax error and YYERROR. |
1688 `-------------------------------------------------------------*/
1690 yyerrstatus = 3; /* Each real token shifted decrements this. */
1694 yyn = yypact[yystate];
1695 if (yyn != YYPACT_NINF)
1698 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1706 /* Pop the current state because it cannot handle the error token. */
1711 yydestruct ("Error: popping",
1712 yystos[yystate], yyvsp);
1715 YY_STACK_PRINT (yyss, yyssp);
1724 /* Shift the error token. */
1725 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1731 /*-------------------------------------.
1732 | yyacceptlab -- YYACCEPT comes here. |
1733 `-------------------------------------*/
1738 /*-----------------------------------.
1739 | yyabortlab -- YYABORT comes here. |
1740 `-----------------------------------*/
1746 /*-------------------------------------------------.
1747 | yyexhaustedlab -- memory exhaustion comes here. |
1748 `-------------------------------------------------*/
1750 yyerror (YY_("memory exhausted"));
1756 if (yychar != YYEOF && yychar != YYEMPTY)
1757 yydestruct ("Cleanup: discarding lookahead",
1759 /* Do not reclaim the symbols of the rule which action triggered
1760 this YYABORT or YYACCEPT. */
1762 YY_STACK_PRINT (yyss, yyssp);
1763 while (yyssp != yyss)
1765 yydestruct ("Cleanup: popping",
1766 yystos[*yyssp], yyvsp);
1771 YYSTACK_FREE (yyss);
1774 if (yymsg != yymsgbuf)
1775 YYSTACK_FREE (yymsg);
1777 /* Make sure YYID is used. */
1778 return YYID (yyresult);
1785 int yyerror(char *s)
1791 * putb is a utility that puts one character to the string
1792 * in current lexical token. This routine deallocates as
1793 * necessary using NMEM.
1796 static void putb(YYSTYPE *lval, CQL_parser cp, int c)
1798 if (lval->len+1 >= lval->size)
1801 nmem_malloc(cp->nmem, (lval->size = lval->len * 2 + 20));
1802 memcpy (nb, lval->buf, lval->len);
1806 lval->buf[lval->len++] = c;
1807 lval->buf[lval->len] = '\0';
1812 * yylex returns next token for Bison to be read. In this
1813 * case one of the CQL terminals are returned.
1815 int yylex(YYSTYPE *lval, void *vp)
1817 CQL_parser cp = (CQL_parser) vp;
1823 lval->buf = (char *) nmem_malloc(cp->nmem, lval->size);
1824 lval->buf[0] = '\0';
1827 c = cp->getbyte(cp->client_data);
1832 } while (isspace(c));
1833 if (strchr("()=></", c))
1839 c1 = cp->getbyte(cp->client_data);
1846 cp->ungetbyte(c1, cp->client_data);
1850 c1 = cp->getbyte(cp->client_data);
1862 cp->ungetbyte(c1, cp->client_data);
1868 while ((c = cp->getbyte(cp->client_data)) != 0 && c != '"')
1871 c = cp->getbyte(cp->client_data);
1878 while (c != 0 && !strchr(" \n()=<>/", c))
1881 c = cp->getbyte(cp->client_data);
1883 c = cp->getbyte(cp->client_data);
1886 printf ("got %s\n", lval->buf);
1889 cp->ungetbyte(c, cp->client_data);
1890 if (!cql_strcmp(lval->buf, "and"))
1895 if (!cql_strcmp(lval->buf, "or"))
1900 if (!cql_strcmp(lval->buf, "not"))
1905 if (!cql_strcmp(lval->buf, "prox"))
1915 int cql_parser_stream(CQL_parser cp,
1916 int (*getbyte)(void *client_data),
1917 void (*ungetbyte)(int b, void *client_data),
1920 nmem_reset(cp->nmem);
1921 cp->getbyte = getbyte;
1922 cp->ungetbyte = ungetbyte;
1923 cp->client_data = client_data;
1925 cql_node_destroy(cp->top);
1932 CQL_parser cql_parser_create(void)
1934 CQL_parser cp = (CQL_parser) xmalloc (sizeof(*cp));
1939 cp->client_data = 0;
1942 cp->nmem = nmem_create();
1946 void cql_parser_destroy(CQL_parser cp)
1948 cql_node_destroy(cp->top);
1949 nmem_destroy(cp->nmem);
1953 struct cql_node *cql_parser_result(CQL_parser cp)