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 17
370 #define YY_END_OF_BUFFER 18
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, 18, 17, 16, 17, 5, 17, 17, 6,
381 7, 15, 14, 12, 17, 13, 15, 15, 15, 17,
382 17, 17, 17, 11, 0, 8, 15, 0, 0, 0,
383 10, 15, 15, 15, 9, 0, 0, 0, 15, 15,
384 15, 0, 0, 15, 15, 4, 0, 15, 3, 0,
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"
849 {yylval.sval = talloc_strdup(SLQ_VAR, yytext); return WORD;}
852 /* rule 16 can match eol */
854 #line 43 "spotlight_rawquery_lexer.l"
859 #line 44 "spotlight_rawquery_lexer.l"
862 #line 863 "spotlight_rawquery_lexer.c"
863 case YY_STATE_EOF(INITIAL):
866 case YY_END_OF_BUFFER:
868 /* Amount of text matched not including the EOB char. */
869 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
871 /* Undo the effects of YY_DO_BEFORE_ACTION. */
872 *yy_cp = (yy_hold_char);
873 YY_RESTORE_YY_MORE_OFFSET
875 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
877 /* We're scanning a new file or input source. It's
878 * possible that this happened because the user
879 * just pointed yyin at a new source and called
880 * yylex(). If so, then we have to assure
881 * consistency between YY_CURRENT_BUFFER and our
882 * globals. Here is the right place to do so, because
883 * this is the first action (other than possibly a
884 * back-up) that will match for the new input source.
886 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
887 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
888 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
891 /* Note that here we test for yy_c_buf_p "<=" to the position
892 * of the first EOB in the buffer, since yy_c_buf_p will
893 * already have been incremented past the NUL character
894 * (since all states make transitions on EOB to the
895 * end-of-buffer state). Contrast this with the test
898 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
899 { /* This was really a NUL. */
900 yy_state_type yy_next_state;
902 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
904 yy_current_state = yy_get_previous_state( );
906 /* Okay, we're now positioned to make the NUL
907 * transition. We couldn't have
908 * yy_get_previous_state() go ahead and do it
909 * for us because it doesn't know how to deal
910 * with the possibility of jamming (and we don't
911 * want to build jamming into it because then it
912 * will run more slowly).
915 yy_next_state = yy_try_NUL_trans( yy_current_state );
917 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
921 /* Consume the NUL. */
922 yy_cp = ++(yy_c_buf_p);
923 yy_current_state = yy_next_state;
929 yy_cp = (yy_c_buf_p);
934 else switch ( yy_get_next_buffer( ) )
936 case EOB_ACT_END_OF_FILE:
938 (yy_did_buffer_switch_on_eof) = 0;
942 /* Note: because we've taken care in
943 * yy_get_next_buffer() to have set up
944 * yytext, we can now set up
945 * yy_c_buf_p so that if some total
946 * hoser (like flex itself) wants to
947 * call the scanner after we return the
948 * YY_NULL, it'll still work - another
949 * YY_NULL will get returned.
951 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
953 yy_act = YY_STATE_EOF(YY_START);
959 if ( ! (yy_did_buffer_switch_on_eof) )
965 case EOB_ACT_CONTINUE_SCAN:
967 (yytext_ptr) + yy_amount_of_matched_text;
969 yy_current_state = yy_get_previous_state( );
971 yy_cp = (yy_c_buf_p);
972 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
975 case EOB_ACT_LAST_MATCH:
977 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
979 yy_current_state = yy_get_previous_state( );
981 yy_cp = (yy_c_buf_p);
982 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
990 "fatal flex scanner internal error--no action found" );
991 } /* end of action switch */
992 } /* end of scanning one token */
995 /* yy_get_next_buffer - try to read in a new buffer
997 * Returns a code representing an action:
998 * EOB_ACT_LAST_MATCH -
999 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1000 * EOB_ACT_END_OF_FILE - end of file
1002 static int yy_get_next_buffer (void)
1004 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1005 register char *source = (yytext_ptr);
1006 register int number_to_move, i;
1009 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1011 "fatal flex scanner internal error--end of buffer missed" );
1013 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1014 { /* Don't try to fill the buffer, so this is an EOF. */
1015 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1017 /* We matched a single character, the EOB, so
1018 * treat this as a final EOF.
1020 return EOB_ACT_END_OF_FILE;
1025 /* We matched some text prior to the EOB, first
1028 return EOB_ACT_LAST_MATCH;
1032 /* Try to read more data. */
1034 /* First move last chars to start of buffer. */
1035 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1037 for ( i = 0; i < number_to_move; ++i )
1038 *(dest++) = *(source++);
1040 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1041 /* don't do the read, it's not guaranteed to return an EOF,
1044 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1048 yy_size_t num_to_read =
1049 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1051 while ( num_to_read <= 0 )
1052 { /* Not enough room in the buffer - grow it. */
1054 /* just a shorter name for the current buffer */
1055 YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
1057 int yy_c_buf_p_offset =
1058 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1060 if ( b->yy_is_our_buffer )
1062 yy_size_t new_size = b->yy_buf_size * 2;
1064 if ( new_size <= 0 )
1065 b->yy_buf_size += b->yy_buf_size / 8;
1067 b->yy_buf_size *= 2;
1069 b->yy_ch_buf = (char *)
1070 /* Include room in for 2 EOB chars. */
1071 yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
1074 /* Can't grow it, we don't own it. */
1077 if ( ! b->yy_ch_buf )
1079 "fatal error - scanner input buffer overflow" );
1081 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1083 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1088 if ( num_to_read > YY_READ_BUF_SIZE )
1089 num_to_read = YY_READ_BUF_SIZE;
1091 /* Read in more data. */
1092 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1093 (yy_n_chars), num_to_read );
1095 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1098 if ( (yy_n_chars) == 0 )
1100 if ( number_to_move == YY_MORE_ADJ )
1102 ret_val = EOB_ACT_END_OF_FILE;
1108 ret_val = EOB_ACT_LAST_MATCH;
1109 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1110 YY_BUFFER_EOF_PENDING;
1115 ret_val = EOB_ACT_CONTINUE_SCAN;
1117 if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1118 /* Extend the array by 50%, plus the number we really need. */
1119 yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1120 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
1121 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1122 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1125 (yy_n_chars) += number_to_move;
1126 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1127 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1129 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1134 /* yy_get_previous_state - get the state just before the EOB char was reached */
1136 static yy_state_type yy_get_previous_state (void)
1138 register yy_state_type yy_current_state;
1139 register char *yy_cp;
1141 yy_current_state = (yy_start);
1143 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1145 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1146 if ( yy_accept[yy_current_state] )
1148 (yy_last_accepting_state) = yy_current_state;
1149 (yy_last_accepting_cpos) = yy_cp;
1151 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1153 yy_current_state = (int) yy_def[yy_current_state];
1154 if ( yy_current_state >= 57 )
1155 yy_c = yy_meta[(unsigned int) yy_c];
1157 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1160 return yy_current_state;
1163 /* yy_try_NUL_trans - try to make a transition on the NUL character
1166 * next_state = yy_try_NUL_trans( current_state );
1168 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1170 register int yy_is_jam;
1171 register char *yy_cp = (yy_c_buf_p);
1173 register YY_CHAR yy_c = 1;
1174 if ( yy_accept[yy_current_state] )
1176 (yy_last_accepting_state) = yy_current_state;
1177 (yy_last_accepting_cpos) = yy_cp;
1179 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1181 yy_current_state = (int) yy_def[yy_current_state];
1182 if ( yy_current_state >= 57 )
1183 yy_c = yy_meta[(unsigned int) yy_c];
1185 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1186 yy_is_jam = (yy_current_state == 56);
1188 return yy_is_jam ? 0 : yy_current_state;
1191 static void yyunput (int c, register char * yy_bp )
1193 register char *yy_cp;
1195 yy_cp = (yy_c_buf_p);
1197 /* undo effects of setting up yytext */
1198 *yy_cp = (yy_hold_char);
1200 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1201 { /* need to shift things up to make room */
1202 /* +2 for EOB chars. */
1203 register yy_size_t number_to_move = (yy_n_chars) + 2;
1204 register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1205 YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1206 register char *source =
1207 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1209 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1210 *--dest = *--source;
1212 yy_cp += (int) (dest - source);
1213 yy_bp += (int) (dest - source);
1214 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1215 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1217 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1218 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1221 *--yy_cp = (char) c;
1223 (yytext_ptr) = yy_bp;
1224 (yy_hold_char) = *yy_cp;
1225 (yy_c_buf_p) = yy_cp;
1230 static int yyinput (void)
1232 static int input (void)
1238 *(yy_c_buf_p) = (yy_hold_char);
1240 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1242 /* yy_c_buf_p now points to the character we want to return.
1243 * If this occurs *before* the EOB characters, then it's a
1244 * valid NUL; if not, then we've hit the end of the buffer.
1246 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1247 /* This was really a NUL. */
1248 *(yy_c_buf_p) = '\0';
1251 { /* need more input */
1252 yy_size_t offset = (yy_c_buf_p) - (yytext_ptr);
1255 switch ( yy_get_next_buffer( ) )
1257 case EOB_ACT_LAST_MATCH:
1258 /* This happens because yy_g_n_b()
1259 * sees that we've accumulated a
1260 * token and flags that we need to
1261 * try matching the token before
1262 * proceeding. But for input(),
1263 * there's no matching to consider.
1264 * So convert the EOB_ACT_LAST_MATCH
1265 * to EOB_ACT_END_OF_FILE.
1268 /* Reset buffer status. */
1273 case EOB_ACT_END_OF_FILE:
1278 if ( ! (yy_did_buffer_switch_on_eof) )
1287 case EOB_ACT_CONTINUE_SCAN:
1288 (yy_c_buf_p) = (yytext_ptr) + offset;
1294 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1295 *(yy_c_buf_p) = '\0'; /* preserve yytext */
1296 (yy_hold_char) = *++(yy_c_buf_p);
1300 #endif /* ifndef YY_NO_INPUT */
1302 /** Immediately switch to a different input stream.
1303 * @param input_file A readable stream.
1305 * @note This function does not reset the start condition to @c INITIAL .
1307 void yyrestart (FILE * input_file )
1310 if ( ! YY_CURRENT_BUFFER ){
1311 yyensure_buffer_stack ();
1312 YY_CURRENT_BUFFER_LVALUE =
1313 yy_create_buffer(yyin,YY_BUF_SIZE );
1316 yy_init_buffer(YY_CURRENT_BUFFER,input_file );
1317 yy_load_buffer_state( );
1320 /** Switch to a different input buffer.
1321 * @param new_buffer The new input buffer.
1324 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
1327 /* TODO. We should be able to replace this entire function body
1329 * yypop_buffer_state();
1330 * yypush_buffer_state(new_buffer);
1332 yyensure_buffer_stack ();
1333 if ( YY_CURRENT_BUFFER == new_buffer )
1336 if ( YY_CURRENT_BUFFER )
1338 /* Flush out information for old buffer. */
1339 *(yy_c_buf_p) = (yy_hold_char);
1340 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1341 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1344 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1345 yy_load_buffer_state( );
1347 /* We don't actually know whether we did this switch during
1348 * EOF (yywrap()) processing, but the only time this flag
1349 * is looked at is after yywrap() is called, so it's safe
1350 * to go ahead and always set it.
1352 (yy_did_buffer_switch_on_eof) = 1;
1355 static void yy_load_buffer_state (void)
1357 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1358 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1359 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1360 (yy_hold_char) = *(yy_c_buf_p);
1363 /** Allocate and initialize an input buffer state.
1364 * @param file A readable stream.
1365 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1367 * @return the allocated buffer state.
1369 YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
1373 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
1375 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1377 b->yy_buf_size = size;
1379 /* yy_ch_buf has to be 2 characters longer than the size given because
1380 * we need to put in 2 end-of-buffer characters.
1382 b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 );
1383 if ( ! b->yy_ch_buf )
1384 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1386 b->yy_is_our_buffer = 1;
1388 yy_init_buffer(b,file );
1393 /** Destroy the buffer.
1394 * @param b a buffer created with yy_create_buffer()
1397 void yy_delete_buffer (YY_BUFFER_STATE b )
1403 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1404 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1406 if ( b->yy_is_our_buffer )
1407 yyfree((void *) b->yy_ch_buf );
1409 yyfree((void *) b );
1412 /* Initializes or reinitializes a buffer.
1413 * This function is sometimes called more than once on the same buffer,
1414 * such as during a yyrestart() or at EOF.
1416 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
1421 yy_flush_buffer(b );
1423 b->yy_input_file = file;
1424 b->yy_fill_buffer = 1;
1426 /* If b is the current buffer, then yy_init_buffer was _probably_
1427 * called from yyrestart() or through yy_get_next_buffer.
1428 * In that case, we don't want to reset the lineno or column.
1430 if (b != YY_CURRENT_BUFFER){
1431 b->yy_bs_lineno = 1;
1432 b->yy_bs_column = 0;
1435 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1440 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1441 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1444 void yy_flush_buffer (YY_BUFFER_STATE b )
1451 /* We always need two end-of-buffer characters. The first causes
1452 * a transition to the end-of-buffer state. The second causes
1453 * a jam in that state.
1455 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1456 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1458 b->yy_buf_pos = &b->yy_ch_buf[0];
1461 b->yy_buffer_status = YY_BUFFER_NEW;
1463 if ( b == YY_CURRENT_BUFFER )
1464 yy_load_buffer_state( );
1467 /** Pushes the new state onto the stack. The new state becomes
1468 * the current state. This function will allocate the stack
1470 * @param new_buffer The new state.
1473 void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
1475 if (new_buffer == NULL)
1478 yyensure_buffer_stack();
1480 /* This block is copied from yy_switch_to_buffer. */
1481 if ( YY_CURRENT_BUFFER )
1483 /* Flush out information for old buffer. */
1484 *(yy_c_buf_p) = (yy_hold_char);
1485 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1486 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1489 /* Only push if top exists. Otherwise, replace top. */
1490 if (YY_CURRENT_BUFFER)
1491 (yy_buffer_stack_top)++;
1492 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1494 /* copied from yy_switch_to_buffer. */
1495 yy_load_buffer_state( );
1496 (yy_did_buffer_switch_on_eof) = 1;
1499 /** Removes and deletes the top of the stack, if present.
1500 * The next element becomes the new top.
1503 void yypop_buffer_state (void)
1505 if (!YY_CURRENT_BUFFER)
1508 yy_delete_buffer(YY_CURRENT_BUFFER );
1509 YY_CURRENT_BUFFER_LVALUE = NULL;
1510 if ((yy_buffer_stack_top) > 0)
1511 --(yy_buffer_stack_top);
1513 if (YY_CURRENT_BUFFER) {
1514 yy_load_buffer_state( );
1515 (yy_did_buffer_switch_on_eof) = 1;
1519 /* Allocates the stack if it does not exist.
1520 * Guarantees space for at least one push.
1522 static void yyensure_buffer_stack (void)
1524 yy_size_t num_to_alloc;
1526 if (!(yy_buffer_stack)) {
1528 /* First allocation is just for 2 elements, since we don't know if this
1529 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1530 * immediate realloc on the next call.
1533 (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
1534 (num_to_alloc * sizeof(struct yy_buffer_state*)
1536 if ( ! (yy_buffer_stack) )
1537 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1539 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1541 (yy_buffer_stack_max) = num_to_alloc;
1542 (yy_buffer_stack_top) = 0;
1546 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1548 /* Increase the buffer to prepare for a possible push. */
1549 int grow_size = 8 /* arbitrary grow size */;
1551 num_to_alloc = (yy_buffer_stack_max) + grow_size;
1552 (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
1554 num_to_alloc * sizeof(struct yy_buffer_state*)
1556 if ( ! (yy_buffer_stack) )
1557 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1559 /* zero only the new slots.*/
1560 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1561 (yy_buffer_stack_max) = num_to_alloc;
1565 /** Setup the input buffer state to scan directly from a user-specified character buffer.
1566 * @param base the character buffer
1567 * @param size the size in bytes of the character buffer
1569 * @return the newly allocated buffer state object.
1571 YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
1576 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1577 base[size-1] != YY_END_OF_BUFFER_CHAR )
1578 /* They forgot to leave room for the EOB's. */
1581 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
1583 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1585 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1586 b->yy_buf_pos = b->yy_ch_buf = base;
1587 b->yy_is_our_buffer = 0;
1588 b->yy_input_file = 0;
1589 b->yy_n_chars = b->yy_buf_size;
1590 b->yy_is_interactive = 0;
1592 b->yy_fill_buffer = 0;
1593 b->yy_buffer_status = YY_BUFFER_NEW;
1595 yy_switch_to_buffer(b );
1600 /** Setup the input buffer state to scan a string. The next call to yylex() will
1601 * scan from a @e copy of @a str.
1602 * @param yystr a NUL-terminated string to scan
1604 * @return the newly allocated buffer state object.
1605 * @note If you want to scan bytes that may contain NUL values, then use
1606 * yy_scan_bytes() instead.
1608 YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
1611 return yy_scan_bytes(yystr,strlen(yystr) );
1614 /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
1615 * scan from a @e copy of @a bytes.
1616 * @param yybytes the byte buffer to scan
1617 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
1619 * @return the newly allocated buffer state object.
1621 YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len )
1628 /* Get memory for full buffer, including space for trailing EOB's. */
1629 n = _yybytes_len + 2;
1630 buf = (char *) yyalloc(n );
1632 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1634 for ( i = 0; i < _yybytes_len; ++i )
1635 buf[i] = yybytes[i];
1637 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1639 b = yy_scan_buffer(buf,n );
1641 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1643 /* It's okay to grow etc. this buffer, and we should throw it
1644 * away when we're done.
1646 b->yy_is_our_buffer = 1;
1651 #ifndef YY_EXIT_FAILURE
1652 #define YY_EXIT_FAILURE 2
1655 static void yy_fatal_error (yyconst char* msg )
1657 (void) fprintf( stderr, "%s\n", msg );
1658 exit( YY_EXIT_FAILURE );
1661 /* Redefine yyless() so it works in section 3 code. */
1667 /* Undo effects of setting up yytext. */ \
1668 int yyless_macro_arg = (n); \
1669 YY_LESS_LINENO(yyless_macro_arg);\
1670 yytext[yyleng] = (yy_hold_char); \
1671 (yy_c_buf_p) = yytext + yyless_macro_arg; \
1672 (yy_hold_char) = *(yy_c_buf_p); \
1673 *(yy_c_buf_p) = '\0'; \
1674 yyleng = yyless_macro_arg; \
1678 /* Accessor methods (get/set functions) to struct members. */
1680 /** Get the current line number.
1683 int yyget_lineno (void)
1689 /** Get the input stream.
1692 FILE *yyget_in (void)
1697 /** Get the output stream.
1700 FILE *yyget_out (void)
1705 /** Get the length of the current token.
1708 yy_size_t yyget_leng (void)
1713 /** Get the current token.
1717 char *yyget_text (void)
1722 /** Set the current line number.
1723 * @param line_number
1726 void yyset_lineno (int line_number )
1729 yylineno = line_number;
1732 /** Set the input stream. This does not discard the current
1734 * @param in_str A readable stream.
1736 * @see yy_switch_to_buffer
1738 void yyset_in (FILE * in_str )
1743 void yyset_out (FILE * out_str )
1748 int yyget_debug (void)
1750 return yy_flex_debug;
1753 void yyset_debug (int bdebug )
1755 yy_flex_debug = bdebug ;
1758 static int yy_init_globals (void)
1760 /* Initialization is the same as for the non-reentrant scanner.
1761 * This function is called from yylex_destroy(), so don't allocate here.
1764 (yy_buffer_stack) = 0;
1765 (yy_buffer_stack_top) = 0;
1766 (yy_buffer_stack_max) = 0;
1767 (yy_c_buf_p) = (char *) 0;
1771 /* Defined in main.c */
1780 /* For future reference: Set errno on error, since we are called by
1786 /* yylex_destroy is for both reentrant and non-reentrant scanners. */
1787 int yylex_destroy (void)
1790 /* Pop the buffer stack, destroying each element. */
1791 while(YY_CURRENT_BUFFER){
1792 yy_delete_buffer(YY_CURRENT_BUFFER );
1793 YY_CURRENT_BUFFER_LVALUE = NULL;
1794 yypop_buffer_state();
1797 /* Destroy the stack itself. */
1798 yyfree((yy_buffer_stack) );
1799 (yy_buffer_stack) = NULL;
1801 /* Reset the globals. This is important in a non-reentrant scanner so the next time
1802 * yylex() is called, initialization will occur. */
1809 * Internal utility routines.
1813 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
1816 for ( i = 0; i < n; ++i )
1821 #ifdef YY_NEED_STRLEN
1822 static int yy_flex_strlen (yyconst char * s )
1825 for ( n = 0; s[n]; ++n )
1832 void *yyalloc (yy_size_t size )
1834 return (void *) malloc( size );
1837 void *yyrealloc (void * ptr, yy_size_t size )
1839 /* The cast to (char *) in the following accommodates both
1840 * implementations that use char* generic pointers, and those
1841 * that use void* generic pointers. It works with the latter
1842 * because both ANSI C and C++ allow castless assignment from
1843 * any pointer type to void*, and deal with argument conversions
1844 * as though doing an assignment.
1846 return (void *) realloc( (char *) ptr, size );
1849 void yyfree (void * ptr )
1851 free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
1854 #define YYTABLES_NAME "yytables"
1856 #line 44 "spotlight_rawquery_lexer.l"