]> arthur.barton.de Git - netatalk.git/blob - etc/spotlight/spotlight_rawquery_lexer.c
Spotlight: use async Tracker SPARQL API
[netatalk.git] / etc / spotlight / spotlight_rawquery_lexer.c
1 #line 2 "spotlight_rawquery_lexer.l"
2 #ifdef HAVE_CONFIG_H
3 #include "config.h"
4 #endif /* HAVE_CONFIG_H */
5
6
7
8 #line 9 "spotlight_rawquery_lexer.c"
9
10 #define  YY_INT_ALIGNED short int
11
12 /* A lexical scanner generated by flex */
13
14 #define FLEX_SCANNER
15 #define YY_FLEX_MAJOR_VERSION 2
16 #define YY_FLEX_MINOR_VERSION 5
17 #define YY_FLEX_SUBMINOR_VERSION 37
18 #if YY_FLEX_SUBMINOR_VERSION > 0
19 #define FLEX_BETA
20 #endif
21
22 /* First, we deal with  platform-specific or compiler-specific issues. */
23
24 /* begin standard C headers. */
25 #include <stdio.h>
26 #include <string.h>
27 #include <errno.h>
28 #include <stdlib.h>
29
30 /* end standard C headers. */
31
32 /* flex integer type definitions */
33
34 #ifndef FLEXINT_H
35 #define FLEXINT_H
36
37 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
38
39 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
40
41 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
42  * if you want the limit (max/min) macros for int types. 
43  */
44 #ifndef __STDC_LIMIT_MACROS
45 #define __STDC_LIMIT_MACROS 1
46 #endif
47
48 #include <inttypes.h>
49 typedef int8_t flex_int8_t;
50 typedef uint8_t flex_uint8_t;
51 typedef int16_t flex_int16_t;
52 typedef uint16_t flex_uint16_t;
53 typedef int32_t flex_int32_t;
54 typedef uint32_t flex_uint32_t;
55 #else
56 typedef signed char flex_int8_t;
57 typedef short int flex_int16_t;
58 typedef int flex_int32_t;
59 typedef unsigned char flex_uint8_t; 
60 typedef unsigned short int flex_uint16_t;
61 typedef unsigned int flex_uint32_t;
62
63 /* Limits of integral types. */
64 #ifndef INT8_MIN
65 #define INT8_MIN               (-128)
66 #endif
67 #ifndef INT16_MIN
68 #define INT16_MIN              (-32767-1)
69 #endif
70 #ifndef INT32_MIN
71 #define INT32_MIN              (-2147483647-1)
72 #endif
73 #ifndef INT8_MAX
74 #define INT8_MAX               (127)
75 #endif
76 #ifndef INT16_MAX
77 #define INT16_MAX              (32767)
78 #endif
79 #ifndef INT32_MAX
80 #define INT32_MAX              (2147483647)
81 #endif
82 #ifndef UINT8_MAX
83 #define UINT8_MAX              (255U)
84 #endif
85 #ifndef UINT16_MAX
86 #define UINT16_MAX             (65535U)
87 #endif
88 #ifndef UINT32_MAX
89 #define UINT32_MAX             (4294967295U)
90 #endif
91
92 #endif /* ! C99 */
93
94 #endif /* ! FLEXINT_H */
95
96 #ifdef __cplusplus
97
98 /* The "const" storage-class-modifier is valid. */
99 #define YY_USE_CONST
100
101 #else   /* ! __cplusplus */
102
103 /* C99 requires __STDC__ to be defined as 1. */
104 #if defined (__STDC__)
105
106 #define YY_USE_CONST
107
108 #endif  /* defined (__STDC__) */
109 #endif  /* ! __cplusplus */
110
111 #ifdef YY_USE_CONST
112 #define yyconst const
113 #else
114 #define yyconst
115 #endif
116
117 /* Returned upon end-of-file. */
118 #define YY_NULL 0
119
120 /* Promotes a possibly negative, possibly signed char to an unsigned
121  * integer for use as an array index.  If the signed char is negative,
122  * we want to instead treat it as an 8-bit unsigned char, hence the
123  * double cast.
124  */
125 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
126
127 /* Enter a start condition.  This macro really ought to take a parameter,
128  * but we do it the disgusting crufty way forced on us by the ()-less
129  * definition of BEGIN.
130  */
131 #define BEGIN (yy_start) = 1 + 2 *
132
133 /* Translate the current start state into a value that can be later handed
134  * to BEGIN to return to the state.  The YYSTATE alias is for lex
135  * compatibility.
136  */
137 #define YY_START (((yy_start) - 1) / 2)
138 #define YYSTATE YY_START
139
140 /* Action number for EOF rule of a given start state. */
141 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
142
143 /* Special action meaning "start processing a new file". */
144 #define YY_NEW_FILE yyrestart(yyin  )
145
146 #define YY_END_OF_BUFFER_CHAR 0
147
148 /* Size of default input buffer. */
149 #ifndef YY_BUF_SIZE
150 #define YY_BUF_SIZE 16384
151 #endif
152
153 /* The state buf must be large enough to hold one state per character in the main buffer.
154  */
155 #define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
156
157 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
158 #define YY_TYPEDEF_YY_BUFFER_STATE
159 typedef struct yy_buffer_state *YY_BUFFER_STATE;
160 #endif
161
162 #ifndef YY_TYPEDEF_YY_SIZE_T
163 #define YY_TYPEDEF_YY_SIZE_T
164 typedef size_t yy_size_t;
165 #endif
166
167 extern yy_size_t yyleng;
168
169 extern FILE *yyin, *yyout;
170
171 #define EOB_ACT_CONTINUE_SCAN 0
172 #define EOB_ACT_END_OF_FILE 1
173 #define EOB_ACT_LAST_MATCH 2
174
175     #define YY_LESS_LINENO(n)
176     
177 /* Return all but the first "n" matched characters back to the input stream. */
178 #define yyless(n) \
179         do \
180                 { \
181                 /* Undo effects of setting up yytext. */ \
182         int yyless_macro_arg = (n); \
183         YY_LESS_LINENO(yyless_macro_arg);\
184                 *yy_cp = (yy_hold_char); \
185                 YY_RESTORE_YY_MORE_OFFSET \
186                 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
187                 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
188                 } \
189         while ( 0 )
190
191 #define unput(c) yyunput( c, (yytext_ptr)  )
192
193 #ifndef YY_STRUCT_YY_BUFFER_STATE
194 #define YY_STRUCT_YY_BUFFER_STATE
195 struct yy_buffer_state
196         {
197         FILE *yy_input_file;
198
199         char *yy_ch_buf;                /* input buffer */
200         char *yy_buf_pos;               /* current position in input buffer */
201
202         /* Size of input buffer in bytes, not including room for EOB
203          * characters.
204          */
205         yy_size_t yy_buf_size;
206
207         /* Number of characters read into yy_ch_buf, not including EOB
208          * characters.
209          */
210         yy_size_t yy_n_chars;
211
212         /* Whether we "own" the buffer - i.e., we know we created it,
213          * and can realloc() it to grow it, and should free() it to
214          * delete it.
215          */
216         int yy_is_our_buffer;
217
218         /* Whether this is an "interactive" input source; if so, and
219          * if we're using stdio for input, then we want to use getc()
220          * instead of fread(), to make sure we stop fetching input after
221          * each newline.
222          */
223         int yy_is_interactive;
224
225         /* Whether we're considered to be at the beginning of a line.
226          * If so, '^' rules will be active on the next match, otherwise
227          * not.
228          */
229         int yy_at_bol;
230
231     int yy_bs_lineno; /**< The line count. */
232     int yy_bs_column; /**< The column count. */
233     
234         /* Whether to try to fill the input buffer when we reach the
235          * end of it.
236          */
237         int yy_fill_buffer;
238
239         int yy_buffer_status;
240
241 #define YY_BUFFER_NEW 0
242 #define YY_BUFFER_NORMAL 1
243         /* When an EOF's been seen but there's still some text to process
244          * then we mark the buffer as YY_EOF_PENDING, to indicate that we
245          * shouldn't try reading from the input source any more.  We might
246          * still have a bunch of tokens to match, though, because of
247          * possible backing-up.
248          *
249          * When we actually see the EOF, we change the status to "new"
250          * (via yyrestart()), so that the user can continue scanning by
251          * just pointing yyin at a new input file.
252          */
253 #define YY_BUFFER_EOF_PENDING 2
254
255         };
256 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
257
258 /* Stack of input buffers. */
259 static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
260 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
261 static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
262
263 /* We provide macros for accessing buffer states in case in the
264  * future we want to put the buffer states in a more general
265  * "scanner state".
266  *
267  * Returns the top of the stack, or NULL.
268  */
269 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
270                           ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
271                           : NULL)
272
273 /* Same as previous macro, but useful when we know that the buffer stack is not
274  * NULL or when we need an lvalue. For internal use only.
275  */
276 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
277
278 /* yy_hold_char holds the character lost when yytext is formed. */
279 static char yy_hold_char;
280 static yy_size_t yy_n_chars;            /* number of characters read into yy_ch_buf */
281 yy_size_t yyleng;
282
283 /* Points to current character in buffer. */
284 static char *yy_c_buf_p = (char *) 0;
285 static int yy_init = 0;         /* whether we need to initialize */
286 static int yy_start = 0;        /* start state number */
287
288 /* Flag which is used to allow yywrap()'s to do buffer switches
289  * instead of setting up a fresh yyin.  A bit of a hack ...
290  */
291 static int yy_did_buffer_switch_on_eof;
292
293 void yyrestart (FILE *input_file  );
294 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer  );
295 YY_BUFFER_STATE yy_create_buffer (FILE *file,int size  );
296 void yy_delete_buffer (YY_BUFFER_STATE b  );
297 void yy_flush_buffer (YY_BUFFER_STATE b  );
298 void yypush_buffer_state (YY_BUFFER_STATE new_buffer  );
299 void yypop_buffer_state (void );
300
301 static void yyensure_buffer_stack (void );
302 static void yy_load_buffer_state (void );
303 static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file  );
304
305 #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
306
307 YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size  );
308 YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str  );
309 YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len  );
310
311 void *yyalloc (yy_size_t  );
312 void *yyrealloc (void *,yy_size_t  );
313 void yyfree (void *  );
314
315 #define yy_new_buffer yy_create_buffer
316
317 #define yy_set_interactive(is_interactive) \
318         { \
319         if ( ! YY_CURRENT_BUFFER ){ \
320         yyensure_buffer_stack (); \
321                 YY_CURRENT_BUFFER_LVALUE =    \
322             yy_create_buffer(yyin,YY_BUF_SIZE ); \
323         } \
324         YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
325         }
326
327 #define yy_set_bol(at_bol) \
328         { \
329         if ( ! YY_CURRENT_BUFFER ){\
330         yyensure_buffer_stack (); \
331                 YY_CURRENT_BUFFER_LVALUE =    \
332             yy_create_buffer(yyin,YY_BUF_SIZE ); \
333         } \
334         YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
335         }
336
337 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
338
339 /* Begin user sect3 */
340
341 typedef unsigned char YY_CHAR;
342
343 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
344
345 typedef int yy_state_type;
346
347 extern int yylineno;
348
349 int yylineno = 1;
350
351 extern char *yytext;
352 #define yytext_ptr yytext
353
354 static yy_state_type yy_get_previous_state (void );
355 static yy_state_type yy_try_NUL_trans (yy_state_type current_state  );
356 static int yy_get_next_buffer (void );
357 static void yy_fatal_error (yyconst char msg[]  );
358
359 /* Done after the current pattern has been matched and before the
360  * corresponding action - sets up yytext.
361  */
362 #define YY_DO_BEFORE_ACTION \
363         (yytext_ptr) = yy_bp; \
364         yyleng = (size_t) (yy_cp - yy_bp); \
365         (yy_hold_char) = *yy_cp; \
366         *yy_cp = '\0'; \
367         (yy_c_buf_p) = yy_cp;
368
369 #define YY_NUM_RULES 17
370 #define YY_END_OF_BUFFER 18
371 /* This struct is not used in this scanner,
372    but its presence is necessary. */
373 struct yy_trans_info
374         {
375         flex_int32_t yy_verify;
376         flex_int32_t yy_nxt;
377         };
378 static yyconst flex_int16_t yy_accept[57] =
379     {   0,
380         0,    0,   18,   17,   16,   17,    5,   17,   17,    6,
381         7,   15,   14,   12,   17,   13,   15,   15,   15,   17,
382        17,   17,   17,   11,    0,    8,   15,    0,    0,    0,
383        10,   15,   15,   15,    9,    0,    0,    0,   15,   15,
384        15,    0,    0,   15,   15,    4,    0,   15,    3,    0,
385        15,    0,    1,    0,    2,    0
386     } ;
387
388 static yyconst flex_int32_t yy_ec[256] =
389     {   0,
390         1,    1,    1,    1,    1,    1,    1,    1,    2,    2,
391         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
392         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
393         1,    2,    3,    4,    1,    5,    1,    6,    1,    7,
394         8,    9,    1,   10,    9,   11,    1,    9,    9,    9,
395         9,    9,    9,    9,    9,    9,    9,    9,    1,   12,
396        13,   14,    1,    1,    9,    9,    9,    9,    9,    9,
397         9,    9,   15,    9,    9,    9,    9,    9,    9,    9,
398         9,   16,    9,    9,    9,    9,    9,    9,    9,    9,
399         1,    1,    1,    1,    9,    1,   17,    9,    9,    9,
400
401        18,   19,   20,    9,   21,    9,    9,   22,   23,   24,
402        25,    9,    9,   26,   27,   28,   29,    9,    9,    9,
403         9,    9,    1,   30,    1,    1,    1,   31,   31,   31,
404        31,   31,   31,   31,   31,   31,   31,   31,   31,   31,
405        31,   31,   31,   31,   31,   31,   31,   31,   31,   31,
406        31,   31,   31,   31,   31,   31,   31,   31,   31,   31,
407        31,   31,   31,   31,   31,   31,   31,   31,   31,   31,
408        31,   31,   31,   31,   31,   31,   31,   31,   31,   31,
409        31,   31,   31,   31,   31,   31,   31,   31,   31,   31,
410        31,    1,    1,   32,   32,   32,   32,   32,   32,   32,
411
412        32,   32,   32,   32,   32,   32,   32,   32,   32,   32,
413        32,   32,   32,   32,   32,   32,   32,   32,   32,   32,
414        32,   32,   32,   33,   33,   33,   33,   33,   33,   33,
415        33,   33,   33,   33,   33,   33,   33,   33,   33,   34,
416        34,   34,   34,   34,    1,    1,    1,    1,    1,    1,
417         1,    1,    1,    1,    1
418     } ;
419
420 static yyconst flex_int32_t yy_meta[35] =
421     {   0,
422         1,    1,    1,    1,    1,    1,    1,    1,    2,    1,
423         2,    1,    1,    1,    2,    2,    2,    2,    2,    2,
424         2,    2,    2,    2,    2,    2,    2,    2,    2,    1,
425         1,    2,    2,    2
426     } ;
427
428 static yyconst flex_int16_t yy_base[58] =
429     {   0,
430         0,    0,   91,   92,   92,   77,   92,   61,   82,   92,
431        92,    3,   92,   92,   74,   92,   14,   25,   15,   56,
432        54,   53,   52,   92,   61,   92,   57,   49,   48,   47,
433        92,   27,   28,   16,   92,   46,   45,   52,   36,   30,
434        37,   43,   55,   48,   38,   47,   59,   39,   45,   47,
435        40,   40,   42,   40,   92,   92,   42
436     } ;
437
438 static yyconst flex_int16_t yy_def[58] =
439     {   0,
440        56,    1,   56,   56,   56,   56,   56,   56,   56,   56,
441        56,   57,   56,   56,   56,   56,   57,   17,   17,   56,
442        56,   56,   56,   56,   56,   56,   17,   56,   56,   56,
443        56,   17,   17,   17,   56,   56,   56,   56,   17,   17,
444        17,   56,   56,   17,   17,   17,   56,   17,   17,   56,
445        17,   56,   17,   56,   56,    0,   56
446     } ;
447
448 static yyconst flex_int16_t yy_nxt[127] =
449     {   0,
450         4,    5,    6,    7,    8,    9,   10,   11,   12,   13,
451        12,   14,   15,   16,   17,   12,   12,   12,   18,   12,
452        12,   12,   12,   12,   12,   12,   12,   19,   12,   20,
453         4,   21,   22,   23,   28,   29,   30,   32,   27,   27,
454        34,   33,   39,   27,   41,   28,   29,   30,   27,   40,
455        27,   27,   44,   27,   46,   49,   45,   53,   51,   27,
456        27,   27,   27,   27,   55,   27,   54,   52,   27,   50,
457        27,   48,   47,   27,   43,   42,   27,   37,   36,   27,
458        27,   38,   37,   36,   27,   35,   31,   26,   25,   24,
459        56,    3,   56,   56,   56,   56,   56,   56,   56,   56,
460
461        56,   56,   56,   56,   56,   56,   56,   56,   56,   56,
462        56,   56,   56,   56,   56,   56,   56,   56,   56,   56,
463        56,   56,   56,   56,   56,   56
464     } ;
465
466 static yyconst flex_int16_t yy_chk[127] =
467     {   0,
468         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
469         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
470         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
471         1,    1,    1,    1,   12,   12,   12,   17,   19,   34,
472        19,   18,   32,   57,   34,   17,   17,   17,   18,   33,
473        32,   33,   39,   40,   41,   45,   40,   51,   48,   39,
474        41,   45,   48,   51,   54,   53,   52,   50,   49,   47,
475        46,   44,   43,   42,   38,   37,   36,   30,   29,   28,
476        27,   25,   23,   22,   21,   20,   15,    9,    8,    6,
477         3,   56,   56,   56,   56,   56,   56,   56,   56,   56,
478
479        56,   56,   56,   56,   56,   56,   56,   56,   56,   56,
480        56,   56,   56,   56,   56,   56,   56,   56,   56,   56,
481        56,   56,   56,   56,   56,   56
482     } ;
483
484 static yy_state_type yy_last_accepting_state;
485 static char *yy_last_accepting_cpos;
486
487 extern int yy_flex_debug;
488 int yy_flex_debug = 0;
489
490 /* The intent behind this definition is that it'll catch
491  * any uses of REJECT which flex missed.
492  */
493 #define REJECT reject_used_but_not_detected
494 #define yymore() yymore_used_but_not_detected
495 #define YY_MORE_ADJ 0
496 #define YY_RESTORE_YY_MORE_OFFSET
497 char *yytext;
498 #line 1 "spotlight_rawquery_lexer.l"
499
500 #line 8 "spotlight_rawquery_lexer.l"
501 #include <stdbool.h>
502 #include <gio/gio.h>
503 #include <atalk/talloc.h>
504 #include <atalk/spotlight.h>
505 #ifdef HAVE_TRACKER
506 #include "sparql_parser.h"
507 #define SLQ_VAR ssp_slq
508 #endif
509 #line 510 "spotlight_rawquery_lexer.c"
510
511 #define INITIAL 0
512
513 #ifndef YY_NO_UNISTD_H
514 /* Special case for "unistd.h", since it is non-ANSI. We include it way
515  * down here because we want the user's section 1 to have been scanned first.
516  * The user has a chance to override it with an option.
517  */
518 #include <unistd.h>
519 #endif
520
521 #ifndef YY_EXTRA_TYPE
522 #define YY_EXTRA_TYPE void *
523 #endif
524
525 static int yy_init_globals (void );
526
527 /* Accessor methods to globals.
528    These are made visible to non-reentrant scanners for convenience. */
529
530 int yylex_destroy (void );
531
532 int yyget_debug (void );
533
534 void yyset_debug (int debug_flag  );
535
536 YY_EXTRA_TYPE yyget_extra (void );
537
538 void yyset_extra (YY_EXTRA_TYPE user_defined  );
539
540 FILE *yyget_in (void );
541
542 void yyset_in  (FILE * in_str  );
543
544 FILE *yyget_out (void );
545
546 void yyset_out  (FILE * out_str  );
547
548 yy_size_t yyget_leng (void );
549
550 char *yyget_text (void );
551
552 int yyget_lineno (void );
553
554 void yyset_lineno (int line_number  );
555
556 /* Macros after this point can all be overridden by user definitions in
557  * section 1.
558  */
559
560 #ifndef YY_SKIP_YYWRAP
561 #ifdef __cplusplus
562 extern "C" int yywrap (void );
563 #else
564 extern int yywrap (void );
565 #endif
566 #endif
567
568     static void yyunput (int c,char *buf_ptr  );
569     
570 #ifndef yytext_ptr
571 static void yy_flex_strncpy (char *,yyconst char *,int );
572 #endif
573
574 #ifdef YY_NEED_STRLEN
575 static int yy_flex_strlen (yyconst char * );
576 #endif
577
578 #ifndef YY_NO_INPUT
579
580 #ifdef __cplusplus
581 static int yyinput (void );
582 #else
583 static int input (void );
584 #endif
585
586 #endif
587
588 /* Amount of stuff to slurp up with each read. */
589 #ifndef YY_READ_BUF_SIZE
590 #define YY_READ_BUF_SIZE 8192
591 #endif
592
593 /* Copy whatever the last rule matched to the standard output. */
594 #ifndef ECHO
595 /* This used to be an fputs(), but since the string might contain NUL's,
596  * we now use fwrite().
597  */
598 #define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
599 #endif
600
601 /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
602  * is returned in "result".
603  */
604 #ifndef YY_INPUT
605 #define YY_INPUT(buf,result,max_size) \
606         if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
607                 { \
608                 int c = '*'; \
609                 size_t n; \
610                 for ( n = 0; n < max_size && \
611                              (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
612                         buf[n] = (char) c; \
613                 if ( c == '\n' ) \
614                         buf[n++] = (char) c; \
615                 if ( c == EOF && ferror( yyin ) ) \
616                         YY_FATAL_ERROR( "input in flex scanner failed" ); \
617                 result = n; \
618                 } \
619         else \
620                 { \
621                 errno=0; \
622                 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
623                         { \
624                         if( errno != EINTR) \
625                                 { \
626                                 YY_FATAL_ERROR( "input in flex scanner failed" ); \
627                                 break; \
628                                 } \
629                         errno=0; \
630                         clearerr(yyin); \
631                         } \
632                 }\
633 \
634
635 #endif
636
637 /* No semi-colon after return; correct usage is to write "yyterminate();" -
638  * we don't want an extra ';' after the "return" because that will cause
639  * some compilers to complain about unreachable statements.
640  */
641 #ifndef yyterminate
642 #define yyterminate() return YY_NULL
643 #endif
644
645 /* Number of entries by which start-condition stack grows. */
646 #ifndef YY_START_STACK_INCR
647 #define YY_START_STACK_INCR 25
648 #endif
649
650 /* Report a fatal error. */
651 #ifndef YY_FATAL_ERROR
652 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
653 #endif
654
655 /* end tables serialization structures and prototypes */
656
657 /* Default declaration of generated scanner - a define so the user can
658  * easily add parameters.
659  */
660 #ifndef YY_DECL
661 #define YY_DECL_IS_OURS 1
662
663 extern int yylex (void);
664
665 #define YY_DECL int yylex (void)
666 #endif /* !YY_DECL */
667
668 /* Code executed at the beginning of each rule, after yytext and yyleng
669  * have been set up.
670  */
671 #ifndef YY_USER_ACTION
672 #define YY_USER_ACTION
673 #endif
674
675 /* Code executed at the end of each rule. */
676 #ifndef YY_BREAK
677 #define YY_BREAK break;
678 #endif
679
680 #define YY_RULE_SETUP \
681         YY_USER_ACTION
682
683 /** The main scanner function which does all the work.
684  */
685 YY_DECL
686 {
687         register yy_state_type yy_current_state;
688         register char *yy_cp, *yy_bp;
689         register int yy_act;
690     
691 #line 27 "spotlight_rawquery_lexer.l"
692
693 #line 694 "spotlight_rawquery_lexer.c"
694
695         if ( !(yy_init) )
696                 {
697                 (yy_init) = 1;
698
699 #ifdef YY_USER_INIT
700                 YY_USER_INIT;
701 #endif
702
703                 if ( ! (yy_start) )
704                         (yy_start) = 1; /* first start state */
705
706                 if ( ! yyin )
707                         yyin = stdin;
708
709                 if ( ! yyout )
710                         yyout = stdout;
711
712                 if ( ! YY_CURRENT_BUFFER ) {
713                         yyensure_buffer_stack ();
714                         YY_CURRENT_BUFFER_LVALUE =
715                                 yy_create_buffer(yyin,YY_BUF_SIZE );
716                 }
717
718                 yy_load_buffer_state( );
719                 }
720
721         while ( 1 )             /* loops until end-of-file is reached */
722                 {
723                 yy_cp = (yy_c_buf_p);
724
725                 /* Support of yytext. */
726                 *yy_cp = (yy_hold_char);
727
728                 /* yy_bp points to the position in yy_ch_buf of the start of
729                  * the current run.
730                  */
731                 yy_bp = yy_cp;
732
733                 yy_current_state = (yy_start);
734 yy_match:
735                 do
736                         {
737                         register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
738                         if ( yy_accept[yy_current_state] )
739                                 {
740                                 (yy_last_accepting_state) = yy_current_state;
741                                 (yy_last_accepting_cpos) = yy_cp;
742                                 }
743                         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
744                                 {
745                                 yy_current_state = (int) yy_def[yy_current_state];
746                                 if ( yy_current_state >= 57 )
747                                         yy_c = yy_meta[(unsigned int) yy_c];
748                                 }
749                         yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
750                         ++yy_cp;
751                         }
752                 while ( yy_base[yy_current_state] != 92 );
753
754 yy_find_action:
755                 yy_act = yy_accept[yy_current_state];
756                 if ( yy_act == 0 )
757                         { /* have to back up */
758                         yy_cp = (yy_last_accepting_cpos);
759                         yy_current_state = (yy_last_accepting_state);
760                         yy_act = yy_accept[yy_current_state];
761                         }
762
763                 YY_DO_BEFORE_ACTION;
764
765 do_action:      /* This label is used only to access EOF actions. */
766
767                 switch ( yy_act )
768         { /* beginning of action switch */
769                         case 0: /* must back up */
770                         /* undo the effects of YY_DO_BEFORE_ACTION */
771                         *yy_cp = (yy_hold_char);
772                         yy_cp = (yy_last_accepting_cpos);
773                         yy_current_state = (yy_last_accepting_state);
774                         goto yy_find_action;
775
776 case 1:
777 YY_RULE_SETUP
778 #line 28 "spotlight_rawquery_lexer.l"
779 return FUNC_INRANGE;
780         YY_BREAK
781 case 2:
782 YY_RULE_SETUP
783 #line 29 "spotlight_rawquery_lexer.l"
784 return DATE_ISO;
785         YY_BREAK
786 case 3:
787 YY_RULE_SETUP
788 #line 30 "spotlight_rawquery_lexer.l"
789 {yylval.bval = false; return BOOL;}
790         YY_BREAK
791 case 4:
792 YY_RULE_SETUP
793 #line 31 "spotlight_rawquery_lexer.l"
794 {yylval.bval = true; return BOOL;}
795         YY_BREAK
796 case 5:
797 YY_RULE_SETUP
798 #line 32 "spotlight_rawquery_lexer.l"
799 return QUOTE;
800         YY_BREAK
801 case 6:
802 YY_RULE_SETUP
803 #line 33 "spotlight_rawquery_lexer.l"
804 return OBRACE;
805         YY_BREAK
806 case 7:
807 YY_RULE_SETUP
808 #line 34 "spotlight_rawquery_lexer.l"
809 return CBRACE;
810         YY_BREAK
811 case 8:
812 YY_RULE_SETUP
813 #line 35 "spotlight_rawquery_lexer.l"
814 return AND;
815         YY_BREAK
816 case 9:
817 YY_RULE_SETUP
818 #line 36 "spotlight_rawquery_lexer.l"
819 return OR;
820         YY_BREAK
821 case 10:
822 YY_RULE_SETUP
823 #line 37 "spotlight_rawquery_lexer.l"
824 return EQUAL;
825         YY_BREAK
826 case 11:
827 YY_RULE_SETUP
828 #line 38 "spotlight_rawquery_lexer.l"
829 return UNEQUAL;
830         YY_BREAK
831 case 12:
832 YY_RULE_SETUP
833 #line 39 "spotlight_rawquery_lexer.l"
834 return LT;
835         YY_BREAK
836 case 13:
837 YY_RULE_SETUP
838 #line 40 "spotlight_rawquery_lexer.l"
839 return GT;
840         YY_BREAK
841 case 14:
842 YY_RULE_SETUP
843 #line 41 "spotlight_rawquery_lexer.l"
844 return COMMA;
845         YY_BREAK
846 case 15:
847 YY_RULE_SETUP
848 #line 42 "spotlight_rawquery_lexer.l"
849 {yylval.sval = talloc_strdup(SLQ_VAR, yytext); return WORD;}
850         YY_BREAK
851 case 16:
852 /* rule 16 can match eol */
853 YY_RULE_SETUP
854 #line 43 "spotlight_rawquery_lexer.l"
855 /* ignore */
856         YY_BREAK
857 case 17:
858 YY_RULE_SETUP
859 #line 44 "spotlight_rawquery_lexer.l"
860 ECHO;
861         YY_BREAK
862 #line 863 "spotlight_rawquery_lexer.c"
863 case YY_STATE_EOF(INITIAL):
864         yyterminate();
865
866         case YY_END_OF_BUFFER:
867                 {
868                 /* Amount of text matched not including the EOB char. */
869                 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
870
871                 /* Undo the effects of YY_DO_BEFORE_ACTION. */
872                 *yy_cp = (yy_hold_char);
873                 YY_RESTORE_YY_MORE_OFFSET
874
875                 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
876                         {
877                         /* We're scanning a new file or input source.  It's
878                          * possible that this happened because the user
879                          * just pointed yyin at a new source and called
880                          * yylex().  If so, then we have to assure
881                          * consistency between YY_CURRENT_BUFFER and our
882                          * globals.  Here is the right place to do so, because
883                          * this is the first action (other than possibly a
884                          * back-up) that will match for the new input source.
885                          */
886                         (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
887                         YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
888                         YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
889                         }
890
891                 /* Note that here we test for yy_c_buf_p "<=" to the position
892                  * of the first EOB in the buffer, since yy_c_buf_p will
893                  * already have been incremented past the NUL character
894                  * (since all states make transitions on EOB to the
895                  * end-of-buffer state).  Contrast this with the test
896                  * in input().
897                  */
898                 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
899                         { /* This was really a NUL. */
900                         yy_state_type yy_next_state;
901
902                         (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
903
904                         yy_current_state = yy_get_previous_state(  );
905
906                         /* Okay, we're now positioned to make the NUL
907                          * transition.  We couldn't have
908                          * yy_get_previous_state() go ahead and do it
909                          * for us because it doesn't know how to deal
910                          * with the possibility of jamming (and we don't
911                          * want to build jamming into it because then it
912                          * will run more slowly).
913                          */
914
915                         yy_next_state = yy_try_NUL_trans( yy_current_state );
916
917                         yy_bp = (yytext_ptr) + YY_MORE_ADJ;
918
919                         if ( yy_next_state )
920                                 {
921                                 /* Consume the NUL. */
922                                 yy_cp = ++(yy_c_buf_p);
923                                 yy_current_state = yy_next_state;
924                                 goto yy_match;
925                                 }
926
927                         else
928                                 {
929                                 yy_cp = (yy_c_buf_p);
930                                 goto yy_find_action;
931                                 }
932                         }
933
934                 else switch ( yy_get_next_buffer(  ) )
935                         {
936                         case EOB_ACT_END_OF_FILE:
937                                 {
938                                 (yy_did_buffer_switch_on_eof) = 0;
939
940                                 if ( yywrap( ) )
941                                         {
942                                         /* Note: because we've taken care in
943                                          * yy_get_next_buffer() to have set up
944                                          * yytext, we can now set up
945                                          * yy_c_buf_p so that if some total
946                                          * hoser (like flex itself) wants to
947                                          * call the scanner after we return the
948                                          * YY_NULL, it'll still work - another
949                                          * YY_NULL will get returned.
950                                          */
951                                         (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
952
953                                         yy_act = YY_STATE_EOF(YY_START);
954                                         goto do_action;
955                                         }
956
957                                 else
958                                         {
959                                         if ( ! (yy_did_buffer_switch_on_eof) )
960                                                 YY_NEW_FILE;
961                                         }
962                                 break;
963                                 }
964
965                         case EOB_ACT_CONTINUE_SCAN:
966                                 (yy_c_buf_p) =
967                                         (yytext_ptr) + yy_amount_of_matched_text;
968
969                                 yy_current_state = yy_get_previous_state(  );
970
971                                 yy_cp = (yy_c_buf_p);
972                                 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
973                                 goto yy_match;
974
975                         case EOB_ACT_LAST_MATCH:
976                                 (yy_c_buf_p) =
977                                 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
978
979                                 yy_current_state = yy_get_previous_state(  );
980
981                                 yy_cp = (yy_c_buf_p);
982                                 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
983                                 goto yy_find_action;
984                         }
985                 break;
986                 }
987
988         default:
989                 YY_FATAL_ERROR(
990                         "fatal flex scanner internal error--no action found" );
991         } /* end of action switch */
992                 } /* end of scanning one token */
993 } /* end of yylex */
994
995 /* yy_get_next_buffer - try to read in a new buffer
996  *
997  * Returns a code representing an action:
998  *      EOB_ACT_LAST_MATCH -
999  *      EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1000  *      EOB_ACT_END_OF_FILE - end of file
1001  */
1002 static int yy_get_next_buffer (void)
1003 {
1004         register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1005         register char *source = (yytext_ptr);
1006         register int number_to_move, i;
1007         int ret_val;
1008
1009         if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1010                 YY_FATAL_ERROR(
1011                 "fatal flex scanner internal error--end of buffer missed" );
1012
1013         if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1014                 { /* Don't try to fill the buffer, so this is an EOF. */
1015                 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1016                         {
1017                         /* We matched a single character, the EOB, so
1018                          * treat this as a final EOF.
1019                          */
1020                         return EOB_ACT_END_OF_FILE;
1021                         }
1022
1023                 else
1024                         {
1025                         /* We matched some text prior to the EOB, first
1026                          * process it.
1027                          */
1028                         return EOB_ACT_LAST_MATCH;
1029                         }
1030                 }
1031
1032         /* Try to read more data. */
1033
1034         /* First move last chars to start of buffer. */
1035         number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1036
1037         for ( i = 0; i < number_to_move; ++i )
1038                 *(dest++) = *(source++);
1039
1040         if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1041                 /* don't do the read, it's not guaranteed to return an EOF,
1042                  * just force an EOF
1043                  */
1044                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1045
1046         else
1047                 {
1048                         yy_size_t num_to_read =
1049                         YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1050
1051                 while ( num_to_read <= 0 )
1052                         { /* Not enough room in the buffer - grow it. */
1053
1054                         /* just a shorter name for the current buffer */
1055                         YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
1056
1057                         int yy_c_buf_p_offset =
1058                                 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1059
1060                         if ( b->yy_is_our_buffer )
1061                                 {
1062                                 yy_size_t new_size = b->yy_buf_size * 2;
1063
1064                                 if ( new_size <= 0 )
1065                                         b->yy_buf_size += b->yy_buf_size / 8;
1066                                 else
1067                                         b->yy_buf_size *= 2;
1068
1069                                 b->yy_ch_buf = (char *)
1070                                         /* Include room in for 2 EOB chars. */
1071                                         yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2  );
1072                                 }
1073                         else
1074                                 /* Can't grow it, we don't own it. */
1075                                 b->yy_ch_buf = 0;
1076
1077                         if ( ! b->yy_ch_buf )
1078                                 YY_FATAL_ERROR(
1079                                 "fatal error - scanner input buffer overflow" );
1080
1081                         (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1082
1083                         num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1084                                                 number_to_move - 1;
1085
1086                         }
1087
1088                 if ( num_to_read > YY_READ_BUF_SIZE )
1089                         num_to_read = YY_READ_BUF_SIZE;
1090
1091                 /* Read in more data. */
1092                 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1093                         (yy_n_chars), num_to_read );
1094
1095                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1096                 }
1097
1098         if ( (yy_n_chars) == 0 )
1099                 {
1100                 if ( number_to_move == YY_MORE_ADJ )
1101                         {
1102                         ret_val = EOB_ACT_END_OF_FILE;
1103                         yyrestart(yyin  );
1104                         }
1105
1106                 else
1107                         {
1108                         ret_val = EOB_ACT_LAST_MATCH;
1109                         YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1110                                 YY_BUFFER_EOF_PENDING;
1111                         }
1112                 }
1113
1114         else
1115                 ret_val = EOB_ACT_CONTINUE_SCAN;
1116
1117         if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1118                 /* Extend the array by 50%, plus the number we really need. */
1119                 yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1120                 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size  );
1121                 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1122                         YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1123         }
1124
1125         (yy_n_chars) += number_to_move;
1126         YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1127         YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1128
1129         (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1130
1131         return ret_val;
1132 }
1133
1134 /* yy_get_previous_state - get the state just before the EOB char was reached */
1135
1136     static yy_state_type yy_get_previous_state (void)
1137 {
1138         register yy_state_type yy_current_state;
1139         register char *yy_cp;
1140     
1141         yy_current_state = (yy_start);
1142
1143         for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1144                 {
1145                 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1146                 if ( yy_accept[yy_current_state] )
1147                         {
1148                         (yy_last_accepting_state) = yy_current_state;
1149                         (yy_last_accepting_cpos) = yy_cp;
1150                         }
1151                 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1152                         {
1153                         yy_current_state = (int) yy_def[yy_current_state];
1154                         if ( yy_current_state >= 57 )
1155                                 yy_c = yy_meta[(unsigned int) yy_c];
1156                         }
1157                 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1158                 }
1159
1160         return yy_current_state;
1161 }
1162
1163 /* yy_try_NUL_trans - try to make a transition on the NUL character
1164  *
1165  * synopsis
1166  *      next_state = yy_try_NUL_trans( current_state );
1167  */
1168     static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state )
1169 {
1170         register int yy_is_jam;
1171         register char *yy_cp = (yy_c_buf_p);
1172
1173         register YY_CHAR yy_c = 1;
1174         if ( yy_accept[yy_current_state] )
1175                 {
1176                 (yy_last_accepting_state) = yy_current_state;
1177                 (yy_last_accepting_cpos) = yy_cp;
1178                 }
1179         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1180                 {
1181                 yy_current_state = (int) yy_def[yy_current_state];
1182                 if ( yy_current_state >= 57 )
1183                         yy_c = yy_meta[(unsigned int) yy_c];
1184                 }
1185         yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1186         yy_is_jam = (yy_current_state == 56);
1187
1188                 return yy_is_jam ? 0 : yy_current_state;
1189 }
1190
1191     static void yyunput (int c, register char * yy_bp )
1192 {
1193         register char *yy_cp;
1194     
1195     yy_cp = (yy_c_buf_p);
1196
1197         /* undo effects of setting up yytext */
1198         *yy_cp = (yy_hold_char);
1199
1200         if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1201                 { /* need to shift things up to make room */
1202                 /* +2 for EOB chars. */
1203                 register yy_size_t number_to_move = (yy_n_chars) + 2;
1204                 register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1205                                         YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1206                 register char *source =
1207                                 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1208
1209                 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1210                         *--dest = *--source;
1211
1212                 yy_cp += (int) (dest - source);
1213                 yy_bp += (int) (dest - source);
1214                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1215                         (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1216
1217                 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1218                         YY_FATAL_ERROR( "flex scanner push-back overflow" );
1219                 }
1220
1221         *--yy_cp = (char) c;
1222
1223         (yytext_ptr) = yy_bp;
1224         (yy_hold_char) = *yy_cp;
1225         (yy_c_buf_p) = yy_cp;
1226 }
1227
1228 #ifndef YY_NO_INPUT
1229 #ifdef __cplusplus
1230     static int yyinput (void)
1231 #else
1232     static int input  (void)
1233 #endif
1234
1235 {
1236         int c;
1237     
1238         *(yy_c_buf_p) = (yy_hold_char);
1239
1240         if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1241                 {
1242                 /* yy_c_buf_p now points to the character we want to return.
1243                  * If this occurs *before* the EOB characters, then it's a
1244                  * valid NUL; if not, then we've hit the end of the buffer.
1245                  */
1246                 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1247                         /* This was really a NUL. */
1248                         *(yy_c_buf_p) = '\0';
1249
1250                 else
1251                         { /* need more input */
1252                         yy_size_t offset = (yy_c_buf_p) - (yytext_ptr);
1253                         ++(yy_c_buf_p);
1254
1255                         switch ( yy_get_next_buffer(  ) )
1256                                 {
1257                                 case EOB_ACT_LAST_MATCH:
1258                                         /* This happens because yy_g_n_b()
1259                                          * sees that we've accumulated a
1260                                          * token and flags that we need to
1261                                          * try matching the token before
1262                                          * proceeding.  But for input(),
1263                                          * there's no matching to consider.
1264                                          * So convert the EOB_ACT_LAST_MATCH
1265                                          * to EOB_ACT_END_OF_FILE.
1266                                          */
1267
1268                                         /* Reset buffer status. */
1269                                         yyrestart(yyin );
1270
1271                                         /*FALLTHROUGH*/
1272
1273                                 case EOB_ACT_END_OF_FILE:
1274                                         {
1275                                         if ( yywrap( ) )
1276                                                 return EOF;
1277
1278                                         if ( ! (yy_did_buffer_switch_on_eof) )
1279                                                 YY_NEW_FILE;
1280 #ifdef __cplusplus
1281                                         return yyinput();
1282 #else
1283                                         return input();
1284 #endif
1285                                         }
1286
1287                                 case EOB_ACT_CONTINUE_SCAN:
1288                                         (yy_c_buf_p) = (yytext_ptr) + offset;
1289                                         break;
1290                                 }
1291                         }
1292                 }
1293
1294         c = *(unsigned char *) (yy_c_buf_p);    /* cast for 8-bit char's */
1295         *(yy_c_buf_p) = '\0';   /* preserve yytext */
1296         (yy_hold_char) = *++(yy_c_buf_p);
1297
1298         return c;
1299 }
1300 #endif  /* ifndef YY_NO_INPUT */
1301
1302 /** Immediately switch to a different input stream.
1303  * @param input_file A readable stream.
1304  * 
1305  * @note This function does not reset the start condition to @c INITIAL .
1306  */
1307     void yyrestart  (FILE * input_file )
1308 {
1309     
1310         if ( ! YY_CURRENT_BUFFER ){
1311         yyensure_buffer_stack ();
1312                 YY_CURRENT_BUFFER_LVALUE =
1313             yy_create_buffer(yyin,YY_BUF_SIZE );
1314         }
1315
1316         yy_init_buffer(YY_CURRENT_BUFFER,input_file );
1317         yy_load_buffer_state( );
1318 }
1319
1320 /** Switch to a different input buffer.
1321  * @param new_buffer The new input buffer.
1322  * 
1323  */
1324     void yy_switch_to_buffer  (YY_BUFFER_STATE  new_buffer )
1325 {
1326     
1327         /* TODO. We should be able to replace this entire function body
1328          * with
1329          *              yypop_buffer_state();
1330          *              yypush_buffer_state(new_buffer);
1331      */
1332         yyensure_buffer_stack ();
1333         if ( YY_CURRENT_BUFFER == new_buffer )
1334                 return;
1335
1336         if ( YY_CURRENT_BUFFER )
1337                 {
1338                 /* Flush out information for old buffer. */
1339                 *(yy_c_buf_p) = (yy_hold_char);
1340                 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1341                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1342                 }
1343
1344         YY_CURRENT_BUFFER_LVALUE = new_buffer;
1345         yy_load_buffer_state( );
1346
1347         /* We don't actually know whether we did this switch during
1348          * EOF (yywrap()) processing, but the only time this flag
1349          * is looked at is after yywrap() is called, so it's safe
1350          * to go ahead and always set it.
1351          */
1352         (yy_did_buffer_switch_on_eof) = 1;
1353 }
1354
1355 static void yy_load_buffer_state  (void)
1356 {
1357         (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1358         (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1359         yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1360         (yy_hold_char) = *(yy_c_buf_p);
1361 }
1362
1363 /** Allocate and initialize an input buffer state.
1364  * @param file A readable stream.
1365  * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1366  * 
1367  * @return the allocated buffer state.
1368  */
1369     YY_BUFFER_STATE yy_create_buffer  (FILE * file, int  size )
1370 {
1371         YY_BUFFER_STATE b;
1372     
1373         b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state )  );
1374         if ( ! b )
1375                 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1376
1377         b->yy_buf_size = size;
1378
1379         /* yy_ch_buf has to be 2 characters longer than the size given because
1380          * we need to put in 2 end-of-buffer characters.
1381          */
1382         b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2  );
1383         if ( ! b->yy_ch_buf )
1384                 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1385
1386         b->yy_is_our_buffer = 1;
1387
1388         yy_init_buffer(b,file );
1389
1390         return b;
1391 }
1392
1393 /** Destroy the buffer.
1394  * @param b a buffer created with yy_create_buffer()
1395  * 
1396  */
1397     void yy_delete_buffer (YY_BUFFER_STATE  b )
1398 {
1399     
1400         if ( ! b )
1401                 return;
1402
1403         if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1404                 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1405
1406         if ( b->yy_is_our_buffer )
1407                 yyfree((void *) b->yy_ch_buf  );
1408
1409         yyfree((void *) b  );
1410 }
1411
1412 /* Initializes or reinitializes a buffer.
1413  * This function is sometimes called more than once on the same buffer,
1414  * such as during a yyrestart() or at EOF.
1415  */
1416     static void yy_init_buffer  (YY_BUFFER_STATE  b, FILE * file )
1417
1418 {
1419         int oerrno = errno;
1420     
1421         yy_flush_buffer(b );
1422
1423         b->yy_input_file = file;
1424         b->yy_fill_buffer = 1;
1425
1426     /* If b is the current buffer, then yy_init_buffer was _probably_
1427      * called from yyrestart() or through yy_get_next_buffer.
1428      * In that case, we don't want to reset the lineno or column.
1429      */
1430     if (b != YY_CURRENT_BUFFER){
1431         b->yy_bs_lineno = 1;
1432         b->yy_bs_column = 0;
1433     }
1434
1435         b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1436     
1437         errno = oerrno;
1438 }
1439
1440 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1441  * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1442  * 
1443  */
1444     void yy_flush_buffer (YY_BUFFER_STATE  b )
1445 {
1446         if ( ! b )
1447                 return;
1448
1449         b->yy_n_chars = 0;
1450
1451         /* We always need two end-of-buffer characters.  The first causes
1452          * a transition to the end-of-buffer state.  The second causes
1453          * a jam in that state.
1454          */
1455         b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1456         b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1457
1458         b->yy_buf_pos = &b->yy_ch_buf[0];
1459
1460         b->yy_at_bol = 1;
1461         b->yy_buffer_status = YY_BUFFER_NEW;
1462
1463         if ( b == YY_CURRENT_BUFFER )
1464                 yy_load_buffer_state( );
1465 }
1466
1467 /** Pushes the new state onto the stack. The new state becomes
1468  *  the current state. This function will allocate the stack
1469  *  if necessary.
1470  *  @param new_buffer The new state.
1471  *  
1472  */
1473 void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
1474 {
1475         if (new_buffer == NULL)
1476                 return;
1477
1478         yyensure_buffer_stack();
1479
1480         /* This block is copied from yy_switch_to_buffer. */
1481         if ( YY_CURRENT_BUFFER )
1482                 {
1483                 /* Flush out information for old buffer. */
1484                 *(yy_c_buf_p) = (yy_hold_char);
1485                 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1486                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1487                 }
1488
1489         /* Only push if top exists. Otherwise, replace top. */
1490         if (YY_CURRENT_BUFFER)
1491                 (yy_buffer_stack_top)++;
1492         YY_CURRENT_BUFFER_LVALUE = new_buffer;
1493
1494         /* copied from yy_switch_to_buffer. */
1495         yy_load_buffer_state( );
1496         (yy_did_buffer_switch_on_eof) = 1;
1497 }
1498
1499 /** Removes and deletes the top of the stack, if present.
1500  *  The next element becomes the new top.
1501  *  
1502  */
1503 void yypop_buffer_state (void)
1504 {
1505         if (!YY_CURRENT_BUFFER)
1506                 return;
1507
1508         yy_delete_buffer(YY_CURRENT_BUFFER );
1509         YY_CURRENT_BUFFER_LVALUE = NULL;
1510         if ((yy_buffer_stack_top) > 0)
1511                 --(yy_buffer_stack_top);
1512
1513         if (YY_CURRENT_BUFFER) {
1514                 yy_load_buffer_state( );
1515                 (yy_did_buffer_switch_on_eof) = 1;
1516         }
1517 }
1518
1519 /* Allocates the stack if it does not exist.
1520  *  Guarantees space for at least one push.
1521  */
1522 static void yyensure_buffer_stack (void)
1523 {
1524         yy_size_t num_to_alloc;
1525     
1526         if (!(yy_buffer_stack)) {
1527
1528                 /* First allocation is just for 2 elements, since we don't know if this
1529                  * scanner will even need a stack. We use 2 instead of 1 to avoid an
1530                  * immediate realloc on the next call.
1531          */
1532                 num_to_alloc = 1;
1533                 (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
1534                                                                 (num_to_alloc * sizeof(struct yy_buffer_state*)
1535                                                                 );
1536                 if ( ! (yy_buffer_stack) )
1537                         YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1538                                                                   
1539                 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1540                                 
1541                 (yy_buffer_stack_max) = num_to_alloc;
1542                 (yy_buffer_stack_top) = 0;
1543                 return;
1544         }
1545
1546         if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1547
1548                 /* Increase the buffer to prepare for a possible push. */
1549                 int grow_size = 8 /* arbitrary grow size */;
1550
1551                 num_to_alloc = (yy_buffer_stack_max) + grow_size;
1552                 (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
1553                                                                 ((yy_buffer_stack),
1554                                                                 num_to_alloc * sizeof(struct yy_buffer_state*)
1555                                                                 );
1556                 if ( ! (yy_buffer_stack) )
1557                         YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1558
1559                 /* zero only the new slots.*/
1560                 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1561                 (yy_buffer_stack_max) = num_to_alloc;
1562         }
1563 }
1564
1565 /** Setup the input buffer state to scan directly from a user-specified character buffer.
1566  * @param base the character buffer
1567  * @param size the size in bytes of the character buffer
1568  * 
1569  * @return the newly allocated buffer state object. 
1570  */
1571 YY_BUFFER_STATE yy_scan_buffer  (char * base, yy_size_t  size )
1572 {
1573         YY_BUFFER_STATE b;
1574     
1575         if ( size < 2 ||
1576              base[size-2] != YY_END_OF_BUFFER_CHAR ||
1577              base[size-1] != YY_END_OF_BUFFER_CHAR )
1578                 /* They forgot to leave room for the EOB's. */
1579                 return 0;
1580
1581         b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state )  );
1582         if ( ! b )
1583                 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1584
1585         b->yy_buf_size = size - 2;      /* "- 2" to take care of EOB's */
1586         b->yy_buf_pos = b->yy_ch_buf = base;
1587         b->yy_is_our_buffer = 0;
1588         b->yy_input_file = 0;
1589         b->yy_n_chars = b->yy_buf_size;
1590         b->yy_is_interactive = 0;
1591         b->yy_at_bol = 1;
1592         b->yy_fill_buffer = 0;
1593         b->yy_buffer_status = YY_BUFFER_NEW;
1594
1595         yy_switch_to_buffer(b  );
1596
1597         return b;
1598 }
1599
1600 /** Setup the input buffer state to scan a string. The next call to yylex() will
1601  * scan from a @e copy of @a str.
1602  * @param yystr a NUL-terminated string to scan
1603  * 
1604  * @return the newly allocated buffer state object.
1605  * @note If you want to scan bytes that may contain NUL values, then use
1606  *       yy_scan_bytes() instead.
1607  */
1608 YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
1609 {
1610     
1611         return yy_scan_bytes(yystr,strlen(yystr) );
1612 }
1613
1614 /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
1615  * scan from a @e copy of @a bytes.
1616  * @param yybytes the byte buffer to scan
1617  * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
1618  * 
1619  * @return the newly allocated buffer state object.
1620  */
1621 YY_BUFFER_STATE yy_scan_bytes  (yyconst char * yybytes, yy_size_t  _yybytes_len )
1622 {
1623         YY_BUFFER_STATE b;
1624         char *buf;
1625         yy_size_t n;
1626         yy_size_t i;
1627     
1628         /* Get memory for full buffer, including space for trailing EOB's. */
1629         n = _yybytes_len + 2;
1630         buf = (char *) yyalloc(n  );
1631         if ( ! buf )
1632                 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1633
1634         for ( i = 0; i < _yybytes_len; ++i )
1635                 buf[i] = yybytes[i];
1636
1637         buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1638
1639         b = yy_scan_buffer(buf,n );
1640         if ( ! b )
1641                 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1642
1643         /* It's okay to grow etc. this buffer, and we should throw it
1644          * away when we're done.
1645          */
1646         b->yy_is_our_buffer = 1;
1647
1648         return b;
1649 }
1650
1651 #ifndef YY_EXIT_FAILURE
1652 #define YY_EXIT_FAILURE 2
1653 #endif
1654
1655 static void yy_fatal_error (yyconst char* msg )
1656 {
1657         (void) fprintf( stderr, "%s\n", msg );
1658         exit( YY_EXIT_FAILURE );
1659 }
1660
1661 /* Redefine yyless() so it works in section 3 code. */
1662
1663 #undef yyless
1664 #define yyless(n) \
1665         do \
1666                 { \
1667                 /* Undo effects of setting up yytext. */ \
1668         int yyless_macro_arg = (n); \
1669         YY_LESS_LINENO(yyless_macro_arg);\
1670                 yytext[yyleng] = (yy_hold_char); \
1671                 (yy_c_buf_p) = yytext + yyless_macro_arg; \
1672                 (yy_hold_char) = *(yy_c_buf_p); \
1673                 *(yy_c_buf_p) = '\0'; \
1674                 yyleng = yyless_macro_arg; \
1675                 } \
1676         while ( 0 )
1677
1678 /* Accessor  methods (get/set functions) to struct members. */
1679
1680 /** Get the current line number.
1681  * 
1682  */
1683 int yyget_lineno  (void)
1684 {
1685         
1686     return yylineno;
1687 }
1688
1689 /** Get the input stream.
1690  * 
1691  */
1692 FILE *yyget_in  (void)
1693 {
1694         return yyin;
1695 }
1696
1697 /** Get the output stream.
1698  * 
1699  */
1700 FILE *yyget_out  (void)
1701 {
1702         return yyout;
1703 }
1704
1705 /** Get the length of the current token.
1706  * 
1707  */
1708 yy_size_t yyget_leng  (void)
1709 {
1710         return yyleng;
1711 }
1712
1713 /** Get the current token.
1714  * 
1715  */
1716
1717 char *yyget_text  (void)
1718 {
1719         return yytext;
1720 }
1721
1722 /** Set the current line number.
1723  * @param line_number
1724  * 
1725  */
1726 void yyset_lineno (int  line_number )
1727 {
1728     
1729     yylineno = line_number;
1730 }
1731
1732 /** Set the input stream. This does not discard the current
1733  * input buffer.
1734  * @param in_str A readable stream.
1735  * 
1736  * @see yy_switch_to_buffer
1737  */
1738 void yyset_in (FILE *  in_str )
1739 {
1740         yyin = in_str ;
1741 }
1742
1743 void yyset_out (FILE *  out_str )
1744 {
1745         yyout = out_str ;
1746 }
1747
1748 int yyget_debug  (void)
1749 {
1750         return yy_flex_debug;
1751 }
1752
1753 void yyset_debug (int  bdebug )
1754 {
1755         yy_flex_debug = bdebug ;
1756 }
1757
1758 static int yy_init_globals (void)
1759 {
1760         /* Initialization is the same as for the non-reentrant scanner.
1761      * This function is called from yylex_destroy(), so don't allocate here.
1762      */
1763
1764     (yy_buffer_stack) = 0;
1765     (yy_buffer_stack_top) = 0;
1766     (yy_buffer_stack_max) = 0;
1767     (yy_c_buf_p) = (char *) 0;
1768     (yy_init) = 0;
1769     (yy_start) = 0;
1770
1771 /* Defined in main.c */
1772 #ifdef YY_STDINIT
1773     yyin = stdin;
1774     yyout = stdout;
1775 #else
1776     yyin = (FILE *) 0;
1777     yyout = (FILE *) 0;
1778 #endif
1779
1780     /* For future reference: Set errno on error, since we are called by
1781      * yylex_init()
1782      */
1783     return 0;
1784 }
1785
1786 /* yylex_destroy is for both reentrant and non-reentrant scanners. */
1787 int yylex_destroy  (void)
1788 {
1789     
1790     /* Pop the buffer stack, destroying each element. */
1791         while(YY_CURRENT_BUFFER){
1792                 yy_delete_buffer(YY_CURRENT_BUFFER  );
1793                 YY_CURRENT_BUFFER_LVALUE = NULL;
1794                 yypop_buffer_state();
1795         }
1796
1797         /* Destroy the stack itself. */
1798         yyfree((yy_buffer_stack) );
1799         (yy_buffer_stack) = NULL;
1800
1801     /* Reset the globals. This is important in a non-reentrant scanner so the next time
1802      * yylex() is called, initialization will occur. */
1803     yy_init_globals( );
1804
1805     return 0;
1806 }
1807
1808 /*
1809  * Internal utility routines.
1810  */
1811
1812 #ifndef yytext_ptr
1813 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
1814 {
1815         register int i;
1816         for ( i = 0; i < n; ++i )
1817                 s1[i] = s2[i];
1818 }
1819 #endif
1820
1821 #ifdef YY_NEED_STRLEN
1822 static int yy_flex_strlen (yyconst char * s )
1823 {
1824         register int n;
1825         for ( n = 0; s[n]; ++n )
1826                 ;
1827
1828         return n;
1829 }
1830 #endif
1831
1832 void *yyalloc (yy_size_t  size )
1833 {
1834         return (void *) malloc( size );
1835 }
1836
1837 void *yyrealloc  (void * ptr, yy_size_t  size )
1838 {
1839         /* The cast to (char *) in the following accommodates both
1840          * implementations that use char* generic pointers, and those
1841          * that use void* generic pointers.  It works with the latter
1842          * because both ANSI C and C++ allow castless assignment from
1843          * any pointer type to void*, and deal with argument conversions
1844          * as though doing an assignment.
1845          */
1846         return (void *) realloc( (char *) ptr, size );
1847 }
1848
1849 void yyfree (void * ptr )
1850 {
1851         free( (char *) ptr );   /* see yyrealloc() for (char *) cast */
1852 }
1853
1854 #define YYTABLES_NAME "yytables"
1855
1856 #line 44 "spotlight_rawquery_lexer.l"
1857
1858
1859