]> arthur.barton.de Git - netatalk.git/blob - etc/spotlight/spotlight_rawquery_lexer.c
Spotlight: support for OS X 10.6 clients
[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 18
370 #define YY_END_OF_BUFFER 19
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,   19,   18,   17,   18,    5,   18,   18,    6,
381         7,   16,   15,   13,   11,   14,   16,   16,   16,   18,
382        18,   18,   18,   12,    0,    8,   16,    0,    0,    0,
383        10,   16,   16,   16,    9,    0,    0,    0,   16,   16,
384        16,    0,    0,   16,   16,    4,    0,   16,    3,    0,
385        16,    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 EQUAL;
830         YY_BREAK
831 case 12:
832 YY_RULE_SETUP
833 #line 39 "spotlight_rawquery_lexer.l"
834 return UNEQUAL;
835         YY_BREAK
836 case 13:
837 YY_RULE_SETUP
838 #line 40 "spotlight_rawquery_lexer.l"
839 return LT;
840         YY_BREAK
841 case 14:
842 YY_RULE_SETUP
843 #line 41 "spotlight_rawquery_lexer.l"
844 return GT;
845         YY_BREAK
846 case 15:
847 YY_RULE_SETUP
848 #line 42 "spotlight_rawquery_lexer.l"
849 return COMMA;
850         YY_BREAK
851 case 16:
852 YY_RULE_SETUP
853 #line 43 "spotlight_rawquery_lexer.l"
854 {yylval.sval = talloc_strdup(SLQ_VAR, yytext); return WORD;}
855         YY_BREAK
856 case 17:
857 /* rule 17 can match eol */
858 YY_RULE_SETUP
859 #line 44 "spotlight_rawquery_lexer.l"
860 /* ignore */
861         YY_BREAK
862 case 18:
863 YY_RULE_SETUP
864 #line 45 "spotlight_rawquery_lexer.l"
865 ECHO;
866         YY_BREAK
867 #line 868 "spotlight_rawquery_lexer.c"
868 case YY_STATE_EOF(INITIAL):
869         yyterminate();
870
871         case YY_END_OF_BUFFER:
872                 {
873                 /* Amount of text matched not including the EOB char. */
874                 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
875
876                 /* Undo the effects of YY_DO_BEFORE_ACTION. */
877                 *yy_cp = (yy_hold_char);
878                 YY_RESTORE_YY_MORE_OFFSET
879
880                 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
881                         {
882                         /* We're scanning a new file or input source.  It's
883                          * possible that this happened because the user
884                          * just pointed yyin at a new source and called
885                          * yylex().  If so, then we have to assure
886                          * consistency between YY_CURRENT_BUFFER and our
887                          * globals.  Here is the right place to do so, because
888                          * this is the first action (other than possibly a
889                          * back-up) that will match for the new input source.
890                          */
891                         (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
892                         YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
893                         YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
894                         }
895
896                 /* Note that here we test for yy_c_buf_p "<=" to the position
897                  * of the first EOB in the buffer, since yy_c_buf_p will
898                  * already have been incremented past the NUL character
899                  * (since all states make transitions on EOB to the
900                  * end-of-buffer state).  Contrast this with the test
901                  * in input().
902                  */
903                 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
904                         { /* This was really a NUL. */
905                         yy_state_type yy_next_state;
906
907                         (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
908
909                         yy_current_state = yy_get_previous_state(  );
910
911                         /* Okay, we're now positioned to make the NUL
912                          * transition.  We couldn't have
913                          * yy_get_previous_state() go ahead and do it
914                          * for us because it doesn't know how to deal
915                          * with the possibility of jamming (and we don't
916                          * want to build jamming into it because then it
917                          * will run more slowly).
918                          */
919
920                         yy_next_state = yy_try_NUL_trans( yy_current_state );
921
922                         yy_bp = (yytext_ptr) + YY_MORE_ADJ;
923
924                         if ( yy_next_state )
925                                 {
926                                 /* Consume the NUL. */
927                                 yy_cp = ++(yy_c_buf_p);
928                                 yy_current_state = yy_next_state;
929                                 goto yy_match;
930                                 }
931
932                         else
933                                 {
934                                 yy_cp = (yy_c_buf_p);
935                                 goto yy_find_action;
936                                 }
937                         }
938
939                 else switch ( yy_get_next_buffer(  ) )
940                         {
941                         case EOB_ACT_END_OF_FILE:
942                                 {
943                                 (yy_did_buffer_switch_on_eof) = 0;
944
945                                 if ( yywrap( ) )
946                                         {
947                                         /* Note: because we've taken care in
948                                          * yy_get_next_buffer() to have set up
949                                          * yytext, we can now set up
950                                          * yy_c_buf_p so that if some total
951                                          * hoser (like flex itself) wants to
952                                          * call the scanner after we return the
953                                          * YY_NULL, it'll still work - another
954                                          * YY_NULL will get returned.
955                                          */
956                                         (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
957
958                                         yy_act = YY_STATE_EOF(YY_START);
959                                         goto do_action;
960                                         }
961
962                                 else
963                                         {
964                                         if ( ! (yy_did_buffer_switch_on_eof) )
965                                                 YY_NEW_FILE;
966                                         }
967                                 break;
968                                 }
969
970                         case EOB_ACT_CONTINUE_SCAN:
971                                 (yy_c_buf_p) =
972                                         (yytext_ptr) + yy_amount_of_matched_text;
973
974                                 yy_current_state = yy_get_previous_state(  );
975
976                                 yy_cp = (yy_c_buf_p);
977                                 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
978                                 goto yy_match;
979
980                         case EOB_ACT_LAST_MATCH:
981                                 (yy_c_buf_p) =
982                                 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
983
984                                 yy_current_state = yy_get_previous_state(  );
985
986                                 yy_cp = (yy_c_buf_p);
987                                 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
988                                 goto yy_find_action;
989                         }
990                 break;
991                 }
992
993         default:
994                 YY_FATAL_ERROR(
995                         "fatal flex scanner internal error--no action found" );
996         } /* end of action switch */
997                 } /* end of scanning one token */
998 } /* end of yylex */
999
1000 /* yy_get_next_buffer - try to read in a new buffer
1001  *
1002  * Returns a code representing an action:
1003  *      EOB_ACT_LAST_MATCH -
1004  *      EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1005  *      EOB_ACT_END_OF_FILE - end of file
1006  */
1007 static int yy_get_next_buffer (void)
1008 {
1009         register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1010         register char *source = (yytext_ptr);
1011         register int number_to_move, i;
1012         int ret_val;
1013
1014         if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1015                 YY_FATAL_ERROR(
1016                 "fatal flex scanner internal error--end of buffer missed" );
1017
1018         if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1019                 { /* Don't try to fill the buffer, so this is an EOF. */
1020                 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1021                         {
1022                         /* We matched a single character, the EOB, so
1023                          * treat this as a final EOF.
1024                          */
1025                         return EOB_ACT_END_OF_FILE;
1026                         }
1027
1028                 else
1029                         {
1030                         /* We matched some text prior to the EOB, first
1031                          * process it.
1032                          */
1033                         return EOB_ACT_LAST_MATCH;
1034                         }
1035                 }
1036
1037         /* Try to read more data. */
1038
1039         /* First move last chars to start of buffer. */
1040         number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1041
1042         for ( i = 0; i < number_to_move; ++i )
1043                 *(dest++) = *(source++);
1044
1045         if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1046                 /* don't do the read, it's not guaranteed to return an EOF,
1047                  * just force an EOF
1048                  */
1049                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1050
1051         else
1052                 {
1053                         yy_size_t num_to_read =
1054                         YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1055
1056                 while ( num_to_read <= 0 )
1057                         { /* Not enough room in the buffer - grow it. */
1058
1059                         /* just a shorter name for the current buffer */
1060                         YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
1061
1062                         int yy_c_buf_p_offset =
1063                                 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1064
1065                         if ( b->yy_is_our_buffer )
1066                                 {
1067                                 yy_size_t new_size = b->yy_buf_size * 2;
1068
1069                                 if ( new_size <= 0 )
1070                                         b->yy_buf_size += b->yy_buf_size / 8;
1071                                 else
1072                                         b->yy_buf_size *= 2;
1073
1074                                 b->yy_ch_buf = (char *)
1075                                         /* Include room in for 2 EOB chars. */
1076                                         yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2  );
1077                                 }
1078                         else
1079                                 /* Can't grow it, we don't own it. */
1080                                 b->yy_ch_buf = 0;
1081
1082                         if ( ! b->yy_ch_buf )
1083                                 YY_FATAL_ERROR(
1084                                 "fatal error - scanner input buffer overflow" );
1085
1086                         (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1087
1088                         num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1089                                                 number_to_move - 1;
1090
1091                         }
1092
1093                 if ( num_to_read > YY_READ_BUF_SIZE )
1094                         num_to_read = YY_READ_BUF_SIZE;
1095
1096                 /* Read in more data. */
1097                 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1098                         (yy_n_chars), num_to_read );
1099
1100                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1101                 }
1102
1103         if ( (yy_n_chars) == 0 )
1104                 {
1105                 if ( number_to_move == YY_MORE_ADJ )
1106                         {
1107                         ret_val = EOB_ACT_END_OF_FILE;
1108                         yyrestart(yyin  );
1109                         }
1110
1111                 else
1112                         {
1113                         ret_val = EOB_ACT_LAST_MATCH;
1114                         YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1115                                 YY_BUFFER_EOF_PENDING;
1116                         }
1117                 }
1118
1119         else
1120                 ret_val = EOB_ACT_CONTINUE_SCAN;
1121
1122         if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1123                 /* Extend the array by 50%, plus the number we really need. */
1124                 yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1125                 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size  );
1126                 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1127                         YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1128         }
1129
1130         (yy_n_chars) += number_to_move;
1131         YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1132         YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1133
1134         (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1135
1136         return ret_val;
1137 }
1138
1139 /* yy_get_previous_state - get the state just before the EOB char was reached */
1140
1141     static yy_state_type yy_get_previous_state (void)
1142 {
1143         register yy_state_type yy_current_state;
1144         register char *yy_cp;
1145     
1146         yy_current_state = (yy_start);
1147
1148         for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1149                 {
1150                 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1151                 if ( yy_accept[yy_current_state] )
1152                         {
1153                         (yy_last_accepting_state) = yy_current_state;
1154                         (yy_last_accepting_cpos) = yy_cp;
1155                         }
1156                 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1157                         {
1158                         yy_current_state = (int) yy_def[yy_current_state];
1159                         if ( yy_current_state >= 57 )
1160                                 yy_c = yy_meta[(unsigned int) yy_c];
1161                         }
1162                 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1163                 }
1164
1165         return yy_current_state;
1166 }
1167
1168 /* yy_try_NUL_trans - try to make a transition on the NUL character
1169  *
1170  * synopsis
1171  *      next_state = yy_try_NUL_trans( current_state );
1172  */
1173     static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state )
1174 {
1175         register int yy_is_jam;
1176         register char *yy_cp = (yy_c_buf_p);
1177
1178         register YY_CHAR yy_c = 1;
1179         if ( yy_accept[yy_current_state] )
1180                 {
1181                 (yy_last_accepting_state) = yy_current_state;
1182                 (yy_last_accepting_cpos) = yy_cp;
1183                 }
1184         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1185                 {
1186                 yy_current_state = (int) yy_def[yy_current_state];
1187                 if ( yy_current_state >= 57 )
1188                         yy_c = yy_meta[(unsigned int) yy_c];
1189                 }
1190         yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1191         yy_is_jam = (yy_current_state == 56);
1192
1193                 return yy_is_jam ? 0 : yy_current_state;
1194 }
1195
1196     static void yyunput (int c, register char * yy_bp )
1197 {
1198         register char *yy_cp;
1199     
1200     yy_cp = (yy_c_buf_p);
1201
1202         /* undo effects of setting up yytext */
1203         *yy_cp = (yy_hold_char);
1204
1205         if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1206                 { /* need to shift things up to make room */
1207                 /* +2 for EOB chars. */
1208                 register yy_size_t number_to_move = (yy_n_chars) + 2;
1209                 register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1210                                         YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1211                 register char *source =
1212                                 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1213
1214                 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1215                         *--dest = *--source;
1216
1217                 yy_cp += (int) (dest - source);
1218                 yy_bp += (int) (dest - source);
1219                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1220                         (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1221
1222                 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1223                         YY_FATAL_ERROR( "flex scanner push-back overflow" );
1224                 }
1225
1226         *--yy_cp = (char) c;
1227
1228         (yytext_ptr) = yy_bp;
1229         (yy_hold_char) = *yy_cp;
1230         (yy_c_buf_p) = yy_cp;
1231 }
1232
1233 #ifndef YY_NO_INPUT
1234 #ifdef __cplusplus
1235     static int yyinput (void)
1236 #else
1237     static int input  (void)
1238 #endif
1239
1240 {
1241         int c;
1242     
1243         *(yy_c_buf_p) = (yy_hold_char);
1244
1245         if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1246                 {
1247                 /* yy_c_buf_p now points to the character we want to return.
1248                  * If this occurs *before* the EOB characters, then it's a
1249                  * valid NUL; if not, then we've hit the end of the buffer.
1250                  */
1251                 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1252                         /* This was really a NUL. */
1253                         *(yy_c_buf_p) = '\0';
1254
1255                 else
1256                         { /* need more input */
1257                         yy_size_t offset = (yy_c_buf_p) - (yytext_ptr);
1258                         ++(yy_c_buf_p);
1259
1260                         switch ( yy_get_next_buffer(  ) )
1261                                 {
1262                                 case EOB_ACT_LAST_MATCH:
1263                                         /* This happens because yy_g_n_b()
1264                                          * sees that we've accumulated a
1265                                          * token and flags that we need to
1266                                          * try matching the token before
1267                                          * proceeding.  But for input(),
1268                                          * there's no matching to consider.
1269                                          * So convert the EOB_ACT_LAST_MATCH
1270                                          * to EOB_ACT_END_OF_FILE.
1271                                          */
1272
1273                                         /* Reset buffer status. */
1274                                         yyrestart(yyin );
1275
1276                                         /*FALLTHROUGH*/
1277
1278                                 case EOB_ACT_END_OF_FILE:
1279                                         {
1280                                         if ( yywrap( ) )
1281                                                 return EOF;
1282
1283                                         if ( ! (yy_did_buffer_switch_on_eof) )
1284                                                 YY_NEW_FILE;
1285 #ifdef __cplusplus
1286                                         return yyinput();
1287 #else
1288                                         return input();
1289 #endif
1290                                         }
1291
1292                                 case EOB_ACT_CONTINUE_SCAN:
1293                                         (yy_c_buf_p) = (yytext_ptr) + offset;
1294                                         break;
1295                                 }
1296                         }
1297                 }
1298
1299         c = *(unsigned char *) (yy_c_buf_p);    /* cast for 8-bit char's */
1300         *(yy_c_buf_p) = '\0';   /* preserve yytext */
1301         (yy_hold_char) = *++(yy_c_buf_p);
1302
1303         return c;
1304 }
1305 #endif  /* ifndef YY_NO_INPUT */
1306
1307 /** Immediately switch to a different input stream.
1308  * @param input_file A readable stream.
1309  * 
1310  * @note This function does not reset the start condition to @c INITIAL .
1311  */
1312     void yyrestart  (FILE * input_file )
1313 {
1314     
1315         if ( ! YY_CURRENT_BUFFER ){
1316         yyensure_buffer_stack ();
1317                 YY_CURRENT_BUFFER_LVALUE =
1318             yy_create_buffer(yyin,YY_BUF_SIZE );
1319         }
1320
1321         yy_init_buffer(YY_CURRENT_BUFFER,input_file );
1322         yy_load_buffer_state( );
1323 }
1324
1325 /** Switch to a different input buffer.
1326  * @param new_buffer The new input buffer.
1327  * 
1328  */
1329     void yy_switch_to_buffer  (YY_BUFFER_STATE  new_buffer )
1330 {
1331     
1332         /* TODO. We should be able to replace this entire function body
1333          * with
1334          *              yypop_buffer_state();
1335          *              yypush_buffer_state(new_buffer);
1336      */
1337         yyensure_buffer_stack ();
1338         if ( YY_CURRENT_BUFFER == new_buffer )
1339                 return;
1340
1341         if ( YY_CURRENT_BUFFER )
1342                 {
1343                 /* Flush out information for old buffer. */
1344                 *(yy_c_buf_p) = (yy_hold_char);
1345                 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1346                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1347                 }
1348
1349         YY_CURRENT_BUFFER_LVALUE = new_buffer;
1350         yy_load_buffer_state( );
1351
1352         /* We don't actually know whether we did this switch during
1353          * EOF (yywrap()) processing, but the only time this flag
1354          * is looked at is after yywrap() is called, so it's safe
1355          * to go ahead and always set it.
1356          */
1357         (yy_did_buffer_switch_on_eof) = 1;
1358 }
1359
1360 static void yy_load_buffer_state  (void)
1361 {
1362         (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1363         (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1364         yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1365         (yy_hold_char) = *(yy_c_buf_p);
1366 }
1367
1368 /** Allocate and initialize an input buffer state.
1369  * @param file A readable stream.
1370  * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1371  * 
1372  * @return the allocated buffer state.
1373  */
1374     YY_BUFFER_STATE yy_create_buffer  (FILE * file, int  size )
1375 {
1376         YY_BUFFER_STATE b;
1377     
1378         b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state )  );
1379         if ( ! b )
1380                 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1381
1382         b->yy_buf_size = size;
1383
1384         /* yy_ch_buf has to be 2 characters longer than the size given because
1385          * we need to put in 2 end-of-buffer characters.
1386          */
1387         b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2  );
1388         if ( ! b->yy_ch_buf )
1389                 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1390
1391         b->yy_is_our_buffer = 1;
1392
1393         yy_init_buffer(b,file );
1394
1395         return b;
1396 }
1397
1398 /** Destroy the buffer.
1399  * @param b a buffer created with yy_create_buffer()
1400  * 
1401  */
1402     void yy_delete_buffer (YY_BUFFER_STATE  b )
1403 {
1404     
1405         if ( ! b )
1406                 return;
1407
1408         if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1409                 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1410
1411         if ( b->yy_is_our_buffer )
1412                 yyfree((void *) b->yy_ch_buf  );
1413
1414         yyfree((void *) b  );
1415 }
1416
1417 /* Initializes or reinitializes a buffer.
1418  * This function is sometimes called more than once on the same buffer,
1419  * such as during a yyrestart() or at EOF.
1420  */
1421     static void yy_init_buffer  (YY_BUFFER_STATE  b, FILE * file )
1422
1423 {
1424         int oerrno = errno;
1425     
1426         yy_flush_buffer(b );
1427
1428         b->yy_input_file = file;
1429         b->yy_fill_buffer = 1;
1430
1431     /* If b is the current buffer, then yy_init_buffer was _probably_
1432      * called from yyrestart() or through yy_get_next_buffer.
1433      * In that case, we don't want to reset the lineno or column.
1434      */
1435     if (b != YY_CURRENT_BUFFER){
1436         b->yy_bs_lineno = 1;
1437         b->yy_bs_column = 0;
1438     }
1439
1440         b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1441     
1442         errno = oerrno;
1443 }
1444
1445 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1446  * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1447  * 
1448  */
1449     void yy_flush_buffer (YY_BUFFER_STATE  b )
1450 {
1451         if ( ! b )
1452                 return;
1453
1454         b->yy_n_chars = 0;
1455
1456         /* We always need two end-of-buffer characters.  The first causes
1457          * a transition to the end-of-buffer state.  The second causes
1458          * a jam in that state.
1459          */
1460         b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1461         b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1462
1463         b->yy_buf_pos = &b->yy_ch_buf[0];
1464
1465         b->yy_at_bol = 1;
1466         b->yy_buffer_status = YY_BUFFER_NEW;
1467
1468         if ( b == YY_CURRENT_BUFFER )
1469                 yy_load_buffer_state( );
1470 }
1471
1472 /** Pushes the new state onto the stack. The new state becomes
1473  *  the current state. This function will allocate the stack
1474  *  if necessary.
1475  *  @param new_buffer The new state.
1476  *  
1477  */
1478 void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
1479 {
1480         if (new_buffer == NULL)
1481                 return;
1482
1483         yyensure_buffer_stack();
1484
1485         /* This block is copied from yy_switch_to_buffer. */
1486         if ( YY_CURRENT_BUFFER )
1487                 {
1488                 /* Flush out information for old buffer. */
1489                 *(yy_c_buf_p) = (yy_hold_char);
1490                 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1491                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1492                 }
1493
1494         /* Only push if top exists. Otherwise, replace top. */
1495         if (YY_CURRENT_BUFFER)
1496                 (yy_buffer_stack_top)++;
1497         YY_CURRENT_BUFFER_LVALUE = new_buffer;
1498
1499         /* copied from yy_switch_to_buffer. */
1500         yy_load_buffer_state( );
1501         (yy_did_buffer_switch_on_eof) = 1;
1502 }
1503
1504 /** Removes and deletes the top of the stack, if present.
1505  *  The next element becomes the new top.
1506  *  
1507  */
1508 void yypop_buffer_state (void)
1509 {
1510         if (!YY_CURRENT_BUFFER)
1511                 return;
1512
1513         yy_delete_buffer(YY_CURRENT_BUFFER );
1514         YY_CURRENT_BUFFER_LVALUE = NULL;
1515         if ((yy_buffer_stack_top) > 0)
1516                 --(yy_buffer_stack_top);
1517
1518         if (YY_CURRENT_BUFFER) {
1519                 yy_load_buffer_state( );
1520                 (yy_did_buffer_switch_on_eof) = 1;
1521         }
1522 }
1523
1524 /* Allocates the stack if it does not exist.
1525  *  Guarantees space for at least one push.
1526  */
1527 static void yyensure_buffer_stack (void)
1528 {
1529         yy_size_t num_to_alloc;
1530     
1531         if (!(yy_buffer_stack)) {
1532
1533                 /* First allocation is just for 2 elements, since we don't know if this
1534                  * scanner will even need a stack. We use 2 instead of 1 to avoid an
1535                  * immediate realloc on the next call.
1536          */
1537                 num_to_alloc = 1;
1538                 (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
1539                                                                 (num_to_alloc * sizeof(struct yy_buffer_state*)
1540                                                                 );
1541                 if ( ! (yy_buffer_stack) )
1542                         YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1543                                                                   
1544                 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1545                                 
1546                 (yy_buffer_stack_max) = num_to_alloc;
1547                 (yy_buffer_stack_top) = 0;
1548                 return;
1549         }
1550
1551         if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1552
1553                 /* Increase the buffer to prepare for a possible push. */
1554                 int grow_size = 8 /* arbitrary grow size */;
1555
1556                 num_to_alloc = (yy_buffer_stack_max) + grow_size;
1557                 (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
1558                                                                 ((yy_buffer_stack),
1559                                                                 num_to_alloc * sizeof(struct yy_buffer_state*)
1560                                                                 );
1561                 if ( ! (yy_buffer_stack) )
1562                         YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1563
1564                 /* zero only the new slots.*/
1565                 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1566                 (yy_buffer_stack_max) = num_to_alloc;
1567         }
1568 }
1569
1570 /** Setup the input buffer state to scan directly from a user-specified character buffer.
1571  * @param base the character buffer
1572  * @param size the size in bytes of the character buffer
1573  * 
1574  * @return the newly allocated buffer state object. 
1575  */
1576 YY_BUFFER_STATE yy_scan_buffer  (char * base, yy_size_t  size )
1577 {
1578         YY_BUFFER_STATE b;
1579     
1580         if ( size < 2 ||
1581              base[size-2] != YY_END_OF_BUFFER_CHAR ||
1582              base[size-1] != YY_END_OF_BUFFER_CHAR )
1583                 /* They forgot to leave room for the EOB's. */
1584                 return 0;
1585
1586         b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state )  );
1587         if ( ! b )
1588                 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1589
1590         b->yy_buf_size = size - 2;      /* "- 2" to take care of EOB's */
1591         b->yy_buf_pos = b->yy_ch_buf = base;
1592         b->yy_is_our_buffer = 0;
1593         b->yy_input_file = 0;
1594         b->yy_n_chars = b->yy_buf_size;
1595         b->yy_is_interactive = 0;
1596         b->yy_at_bol = 1;
1597         b->yy_fill_buffer = 0;
1598         b->yy_buffer_status = YY_BUFFER_NEW;
1599
1600         yy_switch_to_buffer(b  );
1601
1602         return b;
1603 }
1604
1605 /** Setup the input buffer state to scan a string. The next call to yylex() will
1606  * scan from a @e copy of @a str.
1607  * @param yystr a NUL-terminated string to scan
1608  * 
1609  * @return the newly allocated buffer state object.
1610  * @note If you want to scan bytes that may contain NUL values, then use
1611  *       yy_scan_bytes() instead.
1612  */
1613 YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
1614 {
1615     
1616         return yy_scan_bytes(yystr,strlen(yystr) );
1617 }
1618
1619 /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
1620  * scan from a @e copy of @a bytes.
1621  * @param yybytes the byte buffer to scan
1622  * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
1623  * 
1624  * @return the newly allocated buffer state object.
1625  */
1626 YY_BUFFER_STATE yy_scan_bytes  (yyconst char * yybytes, yy_size_t  _yybytes_len )
1627 {
1628         YY_BUFFER_STATE b;
1629         char *buf;
1630         yy_size_t n;
1631         yy_size_t i;
1632     
1633         /* Get memory for full buffer, including space for trailing EOB's. */
1634         n = _yybytes_len + 2;
1635         buf = (char *) yyalloc(n  );
1636         if ( ! buf )
1637                 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1638
1639         for ( i = 0; i < _yybytes_len; ++i )
1640                 buf[i] = yybytes[i];
1641
1642         buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1643
1644         b = yy_scan_buffer(buf,n );
1645         if ( ! b )
1646                 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1647
1648         /* It's okay to grow etc. this buffer, and we should throw it
1649          * away when we're done.
1650          */
1651         b->yy_is_our_buffer = 1;
1652
1653         return b;
1654 }
1655
1656 #ifndef YY_EXIT_FAILURE
1657 #define YY_EXIT_FAILURE 2
1658 #endif
1659
1660 static void yy_fatal_error (yyconst char* msg )
1661 {
1662         (void) fprintf( stderr, "%s\n", msg );
1663         exit( YY_EXIT_FAILURE );
1664 }
1665
1666 /* Redefine yyless() so it works in section 3 code. */
1667
1668 #undef yyless
1669 #define yyless(n) \
1670         do \
1671                 { \
1672                 /* Undo effects of setting up yytext. */ \
1673         int yyless_macro_arg = (n); \
1674         YY_LESS_LINENO(yyless_macro_arg);\
1675                 yytext[yyleng] = (yy_hold_char); \
1676                 (yy_c_buf_p) = yytext + yyless_macro_arg; \
1677                 (yy_hold_char) = *(yy_c_buf_p); \
1678                 *(yy_c_buf_p) = '\0'; \
1679                 yyleng = yyless_macro_arg; \
1680                 } \
1681         while ( 0 )
1682
1683 /* Accessor  methods (get/set functions) to struct members. */
1684
1685 /** Get the current line number.
1686  * 
1687  */
1688 int yyget_lineno  (void)
1689 {
1690         
1691     return yylineno;
1692 }
1693
1694 /** Get the input stream.
1695  * 
1696  */
1697 FILE *yyget_in  (void)
1698 {
1699         return yyin;
1700 }
1701
1702 /** Get the output stream.
1703  * 
1704  */
1705 FILE *yyget_out  (void)
1706 {
1707         return yyout;
1708 }
1709
1710 /** Get the length of the current token.
1711  * 
1712  */
1713 yy_size_t yyget_leng  (void)
1714 {
1715         return yyleng;
1716 }
1717
1718 /** Get the current token.
1719  * 
1720  */
1721
1722 char *yyget_text  (void)
1723 {
1724         return yytext;
1725 }
1726
1727 /** Set the current line number.
1728  * @param line_number
1729  * 
1730  */
1731 void yyset_lineno (int  line_number )
1732 {
1733     
1734     yylineno = line_number;
1735 }
1736
1737 /** Set the input stream. This does not discard the current
1738  * input buffer.
1739  * @param in_str A readable stream.
1740  * 
1741  * @see yy_switch_to_buffer
1742  */
1743 void yyset_in (FILE *  in_str )
1744 {
1745         yyin = in_str ;
1746 }
1747
1748 void yyset_out (FILE *  out_str )
1749 {
1750         yyout = out_str ;
1751 }
1752
1753 int yyget_debug  (void)
1754 {
1755         return yy_flex_debug;
1756 }
1757
1758 void yyset_debug (int  bdebug )
1759 {
1760         yy_flex_debug = bdebug ;
1761 }
1762
1763 static int yy_init_globals (void)
1764 {
1765         /* Initialization is the same as for the non-reentrant scanner.
1766      * This function is called from yylex_destroy(), so don't allocate here.
1767      */
1768
1769     (yy_buffer_stack) = 0;
1770     (yy_buffer_stack_top) = 0;
1771     (yy_buffer_stack_max) = 0;
1772     (yy_c_buf_p) = (char *) 0;
1773     (yy_init) = 0;
1774     (yy_start) = 0;
1775
1776 /* Defined in main.c */
1777 #ifdef YY_STDINIT
1778     yyin = stdin;
1779     yyout = stdout;
1780 #else
1781     yyin = (FILE *) 0;
1782     yyout = (FILE *) 0;
1783 #endif
1784
1785     /* For future reference: Set errno on error, since we are called by
1786      * yylex_init()
1787      */
1788     return 0;
1789 }
1790
1791 /* yylex_destroy is for both reentrant and non-reentrant scanners. */
1792 int yylex_destroy  (void)
1793 {
1794     
1795     /* Pop the buffer stack, destroying each element. */
1796         while(YY_CURRENT_BUFFER){
1797                 yy_delete_buffer(YY_CURRENT_BUFFER  );
1798                 YY_CURRENT_BUFFER_LVALUE = NULL;
1799                 yypop_buffer_state();
1800         }
1801
1802         /* Destroy the stack itself. */
1803         yyfree((yy_buffer_stack) );
1804         (yy_buffer_stack) = NULL;
1805
1806     /* Reset the globals. This is important in a non-reentrant scanner so the next time
1807      * yylex() is called, initialization will occur. */
1808     yy_init_globals( );
1809
1810     return 0;
1811 }
1812
1813 /*
1814  * Internal utility routines.
1815  */
1816
1817 #ifndef yytext_ptr
1818 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
1819 {
1820         register int i;
1821         for ( i = 0; i < n; ++i )
1822                 s1[i] = s2[i];
1823 }
1824 #endif
1825
1826 #ifdef YY_NEED_STRLEN
1827 static int yy_flex_strlen (yyconst char * s )
1828 {
1829         register int n;
1830         for ( n = 0; s[n]; ++n )
1831                 ;
1832
1833         return n;
1834 }
1835 #endif
1836
1837 void *yyalloc (yy_size_t  size )
1838 {
1839         return (void *) malloc( size );
1840 }
1841
1842 void *yyrealloc  (void * ptr, yy_size_t  size )
1843 {
1844         /* The cast to (char *) in the following accommodates both
1845          * implementations that use char* generic pointers, and those
1846          * that use void* generic pointers.  It works with the latter
1847          * because both ANSI C and C++ allow castless assignment from
1848          * any pointer type to void*, and deal with argument conversions
1849          * as though doing an assignment.
1850          */
1851         return (void *) realloc( (char *) ptr, size );
1852 }
1853
1854 void yyfree (void * ptr )
1855 {
1856         free( (char *) ptr );   /* see yyrealloc() for (char *) cast */
1857 }
1858
1859 #define YYTABLES_NAME "yytables"
1860
1861 #line 45 "spotlight_rawquery_lexer.l"
1862
1863
1864