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