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 "spotlight_SPARQL_map.h"
78 #include "spotlight.h"
80 struct yy_buffer_state;
81 typedef struct yy_buffer_state *YY_BUFFER_STATE;
82 extern int yylex (void);
83 extern void yyerror (char const *);
84 extern void *yyterminate(void);
85 extern YY_BUFFER_STATE yy_scan_string( const char *str);
86 extern void yy_delete_buffer ( YY_BUFFER_STATE buffer );
88 static const char *map_expr(const char *attr, const char *val);
89 static const char *map_daterange(const char *dateattr, const char *date1, const char *date2);
96 /* Line 268 of yacc.c */
97 #line 98 "spotlight_rawquery_parser.c"
99 /* Enabling traces. */
104 /* Enabling verbose error messages. */
105 #ifdef YYERROR_VERBOSE
106 # undef YYERROR_VERBOSE
107 # define YYERROR_VERBOSE 1
109 # define YYERROR_VERBOSE 1
112 /* Enabling the token table. */
113 #ifndef YYTOKEN_TABLE
114 # define YYTOKEN_TABLE 0
121 /* Put the tokens into the symbol table, so that GDB and other debuggers
140 #define FUNC_INRANGE 260
141 #define DATE_SPEC 261
153 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
154 typedef union YYSTYPE
157 /* Line 293 of yacc.c */
158 #line 33 "spotlight_rawquery_parser.y"
165 /* Line 293 of yacc.c */
166 #line 167 "spotlight_rawquery_parser.c"
168 # define YYSTYPE_IS_TRIVIAL 1
169 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
170 # define YYSTYPE_IS_DECLARED 1
173 /* "%code provides" blocks. */
175 /* Line 340 of yacc.c */
176 #line 27 "spotlight_rawquery_parser.y"
178 extern const gchar *map_spotlight_to_sparql_query(slq_t *slq);
179 extern slq_t *ssp_slq;
180 extern gchar *ssp_result;
184 /* Line 340 of yacc.c */
185 #line 186 "spotlight_rawquery_parser.c"
187 /* Copy the second part of user declarations. */
190 /* Line 343 of yacc.c */
191 #line 192 "spotlight_rawquery_parser.c"
198 typedef YYTYPE_UINT8 yytype_uint8;
200 typedef unsigned char yytype_uint8;
204 typedef YYTYPE_INT8 yytype_int8;
205 #elif (defined __STDC__ || defined __C99__FUNC__ \
206 || defined __cplusplus || defined _MSC_VER)
207 typedef signed char yytype_int8;
209 typedef short int yytype_int8;
213 typedef YYTYPE_UINT16 yytype_uint16;
215 typedef unsigned short int yytype_uint16;
219 typedef YYTYPE_INT16 yytype_int16;
221 typedef short int yytype_int16;
225 # ifdef __SIZE_TYPE__
226 # define YYSIZE_T __SIZE_TYPE__
227 # elif defined size_t
228 # define YYSIZE_T size_t
229 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
230 || defined __cplusplus || defined _MSC_VER)
231 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
232 # define YYSIZE_T size_t
234 # define YYSIZE_T unsigned int
238 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
241 # if defined YYENABLE_NLS && YYENABLE_NLS
243 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
244 # define YY_(msgid) dgettext ("bison-runtime", msgid)
248 # define YY_(msgid) msgid
252 /* Suppress unused-variable warnings by "using" E. */
253 #if ! defined lint || defined __GNUC__
254 # define YYUSE(e) ((void) (e))
256 # define YYUSE(e) /* empty */
259 /* Identity function, used to suppress warnings about constant conditions. */
263 #if (defined __STDC__ || defined __C99__FUNC__ \
264 || defined __cplusplus || defined _MSC_VER)
277 #if ! defined yyoverflow || YYERROR_VERBOSE
279 /* The parser invokes alloca or malloc; define the necessary symbols. */
281 # ifdef YYSTACK_USE_ALLOCA
282 # if YYSTACK_USE_ALLOCA
284 # define YYSTACK_ALLOC __builtin_alloca
285 # elif defined __BUILTIN_VA_ARG_INCR
286 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
288 # define YYSTACK_ALLOC __alloca
289 # elif defined _MSC_VER
290 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
291 # define alloca _alloca
293 # define YYSTACK_ALLOC alloca
294 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
295 || defined __cplusplus || defined _MSC_VER)
296 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
297 # ifndef EXIT_SUCCESS
298 # define EXIT_SUCCESS 0
305 # ifdef YYSTACK_ALLOC
306 /* Pacify GCC's `empty if-body' warning. */
307 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
308 # ifndef YYSTACK_ALLOC_MAXIMUM
309 /* The OS might guarantee only one guard page at the bottom of the stack,
310 and a page size can be as small as 4096 bytes. So we cannot safely
311 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
312 to allow for a few compiler-allocated temporary stack slots. */
313 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
316 # define YYSTACK_ALLOC YYMALLOC
317 # define YYSTACK_FREE YYFREE
318 # ifndef YYSTACK_ALLOC_MAXIMUM
319 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
321 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
322 && ! ((defined YYMALLOC || defined malloc) \
323 && (defined YYFREE || defined free)))
324 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
325 # ifndef EXIT_SUCCESS
326 # define EXIT_SUCCESS 0
330 # define YYMALLOC malloc
331 # if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
332 || defined __cplusplus || defined _MSC_VER)
333 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
338 # if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
339 || defined __cplusplus || defined _MSC_VER)
340 void free (void *); /* INFRINGES ON USER NAME SPACE */
344 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
347 #if (! defined yyoverflow \
348 && (! defined __cplusplus \
349 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
351 /* A type that is properly aligned for any stack member. */
354 yytype_int16 yyss_alloc;
358 /* The size of the maximum gap between one aligned stack and the next. */
359 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
361 /* The size of an array large to enough to hold all stacks, each with
363 # define YYSTACK_BYTES(N) \
364 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
365 + YYSTACK_GAP_MAXIMUM)
367 # define YYCOPY_NEEDED 1
369 /* Relocate STACK from its old location to the new one. The
370 local variables YYSIZE and YYSTACKSIZE give the old and new number of
371 elements in the stack, and YYPTR gives the new location of the
372 stack. Advance YYPTR to a properly aligned location for the next
374 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
377 YYSIZE_T yynewbytes; \
378 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
379 Stack = &yyptr->Stack_alloc; \
380 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
381 yyptr += yynewbytes / sizeof (*yyptr); \
387 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
388 /* Copy COUNT objects from FROM to TO. The source and destination do
391 # if defined __GNUC__ && 1 < __GNUC__
392 # define YYCOPY(To, From, Count) \
393 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
395 # define YYCOPY(To, From, Count) \
399 for (yyi = 0; yyi < (Count); yyi++) \
400 (To)[yyi] = (From)[yyi]; \
405 #endif /* !YYCOPY_NEEDED */
407 /* YYFINAL -- State number of the termination state. */
409 /* YYLAST -- Last index in YYTABLE. */
412 /* YYNTOKENS -- Number of terminals. */
414 /* YYNNTS -- Number of nonterminals. */
416 /* YYNRULES -- Number of rules. */
418 /* YYNRULES -- Number of states. */
421 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
423 #define YYMAXUTOK 268
425 #define YYTRANSLATE(YYX) \
426 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
428 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
429 static const yytype_uint8 yytranslate[] =
431 0, 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, 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, 1, 2, 3, 4,
457 5, 6, 7, 8, 9, 10, 11, 12, 13
461 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
463 static const yytype_uint8 yyprhs[] =
465 0, 0, 3, 4, 7, 9, 13, 15, 17, 21,
469 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
470 static const yytype_int8 yyrhs[] =
472 15, 0, -1, -1, 15, 16, -1, 17, -1, 18,
473 13, 18, -1, 18, -1, 19, -1, 7, 17, 8,
474 -1, 17, 12, 17, -1, 17, 13, 17, -1, 4,
475 9, 11, 4, 11, -1, 5, 7, 4, 10, 6,
476 7, 3, 8, 10, 6, 7, 3, 8, 8, -1
479 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
480 static const yytype_uint8 yyrline[] =
482 0, 51, 51, 53, 57, 67, 73, 74, 75, 76,
487 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
488 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
489 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
490 static const char *const yytname[] =
492 "$end", "error", "$undefined", "DATE", "WORD", "FUNC_INRANGE",
493 "DATE_SPEC", "OBRACE", "CBRACE", "EQUAL", "COMMA", "QUOTE", "AND", "OR",
494 "$accept", "input", "line", "expr", "match", "function", 0
499 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
501 static const yytype_uint16 yytoknum[] =
503 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
508 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
509 static const yytype_uint8 yyr1[] =
511 0, 14, 15, 15, 16, 17, 17, 17, 17, 17,
515 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
516 static const yytype_uint8 yyr2[] =
518 0, 2, 0, 2, 1, 3, 1, 1, 3, 3,
522 /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
523 Performed when YYTABLE doesn't specify something else to do. Zero
524 means the default is an error. */
525 static const yytype_uint8 yydefact[] =
527 2, 0, 1, 0, 0, 0, 3, 4, 6, 7,
528 0, 0, 0, 0, 0, 0, 0, 0, 8, 9,
529 10, 5, 0, 0, 11, 0, 0, 0, 0, 0,
533 /* YYDEFGOTO[NTERM-NUM]. */
534 static const yytype_int8 yydefgoto[] =
539 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
541 #define YYPACT_NINF -7
542 static const yytype_int8 yypact[] =
544 -7, 6, -7, -6, -2, -3, -7, 2, 5, -7,
545 -4, 15, 4, -3, -3, 16, 17, 12, -7, 10,
546 -7, -7, 13, 19, -7, 20, 23, 21, 18, 24,
550 /* YYPGOTO[NTERM-NUM]. */
551 static const yytype_int8 yypgoto[] =
553 -7, -7, -7, -5, 22, -7
556 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
557 positive, shift that token. If negative, reduce the rule which
558 number is the opposite. If YYTABLE_NINF, syntax error. */
559 #define YYTABLE_NINF -1
560 static const yytype_uint8 yytable[] =
562 12, 3, 4, 10, 5, 11, 2, 16, 19, 20,
563 3, 4, 18, 5, 13, 14, 13, 14, 15, 17,
564 3, 22, 23, 14, 24, 25, 27, 26, 29, 28,
565 30, 32, 31, 0, 33, 34, 0, 21
568 #define yypact_value_is_default(yystate) \
571 #define yytable_value_is_error(yytable_value) \
574 static const yytype_int8 yycheck[] =
576 5, 4, 5, 9, 7, 7, 0, 11, 13, 14,
577 4, 5, 8, 7, 12, 13, 12, 13, 13, 4,
578 4, 4, 10, 13, 11, 6, 3, 7, 10, 8,
579 6, 3, 7, -1, 8, 8, -1, 15
582 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
583 symbol of state STATE-NUM. */
584 static const yytype_uint8 yystos[] =
586 0, 15, 0, 4, 5, 7, 16, 17, 18, 19,
587 9, 7, 17, 12, 13, 13, 11, 4, 8, 17,
588 17, 18, 4, 10, 11, 6, 7, 3, 8, 10,
592 #define yyerrok (yyerrstatus = 0)
593 #define yyclearin (yychar = YYEMPTY)
597 #define YYACCEPT goto yyacceptlab
598 #define YYABORT goto yyabortlab
599 #define YYERROR goto yyerrorlab
602 /* Like YYERROR except do call yyerror. This remains here temporarily
603 to ease the transition to the new meaning of YYERROR, for GCC.
604 Once GCC version 2 has supplanted version 1, this can go. However,
605 YYFAIL appears to be in use. Nevertheless, it is formally deprecated
606 in Bison 2.4.2's NEWS entry, where a plan to phase it out is
609 #define YYFAIL goto yyerrlab
611 /* This is here to suppress warnings from the GCC cpp's
612 -Wunused-macros. Normally we don't worry about that warning, but
613 some users do, and we want to make it easy for users to remove
614 YYFAIL uses, which will produce warnings from Bison 2.5. */
617 #define YYRECOVERING() (!!yyerrstatus)
619 #define YYBACKUP(Token, Value) \
621 if (yychar == YYEMPTY && yylen == 1) \
630 yyerror (YY_("syntax error: cannot back up")); \
637 #define YYERRCODE 256
640 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
641 If N is 0, then set CURRENT to the empty location which ends
642 the previous symbol: RHS[0] (always defined). */
644 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
645 #ifndef YYLLOC_DEFAULT
646 # define YYLLOC_DEFAULT(Current, Rhs, N) \
650 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
651 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
652 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
653 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
657 (Current).first_line = (Current).last_line = \
658 YYRHSLOC (Rhs, 0).last_line; \
659 (Current).first_column = (Current).last_column = \
660 YYRHSLOC (Rhs, 0).last_column; \
666 /* This macro is provided for backward compatibility. */
668 #ifndef YY_LOCATION_PRINT
669 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
673 /* YYLEX -- calling `yylex' with the right arguments. */
676 # define YYLEX yylex (YYLEX_PARAM)
678 # define YYLEX yylex ()
681 /* Enable debugging if requested. */
685 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
686 # define YYFPRINTF fprintf
689 # define YYDPRINTF(Args) \
695 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
699 YYFPRINTF (stderr, "%s ", Title); \
700 yy_symbol_print (stderr, \
702 YYFPRINTF (stderr, "\n"); \
707 /*--------------------------------.
708 | Print this symbol on YYOUTPUT. |
709 `--------------------------------*/
712 #if (defined __STDC__ || defined __C99__FUNC__ \
713 || defined __cplusplus || defined _MSC_VER)
715 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
718 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
721 YYSTYPE const * const yyvaluep;
727 if (yytype < YYNTOKENS)
728 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
740 /*--------------------------------.
741 | Print this symbol on YYOUTPUT. |
742 `--------------------------------*/
744 #if (defined __STDC__ || defined __C99__FUNC__ \
745 || defined __cplusplus || defined _MSC_VER)
747 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
750 yy_symbol_print (yyoutput, yytype, yyvaluep)
753 YYSTYPE const * const yyvaluep;
756 if (yytype < YYNTOKENS)
757 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
759 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
761 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
762 YYFPRINTF (yyoutput, ")");
765 /*------------------------------------------------------------------.
766 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
768 `------------------------------------------------------------------*/
770 #if (defined __STDC__ || defined __C99__FUNC__ \
771 || defined __cplusplus || defined _MSC_VER)
773 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
776 yy_stack_print (yybottom, yytop)
777 yytype_int16 *yybottom;
781 YYFPRINTF (stderr, "Stack now");
782 for (; yybottom <= yytop; yybottom++)
784 int yybot = *yybottom;
785 YYFPRINTF (stderr, " %d", yybot);
787 YYFPRINTF (stderr, "\n");
790 # define YY_STACK_PRINT(Bottom, Top) \
793 yy_stack_print ((Bottom), (Top)); \
797 /*------------------------------------------------.
798 | Report that the YYRULE is going to be reduced. |
799 `------------------------------------------------*/
801 #if (defined __STDC__ || defined __C99__FUNC__ \
802 || defined __cplusplus || defined _MSC_VER)
804 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
807 yy_reduce_print (yyvsp, yyrule)
812 int yynrhs = yyr2[yyrule];
814 unsigned long int yylno = yyrline[yyrule];
815 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
817 /* The symbols being reduced. */
818 for (yyi = 0; yyi < yynrhs; yyi++)
820 YYFPRINTF (stderr, " $%d = ", yyi + 1);
821 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
822 &(yyvsp[(yyi + 1) - (yynrhs)])
824 YYFPRINTF (stderr, "\n");
828 # define YY_REDUCE_PRINT(Rule) \
831 yy_reduce_print (yyvsp, Rule); \
834 /* Nonzero means print parse trace. It is left uninitialized so that
835 multiple parsers can coexist. */
838 # define YYDPRINTF(Args)
839 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
840 # define YY_STACK_PRINT(Bottom, Top)
841 # define YY_REDUCE_PRINT(Rule)
842 #endif /* !YYDEBUG */
845 /* YYINITDEPTH -- initial size of the parser's stacks. */
847 # define YYINITDEPTH 200
850 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
851 if the built-in stack extension method is used).
853 Do not make this value too large; the results are undefined if
854 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
855 evaluated with infinite-precision integer arithmetic. */
858 # define YYMAXDEPTH 10000
865 # if defined __GLIBC__ && defined _STRING_H
866 # define yystrlen strlen
868 /* Return the length of YYSTR. */
869 #if (defined __STDC__ || defined __C99__FUNC__ \
870 || defined __cplusplus || defined _MSC_VER)
872 yystrlen (const char *yystr)
880 for (yylen = 0; yystr[yylen]; yylen++)
888 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
889 # define yystpcpy stpcpy
891 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
893 #if (defined __STDC__ || defined __C99__FUNC__ \
894 || defined __cplusplus || defined _MSC_VER)
896 yystpcpy (char *yydest, const char *yysrc)
899 yystpcpy (yydest, yysrc)
905 const char *yys = yysrc;
907 while ((*yyd++ = *yys++) != '\0')
916 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
917 quotes and backslashes, so that it's suitable for yyerror. The
918 heuristic is that double-quoting is unnecessary unless the string
919 contains an apostrophe, a comma, or backslash (other than
920 backslash-backslash). YYSTR is taken from yytname. If YYRES is
921 null, do not copy; instead, return the length of what the result
924 yytnamerr (char *yyres, const char *yystr)
929 char const *yyp = yystr;
936 goto do_not_strip_quotes;
940 goto do_not_strip_quotes;
953 do_not_strip_quotes: ;
957 return yystrlen (yystr);
959 return yystpcpy (yyres, yystr) - yyres;
963 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
964 about the unexpected token YYTOKEN for the state stack whose top is
967 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
968 not large enough to hold the message. In that case, also set
969 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
970 required number of bytes is too large to store. */
972 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
973 yytype_int16 *yyssp, int yytoken)
975 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]);
976 YYSIZE_T yysize = yysize0;
978 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
979 /* Internationalized format string. */
980 const char *yyformat = 0;
981 /* Arguments of yyformat. */
982 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
983 /* Number of reported tokens (one for the "unexpected", one per
987 /* There are many possibilities here to consider:
988 - Assume YYFAIL is not used. It's too flawed to consider. See
989 <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
990 for details. YYERROR is fine as it does not invoke this
992 - If this state is a consistent state with a default action, then
993 the only way this function was invoked is if the default action
994 is an error action. In that case, don't check for expected
995 tokens because there are none.
996 - The only way there can be no lookahead present (in yychar) is if
997 this state is a consistent state with a default action. Thus,
998 detecting the absence of a lookahead is sufficient to determine
999 that there is no unexpected or expected token to report. In that
1000 case, just report a simple "syntax error".
1001 - Don't assume there isn't a lookahead just because this state is a
1002 consistent state with a default action. There might have been a
1003 previous inconsistent state, consistent state with a non-default
1004 action, or user semantic action that manipulated yychar.
1005 - Of course, the expected token list depends on states to have
1006 correct lookahead information, and it depends on the parser not
1007 to perform extra reductions after fetching a lookahead from the
1008 scanner and before detecting a syntax error. Thus, state merging
1009 (from LALR or IELR) and default reductions corrupt the expected
1010 token list. However, the list is correct for canonical LR with
1011 one exception: it will still contain any token that will not be
1012 accepted due to an error action in a later state.
1014 if (yytoken != YYEMPTY)
1016 int yyn = yypact[*yyssp];
1017 yyarg[yycount++] = yytname[yytoken];
1018 if (!yypact_value_is_default (yyn))
1020 /* Start YYX at -YYN if negative to avoid negative indexes in
1021 YYCHECK. In other words, skip the first -YYN actions for
1022 this state because they are default actions. */
1023 int yyxbegin = yyn < 0 ? -yyn : 0;
1024 /* Stay within bounds of both yycheck and yytname. */
1025 int yychecklim = YYLAST - yyn + 1;
1026 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1029 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1030 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1031 && !yytable_value_is_error (yytable[yyx + yyn]))
1033 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1039 yyarg[yycount++] = yytname[yyx];
1040 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1041 if (! (yysize <= yysize1
1042 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1051 # define YYCASE_(N, S) \
1055 YYCASE_(0, YY_("syntax error"));
1056 YYCASE_(1, YY_("syntax error, unexpected %s"));
1057 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1058 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1059 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1060 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1064 yysize1 = yysize + yystrlen (yyformat);
1065 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1069 if (*yymsg_alloc < yysize)
1071 *yymsg_alloc = 2 * yysize;
1072 if (! (yysize <= *yymsg_alloc
1073 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1074 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1078 /* Avoid sprintf, as that infringes on the user's name space.
1079 Don't have undefined behavior even if the translation
1080 produced a string with the wrong number of "%s"s. */
1084 while ((*yyp = *yyformat) != '\0')
1085 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1087 yyp += yytnamerr (yyp, yyarg[yyi++]);
1098 #endif /* YYERROR_VERBOSE */
1100 /*-----------------------------------------------.
1101 | Release the memory associated to this symbol. |
1102 `-----------------------------------------------*/
1105 #if (defined __STDC__ || defined __C99__FUNC__ \
1106 || defined __cplusplus || defined _MSC_VER)
1108 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1111 yydestruct (yymsg, yytype, yyvaluep)
1121 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1132 /* Prevent warnings from -Wmissing-prototypes. */
1133 #ifdef YYPARSE_PARAM
1134 #if defined __STDC__ || defined __cplusplus
1135 int yyparse (void *YYPARSE_PARAM);
1139 #else /* ! YYPARSE_PARAM */
1140 #if defined __STDC__ || defined __cplusplus
1145 #endif /* ! YYPARSE_PARAM */
1148 /* The lookahead symbol. */
1151 /* The semantic value of the lookahead symbol. */
1154 /* Number of syntax errors so far. */
1162 #ifdef YYPARSE_PARAM
1163 #if (defined __STDC__ || defined __C99__FUNC__ \
1164 || defined __cplusplus || defined _MSC_VER)
1166 yyparse (void *YYPARSE_PARAM)
1169 yyparse (YYPARSE_PARAM)
1170 void *YYPARSE_PARAM;
1172 #else /* ! YYPARSE_PARAM */
1173 #if (defined __STDC__ || defined __C99__FUNC__ \
1174 || defined __cplusplus || defined _MSC_VER)
1185 /* Number of tokens to shift before error messages enabled. */
1188 /* The stacks and their tools:
1189 `yyss': related to states.
1190 `yyvs': related to semantic values.
1192 Refer to the stacks thru separate pointers, to allow yyoverflow
1193 to reallocate them elsewhere. */
1195 /* The state stack. */
1196 yytype_int16 yyssa[YYINITDEPTH];
1198 yytype_int16 *yyssp;
1200 /* The semantic value stack. */
1201 YYSTYPE yyvsa[YYINITDEPTH];
1205 YYSIZE_T yystacksize;
1209 /* Lookahead token as an internal (translated) token number. */
1211 /* The variables used to return semantic value and location from the
1216 /* Buffer for error messages, and its allocated size. */
1218 char *yymsg = yymsgbuf;
1219 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1222 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1224 /* The number of symbols on the RHS of the reduced rule.
1225 Keep to zero when no symbol should be popped. */
1231 yystacksize = YYINITDEPTH;
1233 YYDPRINTF ((stderr, "Starting parse\n"));
1238 yychar = YYEMPTY; /* Cause a token to be read. */
1240 /* Initialize stack pointers.
1241 Waste one element of value and location stack
1242 so that they stay on the same level as the state stack.
1243 The wasted elements are never initialized. */
1249 /*------------------------------------------------------------.
1250 | yynewstate -- Push a new state, which is found in yystate. |
1251 `------------------------------------------------------------*/
1253 /* In all cases, when you get here, the value and location stacks
1254 have just been pushed. So pushing a state here evens the stacks. */
1260 if (yyss + yystacksize - 1 <= yyssp)
1262 /* Get the current used size of the three stacks, in elements. */
1263 YYSIZE_T yysize = yyssp - yyss + 1;
1267 /* Give user a chance to reallocate the stack. Use copies of
1268 these so that the &'s don't force the real ones into
1270 YYSTYPE *yyvs1 = yyvs;
1271 yytype_int16 *yyss1 = yyss;
1273 /* Each stack pointer address is followed by the size of the
1274 data in use in that stack, in bytes. This used to be a
1275 conditional around just the two extra args, but that might
1276 be undefined if yyoverflow is a macro. */
1277 yyoverflow (YY_("memory exhausted"),
1278 &yyss1, yysize * sizeof (*yyssp),
1279 &yyvs1, yysize * sizeof (*yyvsp),
1285 #else /* no yyoverflow */
1286 # ifndef YYSTACK_RELOCATE
1287 goto yyexhaustedlab;
1289 /* Extend the stack our own way. */
1290 if (YYMAXDEPTH <= yystacksize)
1291 goto yyexhaustedlab;
1293 if (YYMAXDEPTH < yystacksize)
1294 yystacksize = YYMAXDEPTH;
1297 yytype_int16 *yyss1 = yyss;
1298 union yyalloc *yyptr =
1299 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1301 goto yyexhaustedlab;
1302 YYSTACK_RELOCATE (yyss_alloc, yyss);
1303 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1304 # undef YYSTACK_RELOCATE
1306 YYSTACK_FREE (yyss1);
1309 #endif /* no yyoverflow */
1311 yyssp = yyss + yysize - 1;
1312 yyvsp = yyvs + yysize - 1;
1314 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1315 (unsigned long int) yystacksize));
1317 if (yyss + yystacksize - 1 <= yyssp)
1321 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1323 if (yystate == YYFINAL)
1333 /* Do appropriate processing given the current state. Read a
1334 lookahead token if we need one and don't already have one. */
1336 /* First try to decide what to do without reference to lookahead token. */
1337 yyn = yypact[yystate];
1338 if (yypact_value_is_default (yyn))
1341 /* Not known => get a lookahead token if don't already have one. */
1343 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1344 if (yychar == YYEMPTY)
1346 YYDPRINTF ((stderr, "Reading a token: "));
1350 if (yychar <= YYEOF)
1352 yychar = yytoken = YYEOF;
1353 YYDPRINTF ((stderr, "Now at end of input.\n"));
1357 yytoken = YYTRANSLATE (yychar);
1358 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1361 /* If the proper action on seeing token YYTOKEN is to reduce or to
1362 detect an error, take that action. */
1364 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1369 if (yytable_value_is_error (yyn))
1375 /* Count tokens shifted since error; after three, turn off error
1380 /* Shift the lookahead token. */
1381 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1383 /* Discard the shifted token. */
1392 /*-----------------------------------------------------------.
1393 | yydefault -- do the default action for the current state. |
1394 `-----------------------------------------------------------*/
1396 yyn = yydefact[yystate];
1402 /*-----------------------------.
1403 | yyreduce -- Do a reduction. |
1404 `-----------------------------*/
1406 /* yyn is the number of a rule to reduce with. */
1409 /* If YYLEN is nonzero, implement the default value of the action:
1412 Otherwise, the following line sets YYVAL to garbage.
1413 This behavior is undocumented and Bison
1414 users should not rely upon it. Assigning to YYVAL
1415 unconditionally makes the parser a bit smaller, and it avoids a
1416 GCC warning that YYVAL may be used uninitialized. */
1417 yyval = yyvsp[1-yylen];
1420 YY_REDUCE_PRINT (yyn);
1425 /* Line 1806 of yacc.c */
1426 #line 57 "spotlight_rawquery_parser.y"
1428 ssp_result = talloc_asprintf(ssp_slq,
1429 "SELECT DISTINCT ?url WHERE "
1430 "{ ?x nie:url ?url FILTER(fn:starts-with(?url, 'file://%s/')) . %s}",
1431 ssp_slq->slq_vol->v_path, (yyvsp[(1) - (1)].sval));
1432 (yyval.sval) = ssp_result;
1438 /* Line 1806 of yacc.c */
1439 #line 67 "spotlight_rawquery_parser.y"
1441 if (strcmp((yyvsp[(1) - (3)].sval), (yyvsp[(3) - (3)].sval)) != 0)
1442 (yyval.sval) = talloc_asprintf(ssp_slq, "{ %s } UNION { %s }", (yyvsp[(1) - (3)].sval), (yyvsp[(3) - (3)].sval));
1444 (yyval.sval) = talloc_asprintf(ssp_slq, "%s", (yyvsp[(1) - (3)].sval));
1450 /* Line 1806 of yacc.c */
1451 #line 73 "spotlight_rawquery_parser.y"
1452 {(yyval.sval) = (yyvsp[(1) - (1)].sval);}
1457 /* Line 1806 of yacc.c */
1458 #line 74 "spotlight_rawquery_parser.y"
1459 {(yyval.sval) = (yyvsp[(1) - (1)].sval);}
1464 /* Line 1806 of yacc.c */
1465 #line 75 "spotlight_rawquery_parser.y"
1466 {(yyval.sval) = talloc_asprintf(ssp_slq, "%s", (yyvsp[(2) - (3)].sval));}
1471 /* Line 1806 of yacc.c */
1472 #line 76 "spotlight_rawquery_parser.y"
1473 {(yyval.sval) = talloc_asprintf(ssp_slq, "%s . %s", (yyvsp[(1) - (3)].sval), (yyvsp[(3) - (3)].sval));}
1478 /* Line 1806 of yacc.c */
1479 #line 77 "spotlight_rawquery_parser.y"
1481 if (strcmp((yyvsp[(1) - (3)].sval), (yyvsp[(3) - (3)].sval)) != 0)
1482 (yyval.sval) = talloc_asprintf(ssp_slq, "{ %s } UNION { %s }", (yyvsp[(1) - (3)].sval), (yyvsp[(3) - (3)].sval));
1484 (yyval.sval) = talloc_asprintf(ssp_slq, "%s", (yyvsp[(1) - (3)].sval));
1490 /* Line 1806 of yacc.c */
1491 #line 86 "spotlight_rawquery_parser.y"
1492 {(yyval.sval) = map_expr((yyvsp[(1) - (5)].sval), (yyvsp[(4) - (5)].sval));}
1497 /* Line 1806 of yacc.c */
1498 #line 90 "spotlight_rawquery_parser.y"
1499 {(yyval.sval) = map_daterange((yyvsp[(3) - (14)].sval), (yyvsp[(7) - (14)].sval), (yyvsp[(12) - (14)].sval));}
1504 /* Line 1806 of yacc.c */
1505 #line 1506 "spotlight_rawquery_parser.c"
1508 /* User semantic actions sometimes alter yychar, and that requires
1509 that yytoken be updated with the new translation. We take the
1510 approach of translating immediately before every use of yytoken.
1511 One alternative is translating here after every semantic action,
1512 but that translation would be missed if the semantic action invokes
1513 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1514 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
1515 incorrect destructor might then be invoked immediately. In the
1516 case of YYERROR or YYBACKUP, subsequent parser actions might lead
1517 to an incorrect destructor call or verbose syntax error message
1518 before the lookahead is translated. */
1519 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1523 YY_STACK_PRINT (yyss, yyssp);
1527 /* Now `shift' the result of the reduction. Determine what state
1528 that goes to, based on the state we popped back to and the rule
1529 number reduced by. */
1533 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1534 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1535 yystate = yytable[yystate];
1537 yystate = yydefgoto[yyn - YYNTOKENS];
1542 /*------------------------------------.
1543 | yyerrlab -- here on detecting error |
1544 `------------------------------------*/
1546 /* Make sure we have latest lookahead translation. See comments at
1547 user semantic actions for why this is necessary. */
1548 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
1550 /* If not already recovering from an error, report this error. */
1554 #if ! YYERROR_VERBOSE
1555 yyerror (YY_("syntax error"));
1557 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
1560 char const *yymsgp = YY_("syntax error");
1561 int yysyntax_error_status;
1562 yysyntax_error_status = YYSYNTAX_ERROR;
1563 if (yysyntax_error_status == 0)
1565 else if (yysyntax_error_status == 1)
1567 if (yymsg != yymsgbuf)
1568 YYSTACK_FREE (yymsg);
1569 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
1573 yymsg_alloc = sizeof yymsgbuf;
1574 yysyntax_error_status = 2;
1578 yysyntax_error_status = YYSYNTAX_ERROR;
1583 if (yysyntax_error_status == 2)
1584 goto yyexhaustedlab;
1586 # undef YYSYNTAX_ERROR
1592 if (yyerrstatus == 3)
1594 /* If just tried and failed to reuse lookahead token after an
1595 error, discard it. */
1597 if (yychar <= YYEOF)
1599 /* Return failure if at end of input. */
1600 if (yychar == YYEOF)
1605 yydestruct ("Error: discarding",
1611 /* Else will try to reuse lookahead token after shifting the error
1616 /*---------------------------------------------------.
1617 | yyerrorlab -- error raised explicitly by YYERROR. |
1618 `---------------------------------------------------*/
1621 /* Pacify compilers like GCC when the user code never invokes
1622 YYERROR and the label yyerrorlab therefore never appears in user
1624 if (/*CONSTCOND*/ 0)
1627 /* Do not reclaim the symbols of the rule which action triggered
1631 YY_STACK_PRINT (yyss, yyssp);
1636 /*-------------------------------------------------------------.
1637 | yyerrlab1 -- common code for both syntax error and YYERROR. |
1638 `-------------------------------------------------------------*/
1640 yyerrstatus = 3; /* Each real token shifted decrements this. */
1644 yyn = yypact[yystate];
1645 if (!yypact_value_is_default (yyn))
1648 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1656 /* Pop the current state because it cannot handle the error token. */
1661 yydestruct ("Error: popping",
1662 yystos[yystate], yyvsp);
1665 YY_STACK_PRINT (yyss, yyssp);
1671 /* Shift the error token. */
1672 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1678 /*-------------------------------------.
1679 | yyacceptlab -- YYACCEPT comes here. |
1680 `-------------------------------------*/
1685 /*-----------------------------------.
1686 | yyabortlab -- YYABORT comes here. |
1687 `-----------------------------------*/
1692 #if !defined(yyoverflow) || YYERROR_VERBOSE
1693 /*-------------------------------------------------.
1694 | yyexhaustedlab -- memory exhaustion comes here. |
1695 `-------------------------------------------------*/
1697 yyerror (YY_("memory exhausted"));
1703 if (yychar != YYEMPTY)
1705 /* Make sure we have latest lookahead translation. See comments at
1706 user semantic actions for why this is necessary. */
1707 yytoken = YYTRANSLATE (yychar);
1708 yydestruct ("Cleanup: discarding lookahead",
1711 /* Do not reclaim the symbols of the rule which action triggered
1712 this YYABORT or YYACCEPT. */
1714 YY_STACK_PRINT (yyss, yyssp);
1715 while (yyssp != yyss)
1717 yydestruct ("Cleanup: popping",
1718 yystos[*yyssp], yyvsp);
1723 YYSTACK_FREE (yyss);
1726 if (yymsg != yymsgbuf)
1727 YYSTACK_FREE (yymsg);
1729 /* Make sure YYID is used. */
1730 return YYID (yyresult);
1735 /* Line 2067 of yacc.c */
1736 #line 93 "spotlight_rawquery_parser.y"
1739 const char *map_daterange(const char *dateattr, const char *date1, const char *date2)
1741 char *result = NULL;
1742 struct spotlight_sparql_map *p;
1744 for (p = spotlight_sparql_map; p->ssm_spotlight_attr; p++) {
1745 if (strcmp(dateattr, p->ssm_spotlight_attr) == 0) {
1746 result = talloc_asprintf(ssp_slq,
1747 "?x %s ?d FILTER (?d > '%s' && ?d < '%s')",
1758 const char *map_expr(const char *attr, const char *val)
1760 char *result = NULL;
1761 struct spotlight_sparql_map *p;
1763 for (p = spotlight_sparql_map; p->ssm_spotlight_attr; p++) {
1764 if (strcmp(p->ssm_spotlight_attr, attr) == 0) {
1765 result = talloc_asprintf(ssp_slq, p->ssm_sparql_query_fmtstr, val);
1773 void yyerror(const char *str)
1776 printf("yyerror: %s\n", str);
1778 LOG(log_error, logtype_sl, "yyerror: %s", str);
1787 const gchar *map_spotlight_to_sparql_query(slq_t *slq)
1792 s = yy_scan_string(slq->slq_qstring);
1794 LOG(log_debug, logtype_sl, "map_spotlight_to_sparql_query: %s", slq->slq_qstring);
1797 yy_delete_buffer(s);
1803 int main(int argc, char **argv)
1808 printf("usage: %s QUERY\n", argv[0]);
1812 ssp_slq = talloc_zero(NULL, slq_t);
1813 struct vol *vol = talloc_zero(ssp_slq, struct vol);
1814 vol->v_path = "/Volumes/test";
1815 ssp_slq->slq_vol = vol;
1817 s = yy_scan_string(argv[1]);
1821 yy_delete_buffer(s);
1823 printf("SPARQL: %s\n", ssp_result);