1 /* A Bison parser, made by GNU Bison 2.5. */
3 /* Bison implementation for Yacc-like parsers in C
5 Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc.
7 This program is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
20 /* As a special exception, you may create a larger work that contains
21 part or all of the Bison parser skeleton and distribute that work
22 under terms of your choice, so long as that work isn't itself a
23 parser generator using the skeleton or a modified version thereof
24 as a parser skeleton. Alternatively, if you modify or redistribute
25 the parser skeleton itself, you may (at your option) remove this
26 special exception, which will cause the skeleton and the resulting
27 Bison output files to be licensed under the GNU General Public
28 License without this special exception.
30 This special exception was added by the Free Software Foundation in
31 version 2.2 of Bison. */
33 /* C LALR(1) parser skeleton written by Richard Stallman, by
34 simplifying the original so-called "semantic" parser. */
36 /* All symbols defined below should begin with yy or YY, to avoid
37 infringing on user name space. This should be done even for local
38 variables, as they might otherwise be expanded by user macros.
39 There are some unavoidable exceptions within include files to
40 define necessary library symbols; they are noted "INFRINGES ON
41 USER NAME SPACE" below. */
43 /* Identify Bison output. */
47 #define YYBISON_VERSION "2.5"
50 #define YYSKELETON_NAME "yacc.c"
61 /* Using locations. */
62 #define YYLSP_NEEDED 0
66 /* Copy the first part of user declarations. */
68 /* Line 268 of yacc.c */
69 #line 1 "spotlight_rawquery_parser.y"
75 #include <atalk/talloc.h>
76 #include <atalk/logger.h>
77 #include <atalk/errchk.h>
78 #include "spotlight_SPARQL_map.h"
79 #include "spotlight.h"
81 struct yy_buffer_state;
82 typedef struct yy_buffer_state *YY_BUFFER_STATE;
83 extern int yylex (void);
84 extern void yyerror (char const *);
85 extern void *yyterminate(void);
86 extern YY_BUFFER_STATE yy_scan_string( const char *str);
87 extern void yy_delete_buffer ( YY_BUFFER_STATE buffer );
89 static const char *map_expr(const char *attr, const char *val);
90 static const char *map_daterange(const char *dateattr, const char *date1, const char *date2);
97 /* Line 268 of yacc.c */
98 #line 99 "spotlight_rawquery_parser.c"
100 /* Enabling traces. */
105 /* Enabling verbose error messages. */
106 #ifdef YYERROR_VERBOSE
107 # undef YYERROR_VERBOSE
108 # define YYERROR_VERBOSE 1
110 # define YYERROR_VERBOSE 1
113 /* Enabling the token table. */
114 #ifndef YYTOKEN_TABLE
115 # define YYTOKEN_TABLE 0
122 /* Put the tokens into the symbol table, so that GDB and other debuggers
141 #define FUNC_INRANGE 260
142 #define DATE_SPEC 261
154 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
155 typedef union YYSTYPE
158 /* Line 293 of yacc.c */
159 #line 34 "spotlight_rawquery_parser.y"
166 /* Line 293 of yacc.c */
167 #line 168 "spotlight_rawquery_parser.c"
169 # define YYSTYPE_IS_TRIVIAL 1
170 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
171 # define YYSTYPE_IS_DECLARED 1
174 /* "%code provides" blocks. */
176 /* Line 340 of yacc.c */
177 #line 28 "spotlight_rawquery_parser.y"
179 extern const gchar *map_spotlight_to_sparql_query(slq_t *slq);
180 extern slq_t *ssp_slq;
181 extern gchar *ssp_result;
185 /* Line 340 of yacc.c */
186 #line 187 "spotlight_rawquery_parser.c"
188 /* Copy the second part of user declarations. */
191 /* Line 343 of yacc.c */
192 #line 193 "spotlight_rawquery_parser.c"
199 typedef YYTYPE_UINT8 yytype_uint8;
201 typedef unsigned char yytype_uint8;
205 typedef YYTYPE_INT8 yytype_int8;
206 #elif (defined __STDC__ || defined __C99__FUNC__ \
207 || defined __cplusplus || defined _MSC_VER)
208 typedef signed char yytype_int8;
210 typedef short int yytype_int8;
214 typedef YYTYPE_UINT16 yytype_uint16;
216 typedef unsigned short int yytype_uint16;
220 typedef YYTYPE_INT16 yytype_int16;
222 typedef short int yytype_int16;
226 # ifdef __SIZE_TYPE__
227 # define YYSIZE_T __SIZE_TYPE__
228 # elif defined size_t
229 # define YYSIZE_T size_t
230 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
231 || defined __cplusplus || defined _MSC_VER)
232 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
233 # define YYSIZE_T size_t
235 # define YYSIZE_T unsigned int
239 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
242 # if defined YYENABLE_NLS && YYENABLE_NLS
244 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
245 # define YY_(msgid) dgettext ("bison-runtime", msgid)
249 # define YY_(msgid) msgid
253 /* Suppress unused-variable warnings by "using" E. */
254 #if ! defined lint || defined __GNUC__
255 # define YYUSE(e) ((void) (e))
257 # define YYUSE(e) /* empty */
260 /* Identity function, used to suppress warnings about constant conditions. */
264 #if (defined __STDC__ || defined __C99__FUNC__ \
265 || defined __cplusplus || defined _MSC_VER)
278 #if ! defined yyoverflow || YYERROR_VERBOSE
280 /* The parser invokes alloca or malloc; define the necessary symbols. */
282 # ifdef YYSTACK_USE_ALLOCA
283 # if YYSTACK_USE_ALLOCA
285 # define YYSTACK_ALLOC __builtin_alloca
286 # elif defined __BUILTIN_VA_ARG_INCR
287 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
289 # define YYSTACK_ALLOC __alloca
290 # elif defined _MSC_VER
291 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
292 # define alloca _alloca
294 # define YYSTACK_ALLOC alloca
295 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
296 || defined __cplusplus || defined _MSC_VER)
297 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
298 # ifndef EXIT_SUCCESS
299 # define EXIT_SUCCESS 0
306 # ifdef YYSTACK_ALLOC
307 /* Pacify GCC's `empty if-body' warning. */
308 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
309 # ifndef YYSTACK_ALLOC_MAXIMUM
310 /* The OS might guarantee only one guard page at the bottom of the stack,
311 and a page size can be as small as 4096 bytes. So we cannot safely
312 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
313 to allow for a few compiler-allocated temporary stack slots. */
314 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
317 # define YYSTACK_ALLOC YYMALLOC
318 # define YYSTACK_FREE YYFREE
319 # ifndef YYSTACK_ALLOC_MAXIMUM
320 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
322 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
323 && ! ((defined YYMALLOC || defined malloc) \
324 && (defined YYFREE || defined free)))
325 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
326 # ifndef EXIT_SUCCESS
327 # define EXIT_SUCCESS 0
331 # define YYMALLOC malloc
332 # if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
333 || defined __cplusplus || defined _MSC_VER)
334 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
339 # if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
340 || defined __cplusplus || defined _MSC_VER)
341 void free (void *); /* INFRINGES ON USER NAME SPACE */
345 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
348 #if (! defined yyoverflow \
349 && (! defined __cplusplus \
350 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
352 /* A type that is properly aligned for any stack member. */
355 yytype_int16 yyss_alloc;
359 /* The size of the maximum gap between one aligned stack and the next. */
360 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
362 /* The size of an array large to enough to hold all stacks, each with
364 # define YYSTACK_BYTES(N) \
365 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
366 + YYSTACK_GAP_MAXIMUM)
368 # define YYCOPY_NEEDED 1
370 /* Relocate STACK from its old location to the new one. The
371 local variables YYSIZE and YYSTACKSIZE give the old and new number of
372 elements in the stack, and YYPTR gives the new location of the
373 stack. Advance YYPTR to a properly aligned location for the next
375 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
378 YYSIZE_T yynewbytes; \
379 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
380 Stack = &yyptr->Stack_alloc; \
381 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
382 yyptr += yynewbytes / sizeof (*yyptr); \
388 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
389 /* Copy COUNT objects from FROM to TO. The source and destination do
392 # if defined __GNUC__ && 1 < __GNUC__
393 # define YYCOPY(To, From, Count) \
394 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
396 # define YYCOPY(To, From, Count) \
400 for (yyi = 0; yyi < (Count); yyi++) \
401 (To)[yyi] = (From)[yyi]; \
406 #endif /* !YYCOPY_NEEDED */
408 /* YYFINAL -- State number of the termination state. */
410 /* YYLAST -- Last index in YYTABLE. */
413 /* YYNTOKENS -- Number of terminals. */
415 /* YYNNTS -- Number of nonterminals. */
417 /* YYNRULES -- Number of rules. */
419 /* YYNRULES -- Number of states. */
422 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
424 #define YYMAXUTOK 268
426 #define YYTRANSLATE(YYX) \
427 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
429 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
430 static const yytype_uint8 yytranslate[] =
432 0, 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, 2, 2, 2, 2,
444 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
445 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
446 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
447 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
448 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
449 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
450 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
451 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
452 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
453 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
454 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
455 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
456 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
457 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
458 5, 6, 7, 8, 9, 10, 11, 12, 13
462 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
464 static const yytype_uint8 yyprhs[] =
466 0, 0, 3, 4, 7, 9, 13, 15, 17, 21,
470 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
471 static const yytype_int8 yyrhs[] =
473 15, 0, -1, -1, 15, 16, -1, 17, -1, 18,
474 13, 18, -1, 18, -1, 19, -1, 7, 17, 8,
475 -1, 17, 12, 17, -1, 17, 13, 17, -1, 4,
476 9, 11, 4, 11, -1, 5, 7, 4, 10, 6,
477 7, 3, 8, 10, 6, 7, 3, 8, 8, -1
480 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
481 static const yytype_uint8 yyrline[] =
483 0, 52, 52, 54, 58, 68, 74, 75, 76, 77,
488 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
489 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
490 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
491 static const char *const yytname[] =
493 "$end", "error", "$undefined", "DATE", "WORD", "FUNC_INRANGE",
494 "DATE_SPEC", "OBRACE", "CBRACE", "EQUAL", "COMMA", "QUOTE", "AND", "OR",
495 "$accept", "input", "line", "expr", "match", "function", 0
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,
509 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
510 static const yytype_uint8 yyr1[] =
512 0, 14, 15, 15, 16, 17, 17, 17, 17, 17,
516 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
517 static const yytype_uint8 yyr2[] =
519 0, 2, 0, 2, 1, 3, 1, 1, 3, 3,
523 /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
524 Performed when YYTABLE doesn't specify something else to do. Zero
525 means the default is an error. */
526 static const yytype_uint8 yydefact[] =
528 2, 0, 1, 0, 0, 0, 3, 4, 6, 7,
529 0, 0, 0, 0, 0, 0, 0, 0, 8, 9,
530 10, 5, 0, 0, 11, 0, 0, 0, 0, 0,
534 /* YYDEFGOTO[NTERM-NUM]. */
535 static const yytype_int8 yydefgoto[] =
540 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
542 #define YYPACT_NINF -7
543 static const yytype_int8 yypact[] =
545 -7, 6, -7, -6, -2, -3, -7, 2, 5, -7,
546 -4, 15, 4, -3, -3, 16, 17, 12, -7, 10,
547 -7, -7, 13, 19, -7, 20, 23, 21, 18, 24,
551 /* YYPGOTO[NTERM-NUM]. */
552 static const yytype_int8 yypgoto[] =
554 -7, -7, -7, -5, 22, -7
557 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
558 positive, shift that token. If negative, reduce the rule which
559 number is the opposite. If YYTABLE_NINF, syntax error. */
560 #define YYTABLE_NINF -1
561 static const yytype_uint8 yytable[] =
563 12, 3, 4, 10, 5, 11, 2, 16, 19, 20,
564 3, 4, 18, 5, 13, 14, 13, 14, 15, 17,
565 3, 22, 23, 14, 24, 25, 27, 26, 29, 28,
566 30, 32, 31, 0, 33, 34, 0, 21
569 #define yypact_value_is_default(yystate) \
572 #define yytable_value_is_error(yytable_value) \
575 static const yytype_int8 yycheck[] =
577 5, 4, 5, 9, 7, 7, 0, 11, 13, 14,
578 4, 5, 8, 7, 12, 13, 12, 13, 13, 4,
579 4, 4, 10, 13, 11, 6, 3, 7, 10, 8,
580 6, 3, 7, -1, 8, 8, -1, 15
583 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
584 symbol of state STATE-NUM. */
585 static const yytype_uint8 yystos[] =
587 0, 15, 0, 4, 5, 7, 16, 17, 18, 19,
588 9, 7, 17, 12, 13, 13, 11, 4, 8, 17,
589 17, 18, 4, 10, 11, 6, 7, 3, 8, 10,
593 #define yyerrok (yyerrstatus = 0)
594 #define yyclearin (yychar = YYEMPTY)
598 #define YYACCEPT goto yyacceptlab
599 #define YYABORT goto yyabortlab
600 #define YYERROR goto yyerrorlab
603 /* Like YYERROR except do call yyerror. This remains here temporarily
604 to ease the transition to the new meaning of YYERROR, for GCC.
605 Once GCC version 2 has supplanted version 1, this can go. However,
606 YYFAIL appears to be in use. Nevertheless, it is formally deprecated
607 in Bison 2.4.2's NEWS entry, where a plan to phase it out is
610 #define YYFAIL goto yyerrlab
612 /* This is here to suppress warnings from the GCC cpp's
613 -Wunused-macros. Normally we don't worry about that warning, but
614 some users do, and we want to make it easy for users to remove
615 YYFAIL uses, which will produce warnings from Bison 2.5. */
618 #define YYRECOVERING() (!!yyerrstatus)
620 #define YYBACKUP(Token, Value) \
622 if (yychar == YYEMPTY && yylen == 1) \
631 yyerror (YY_("syntax error: cannot back up")); \
638 #define YYERRCODE 256
641 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
642 If N is 0, then set CURRENT to the empty location which ends
643 the previous symbol: RHS[0] (always defined). */
645 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
646 #ifndef YYLLOC_DEFAULT
647 # define YYLLOC_DEFAULT(Current, Rhs, N) \
651 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
652 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
653 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
654 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
658 (Current).first_line = (Current).last_line = \
659 YYRHSLOC (Rhs, 0).last_line; \
660 (Current).first_column = (Current).last_column = \
661 YYRHSLOC (Rhs, 0).last_column; \
667 /* This macro is provided for backward compatibility. */
669 #ifndef YY_LOCATION_PRINT
670 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
674 /* YYLEX -- calling `yylex' with the right arguments. */
677 # define YYLEX yylex (YYLEX_PARAM)
679 # define YYLEX yylex ()
682 /* Enable debugging if requested. */
686 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
687 # define YYFPRINTF fprintf
690 # define YYDPRINTF(Args) \
696 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
700 YYFPRINTF (stderr, "%s ", Title); \
701 yy_symbol_print (stderr, \
703 YYFPRINTF (stderr, "\n"); \
708 /*--------------------------------.
709 | Print this symbol on YYOUTPUT. |
710 `--------------------------------*/
713 #if (defined __STDC__ || defined __C99__FUNC__ \
714 || defined __cplusplus || defined _MSC_VER)
716 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
719 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
722 YYSTYPE const * const yyvaluep;
728 if (yytype < YYNTOKENS)
729 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
741 /*--------------------------------.
742 | Print this symbol on YYOUTPUT. |
743 `--------------------------------*/
745 #if (defined __STDC__ || defined __C99__FUNC__ \
746 || defined __cplusplus || defined _MSC_VER)
748 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
751 yy_symbol_print (yyoutput, yytype, yyvaluep)
754 YYSTYPE const * const yyvaluep;
757 if (yytype < YYNTOKENS)
758 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
760 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
762 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
763 YYFPRINTF (yyoutput, ")");
766 /*------------------------------------------------------------------.
767 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
769 `------------------------------------------------------------------*/
771 #if (defined __STDC__ || defined __C99__FUNC__ \
772 || defined __cplusplus || defined _MSC_VER)
774 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
777 yy_stack_print (yybottom, yytop)
778 yytype_int16 *yybottom;
782 YYFPRINTF (stderr, "Stack now");
783 for (; yybottom <= yytop; yybottom++)
785 int yybot = *yybottom;
786 YYFPRINTF (stderr, " %d", yybot);
788 YYFPRINTF (stderr, "\n");
791 # define YY_STACK_PRINT(Bottom, Top) \
794 yy_stack_print ((Bottom), (Top)); \
798 /*------------------------------------------------.
799 | Report that the YYRULE is going to be reduced. |
800 `------------------------------------------------*/
802 #if (defined __STDC__ || defined __C99__FUNC__ \
803 || defined __cplusplus || defined _MSC_VER)
805 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
808 yy_reduce_print (yyvsp, yyrule)
813 int yynrhs = yyr2[yyrule];
815 unsigned long int yylno = yyrline[yyrule];
816 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
818 /* The symbols being reduced. */
819 for (yyi = 0; yyi < yynrhs; yyi++)
821 YYFPRINTF (stderr, " $%d = ", yyi + 1);
822 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
823 &(yyvsp[(yyi + 1) - (yynrhs)])
825 YYFPRINTF (stderr, "\n");
829 # define YY_REDUCE_PRINT(Rule) \
832 yy_reduce_print (yyvsp, Rule); \
835 /* Nonzero means print parse trace. It is left uninitialized so that
836 multiple parsers can coexist. */
839 # define YYDPRINTF(Args)
840 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
841 # define YY_STACK_PRINT(Bottom, Top)
842 # define YY_REDUCE_PRINT(Rule)
843 #endif /* !YYDEBUG */
846 /* YYINITDEPTH -- initial size of the parser's stacks. */
848 # define YYINITDEPTH 200
851 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
852 if the built-in stack extension method is used).
854 Do not make this value too large; the results are undefined if
855 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
856 evaluated with infinite-precision integer arithmetic. */
859 # define YYMAXDEPTH 10000
866 # if defined __GLIBC__ && defined _STRING_H
867 # define yystrlen strlen
869 /* Return the length of YYSTR. */
870 #if (defined __STDC__ || defined __C99__FUNC__ \
871 || defined __cplusplus || defined _MSC_VER)
873 yystrlen (const char *yystr)
881 for (yylen = 0; yystr[yylen]; yylen++)
889 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
890 # define yystpcpy stpcpy
892 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
894 #if (defined __STDC__ || defined __C99__FUNC__ \
895 || defined __cplusplus || defined _MSC_VER)
897 yystpcpy (char *yydest, const char *yysrc)
900 yystpcpy (yydest, yysrc)
906 const char *yys = yysrc;
908 while ((*yyd++ = *yys++) != '\0')
917 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
918 quotes and backslashes, so that it's suitable for yyerror. The
919 heuristic is that double-quoting is unnecessary unless the string
920 contains an apostrophe, a comma, or backslash (other than
921 backslash-backslash). YYSTR is taken from yytname. If YYRES is
922 null, do not copy; instead, return the length of what the result
925 yytnamerr (char *yyres, const char *yystr)
930 char const *yyp = yystr;
937 goto do_not_strip_quotes;
941 goto do_not_strip_quotes;
954 do_not_strip_quotes: ;
958 return yystrlen (yystr);
960 return yystpcpy (yyres, yystr) - yyres;
964 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
965 about the unexpected token YYTOKEN for the state stack whose top is
968 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
969 not large enough to hold the message. In that case, also set
970 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
971 required number of bytes is too large to store. */
973 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
974 yytype_int16 *yyssp, int yytoken)
976 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]);
977 YYSIZE_T yysize = yysize0;
979 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
980 /* Internationalized format string. */
981 const char *yyformat = 0;
982 /* Arguments of yyformat. */
983 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
984 /* Number of reported tokens (one for the "unexpected", one per
988 /* There are many possibilities here to consider:
989 - Assume YYFAIL is not used. It's too flawed to consider. See
990 <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
991 for details. YYERROR is fine as it does not invoke this
993 - If this state is a consistent state with a default action, then
994 the only way this function was invoked is if the default action
995 is an error action. In that case, don't check for expected
996 tokens because there are none.
997 - The only way there can be no lookahead present (in yychar) is if
998 this state is a consistent state with a default action. Thus,
999 detecting the absence of a lookahead is sufficient to determine
1000 that there is no unexpected or expected token to report. In that
1001 case, just report a simple "syntax error".
1002 - Don't assume there isn't a lookahead just because this state is a
1003 consistent state with a default action. There might have been a
1004 previous inconsistent state, consistent state with a non-default
1005 action, or user semantic action that manipulated yychar.
1006 - Of course, the expected token list depends on states to have
1007 correct lookahead information, and it depends on the parser not
1008 to perform extra reductions after fetching a lookahead from the
1009 scanner and before detecting a syntax error. Thus, state merging
1010 (from LALR or IELR) and default reductions corrupt the expected
1011 token list. However, the list is correct for canonical LR with
1012 one exception: it will still contain any token that will not be
1013 accepted due to an error action in a later state.
1015 if (yytoken != YYEMPTY)
1017 int yyn = yypact[*yyssp];
1018 yyarg[yycount++] = yytname[yytoken];
1019 if (!yypact_value_is_default (yyn))
1021 /* Start YYX at -YYN if negative to avoid negative indexes in
1022 YYCHECK. In other words, skip the first -YYN actions for
1023 this state because they are default actions. */
1024 int yyxbegin = yyn < 0 ? -yyn : 0;
1025 /* Stay within bounds of both yycheck and yytname. */
1026 int yychecklim = YYLAST - yyn + 1;
1027 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1030 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1031 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1032 && !yytable_value_is_error (yytable[yyx + yyn]))
1034 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1040 yyarg[yycount++] = yytname[yyx];
1041 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1042 if (! (yysize <= yysize1
1043 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1052 # define YYCASE_(N, S) \
1056 YYCASE_(0, YY_("syntax error"));
1057 YYCASE_(1, YY_("syntax error, unexpected %s"));
1058 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1059 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1060 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1061 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1065 yysize1 = yysize + yystrlen (yyformat);
1066 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1070 if (*yymsg_alloc < yysize)
1072 *yymsg_alloc = 2 * yysize;
1073 if (! (yysize <= *yymsg_alloc
1074 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1075 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1079 /* Avoid sprintf, as that infringes on the user's name space.
1080 Don't have undefined behavior even if the translation
1081 produced a string with the wrong number of "%s"s. */
1085 while ((*yyp = *yyformat) != '\0')
1086 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1088 yyp += yytnamerr (yyp, yyarg[yyi++]);
1099 #endif /* YYERROR_VERBOSE */
1101 /*-----------------------------------------------.
1102 | Release the memory associated to this symbol. |
1103 `-----------------------------------------------*/
1106 #if (defined __STDC__ || defined __C99__FUNC__ \
1107 || defined __cplusplus || defined _MSC_VER)
1109 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1112 yydestruct (yymsg, yytype, yyvaluep)
1122 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1133 /* Prevent warnings from -Wmissing-prototypes. */
1134 #ifdef YYPARSE_PARAM
1135 #if defined __STDC__ || defined __cplusplus
1136 int yyparse (void *YYPARSE_PARAM);
1140 #else /* ! YYPARSE_PARAM */
1141 #if defined __STDC__ || defined __cplusplus
1146 #endif /* ! YYPARSE_PARAM */
1149 /* The lookahead symbol. */
1152 /* The semantic value of the lookahead symbol. */
1155 /* Number of syntax errors so far. */
1163 #ifdef YYPARSE_PARAM
1164 #if (defined __STDC__ || defined __C99__FUNC__ \
1165 || defined __cplusplus || defined _MSC_VER)
1167 yyparse (void *YYPARSE_PARAM)
1170 yyparse (YYPARSE_PARAM)
1171 void *YYPARSE_PARAM;
1173 #else /* ! YYPARSE_PARAM */
1174 #if (defined __STDC__ || defined __C99__FUNC__ \
1175 || defined __cplusplus || defined _MSC_VER)
1186 /* Number of tokens to shift before error messages enabled. */
1189 /* The stacks and their tools:
1190 `yyss': related to states.
1191 `yyvs': related to semantic values.
1193 Refer to the stacks thru separate pointers, to allow yyoverflow
1194 to reallocate them elsewhere. */
1196 /* The state stack. */
1197 yytype_int16 yyssa[YYINITDEPTH];
1199 yytype_int16 *yyssp;
1201 /* The semantic value stack. */
1202 YYSTYPE yyvsa[YYINITDEPTH];
1206 YYSIZE_T yystacksize;
1210 /* Lookahead token as an internal (translated) token number. */
1212 /* The variables used to return semantic value and location from the
1217 /* Buffer for error messages, and its allocated size. */
1219 char *yymsg = yymsgbuf;
1220 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1223 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1225 /* The number of symbols on the RHS of the reduced rule.
1226 Keep to zero when no symbol should be popped. */
1232 yystacksize = YYINITDEPTH;
1234 YYDPRINTF ((stderr, "Starting parse\n"));
1239 yychar = YYEMPTY; /* Cause a token to be read. */
1241 /* Initialize stack pointers.
1242 Waste one element of value and location stack
1243 so that they stay on the same level as the state stack.
1244 The wasted elements are never initialized. */
1250 /*------------------------------------------------------------.
1251 | yynewstate -- Push a new state, which is found in yystate. |
1252 `------------------------------------------------------------*/
1254 /* In all cases, when you get here, the value and location stacks
1255 have just been pushed. So pushing a state here evens the stacks. */
1261 if (yyss + yystacksize - 1 <= yyssp)
1263 /* Get the current used size of the three stacks, in elements. */
1264 YYSIZE_T yysize = yyssp - yyss + 1;
1268 /* Give user a chance to reallocate the stack. Use copies of
1269 these so that the &'s don't force the real ones into
1271 YYSTYPE *yyvs1 = yyvs;
1272 yytype_int16 *yyss1 = yyss;
1274 /* Each stack pointer address is followed by the size of the
1275 data in use in that stack, in bytes. This used to be a
1276 conditional around just the two extra args, but that might
1277 be undefined if yyoverflow is a macro. */
1278 yyoverflow (YY_("memory exhausted"),
1279 &yyss1, yysize * sizeof (*yyssp),
1280 &yyvs1, yysize * sizeof (*yyvsp),
1286 #else /* no yyoverflow */
1287 # ifndef YYSTACK_RELOCATE
1288 goto yyexhaustedlab;
1290 /* Extend the stack our own way. */
1291 if (YYMAXDEPTH <= yystacksize)
1292 goto yyexhaustedlab;
1294 if (YYMAXDEPTH < yystacksize)
1295 yystacksize = YYMAXDEPTH;
1298 yytype_int16 *yyss1 = yyss;
1299 union yyalloc *yyptr =
1300 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1302 goto yyexhaustedlab;
1303 YYSTACK_RELOCATE (yyss_alloc, yyss);
1304 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1305 # undef YYSTACK_RELOCATE
1307 YYSTACK_FREE (yyss1);
1310 #endif /* no yyoverflow */
1312 yyssp = yyss + yysize - 1;
1313 yyvsp = yyvs + yysize - 1;
1315 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1316 (unsigned long int) yystacksize));
1318 if (yyss + yystacksize - 1 <= yyssp)
1322 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1324 if (yystate == YYFINAL)
1334 /* Do appropriate processing given the current state. Read a
1335 lookahead token if we need one and don't already have one. */
1337 /* First try to decide what to do without reference to lookahead token. */
1338 yyn = yypact[yystate];
1339 if (yypact_value_is_default (yyn))
1342 /* Not known => get a lookahead token if don't already have one. */
1344 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1345 if (yychar == YYEMPTY)
1347 YYDPRINTF ((stderr, "Reading a token: "));
1351 if (yychar <= YYEOF)
1353 yychar = yytoken = YYEOF;
1354 YYDPRINTF ((stderr, "Now at end of input.\n"));
1358 yytoken = YYTRANSLATE (yychar);
1359 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1362 /* If the proper action on seeing token YYTOKEN is to reduce or to
1363 detect an error, take that action. */
1365 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1370 if (yytable_value_is_error (yyn))
1376 /* Count tokens shifted since error; after three, turn off error
1381 /* Shift the lookahead token. */
1382 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1384 /* Discard the shifted token. */
1393 /*-----------------------------------------------------------.
1394 | yydefault -- do the default action for the current state. |
1395 `-----------------------------------------------------------*/
1397 yyn = yydefact[yystate];
1403 /*-----------------------------.
1404 | yyreduce -- Do a reduction. |
1405 `-----------------------------*/
1407 /* yyn is the number of a rule to reduce with. */
1410 /* If YYLEN is nonzero, implement the default value of the action:
1413 Otherwise, the following line sets YYVAL to garbage.
1414 This behavior is undocumented and Bison
1415 users should not rely upon it. Assigning to YYVAL
1416 unconditionally makes the parser a bit smaller, and it avoids a
1417 GCC warning that YYVAL may be used uninitialized. */
1418 yyval = yyvsp[1-yylen];
1421 YY_REDUCE_PRINT (yyn);
1426 /* Line 1806 of yacc.c */
1427 #line 58 "spotlight_rawquery_parser.y"
1429 ssp_result = talloc_asprintf(ssp_slq,
1430 "SELECT DISTINCT ?url WHERE "
1431 "{ ?x nie:url ?url FILTER(fn:starts-with(?url, 'file://%s/')) . %s}",
1432 ssp_slq->slq_vol->v_path, (yyvsp[(1) - (1)].sval));
1433 (yyval.sval) = ssp_result;
1439 /* Line 1806 of yacc.c */
1440 #line 68 "spotlight_rawquery_parser.y"
1442 if (strcmp((yyvsp[(1) - (3)].sval), (yyvsp[(3) - (3)].sval)) != 0)
1443 (yyval.sval) = talloc_asprintf(ssp_slq, "{ %s } UNION { %s }", (yyvsp[(1) - (3)].sval), (yyvsp[(3) - (3)].sval));
1445 (yyval.sval) = talloc_asprintf(ssp_slq, "%s", (yyvsp[(1) - (3)].sval));
1451 /* Line 1806 of yacc.c */
1452 #line 74 "spotlight_rawquery_parser.y"
1453 {(yyval.sval) = (yyvsp[(1) - (1)].sval);}
1458 /* Line 1806 of yacc.c */
1459 #line 75 "spotlight_rawquery_parser.y"
1460 {(yyval.sval) = (yyvsp[(1) - (1)].sval);}
1465 /* Line 1806 of yacc.c */
1466 #line 76 "spotlight_rawquery_parser.y"
1467 {(yyval.sval) = talloc_asprintf(ssp_slq, "%s", (yyvsp[(2) - (3)].sval));}
1472 /* Line 1806 of yacc.c */
1473 #line 77 "spotlight_rawquery_parser.y"
1474 {(yyval.sval) = talloc_asprintf(ssp_slq, "%s . %s", (yyvsp[(1) - (3)].sval), (yyvsp[(3) - (3)].sval));}
1479 /* Line 1806 of yacc.c */
1480 #line 78 "spotlight_rawquery_parser.y"
1482 if (strcmp((yyvsp[(1) - (3)].sval), (yyvsp[(3) - (3)].sval)) != 0)
1483 (yyval.sval) = talloc_asprintf(ssp_slq, "{ %s } UNION { %s }", (yyvsp[(1) - (3)].sval), (yyvsp[(3) - (3)].sval));
1485 (yyval.sval) = talloc_asprintf(ssp_slq, "%s", (yyvsp[(1) - (3)].sval));
1491 /* Line 1806 of yacc.c */
1492 #line 87 "spotlight_rawquery_parser.y"
1493 {(yyval.sval) = map_expr((yyvsp[(1) - (5)].sval), (yyvsp[(4) - (5)].sval));}
1498 /* Line 1806 of yacc.c */
1499 #line 91 "spotlight_rawquery_parser.y"
1500 {(yyval.sval) = map_daterange((yyvsp[(3) - (14)].sval), (yyvsp[(7) - (14)].sval), (yyvsp[(12) - (14)].sval));}
1505 /* Line 1806 of yacc.c */
1506 #line 1507 "spotlight_rawquery_parser.c"
1509 /* User semantic actions sometimes alter yychar, and that requires
1510 that yytoken be updated with the new translation. We take the
1511 approach of translating immediately before every use of yytoken.
1512 One alternative is translating here after every semantic action,
1513 but that translation would be missed if the semantic action invokes
1514 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1515 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
1516 incorrect destructor might then be invoked immediately. In the
1517 case of YYERROR or YYBACKUP, subsequent parser actions might lead
1518 to an incorrect destructor call or verbose syntax error message
1519 before the lookahead is translated. */
1520 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1524 YY_STACK_PRINT (yyss, yyssp);
1528 /* Now `shift' the result of the reduction. Determine what state
1529 that goes to, based on the state we popped back to and the rule
1530 number reduced by. */
1534 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1535 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1536 yystate = yytable[yystate];
1538 yystate = yydefgoto[yyn - YYNTOKENS];
1543 /*------------------------------------.
1544 | yyerrlab -- here on detecting error |
1545 `------------------------------------*/
1547 /* Make sure we have latest lookahead translation. See comments at
1548 user semantic actions for why this is necessary. */
1549 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
1551 /* If not already recovering from an error, report this error. */
1555 #if ! YYERROR_VERBOSE
1556 yyerror (YY_("syntax error"));
1558 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
1561 char const *yymsgp = YY_("syntax error");
1562 int yysyntax_error_status;
1563 yysyntax_error_status = YYSYNTAX_ERROR;
1564 if (yysyntax_error_status == 0)
1566 else if (yysyntax_error_status == 1)
1568 if (yymsg != yymsgbuf)
1569 YYSTACK_FREE (yymsg);
1570 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
1574 yymsg_alloc = sizeof yymsgbuf;
1575 yysyntax_error_status = 2;
1579 yysyntax_error_status = YYSYNTAX_ERROR;
1584 if (yysyntax_error_status == 2)
1585 goto yyexhaustedlab;
1587 # undef YYSYNTAX_ERROR
1593 if (yyerrstatus == 3)
1595 /* If just tried and failed to reuse lookahead token after an
1596 error, discard it. */
1598 if (yychar <= YYEOF)
1600 /* Return failure if at end of input. */
1601 if (yychar == YYEOF)
1606 yydestruct ("Error: discarding",
1612 /* Else will try to reuse lookahead token after shifting the error
1617 /*---------------------------------------------------.
1618 | yyerrorlab -- error raised explicitly by YYERROR. |
1619 `---------------------------------------------------*/
1622 /* Pacify compilers like GCC when the user code never invokes
1623 YYERROR and the label yyerrorlab therefore never appears in user
1625 if (/*CONSTCOND*/ 0)
1628 /* Do not reclaim the symbols of the rule which action triggered
1632 YY_STACK_PRINT (yyss, yyssp);
1637 /*-------------------------------------------------------------.
1638 | yyerrlab1 -- common code for both syntax error and YYERROR. |
1639 `-------------------------------------------------------------*/
1641 yyerrstatus = 3; /* Each real token shifted decrements this. */
1645 yyn = yypact[yystate];
1646 if (!yypact_value_is_default (yyn))
1649 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1657 /* Pop the current state because it cannot handle the error token. */
1662 yydestruct ("Error: popping",
1663 yystos[yystate], yyvsp);
1666 YY_STACK_PRINT (yyss, yyssp);
1672 /* Shift the error token. */
1673 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1679 /*-------------------------------------.
1680 | yyacceptlab -- YYACCEPT comes here. |
1681 `-------------------------------------*/
1686 /*-----------------------------------.
1687 | yyabortlab -- YYABORT comes here. |
1688 `-----------------------------------*/
1693 #if !defined(yyoverflow) || YYERROR_VERBOSE
1694 /*-------------------------------------------------.
1695 | yyexhaustedlab -- memory exhaustion comes here. |
1696 `-------------------------------------------------*/
1698 yyerror (YY_("memory exhausted"));
1704 if (yychar != YYEMPTY)
1706 /* Make sure we have latest lookahead translation. See comments at
1707 user semantic actions for why this is necessary. */
1708 yytoken = YYTRANSLATE (yychar);
1709 yydestruct ("Cleanup: discarding lookahead",
1712 /* Do not reclaim the symbols of the rule which action triggered
1713 this YYABORT or YYACCEPT. */
1715 YY_STACK_PRINT (yyss, yyssp);
1716 while (yyssp != yyss)
1718 yydestruct ("Cleanup: popping",
1719 yystos[*yyssp], yyvsp);
1724 YYSTACK_FREE (yyss);
1727 if (yymsg != yymsgbuf)
1728 YYSTACK_FREE (yymsg);
1730 /* Make sure YYID is used. */
1731 return YYID (yyresult);
1736 /* Line 2067 of yacc.c */
1737 #line 94 "spotlight_rawquery_parser.y"
1740 const char *map_daterange(const char *dateattr, const char *date1, const char *date2)
1742 char *result = NULL;
1743 struct spotlight_sparql_map *p;
1745 for (p = spotlight_sparql_map; p->ssm_spotlight_attr; p++) {
1746 if (strcmp(dateattr, p->ssm_spotlight_attr) == 0) {
1747 result = talloc_asprintf(ssp_slq,
1748 "?x %s ?d FILTER (?d > '%s' && ?d < '%s')",
1759 const char *map_expr(const char *attr, const char *val)
1761 char *result = NULL;
1762 struct spotlight_sparql_map *p;
1764 for (p = spotlight_sparql_map; p->ssm_spotlight_attr; p++) {
1765 if (strcmp(p->ssm_spotlight_attr, attr) == 0) {
1766 result = talloc_asprintf(ssp_slq, p->ssm_sparql_query_fmtstr, val);
1774 void yyerror(const char *str)
1777 printf("yyerror: %s\n", str);
1779 LOG(log_error, logtype_sl, "yyerror: %s", str);
1788 const gchar *map_spotlight_to_sparql_query(slq_t *slq)
1791 YY_BUFFER_STATE s = NULL;
1794 s = yy_scan_string(slq->slq_qstring);
1796 EC_ZERO( yyparse() );
1800 yy_delete_buffer(s);
1806 int main(int argc, char **argv)
1811 printf("usage: %s QUERY\n", argv[0]);
1815 ssp_slq = talloc_zero(NULL, slq_t);
1816 struct vol *vol = talloc_zero(ssp_slq, struct vol);
1817 vol->v_path = "/Volumes/test";
1818 ssp_slq->slq_vol = vol;
1820 s = yy_scan_string(argv[1]);
1824 yy_delete_buffer(s);
1826 printf("SPARQL: %s\n", ssp_result);