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