Debian Codegraph @

storage/innobase/fts/fts0blex.cc

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