1 #line 2 "spotlight_rawquery_lexer.l"
4 #endif /* HAVE_CONFIG_H */
8 #line 9 "spotlight_rawquery_lexer.c"
10 #define YY_INT_ALIGNED short int
12 /* A lexical scanner generated by flex */
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
22 /* First, we deal with platform-specific or compiler-specific issues. */
24 /* begin standard C headers. */
30 /* end standard C headers. */
32 /* flex integer type definitions */
37 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
39 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
41 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
42 * if you want the limit (max/min) macros for int types.
44 #ifndef __STDC_LIMIT_MACROS
45 #define __STDC_LIMIT_MACROS 1
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;
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;
63 /* Limits of integral types. */
65 #define INT8_MIN (-128)
68 #define INT16_MIN (-32767-1)
71 #define INT32_MIN (-2147483647-1)
74 #define INT8_MAX (127)
77 #define INT16_MAX (32767)
80 #define INT32_MAX (2147483647)
83 #define UINT8_MAX (255U)
86 #define UINT16_MAX (65535U)
89 #define UINT32_MAX (4294967295U)
94 #endif /* ! FLEXINT_H */
98 /* The "const" storage-class-modifier is valid. */
101 #else /* ! __cplusplus */
103 /* C99 requires __STDC__ to be defined as 1. */
104 #if defined (__STDC__)
108 #endif /* defined (__STDC__) */
109 #endif /* ! __cplusplus */
112 #define yyconst const
117 /* Returned upon end-of-file. */
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
125 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
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.
131 #define BEGIN (yy_start) = 1 + 2 *
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
137 #define YY_START (((yy_start) - 1) / 2)
138 #define YYSTATE YY_START
140 /* Action number for EOF rule of a given start state. */
141 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
143 /* Special action meaning "start processing a new file". */
144 #define YY_NEW_FILE yyrestart(yyin )
146 #define YY_END_OF_BUFFER_CHAR 0
148 /* Size of default input buffer. */
150 #define YY_BUF_SIZE 16384
153 /* The state buf must be large enough to hold one state per character in the main buffer.
155 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
157 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
158 #define YY_TYPEDEF_YY_BUFFER_STATE
159 typedef struct yy_buffer_state *YY_BUFFER_STATE;
162 #ifndef YY_TYPEDEF_YY_SIZE_T
163 #define YY_TYPEDEF_YY_SIZE_T
164 typedef size_t yy_size_t;
167 extern yy_size_t yyleng;
169 extern FILE *yyin, *yyout;
171 #define EOB_ACT_CONTINUE_SCAN 0
172 #define EOB_ACT_END_OF_FILE 1
173 #define EOB_ACT_LAST_MATCH 2
175 #define YY_LESS_LINENO(n)
177 /* Return all but the first "n" matched characters back to the input stream. */
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 */ \
191 #define unput(c) yyunput( c, (yytext_ptr) )
193 #ifndef YY_STRUCT_YY_BUFFER_STATE
194 #define YY_STRUCT_YY_BUFFER_STATE
195 struct yy_buffer_state
199 char *yy_ch_buf; /* input buffer */
200 char *yy_buf_pos; /* current position in input buffer */
202 /* Size of input buffer in bytes, not including room for EOB
205 yy_size_t yy_buf_size;
207 /* Number of characters read into yy_ch_buf, not including EOB
210 yy_size_t yy_n_chars;
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
216 int yy_is_our_buffer;
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
223 int yy_is_interactive;
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
231 int yy_bs_lineno; /**< The line count. */
232 int yy_bs_column; /**< The column count. */
234 /* Whether to try to fill the input buffer when we reach the
239 int yy_buffer_status;
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.
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.
253 #define YY_BUFFER_EOF_PENDING 2
256 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
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. */
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
267 * Returns the top of the stack, or NULL.
269 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
270 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
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.
276 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
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 */
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 */
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 ...
291 static int yy_did_buffer_switch_on_eof;
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 );
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 );
305 #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
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 );
311 void *yyalloc (yy_size_t );
312 void *yyrealloc (void *,yy_size_t );
313 void yyfree (void * );
315 #define yy_new_buffer yy_create_buffer
317 #define yy_set_interactive(is_interactive) \
319 if ( ! YY_CURRENT_BUFFER ){ \
320 yyensure_buffer_stack (); \
321 YY_CURRENT_BUFFER_LVALUE = \
322 yy_create_buffer(yyin,YY_BUF_SIZE ); \
324 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
327 #define yy_set_bol(at_bol) \
329 if ( ! YY_CURRENT_BUFFER ){\
330 yyensure_buffer_stack (); \
331 YY_CURRENT_BUFFER_LVALUE = \
332 yy_create_buffer(yyin,YY_BUF_SIZE ); \
334 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
337 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
339 /* Begin user sect3 */
341 typedef unsigned char YY_CHAR;
343 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
345 typedef int yy_state_type;
352 #define yytext_ptr yytext
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[] );
359 /* Done after the current pattern has been matched and before the
360 * corresponding action - sets up yytext.
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; \
367 (yy_c_buf_p) = yy_cp;
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. */
375 flex_int32_t yy_verify;
378 static yyconst flex_int16_t yy_accept[57] =
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,
388 static yyconst flex_int32_t yy_ec[256] =
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,
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,
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,
420 static yyconst flex_int32_t yy_meta[35] =
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,
428 static yyconst flex_int16_t yy_base[58] =
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
438 static yyconst flex_int16_t yy_def[58] =
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
448 static yyconst flex_int16_t yy_nxt[127] =
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,
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
466 static yyconst flex_int16_t yy_chk[127] =
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,
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
484 static yy_state_type yy_last_accepting_state;
485 static char *yy_last_accepting_cpos;
487 extern int yy_flex_debug;
488 int yy_flex_debug = 0;
490 /* The intent behind this definition is that it'll catch
491 * any uses of REJECT which flex missed.
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
498 #line 1 "spotlight_rawquery_lexer.l"
500 #line 8 "spotlight_rawquery_lexer.l"
503 #include <atalk/talloc.h>
504 #include <atalk/spotlight.h>
506 #include "sparql_parser.h"
507 #define SLQ_VAR ssp_slq
509 #line 510 "spotlight_rawquery_lexer.c"
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.
521 #ifndef YY_EXTRA_TYPE
522 #define YY_EXTRA_TYPE void *
525 static int yy_init_globals (void );
527 /* Accessor methods to globals.
528 These are made visible to non-reentrant scanners for convenience. */
530 int yylex_destroy (void );
532 int yyget_debug (void );
534 void yyset_debug (int debug_flag );
536 YY_EXTRA_TYPE yyget_extra (void );
538 void yyset_extra (YY_EXTRA_TYPE user_defined );
540 FILE *yyget_in (void );
542 void yyset_in (FILE * in_str );
544 FILE *yyget_out (void );
546 void yyset_out (FILE * out_str );
548 yy_size_t yyget_leng (void );
550 char *yyget_text (void );
552 int yyget_lineno (void );
554 void yyset_lineno (int line_number );
556 /* Macros after this point can all be overridden by user definitions in
560 #ifndef YY_SKIP_YYWRAP
562 extern "C" int yywrap (void );
564 extern int yywrap (void );
568 static void yyunput (int c,char *buf_ptr );
571 static void yy_flex_strncpy (char *,yyconst char *,int );
574 #ifdef YY_NEED_STRLEN
575 static int yy_flex_strlen (yyconst char * );
581 static int yyinput (void );
583 static int input (void );
588 /* Amount of stuff to slurp up with each read. */
589 #ifndef YY_READ_BUF_SIZE
590 #define YY_READ_BUF_SIZE 8192
593 /* Copy whatever the last rule matched to the standard output. */
595 /* This used to be an fputs(), but since the string might contain NUL's,
596 * we now use fwrite().
598 #define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
601 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
602 * is returned in "result".
605 #define YY_INPUT(buf,result,max_size) \
606 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
610 for ( n = 0; n < max_size && \
611 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
614 buf[n++] = (char) c; \
615 if ( c == EOF && ferror( yyin ) ) \
616 YY_FATAL_ERROR( "input in flex scanner failed" ); \
622 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
624 if( errno != EINTR) \
626 YY_FATAL_ERROR( "input in flex scanner failed" ); \
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.
642 #define yyterminate() return YY_NULL
645 /* Number of entries by which start-condition stack grows. */
646 #ifndef YY_START_STACK_INCR
647 #define YY_START_STACK_INCR 25
650 /* Report a fatal error. */
651 #ifndef YY_FATAL_ERROR
652 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
655 /* end tables serialization structures and prototypes */
657 /* Default declaration of generated scanner - a define so the user can
658 * easily add parameters.
661 #define YY_DECL_IS_OURS 1
663 extern int yylex (void);
665 #define YY_DECL int yylex (void)
666 #endif /* !YY_DECL */
668 /* Code executed at the beginning of each rule, after yytext and yyleng
671 #ifndef YY_USER_ACTION
672 #define YY_USER_ACTION
675 /* Code executed at the end of each rule. */
677 #define YY_BREAK break;
680 #define YY_RULE_SETUP \
683 /** The main scanner function which does all the work.
687 register yy_state_type yy_current_state;
688 register char *yy_cp, *yy_bp;
691 #line 27 "spotlight_rawquery_lexer.l"
693 #line 694 "spotlight_rawquery_lexer.c"
704 (yy_start) = 1; /* first start state */
712 if ( ! YY_CURRENT_BUFFER ) {
713 yyensure_buffer_stack ();
714 YY_CURRENT_BUFFER_LVALUE =
715 yy_create_buffer(yyin,YY_BUF_SIZE );
718 yy_load_buffer_state( );
721 while ( 1 ) /* loops until end-of-file is reached */
723 yy_cp = (yy_c_buf_p);
725 /* Support of yytext. */
726 *yy_cp = (yy_hold_char);
728 /* yy_bp points to the position in yy_ch_buf of the start of
733 yy_current_state = (yy_start);
737 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
738 if ( yy_accept[yy_current_state] )
740 (yy_last_accepting_state) = yy_current_state;
741 (yy_last_accepting_cpos) = yy_cp;
743 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
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];
749 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
752 while ( yy_base[yy_current_state] != 92 );
755 yy_act = yy_accept[yy_current_state];
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];
765 do_action: /* This label is used only to access EOF actions. */
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);
778 #line 28 "spotlight_rawquery_lexer.l"
783 #line 29 "spotlight_rawquery_lexer.l"
788 #line 30 "spotlight_rawquery_lexer.l"
789 {yylval.bval = false; return BOOL;}
793 #line 31 "spotlight_rawquery_lexer.l"
794 {yylval.bval = true; return BOOL;}
798 #line 32 "spotlight_rawquery_lexer.l"
803 #line 33 "spotlight_rawquery_lexer.l"
808 #line 34 "spotlight_rawquery_lexer.l"
813 #line 35 "spotlight_rawquery_lexer.l"
818 #line 36 "spotlight_rawquery_lexer.l"
823 #line 37 "spotlight_rawquery_lexer.l"
828 #line 38 "spotlight_rawquery_lexer.l"
833 #line 39 "spotlight_rawquery_lexer.l"
838 #line 40 "spotlight_rawquery_lexer.l"
843 #line 41 "spotlight_rawquery_lexer.l"
848 #line 42 "spotlight_rawquery_lexer.l"
853 #line 43 "spotlight_rawquery_lexer.l"
854 {yylval.sval = talloc_strdup(SLQ_VAR, yytext); return WORD;}
857 /* rule 17 can match eol */
859 #line 44 "spotlight_rawquery_lexer.l"
864 #line 45 "spotlight_rawquery_lexer.l"
867 #line 868 "spotlight_rawquery_lexer.c"
868 case YY_STATE_EOF(INITIAL):
871 case YY_END_OF_BUFFER:
873 /* Amount of text matched not including the EOB char. */
874 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
876 /* Undo the effects of YY_DO_BEFORE_ACTION. */
877 *yy_cp = (yy_hold_char);
878 YY_RESTORE_YY_MORE_OFFSET
880 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
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.
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;
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
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;
907 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
909 yy_current_state = yy_get_previous_state( );
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).
920 yy_next_state = yy_try_NUL_trans( yy_current_state );
922 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
926 /* Consume the NUL. */
927 yy_cp = ++(yy_c_buf_p);
928 yy_current_state = yy_next_state;
934 yy_cp = (yy_c_buf_p);
939 else switch ( yy_get_next_buffer( ) )
941 case EOB_ACT_END_OF_FILE:
943 (yy_did_buffer_switch_on_eof) = 0;
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.
956 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
958 yy_act = YY_STATE_EOF(YY_START);
964 if ( ! (yy_did_buffer_switch_on_eof) )
970 case EOB_ACT_CONTINUE_SCAN:
972 (yytext_ptr) + yy_amount_of_matched_text;
974 yy_current_state = yy_get_previous_state( );
976 yy_cp = (yy_c_buf_p);
977 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
980 case EOB_ACT_LAST_MATCH:
982 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
984 yy_current_state = yy_get_previous_state( );
986 yy_cp = (yy_c_buf_p);
987 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
995 "fatal flex scanner internal error--no action found" );
996 } /* end of action switch */
997 } /* end of scanning one token */
1000 /* yy_get_next_buffer - try to read in a new buffer
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
1007 static int yy_get_next_buffer (void)
1009 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1010 register char *source = (yytext_ptr);
1011 register int number_to_move, i;
1014 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1016 "fatal flex scanner internal error--end of buffer missed" );
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 )
1022 /* We matched a single character, the EOB, so
1023 * treat this as a final EOF.
1025 return EOB_ACT_END_OF_FILE;
1030 /* We matched some text prior to the EOB, first
1033 return EOB_ACT_LAST_MATCH;
1037 /* Try to read more data. */
1039 /* First move last chars to start of buffer. */
1040 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1042 for ( i = 0; i < number_to_move; ++i )
1043 *(dest++) = *(source++);
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,
1049 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1053 yy_size_t num_to_read =
1054 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1056 while ( num_to_read <= 0 )
1057 { /* Not enough room in the buffer - grow it. */
1059 /* just a shorter name for the current buffer */
1060 YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
1062 int yy_c_buf_p_offset =
1063 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1065 if ( b->yy_is_our_buffer )
1067 yy_size_t new_size = b->yy_buf_size * 2;
1069 if ( new_size <= 0 )
1070 b->yy_buf_size += b->yy_buf_size / 8;
1072 b->yy_buf_size *= 2;
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 );
1079 /* Can't grow it, we don't own it. */
1082 if ( ! b->yy_ch_buf )
1084 "fatal error - scanner input buffer overflow" );
1086 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1088 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1093 if ( num_to_read > YY_READ_BUF_SIZE )
1094 num_to_read = YY_READ_BUF_SIZE;
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 );
1100 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1103 if ( (yy_n_chars) == 0 )
1105 if ( number_to_move == YY_MORE_ADJ )
1107 ret_val = EOB_ACT_END_OF_FILE;
1113 ret_val = EOB_ACT_LAST_MATCH;
1114 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1115 YY_BUFFER_EOF_PENDING;
1120 ret_val = EOB_ACT_CONTINUE_SCAN;
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()" );
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;
1134 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1139 /* yy_get_previous_state - get the state just before the EOB char was reached */
1141 static yy_state_type yy_get_previous_state (void)
1143 register yy_state_type yy_current_state;
1144 register char *yy_cp;
1146 yy_current_state = (yy_start);
1148 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1150 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1151 if ( yy_accept[yy_current_state] )
1153 (yy_last_accepting_state) = yy_current_state;
1154 (yy_last_accepting_cpos) = yy_cp;
1156 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
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];
1162 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1165 return yy_current_state;
1168 /* yy_try_NUL_trans - try to make a transition on the NUL character
1171 * next_state = yy_try_NUL_trans( current_state );
1173 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1175 register int yy_is_jam;
1176 register char *yy_cp = (yy_c_buf_p);
1178 register YY_CHAR yy_c = 1;
1179 if ( yy_accept[yy_current_state] )
1181 (yy_last_accepting_state) = yy_current_state;
1182 (yy_last_accepting_cpos) = yy_cp;
1184 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
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];
1190 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1191 yy_is_jam = (yy_current_state == 56);
1193 return yy_is_jam ? 0 : yy_current_state;
1196 static void yyunput (int c, register char * yy_bp )
1198 register char *yy_cp;
1200 yy_cp = (yy_c_buf_p);
1202 /* undo effects of setting up yytext */
1203 *yy_cp = (yy_hold_char);
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];
1214 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1215 *--dest = *--source;
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;
1222 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1223 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1226 *--yy_cp = (char) c;
1228 (yytext_ptr) = yy_bp;
1229 (yy_hold_char) = *yy_cp;
1230 (yy_c_buf_p) = yy_cp;
1235 static int yyinput (void)
1237 static int input (void)
1243 *(yy_c_buf_p) = (yy_hold_char);
1245 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
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.
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';
1256 { /* need more input */
1257 yy_size_t offset = (yy_c_buf_p) - (yytext_ptr);
1260 switch ( yy_get_next_buffer( ) )
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.
1273 /* Reset buffer status. */
1278 case EOB_ACT_END_OF_FILE:
1283 if ( ! (yy_did_buffer_switch_on_eof) )
1292 case EOB_ACT_CONTINUE_SCAN:
1293 (yy_c_buf_p) = (yytext_ptr) + offset;
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);
1305 #endif /* ifndef YY_NO_INPUT */
1307 /** Immediately switch to a different input stream.
1308 * @param input_file A readable stream.
1310 * @note This function does not reset the start condition to @c INITIAL .
1312 void yyrestart (FILE * input_file )
1315 if ( ! YY_CURRENT_BUFFER ){
1316 yyensure_buffer_stack ();
1317 YY_CURRENT_BUFFER_LVALUE =
1318 yy_create_buffer(yyin,YY_BUF_SIZE );
1321 yy_init_buffer(YY_CURRENT_BUFFER,input_file );
1322 yy_load_buffer_state( );
1325 /** Switch to a different input buffer.
1326 * @param new_buffer The new input buffer.
1329 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
1332 /* TODO. We should be able to replace this entire function body
1334 * yypop_buffer_state();
1335 * yypush_buffer_state(new_buffer);
1337 yyensure_buffer_stack ();
1338 if ( YY_CURRENT_BUFFER == new_buffer )
1341 if ( YY_CURRENT_BUFFER )
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);
1349 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1350 yy_load_buffer_state( );
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.
1357 (yy_did_buffer_switch_on_eof) = 1;
1360 static void yy_load_buffer_state (void)
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);
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.
1372 * @return the allocated buffer state.
1374 YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
1378 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
1380 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1382 b->yy_buf_size = size;
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.
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()" );
1391 b->yy_is_our_buffer = 1;
1393 yy_init_buffer(b,file );
1398 /** Destroy the buffer.
1399 * @param b a buffer created with yy_create_buffer()
1402 void yy_delete_buffer (YY_BUFFER_STATE b )
1408 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1409 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1411 if ( b->yy_is_our_buffer )
1412 yyfree((void *) b->yy_ch_buf );
1414 yyfree((void *) b );
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.
1421 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
1426 yy_flush_buffer(b );
1428 b->yy_input_file = file;
1429 b->yy_fill_buffer = 1;
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.
1435 if (b != YY_CURRENT_BUFFER){
1436 b->yy_bs_lineno = 1;
1437 b->yy_bs_column = 0;
1440 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
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.
1449 void yy_flush_buffer (YY_BUFFER_STATE b )
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.
1460 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1461 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1463 b->yy_buf_pos = &b->yy_ch_buf[0];
1466 b->yy_buffer_status = YY_BUFFER_NEW;
1468 if ( b == YY_CURRENT_BUFFER )
1469 yy_load_buffer_state( );
1472 /** Pushes the new state onto the stack. The new state becomes
1473 * the current state. This function will allocate the stack
1475 * @param new_buffer The new state.
1478 void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
1480 if (new_buffer == NULL)
1483 yyensure_buffer_stack();
1485 /* This block is copied from yy_switch_to_buffer. */
1486 if ( YY_CURRENT_BUFFER )
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);
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;
1499 /* copied from yy_switch_to_buffer. */
1500 yy_load_buffer_state( );
1501 (yy_did_buffer_switch_on_eof) = 1;
1504 /** Removes and deletes the top of the stack, if present.
1505 * The next element becomes the new top.
1508 void yypop_buffer_state (void)
1510 if (!YY_CURRENT_BUFFER)
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);
1518 if (YY_CURRENT_BUFFER) {
1519 yy_load_buffer_state( );
1520 (yy_did_buffer_switch_on_eof) = 1;
1524 /* Allocates the stack if it does not exist.
1525 * Guarantees space for at least one push.
1527 static void yyensure_buffer_stack (void)
1529 yy_size_t num_to_alloc;
1531 if (!(yy_buffer_stack)) {
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.
1538 (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
1539 (num_to_alloc * sizeof(struct yy_buffer_state*)
1541 if ( ! (yy_buffer_stack) )
1542 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1544 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1546 (yy_buffer_stack_max) = num_to_alloc;
1547 (yy_buffer_stack_top) = 0;
1551 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1553 /* Increase the buffer to prepare for a possible push. */
1554 int grow_size = 8 /* arbitrary grow size */;
1556 num_to_alloc = (yy_buffer_stack_max) + grow_size;
1557 (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
1559 num_to_alloc * sizeof(struct yy_buffer_state*)
1561 if ( ! (yy_buffer_stack) )
1562 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
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;
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
1574 * @return the newly allocated buffer state object.
1576 YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
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. */
1586 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
1588 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
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;
1597 b->yy_fill_buffer = 0;
1598 b->yy_buffer_status = YY_BUFFER_NEW;
1600 yy_switch_to_buffer(b );
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
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.
1613 YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
1616 return yy_scan_bytes(yystr,strlen(yystr) );
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.
1624 * @return the newly allocated buffer state object.
1626 YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len )
1633 /* Get memory for full buffer, including space for trailing EOB's. */
1634 n = _yybytes_len + 2;
1635 buf = (char *) yyalloc(n );
1637 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1639 for ( i = 0; i < _yybytes_len; ++i )
1640 buf[i] = yybytes[i];
1642 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1644 b = yy_scan_buffer(buf,n );
1646 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1648 /* It's okay to grow etc. this buffer, and we should throw it
1649 * away when we're done.
1651 b->yy_is_our_buffer = 1;
1656 #ifndef YY_EXIT_FAILURE
1657 #define YY_EXIT_FAILURE 2
1660 static void yy_fatal_error (yyconst char* msg )
1662 (void) fprintf( stderr, "%s\n", msg );
1663 exit( YY_EXIT_FAILURE );
1666 /* Redefine yyless() so it works in section 3 code. */
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; \
1683 /* Accessor methods (get/set functions) to struct members. */
1685 /** Get the current line number.
1688 int yyget_lineno (void)
1694 /** Get the input stream.
1697 FILE *yyget_in (void)
1702 /** Get the output stream.
1705 FILE *yyget_out (void)
1710 /** Get the length of the current token.
1713 yy_size_t yyget_leng (void)
1718 /** Get the current token.
1722 char *yyget_text (void)
1727 /** Set the current line number.
1728 * @param line_number
1731 void yyset_lineno (int line_number )
1734 yylineno = line_number;
1737 /** Set the input stream. This does not discard the current
1739 * @param in_str A readable stream.
1741 * @see yy_switch_to_buffer
1743 void yyset_in (FILE * in_str )
1748 void yyset_out (FILE * out_str )
1753 int yyget_debug (void)
1755 return yy_flex_debug;
1758 void yyset_debug (int bdebug )
1760 yy_flex_debug = bdebug ;
1763 static int yy_init_globals (void)
1765 /* Initialization is the same as for the non-reentrant scanner.
1766 * This function is called from yylex_destroy(), so don't allocate here.
1769 (yy_buffer_stack) = 0;
1770 (yy_buffer_stack_top) = 0;
1771 (yy_buffer_stack_max) = 0;
1772 (yy_c_buf_p) = (char *) 0;
1776 /* Defined in main.c */
1785 /* For future reference: Set errno on error, since we are called by
1791 /* yylex_destroy is for both reentrant and non-reentrant scanners. */
1792 int yylex_destroy (void)
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();
1802 /* Destroy the stack itself. */
1803 yyfree((yy_buffer_stack) );
1804 (yy_buffer_stack) = NULL;
1806 /* Reset the globals. This is important in a non-reentrant scanner so the next time
1807 * yylex() is called, initialization will occur. */
1814 * Internal utility routines.
1818 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
1821 for ( i = 0; i < n; ++i )
1826 #ifdef YY_NEED_STRLEN
1827 static int yy_flex_strlen (yyconst char * s )
1830 for ( n = 0; s[n]; ++n )
1837 void *yyalloc (yy_size_t size )
1839 return (void *) malloc( size );
1842 void *yyrealloc (void * ptr, yy_size_t size )
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.
1851 return (void *) realloc( (char *) ptr, size );
1854 void yyfree (void * ptr )
1856 free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
1859 #define YYTABLES_NAME "yytables"
1861 #line 45 "spotlight_rawquery_lexer.l"