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