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