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