Debian Codegraph @

storage/innobase/fts/fts0tlex.cc

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