xref: /aosp_15_r20/external/libconfig/lib/scanner.c (revision 2e9d491483b805f09ea864149eadd5680efcc72a)
1 #line 1 "scanner.c"
2 
3 #line 3 "scanner.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 6
12 #define YY_FLEX_SUBMINOR_VERSION 4
13 #if YY_FLEX_SUBMINOR_VERSION > 0
14 #define FLEX_BETA
15 #endif
16 
17 #ifdef yy_create_buffer
18 #define libconfig_yy_create_buffer_ALREADY_DEFINED
19 #else
20 #define yy_create_buffer libconfig_yy_create_buffer
21 #endif
22 
23 #ifdef yy_delete_buffer
24 #define libconfig_yy_delete_buffer_ALREADY_DEFINED
25 #else
26 #define yy_delete_buffer libconfig_yy_delete_buffer
27 #endif
28 
29 #ifdef yy_scan_buffer
30 #define libconfig_yy_scan_buffer_ALREADY_DEFINED
31 #else
32 #define yy_scan_buffer libconfig_yy_scan_buffer
33 #endif
34 
35 #ifdef yy_scan_string
36 #define libconfig_yy_scan_string_ALREADY_DEFINED
37 #else
38 #define yy_scan_string libconfig_yy_scan_string
39 #endif
40 
41 #ifdef yy_scan_bytes
42 #define libconfig_yy_scan_bytes_ALREADY_DEFINED
43 #else
44 #define yy_scan_bytes libconfig_yy_scan_bytes
45 #endif
46 
47 #ifdef yy_init_buffer
48 #define libconfig_yy_init_buffer_ALREADY_DEFINED
49 #else
50 #define yy_init_buffer libconfig_yy_init_buffer
51 #endif
52 
53 #ifdef yy_flush_buffer
54 #define libconfig_yy_flush_buffer_ALREADY_DEFINED
55 #else
56 #define yy_flush_buffer libconfig_yy_flush_buffer
57 #endif
58 
59 #ifdef yy_load_buffer_state
60 #define libconfig_yy_load_buffer_state_ALREADY_DEFINED
61 #else
62 #define yy_load_buffer_state libconfig_yy_load_buffer_state
63 #endif
64 
65 #ifdef yy_switch_to_buffer
66 #define libconfig_yy_switch_to_buffer_ALREADY_DEFINED
67 #else
68 #define yy_switch_to_buffer libconfig_yy_switch_to_buffer
69 #endif
70 
71 #ifdef yypush_buffer_state
72 #define libconfig_yypush_buffer_state_ALREADY_DEFINED
73 #else
74 #define yypush_buffer_state libconfig_yypush_buffer_state
75 #endif
76 
77 #ifdef yypop_buffer_state
78 #define libconfig_yypop_buffer_state_ALREADY_DEFINED
79 #else
80 #define yypop_buffer_state libconfig_yypop_buffer_state
81 #endif
82 
83 #ifdef yyensure_buffer_stack
84 #define libconfig_yyensure_buffer_stack_ALREADY_DEFINED
85 #else
86 #define yyensure_buffer_stack libconfig_yyensure_buffer_stack
87 #endif
88 
89 #ifdef yylex
90 #define libconfig_yylex_ALREADY_DEFINED
91 #else
92 #define yylex libconfig_yylex
93 #endif
94 
95 #ifdef yyrestart
96 #define libconfig_yyrestart_ALREADY_DEFINED
97 #else
98 #define yyrestart libconfig_yyrestart
99 #endif
100 
101 #ifdef yylex_init
102 #define libconfig_yylex_init_ALREADY_DEFINED
103 #else
104 #define yylex_init libconfig_yylex_init
105 #endif
106 
107 #ifdef yylex_init_extra
108 #define libconfig_yylex_init_extra_ALREADY_DEFINED
109 #else
110 #define yylex_init_extra libconfig_yylex_init_extra
111 #endif
112 
113 #ifdef yylex_destroy
114 #define libconfig_yylex_destroy_ALREADY_DEFINED
115 #else
116 #define yylex_destroy libconfig_yylex_destroy
117 #endif
118 
119 #ifdef yyget_debug
120 #define libconfig_yyget_debug_ALREADY_DEFINED
121 #else
122 #define yyget_debug libconfig_yyget_debug
123 #endif
124 
125 #ifdef yyset_debug
126 #define libconfig_yyset_debug_ALREADY_DEFINED
127 #else
128 #define yyset_debug libconfig_yyset_debug
129 #endif
130 
131 #ifdef yyget_extra
132 #define libconfig_yyget_extra_ALREADY_DEFINED
133 #else
134 #define yyget_extra libconfig_yyget_extra
135 #endif
136 
137 #ifdef yyset_extra
138 #define libconfig_yyset_extra_ALREADY_DEFINED
139 #else
140 #define yyset_extra libconfig_yyset_extra
141 #endif
142 
143 #ifdef yyget_in
144 #define libconfig_yyget_in_ALREADY_DEFINED
145 #else
146 #define yyget_in libconfig_yyget_in
147 #endif
148 
149 #ifdef yyset_in
150 #define libconfig_yyset_in_ALREADY_DEFINED
151 #else
152 #define yyset_in libconfig_yyset_in
153 #endif
154 
155 #ifdef yyget_out
156 #define libconfig_yyget_out_ALREADY_DEFINED
157 #else
158 #define yyget_out libconfig_yyget_out
159 #endif
160 
161 #ifdef yyset_out
162 #define libconfig_yyset_out_ALREADY_DEFINED
163 #else
164 #define yyset_out libconfig_yyset_out
165 #endif
166 
167 #ifdef yyget_leng
168 #define libconfig_yyget_leng_ALREADY_DEFINED
169 #else
170 #define yyget_leng libconfig_yyget_leng
171 #endif
172 
173 #ifdef yyget_text
174 #define libconfig_yyget_text_ALREADY_DEFINED
175 #else
176 #define yyget_text libconfig_yyget_text
177 #endif
178 
179 #ifdef yyget_lineno
180 #define libconfig_yyget_lineno_ALREADY_DEFINED
181 #else
182 #define yyget_lineno libconfig_yyget_lineno
183 #endif
184 
185 #ifdef yyset_lineno
186 #define libconfig_yyset_lineno_ALREADY_DEFINED
187 #else
188 #define yyset_lineno libconfig_yyset_lineno
189 #endif
190 
191 #ifdef yyget_column
192 #define libconfig_yyget_column_ALREADY_DEFINED
193 #else
194 #define yyget_column libconfig_yyget_column
195 #endif
196 
197 #ifdef yyset_column
198 #define libconfig_yyset_column_ALREADY_DEFINED
199 #else
200 #define yyset_column libconfig_yyset_column
201 #endif
202 
203 #ifdef yywrap
204 #define libconfig_yywrap_ALREADY_DEFINED
205 #else
206 #define yywrap libconfig_yywrap
207 #endif
208 
209 #ifdef yyget_lval
210 #define libconfig_yyget_lval_ALREADY_DEFINED
211 #else
212 #define yyget_lval libconfig_yyget_lval
213 #endif
214 
215 #ifdef yyset_lval
216 #define libconfig_yyset_lval_ALREADY_DEFINED
217 #else
218 #define yyset_lval libconfig_yyset_lval
219 #endif
220 
221 #ifdef yyalloc
222 #define libconfig_yyalloc_ALREADY_DEFINED
223 #else
224 #define yyalloc libconfig_yyalloc
225 #endif
226 
227 #ifdef yyrealloc
228 #define libconfig_yyrealloc_ALREADY_DEFINED
229 #else
230 #define yyrealloc libconfig_yyrealloc
231 #endif
232 
233 #ifdef yyfree
234 #define libconfig_yyfree_ALREADY_DEFINED
235 #else
236 #define yyfree libconfig_yyfree
237 #endif
238 
239 /* First, we deal with  platform-specific or compiler-specific issues. */
240 
241 /* begin standard C headers. */
242 #include <stdio.h>
243 #include <string.h>
244 #include <errno.h>
245 #include <stdlib.h>
246 
247 /* end standard C headers. */
248 
249 /* flex integer type definitions */
250 
251 #ifndef FLEXINT_H
252 #define FLEXINT_H
253 
254 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
255 
256 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
257 
258 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
259  * if you want the limit (max/min) macros for int types.
260  */
261 #ifndef __STDC_LIMIT_MACROS
262 #define __STDC_LIMIT_MACROS 1
263 #endif
264 
265 #include <inttypes.h>
266 typedef int8_t flex_int8_t;
267 typedef uint8_t flex_uint8_t;
268 typedef int16_t flex_int16_t;
269 typedef uint16_t flex_uint16_t;
270 typedef int32_t flex_int32_t;
271 typedef uint32_t flex_uint32_t;
272 #else
273 typedef signed char flex_int8_t;
274 typedef short int flex_int16_t;
275 typedef int flex_int32_t;
276 typedef unsigned char flex_uint8_t;
277 typedef unsigned short int flex_uint16_t;
278 typedef unsigned int flex_uint32_t;
279 
280 /* Limits of integral types. */
281 #ifndef INT8_MIN
282 #define INT8_MIN               (-128)
283 #endif
284 #ifndef INT16_MIN
285 #define INT16_MIN              (-32767-1)
286 #endif
287 #ifndef INT32_MIN
288 #define INT32_MIN              (-2147483647-1)
289 #endif
290 #ifndef INT8_MAX
291 #define INT8_MAX               (127)
292 #endif
293 #ifndef INT16_MAX
294 #define INT16_MAX              (32767)
295 #endif
296 #ifndef INT32_MAX
297 #define INT32_MAX              (2147483647)
298 #endif
299 #ifndef UINT8_MAX
300 #define UINT8_MAX              (255U)
301 #endif
302 #ifndef UINT16_MAX
303 #define UINT16_MAX             (65535U)
304 #endif
305 #ifndef UINT32_MAX
306 #define UINT32_MAX             (4294967295U)
307 #endif
308 
309 #ifndef SIZE_MAX
310 #define SIZE_MAX               (~(size_t)0)
311 #endif
312 
313 #endif /* ! C99 */
314 
315 #endif /* ! FLEXINT_H */
316 
317 /* begin standard C++ headers. */
318 
319 /* TODO: this is always defined, so inline it */
320 #define yyconst const
321 
322 #if defined(__GNUC__) && __GNUC__ >= 3
323 #define yynoreturn __attribute__((__noreturn__))
324 #else
325 #define yynoreturn
326 #endif
327 
328 /* Returned upon end-of-file. */
329 #define YY_NULL 0
330 
331 /* Promotes a possibly negative, possibly signed char to an
332  *   integer in range [0..255] for use as an array index.
333  */
334 #define YY_SC_TO_UI(c) ((YY_CHAR) (c))
335 
336 /* An opaque pointer. */
337 #ifndef YY_TYPEDEF_YY_SCANNER_T
338 #define YY_TYPEDEF_YY_SCANNER_T
339 typedef void* yyscan_t;
340 #endif
341 
342 /* For convenience, these vars (plus the bison vars far below)
343    are macros in the reentrant scanner. */
344 #define yyin yyg->yyin_r
345 #define yyout yyg->yyout_r
346 #define yyextra yyg->yyextra_r
347 #define yyleng yyg->yyleng_r
348 #define yytext yyg->yytext_r
349 #define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
350 #define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
351 #define yy_flex_debug yyg->yy_flex_debug_r
352 
353 /* Enter a start condition.  This macro really ought to take a parameter,
354  * but we do it the disgusting crufty way forced on us by the ()-less
355  * definition of BEGIN.
356  */
357 #define BEGIN yyg->yy_start = 1 + 2 *
358 /* Translate the current start state into a value that can be later handed
359  * to BEGIN to return to the state.  The YYSTATE alias is for lex
360  * compatibility.
361  */
362 #define YY_START ((yyg->yy_start - 1) / 2)
363 #define YYSTATE YY_START
364 /* Action number for EOF rule of a given start state. */
365 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
366 /* Special action meaning "start processing a new file". */
367 #define YY_NEW_FILE yyrestart( yyin , yyscanner )
368 #define YY_END_OF_BUFFER_CHAR 0
369 
370 /* Size of default input buffer. */
371 #ifndef YY_BUF_SIZE
372 #ifdef __ia64__
373 /* On IA-64, the buffer size is 16k, not 8k.
374  * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
375  * Ditto for the __ia64__ case accordingly.
376  */
377 #define YY_BUF_SIZE 32768
378 #else
379 #define YY_BUF_SIZE 16384
380 #endif /* __ia64__ */
381 #endif
382 
383 /* The state buf must be large enough to hold one state per character in the main buffer.
384  */
385 #define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
386 
387 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
388 #define YY_TYPEDEF_YY_BUFFER_STATE
389 typedef struct yy_buffer_state *YY_BUFFER_STATE;
390 #endif
391 
392 #ifndef YY_TYPEDEF_YY_SIZE_T
393 #define YY_TYPEDEF_YY_SIZE_T
394 typedef size_t yy_size_t;
395 #endif
396 
397 #define EOB_ACT_CONTINUE_SCAN 0
398 #define EOB_ACT_END_OF_FILE 1
399 #define EOB_ACT_LAST_MATCH 2
400 
401     /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires
402      *       access to the local variable yy_act. Since yyless() is a macro, it would break
403      *       existing scanners that call yyless() from OUTSIDE yylex.
404      *       One obvious solution it to make yy_act a global. I tried that, and saw
405      *       a 5% performance hit in a non-yylineno scanner, because yy_act is
406      *       normally declared as a register variable-- so it is not worth it.
407      */
408     #define  YY_LESS_LINENO(n) \
409             do { \
410                 int yyl;\
411                 for ( yyl = n; yyl < yyleng; ++yyl )\
412                     if ( yytext[yyl] == '\n' )\
413                         --yylineno;\
414             }while(0)
415     #define YY_LINENO_REWIND_TO(dst) \
416             do {\
417                 const char *p;\
418                 for ( p = yy_cp-1; p >= (dst); --p)\
419                     if ( *p == '\n' )\
420                         --yylineno;\
421             }while(0)
422 
423 /* Return all but the first "n" matched characters back to the input stream. */
424 #define yyless(n) \
425 	do \
426 		{ \
427 		/* Undo effects of setting up yytext. */ \
428         int yyless_macro_arg = (n); \
429         YY_LESS_LINENO(yyless_macro_arg);\
430 		*yy_cp = yyg->yy_hold_char; \
431 		YY_RESTORE_YY_MORE_OFFSET \
432 		yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
433 		YY_DO_BEFORE_ACTION; /* set up yytext again */ \
434 		} \
435 	while ( 0 )
436 #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
437 
438 #ifndef YY_STRUCT_YY_BUFFER_STATE
439 #define YY_STRUCT_YY_BUFFER_STATE
440 struct yy_buffer_state
441 	{
442 	FILE *yy_input_file;
443 
444 	char *yy_ch_buf;		/* input buffer */
445 	char *yy_buf_pos;		/* current position in input buffer */
446 
447 	/* Size of input buffer in bytes, not including room for EOB
448 	 * characters.
449 	 */
450 	int yy_buf_size;
451 
452 	/* Number of characters read into yy_ch_buf, not including EOB
453 	 * characters.
454 	 */
455 	int yy_n_chars;
456 
457 	/* Whether we "own" the buffer - i.e., we know we created it,
458 	 * and can realloc() it to grow it, and should free() it to
459 	 * delete it.
460 	 */
461 	int yy_is_our_buffer;
462 
463 	/* Whether this is an "interactive" input source; if so, and
464 	 * if we're using stdio for input, then we want to use getc()
465 	 * instead of fread(), to make sure we stop fetching input after
466 	 * each newline.
467 	 */
468 	int yy_is_interactive;
469 
470 	/* Whether we're considered to be at the beginning of a line.
471 	 * If so, '^' rules will be active on the next match, otherwise
472 	 * not.
473 	 */
474 	int yy_at_bol;
475 
476     int yy_bs_lineno; /**< The line count. */
477     int yy_bs_column; /**< The column count. */
478 
479 	/* Whether to try to fill the input buffer when we reach the
480 	 * end of it.
481 	 */
482 	int yy_fill_buffer;
483 
484 	int yy_buffer_status;
485 
486 #define YY_BUFFER_NEW 0
487 #define YY_BUFFER_NORMAL 1
488 	/* When an EOF's been seen but there's still some text to process
489 	 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
490 	 * shouldn't try reading from the input source any more.  We might
491 	 * still have a bunch of tokens to match, though, because of
492 	 * possible backing-up.
493 	 *
494 	 * When we actually see the EOF, we change the status to "new"
495 	 * (via yyrestart()), so that the user can continue scanning by
496 	 * just pointing yyin at a new input file.
497 	 */
498 #define YY_BUFFER_EOF_PENDING 2
499 
500 	};
501 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
502 
503 /* We provide macros for accessing buffer states in case in the
504  * future we want to put the buffer states in a more general
505  * "scanner state".
506  *
507  * Returns the top of the stack, or NULL.
508  */
509 #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
510                           ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
511                           : NULL)
512 /* Same as previous macro, but useful when we know that the buffer stack is not
513  * NULL or when we need an lvalue. For internal use only.
514  */
515 #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
516 
517 void yyrestart ( FILE *input_file , yyscan_t yyscanner );
518 void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
519 YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner );
520 void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
521 void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
522 void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
523 void yypop_buffer_state ( yyscan_t yyscanner );
524 
525 static void yyensure_buffer_stack ( yyscan_t yyscanner );
526 static void yy_load_buffer_state ( yyscan_t yyscanner );
527 static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file , yyscan_t yyscanner );
528 #define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER , yyscanner)
529 
530 YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner );
531 YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner );
532 YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner );
533 
534 void *yyalloc ( yy_size_t , yyscan_t yyscanner );
535 void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner );
536 void yyfree ( void * , yyscan_t yyscanner );
537 
538 #define yy_new_buffer yy_create_buffer
539 #define yy_set_interactive(is_interactive) \
540 	{ \
541 	if ( ! YY_CURRENT_BUFFER ){ \
542         yyensure_buffer_stack (yyscanner); \
543 		YY_CURRENT_BUFFER_LVALUE =    \
544             yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \
545 	} \
546 	YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
547 	}
548 #define yy_set_bol(at_bol) \
549 	{ \
550 	if ( ! YY_CURRENT_BUFFER ){\
551         yyensure_buffer_stack (yyscanner); \
552 		YY_CURRENT_BUFFER_LVALUE =    \
553             yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \
554 	} \
555 	YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
556 	}
557 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
558 
559 #define libconfig_yywrap(yyscanner) (/*CONSTCOND*/1)
560 #define YY_SKIP_YYWRAP
561 typedef flex_uint8_t YY_CHAR;
562 
563 typedef int yy_state_type;
564 
565 #define yytext_ptr yytext_r
566 
567 static yy_state_type yy_get_previous_state ( yyscan_t yyscanner );
568 static yy_state_type yy_try_NUL_trans ( yy_state_type current_state  , yyscan_t yyscanner);
569 static int yy_get_next_buffer ( yyscan_t yyscanner );
570 static void yynoreturn yy_fatal_error ( const char* msg , yyscan_t yyscanner );
571 
572 /* Done after the current pattern has been matched and before the
573  * corresponding action - sets up yytext.
574  */
575 #define YY_DO_BEFORE_ACTION \
576 	yyg->yytext_ptr = yy_bp; \
577 	yyleng = (int) (yy_cp - yy_bp); \
578 	yyg->yy_hold_char = *yy_cp; \
579 	*yy_cp = '\0'; \
580 	yyg->yy_c_buf_p = yy_cp;
581 #define YY_NUM_RULES 44
582 #define YY_END_OF_BUFFER 45
583 /* This struct is not used in this scanner,
584    but its presence is necessary. */
585 struct yy_trans_info
586 	{
587 	flex_int32_t yy_verify;
588 	flex_int32_t yy_nxt;
589 	};
590 static const flex_int16_t yy_accept[105] =
591     {   0,
592         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
593        45,   43,   25,   24,   24,    8,    1,   40,   41,   32,
594        43,   27,   33,   43,   34,   34,   26,   42,   32,   32,
595        38,   39,   28,   29,   25,   43,    3,    2,    6,    7,
596         6,    9,   18,   17,   20,   23,   44,   25,   32,   33,
597        34,   33,    0,    4,    1,   33,    0,   35,    0,   32,
598        32,   25,    0,    0,    5,    9,   15,    0,   14,   13,
599        10,   11,   12,   20,   22,   21,    0,   33,   33,    0,
600         0,   33,   35,   36,   32,   32,    0,    0,    0,   33,
601        37,   32,   30,    0,   16,   37,   31,    0,    0,    0,
602 
603         0,    0,   19,    0
604     } ;
605 
606 static const YY_CHAR yy_ec[256] =
607     {   0,
608         1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
609         1,    4,    5,    1,    1,    1,    1,    1,    1,    1,
610         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
611         1,    2,    1,    6,    7,    1,    1,    1,    1,    8,
612         9,   10,   11,   12,   13,   14,   15,   16,   17,   17,
613        17,   17,   17,   17,   17,   17,   17,   18,   19,    1,
614        20,    1,    1,   21,   22,   23,   23,   23,   24,   25,
615        26,   26,   26,   26,   26,   27,   26,   26,   26,   26,
616        26,   28,   29,   30,   31,   26,   26,   32,   26,   26,
617        33,   34,   35,    1,   36,    1,   22,   23,   37,   38,
618 
619        39,   40,   26,   26,   41,   26,   26,   42,   26,   43,
620        26,   26,   26,   44,   29,   45,   46,   26,   26,   32,
621        26,   26,   47,    1,   48,    1,    1,    1,    1,    1,
622         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
623         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
624         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
625         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
626         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
627         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
628         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
629 
630         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
631         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
632         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
633         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
634         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
635         1,    1,    1,    1,    1
636     } ;
637 
638 static const YY_CHAR yy_meta[49] =
639     {   0,
640         1,    1,    1,    1,    1,    2,    1,    1,    1,    3,
641         1,    1,    3,    1,    1,    4,    4,    1,    1,    1,
642         1,    4,    4,    4,    4,    3,    3,    3,    3,    3,
643         3,    3,    1,    2,    1,    3,    4,    4,    4,    4,
644         3,    3,    3,    3,    3,    3,    1,    1
645     } ;
646 
647 static const flex_int16_t yy_base[115] =
648     {   0,
649         0,   47,  199,  198,   47,   48,   46,   47,   48,   49,
650       200,  203,  197,  203,  203,  203,  203,  203,  203,    0,
651        45,  203,   47,   50,   60,   74,  203,  203,  176,   28,
652       203,  203,  203,  203,   64,  156,  203,  203,  203,  203,
653       181,    0,  203,   63,    0,  203,   83,  191,    0,   88,
654       102,   98,   62,  203,  203,  104,  119,  162,    0,   67,
655        65,  121,  127,  124,  203,    0,  203,    0,  203,  203,
656       203,  203,  203,    0,  203,  203,  108,  117,  122,  134,
657       132,  136,  203,  139,  136,  116,  126,    0,  140,  142,
658       135,  130,    0,  102,  203,  203,    0,   85,   72,   63,
659 
660        98,  158,  203,  203,  169,  173,  177,  181,  183,  187,
661       191,   89,   66,   63
662     } ;
663 
664 static const flex_int16_t yy_def[115] =
665     {   0,
666       104,    1,  105,  105,  106,  106,  107,  107,  108,  108,
667       104,  104,  104,  104,  104,  104,  104,  104,  104,  109,
668       104,  104,  104,  104,  104,  104,  104,  104,  109,  109,
669       104,  104,  104,  104,  104,  104,  104,  104,  104,  104,
670       104,  110,  104,  104,  111,  104,  104,  104,  109,  104,
671       104,  104,  104,  104,  104,  104,  104,  104,  112,  109,
672       109,  104,  104,  104,  104,  110,  104,  113,  104,  104,
673       104,  104,  104,  111,  104,  104,  104,  104,  104,  104,
674       104,  104,  104,  112,  109,  109,  104,  114,  104,  104,
675       104,  109,  109,  104,  104,  104,  109,  104,  104,  104,
676 
677       104,  104,  104,    0,  104,  104,  104,  104,  104,  104,
678       104,  104,  104,  104
679     } ;
680 
681 static const flex_int16_t yy_nxt[252] =
682     {   0,
683        12,   13,   14,   15,   15,   16,   17,   18,   19,   20,
684        21,   22,   21,   23,   24,   25,   26,   27,   28,   27,
685        12,   20,   20,   20,   29,   20,   20,   20,   20,   30,
686        20,   20,   31,   12,   32,   12,   20,   20,   20,   29,
687        20,   20,   20,   20,   30,   20,   33,   34,   35,   40,
688        40,   43,   43,   46,   46,   61,   41,   41,   50,   54,
689        51,   51,   52,   52,   55,   62,   95,   36,   67,   88,
690        53,   61,   77,   56,   77,   51,   51,   78,   78,   44,
691        44,   47,   47,   57,   63,   53,   58,   56,   75,   51,
692        51,   59,   84,   85,   68,   86,   69,   57,   57,  102,
693 
694        58,  101,   70,   52,   52,   71,   72,   73,   85,  100,
695        86,   53,   57,   52,   52,   56,   76,   51,   51,   79,
696        79,   53,   62,   78,   78,   57,   53,   80,   58,   81,
697        99,   81,   78,   78,   82,   82,   53,   79,   79,   93,
698        57,   63,   80,   98,   89,   80,   89,   82,   82,   90,
699        90,   82,   82,   97,   93,   90,   90,   90,   90,  102,
700        80,   96,   94,  103,   92,   91,   87,   64,   97,   37,
701        37,   37,   37,   39,   39,   39,   39,   42,   42,   42,
702        42,   45,   45,   45,   45,   49,   49,   66,   83,   66,
703        66,   74,   48,   74,   74,   65,   64,   60,   48,  104,
704 
705        38,   38,   11,  104,  104,  104,  104,  104,  104,  104,
706       104,  104,  104,  104,  104,  104,  104,  104,  104,  104,
707       104,  104,  104,  104,  104,  104,  104,  104,  104,  104,
708       104,  104,  104,  104,  104,  104,  104,  104,  104,  104,
709       104,  104,  104,  104,  104,  104,  104,  104,  104,  104,
710       104
711     } ;
712 
713 static const flex_int16_t yy_chk[252] =
714     {   0,
715         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
716         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
717         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
718         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
719         1,    1,    1,    1,    1,    1,    1,    1,    2,    5,
720         6,    7,    8,    9,   10,   30,    5,    6,   21,   24,
721        21,   21,   23,   23,   24,   35,  114,    2,   44,  113,
722        23,   30,   53,   25,   53,   25,   25,   53,   53,    7,
723         8,    9,   10,   25,   35,   23,   25,   26,   47,   26,
724        26,   25,  112,   60,   44,   61,   44,   26,   25,  101,
725 
726        26,  100,   44,   50,   50,   44,   44,   44,   60,   99,
727        61,   50,   26,   52,   52,   51,   47,   51,   51,   56,
728        56,   52,   62,   77,   77,   51,   50,   56,   51,   57,
729        98,   57,   78,   78,   57,   57,   52,   79,   79,   86,
730        51,   62,   56,   94,   80,   79,   80,   81,   81,   80,
731        80,   82,   82,   92,   86,   89,   89,   90,   90,  102,
732        79,   91,   87,  102,   85,   84,   64,   63,   92,  105,
733       105,  105,  105,  106,  106,  106,  106,  107,  107,  107,
734       107,  108,  108,  108,  108,  109,  109,  110,   58,  110,
735       110,  111,   48,  111,  111,   41,   36,   29,   13,   11,
736 
737         4,    3,  104,  104,  104,  104,  104,  104,  104,  104,
738       104,  104,  104,  104,  104,  104,  104,  104,  104,  104,
739       104,  104,  104,  104,  104,  104,  104,  104,  104,  104,
740       104,  104,  104,  104,  104,  104,  104,  104,  104,  104,
741       104,  104,  104,  104,  104,  104,  104,  104,  104,  104,
742       104
743     } ;
744 
745 /* Table of booleans, true if rule could match eol. */
746 static const flex_int32_t yy_rule_can_match_eol[45] =
747     {   0,
748 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
749     1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
750     0, 0, 0, 0, 0,     };
751 
752 /* The intent behind this definition is that it'll catch
753  * any uses of REJECT which flex missed.
754  */
755 #define REJECT reject_used_but_not_detected
756 #define yymore() yymore_used_but_not_detected
757 #define YY_MORE_ADJ 0
758 #define YY_RESTORE_YY_MORE_OFFSET
759 #line 1 "scanner.l"
760 /* -*- mode: C -*- */
761 /* --------------------------------------------------------------------------
762    libconfig - A library for processing structured configuration files
763    Copyright (C) 2005-2020  Mark A Lindner
764 
765    This file is part of libconfig.
766 
767    This library is free software; you can redistribute it and/or
768    modify it under the terms of the GNU Lesser General Public License
769    as published by the Free Software Foundation; either version 2.1 of
770    the License, or (at your option) any later version.
771 
772    This library is distributed in the hope that it will be useful, but
773    WITHOUT ANY WARRANTY; without even the implied warranty of
774    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
775    Lesser General Public License for more details.
776 
777    You should have received a copy of the GNU Library General Public
778    License along with this library; if not, see
779    <http://www.gnu.org/licenses/>.
780    ----------------------------------------------------------------------------
781 */
782 #define YY_NO_UNISTD_H 1
783 #line 36 "scanner.l"
784 
785 #ifdef _MSC_VER
786 #pragma warning (disable: 4996)
787 #endif
788 
789 #include <stdlib.h>
790 #include <errno.h>
791 #include <ctype.h>
792 #include <string.h>
793 #include <limits.h>
794 
795 #include "parsectx.h"
796 #include "scanctx.h"
797 #include "grammar.h"
798 #include "wincompat.h"
799 #include "util.h"
800 
801 #define YY_NO_INPUT // Suppress generation of useless input() function
802 
803 #line 803 "scanner.c"
804 
805 #line 805 "scanner.c"
806 
807 #define INITIAL 0
808 #define SINGLE_LINE_COMMENT 1
809 #define MULTI_LINE_COMMENT 2
810 #define STRING 3
811 #define INCLUDE 4
812 
813 #ifndef YY_NO_UNISTD_H
814 /* Special case for "unistd.h", since it is non-ANSI. We include it way
815  * down here because we want the user's section 1 to have been scanned first.
816  * The user has a chance to override it with an option.
817  */
818 #include <unistd.h>
819 #endif
820 
821 #define YY_EXTRA_TYPE struct scan_context *
822 
823 /* Holds the entire state of the reentrant scanner. */
824 struct yyguts_t
825     {
826 
827     /* User-defined. Not touched by flex. */
828     YY_EXTRA_TYPE yyextra_r;
829 
830     /* The rest are the same as the globals declared in the non-reentrant scanner. */
831     FILE *yyin_r, *yyout_r;
832     size_t yy_buffer_stack_top; /**< index of top of stack. */
833     size_t yy_buffer_stack_max; /**< capacity of stack. */
834     YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
835     char yy_hold_char;
836     int yy_n_chars;
837     int yyleng_r;
838     char *yy_c_buf_p;
839     int yy_init;
840     int yy_start;
841     int yy_did_buffer_switch_on_eof;
842     int yy_start_stack_ptr;
843     int yy_start_stack_depth;
844     int *yy_start_stack;
845     yy_state_type yy_last_accepting_state;
846     char* yy_last_accepting_cpos;
847 
848     int yylineno_r;
849     int yy_flex_debug_r;
850 
851     char *yytext_r;
852     int yy_more_flag;
853     int yy_more_len;
854 
855     YYSTYPE * yylval_r;
856 
857     }; /* end struct yyguts_t */
858 
859 static int yy_init_globals ( yyscan_t yyscanner );
860 
861     /* This must go here because YYSTYPE and YYLTYPE are included
862      * from bison output in section 1.*/
863     #    define yylval yyg->yylval_r
864 
865 int yylex_init (yyscan_t* scanner);
866 
867 int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner);
868 
869 /* Accessor methods to globals.
870    These are made visible to non-reentrant scanners for convenience. */
871 
872 int yylex_destroy ( yyscan_t yyscanner );
873 
874 int yyget_debug ( yyscan_t yyscanner );
875 
876 void yyset_debug ( int debug_flag , yyscan_t yyscanner );
877 
878 YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner );
879 
880 void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner );
881 
882 FILE *yyget_in ( yyscan_t yyscanner );
883 
884 void yyset_in  ( FILE * _in_str , yyscan_t yyscanner );
885 
886 FILE *yyget_out ( yyscan_t yyscanner );
887 
888 void yyset_out  ( FILE * _out_str , yyscan_t yyscanner );
889 
890 			int yyget_leng ( yyscan_t yyscanner );
891 
892 char *yyget_text ( yyscan_t yyscanner );
893 
894 int yyget_lineno ( yyscan_t yyscanner );
895 
896 void yyset_lineno ( int _line_number , yyscan_t yyscanner );
897 
898 int yyget_column  ( yyscan_t yyscanner );
899 
900 void yyset_column ( int _column_no , yyscan_t yyscanner );
901 
902 YYSTYPE * yyget_lval ( yyscan_t yyscanner );
903 
904 void yyset_lval ( YYSTYPE * yylval_param , yyscan_t yyscanner );
905 
906 /* Macros after this point can all be overridden by user definitions in
907  * section 1.
908  */
909 
910 #ifndef YY_SKIP_YYWRAP
911 #ifdef __cplusplus
912 extern "C" int yywrap ( yyscan_t yyscanner );
913 #else
914 extern int yywrap ( yyscan_t yyscanner );
915 #endif
916 #endif
917 
918 #ifndef YY_NO_UNPUT
919 
920 #endif
921 
922 #ifndef yytext_ptr
923 static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner);
924 #endif
925 
926 #ifdef YY_NEED_STRLEN
927 static int yy_flex_strlen ( const char * , yyscan_t yyscanner);
928 #endif
929 
930 #ifndef YY_NO_INPUT
931 #ifdef __cplusplus
932 static int yyinput ( yyscan_t yyscanner );
933 #else
934 static int input ( yyscan_t yyscanner );
935 #endif
936 
937 #endif
938 
939 /* Amount of stuff to slurp up with each read. */
940 #ifndef YY_READ_BUF_SIZE
941 #ifdef __ia64__
942 /* On IA-64, the buffer size is 16k, not 8k */
943 #define YY_READ_BUF_SIZE 16384
944 #else
945 #define YY_READ_BUF_SIZE 8192
946 #endif /* __ia64__ */
947 #endif
948 
949 /* Copy whatever the last rule matched to the standard output. */
950 #ifndef ECHO
951 /* This used to be an fputs(), but since the string might contain NUL's,
952  * we now use fwrite().
953  */
954 #define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
955 #endif
956 
957 /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
958  * is returned in "result".
959  */
960 #ifndef YY_INPUT
961 #define YY_INPUT(buf,result,max_size) \
962 	if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
963 		{ \
964 		int c = '*'; \
965 		int n; \
966 		for ( n = 0; n < max_size && \
967 			     (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
968 			buf[n] = (char) c; \
969 		if ( c == '\n' ) \
970 			buf[n++] = (char) c; \
971 		if ( c == EOF && ferror( yyin ) ) \
972 			YY_FATAL_ERROR( "input in flex scanner failed" ); \
973 		result = n; \
974 		} \
975 	else \
976 		{ \
977 		errno=0; \
978 		while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
979 			{ \
980 			if( errno != EINTR) \
981 				{ \
982 				YY_FATAL_ERROR( "input in flex scanner failed" ); \
983 				break; \
984 				} \
985 			errno=0; \
986 			clearerr(yyin); \
987 			} \
988 		}\
989 \
990 
991 #endif
992 
993 /* No semi-colon after return; correct usage is to write "yyterminate();" -
994  * we don't want an extra ';' after the "return" because that will cause
995  * some compilers to complain about unreachable statements.
996  */
997 #ifndef yyterminate
998 #define yyterminate() return YY_NULL
999 #endif
1000 
1001 /* Number of entries by which start-condition stack grows. */
1002 #ifndef YY_START_STACK_INCR
1003 #define YY_START_STACK_INCR 25
1004 #endif
1005 
1006 /* Report a fatal error. */
1007 #ifndef YY_FATAL_ERROR
1008 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
1009 #endif
1010 
1011 /* end tables serialization structures and prototypes */
1012 
1013 /* Default declaration of generated scanner - a define so the user can
1014  * easily add parameters.
1015  */
1016 #ifndef YY_DECL
1017 #define YY_DECL_IS_OURS 1
1018 
1019 extern int yylex \
1020                (YYSTYPE * yylval_param , yyscan_t yyscanner);
1021 
1022 #define YY_DECL int yylex \
1023                (YYSTYPE * yylval_param , yyscan_t yyscanner)
1024 #endif /* !YY_DECL */
1025 
1026 /* Code executed at the beginning of each rule, after yytext and yyleng
1027  * have been set up.
1028  */
1029 #ifndef YY_USER_ACTION
1030 #define YY_USER_ACTION
1031 #endif
1032 
1033 /* Code executed at the end of each rule. */
1034 #ifndef YY_BREAK
1035 #define YY_BREAK /*LINTED*/break;
1036 #endif
1037 
1038 #define YY_RULE_SETUP \
1039 	if ( yyleng > 0 ) \
1040 		YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
1041 				(yytext[yyleng - 1] == '\n'); \
1042 	YY_USER_ACTION
1043 
1044 /** The main scanner function which does all the work.
1045  */
1046 YY_DECL
1047 {
1048 	yy_state_type yy_current_state;
1049 	char *yy_cp, *yy_bp;
1050 	int yy_act;
1051     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1052 
1053     yylval = yylval_param;
1054 
1055 	if ( !yyg->yy_init )
1056 		{
1057 		yyg->yy_init = 1;
1058 
1059 #ifdef YY_USER_INIT
1060 		YY_USER_INIT;
1061 #endif
1062 
1063 		if ( ! yyg->yy_start )
1064 			yyg->yy_start = 1;	/* first start state */
1065 
1066 		if ( ! yyin )
1067 			yyin = stdin;
1068 
1069 		if ( ! yyout )
1070 			yyout = stdout;
1071 
1072 		if ( ! YY_CURRENT_BUFFER ) {
1073 			yyensure_buffer_stack (yyscanner);
1074 			YY_CURRENT_BUFFER_LVALUE =
1075 				yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner);
1076 		}
1077 
1078 		yy_load_buffer_state( yyscanner );
1079 		}
1080 
1081 	{
1082 #line 70 "scanner.l"
1083 
1084 
1085 #line 1085 "scanner.c"
1086 
1087 	while ( /*CONSTCOND*/1 )		/* loops until end-of-file is reached */
1088 		{
1089 		yy_cp = yyg->yy_c_buf_p;
1090 
1091 		/* Support of yytext. */
1092 		*yy_cp = yyg->yy_hold_char;
1093 
1094 		/* yy_bp points to the position in yy_ch_buf of the start of
1095 		 * the current run.
1096 		 */
1097 		yy_bp = yy_cp;
1098 
1099 		yy_current_state = yyg->yy_start;
1100 		yy_current_state += YY_AT_BOL();
1101 yy_match:
1102 		do
1103 			{
1104 			YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
1105 			if ( yy_accept[yy_current_state] )
1106 				{
1107 				yyg->yy_last_accepting_state = yy_current_state;
1108 				yyg->yy_last_accepting_cpos = yy_cp;
1109 				}
1110 			while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1111 				{
1112 				yy_current_state = (int) yy_def[yy_current_state];
1113 				if ( yy_current_state >= 105 )
1114 					yy_c = yy_meta[yy_c];
1115 				}
1116 			yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1117 			++yy_cp;
1118 			}
1119 		while ( yy_current_state != 104 );
1120 		yy_cp = yyg->yy_last_accepting_cpos;
1121 		yy_current_state = yyg->yy_last_accepting_state;
1122 
1123 yy_find_action:
1124 		yy_act = yy_accept[yy_current_state];
1125 
1126 		YY_DO_BEFORE_ACTION;
1127 
1128 		if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
1129 			{
1130 			int yyl;
1131 			for ( yyl = 0; yyl < yyleng; ++yyl )
1132 				if ( yytext[yyl] == '\n' )
1133 
1134     do{ yylineno++;
1135         yycolumn=0;
1136     }while(0)
1137 ;
1138 			}
1139 
1140 do_action:	/* This label is used only to access EOF actions. */
1141 
1142 		switch ( yy_act )
1143 	{ /* beginning of action switch */
1144 			case 0: /* must back up */
1145 			/* undo the effects of YY_DO_BEFORE_ACTION */
1146 			*yy_cp = yyg->yy_hold_char;
1147 			yy_cp = yyg->yy_last_accepting_cpos;
1148 			yy_current_state = yyg->yy_last_accepting_state;
1149 			goto yy_find_action;
1150 
1151 case 1:
1152 YY_RULE_SETUP
1153 #line 72 "scanner.l"
1154 { BEGIN SINGLE_LINE_COMMENT; }
1155 	YY_BREAK
1156 case 2:
1157 /* rule 2 can match eol */
1158 YY_RULE_SETUP
1159 #line 73 "scanner.l"
1160 { BEGIN INITIAL; }
1161 	YY_BREAK
1162 case 3:
1163 YY_RULE_SETUP
1164 #line 74 "scanner.l"
1165 { /* ignore */ }
1166 	YY_BREAK
1167 case 4:
1168 YY_RULE_SETUP
1169 #line 76 "scanner.l"
1170 { BEGIN MULTI_LINE_COMMENT; }
1171 	YY_BREAK
1172 case 5:
1173 YY_RULE_SETUP
1174 #line 77 "scanner.l"
1175 { BEGIN INITIAL; }
1176 	YY_BREAK
1177 case 6:
1178 YY_RULE_SETUP
1179 #line 78 "scanner.l"
1180 { /* ignore */ }
1181 	YY_BREAK
1182 case 7:
1183 /* rule 7 can match eol */
1184 YY_RULE_SETUP
1185 #line 79 "scanner.l"
1186 { /* ignore */ }
1187 	YY_BREAK
1188 case 8:
1189 YY_RULE_SETUP
1190 #line 81 "scanner.l"
1191 { BEGIN STRING; }
1192 	YY_BREAK
1193 case 9:
1194 /* rule 9 can match eol */
1195 YY_RULE_SETUP
1196 #line 82 "scanner.l"
1197 { libconfig_scanctx_append_string(yyextra, yytext); }
1198 	YY_BREAK
1199 case 10:
1200 YY_RULE_SETUP
1201 #line 83 "scanner.l"
1202 { libconfig_scanctx_append_char(yyextra, '\n'); }
1203 	YY_BREAK
1204 case 11:
1205 YY_RULE_SETUP
1206 #line 84 "scanner.l"
1207 { libconfig_scanctx_append_char(yyextra, '\r'); }
1208 	YY_BREAK
1209 case 12:
1210 YY_RULE_SETUP
1211 #line 85 "scanner.l"
1212 { libconfig_scanctx_append_char(yyextra, '\t'); }
1213 	YY_BREAK
1214 case 13:
1215 YY_RULE_SETUP
1216 #line 86 "scanner.l"
1217 { libconfig_scanctx_append_char(yyextra, '\f'); }
1218 	YY_BREAK
1219 case 14:
1220 YY_RULE_SETUP
1221 #line 87 "scanner.l"
1222 { libconfig_scanctx_append_char(yyextra, '\\'); }
1223 	YY_BREAK
1224 case 15:
1225 YY_RULE_SETUP
1226 #line 88 "scanner.l"
1227 { libconfig_scanctx_append_char(yyextra, '\"'); }
1228 	YY_BREAK
1229 case 16:
1230 YY_RULE_SETUP
1231 #line 89 "scanner.l"
1232 {
1233                     char c = (char)(strtol(yytext + 2, NULL, 16) & 0xFF);
1234                     libconfig_scanctx_append_char(yyextra, c);
1235                   }
1236 	YY_BREAK
1237 case 17:
1238 YY_RULE_SETUP
1239 #line 93 "scanner.l"
1240 { libconfig_scanctx_append_char(yyextra, '\\'); }
1241 	YY_BREAK
1242 case 18:
1243 YY_RULE_SETUP
1244 #line 94 "scanner.l"
1245 {
1246                     yylval->sval = libconfig_scanctx_take_string(yyextra);
1247                     BEGIN INITIAL;
1248                     return(TOK_STRING);
1249                   }
1250 	YY_BREAK
1251 case 19:
1252 YY_RULE_SETUP
1253 #line 100 "scanner.l"
1254 { BEGIN INCLUDE; }
1255 	YY_BREAK
1256 case 20:
1257 /* rule 20 can match eol */
1258 YY_RULE_SETUP
1259 #line 101 "scanner.l"
1260 { libconfig_scanctx_append_string(yyextra, yytext); }
1261 	YY_BREAK
1262 case 21:
1263 YY_RULE_SETUP
1264 #line 102 "scanner.l"
1265 { libconfig_scanctx_append_char(yyextra, '\\'); }
1266 	YY_BREAK
1267 case 22:
1268 YY_RULE_SETUP
1269 #line 103 "scanner.l"
1270 { libconfig_scanctx_append_char(yyextra, '\"'); }
1271 	YY_BREAK
1272 case 23:
1273 YY_RULE_SETUP
1274 #line 104 "scanner.l"
1275 {
1276   const char *error = NULL;
1277   const char *path = libconfig_scanctx_take_string(yyextra);
1278   FILE *fp = libconfig_scanctx_push_include(yyextra, (void *)YY_CURRENT_BUFFER,
1279                                             path, &error);
1280   __delete(path);
1281 
1282   if(fp)
1283   {
1284     yyin = fp;
1285     yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE, yyscanner),
1286                         yyscanner);
1287   }
1288   else if(error)
1289   {
1290     yyextra->config->error_text = error;
1291     yyextra->config->error_file = libconfig_scanctx_current_filename(yyextra);
1292     yyextra->config->error_line = libconfig_yyget_lineno(yyscanner);
1293     return TOK_ERROR;
1294   }
1295   BEGIN INITIAL;
1296 }
1297 	YY_BREAK
1298 case 24:
1299 /* rule 24 can match eol */
1300 YY_RULE_SETUP
1301 #line 127 "scanner.l"
1302 { /* ignore */ }
1303 	YY_BREAK
1304 case 25:
1305 YY_RULE_SETUP
1306 #line 128 "scanner.l"
1307 { /* ignore */ }
1308 	YY_BREAK
1309 case 26:
1310 YY_RULE_SETUP
1311 #line 130 "scanner.l"
1312 { return(TOK_EQUALS); }
1313 	YY_BREAK
1314 case 27:
1315 YY_RULE_SETUP
1316 #line 131 "scanner.l"
1317 { return(TOK_COMMA); }
1318 	YY_BREAK
1319 case 28:
1320 YY_RULE_SETUP
1321 #line 132 "scanner.l"
1322 { return(TOK_GROUP_START); }
1323 	YY_BREAK
1324 case 29:
1325 YY_RULE_SETUP
1326 #line 133 "scanner.l"
1327 { return(TOK_GROUP_END); }
1328 	YY_BREAK
1329 case 30:
1330 YY_RULE_SETUP
1331 #line 134 "scanner.l"
1332 { yylval->ival = 1; return(TOK_BOOLEAN); }
1333 	YY_BREAK
1334 case 31:
1335 YY_RULE_SETUP
1336 #line 135 "scanner.l"
1337 { yylval->ival = 0; return(TOK_BOOLEAN); }
1338 	YY_BREAK
1339 case 32:
1340 YY_RULE_SETUP
1341 #line 136 "scanner.l"
1342 { yylval->sval = yytext; return(TOK_NAME); }
1343 	YY_BREAK
1344 case 33:
1345 YY_RULE_SETUP
1346 #line 137 "scanner.l"
1347 { yylval->fval = atof(yytext); return(TOK_FLOAT); }
1348 	YY_BREAK
1349 case 34:
1350 YY_RULE_SETUP
1351 #line 138 "scanner.l"
1352 {
1353                     int ok;
1354                     long long llval = libconfig_parse_integer(yytext, &ok);
1355                     if(!ok)
1356                       return(TOK_ERROR);
1357 
1358                     if((llval < INT_MIN) || (llval > INT_MAX))
1359                     {
1360                       yylval->llval = llval;
1361                       return(TOK_INTEGER64);
1362                     }
1363                     else
1364                     {
1365                       yylval->ival = (int)llval;
1366                       return(TOK_INTEGER);
1367                     }
1368                   }
1369 	YY_BREAK
1370 case 35:
1371 YY_RULE_SETUP
1372 #line 155 "scanner.l"
1373 { yylval->llval = atoll(yytext); return(TOK_INTEGER64); }
1374 	YY_BREAK
1375 case 36:
1376 YY_RULE_SETUP
1377 #line 156 "scanner.l"
1378 {
1379                     yylval->ival = strtoul(yytext, NULL, 16);
1380                     return(TOK_HEX);
1381                   }
1382 	YY_BREAK
1383 case 37:
1384 YY_RULE_SETUP
1385 #line 160 "scanner.l"
1386 {
1387                     yylval->llval = libconfig_parse_hex64(yytext);
1388                     return(TOK_HEX64);
1389                   }
1390 	YY_BREAK
1391 case 38:
1392 YY_RULE_SETUP
1393 #line 164 "scanner.l"
1394 { return(TOK_ARRAY_START); }
1395 	YY_BREAK
1396 case 39:
1397 YY_RULE_SETUP
1398 #line 165 "scanner.l"
1399 { return(TOK_ARRAY_END); }
1400 	YY_BREAK
1401 case 40:
1402 YY_RULE_SETUP
1403 #line 166 "scanner.l"
1404 { return(TOK_LIST_START); }
1405 	YY_BREAK
1406 case 41:
1407 YY_RULE_SETUP
1408 #line 167 "scanner.l"
1409 { return(TOK_LIST_END); }
1410 	YY_BREAK
1411 case 42:
1412 YY_RULE_SETUP
1413 #line 168 "scanner.l"
1414 { return(TOK_SEMICOLON); }
1415 	YY_BREAK
1416 case 43:
1417 YY_RULE_SETUP
1418 #line 169 "scanner.l"
1419 { return(TOK_GARBAGE); }
1420 	YY_BREAK
1421 case YY_STATE_EOF(INITIAL):
1422 case YY_STATE_EOF(SINGLE_LINE_COMMENT):
1423 case YY_STATE_EOF(MULTI_LINE_COMMENT):
1424 case YY_STATE_EOF(STRING):
1425 case YY_STATE_EOF(INCLUDE):
1426 #line 171 "scanner.l"
1427 {
1428   const char *error = NULL;
1429   FILE *fp;
1430 
1431   fp = libconfig_scanctx_next_include_file(yyextra, &error);
1432   if(fp)
1433   {
1434     yyin = fp;
1435     yy_delete_buffer(YY_CURRENT_BUFFER, yyscanner);
1436     yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE, yyscanner),
1437                         yyscanner);
1438   }
1439   else if(error)
1440   {
1441     yyextra->config->error_text = error;
1442     yyextra->config->error_file = libconfig_scanctx_current_filename(yyextra);
1443     yyextra->config->error_line = libconfig_yyget_lineno(yyscanner);
1444     return TOK_ERROR;
1445   }
1446   else
1447   {
1448     /* No more files in the current include list. */
1449     YY_BUFFER_STATE buf = (YY_BUFFER_STATE)libconfig_scanctx_pop_include(yyextra);
1450     if(buf)
1451     {
1452       yy_delete_buffer(YY_CURRENT_BUFFER, yyscanner);
1453       yy_switch_to_buffer(buf, yyscanner);
1454     }
1455     else
1456       yyterminate();
1457   }
1458 }
1459 	YY_BREAK
1460 case 44:
1461 YY_RULE_SETUP
1462 #line 203 "scanner.l"
1463 ECHO;
1464 	YY_BREAK
1465 #line 1465 "scanner.c"
1466 
1467 	case YY_END_OF_BUFFER:
1468 		{
1469 		/* Amount of text matched not including the EOB char. */
1470 		int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
1471 
1472 		/* Undo the effects of YY_DO_BEFORE_ACTION. */
1473 		*yy_cp = yyg->yy_hold_char;
1474 		YY_RESTORE_YY_MORE_OFFSET
1475 
1476 		if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1477 			{
1478 			/* We're scanning a new file or input source.  It's
1479 			 * possible that this happened because the user
1480 			 * just pointed yyin at a new source and called
1481 			 * yylex().  If so, then we have to assure
1482 			 * consistency between YY_CURRENT_BUFFER and our
1483 			 * globals.  Here is the right place to do so, because
1484 			 * this is the first action (other than possibly a
1485 			 * back-up) that will match for the new input source.
1486 			 */
1487 			yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1488 			YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1489 			YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1490 			}
1491 
1492 		/* Note that here we test for yy_c_buf_p "<=" to the position
1493 		 * of the first EOB in the buffer, since yy_c_buf_p will
1494 		 * already have been incremented past the NUL character
1495 		 * (since all states make transitions on EOB to the
1496 		 * end-of-buffer state).  Contrast this with the test
1497 		 * in input().
1498 		 */
1499 		if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
1500 			{ /* This was really a NUL. */
1501 			yy_state_type yy_next_state;
1502 
1503 			yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
1504 
1505 			yy_current_state = yy_get_previous_state( yyscanner );
1506 
1507 			/* Okay, we're now positioned to make the NUL
1508 			 * transition.  We couldn't have
1509 			 * yy_get_previous_state() go ahead and do it
1510 			 * for us because it doesn't know how to deal
1511 			 * with the possibility of jamming (and we don't
1512 			 * want to build jamming into it because then it
1513 			 * will run more slowly).
1514 			 */
1515 
1516 			yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
1517 
1518 			yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1519 
1520 			if ( yy_next_state )
1521 				{
1522 				/* Consume the NUL. */
1523 				yy_cp = ++yyg->yy_c_buf_p;
1524 				yy_current_state = yy_next_state;
1525 				goto yy_match;
1526 				}
1527 
1528 			else
1529 				{
1530 				yy_cp = yyg->yy_last_accepting_cpos;
1531 				yy_current_state = yyg->yy_last_accepting_state;
1532 				goto yy_find_action;
1533 				}
1534 			}
1535 
1536 		else switch ( yy_get_next_buffer( yyscanner ) )
1537 			{
1538 			case EOB_ACT_END_OF_FILE:
1539 				{
1540 				yyg->yy_did_buffer_switch_on_eof = 0;
1541 
1542 				if ( yywrap( yyscanner ) )
1543 					{
1544 					/* Note: because we've taken care in
1545 					 * yy_get_next_buffer() to have set up
1546 					 * yytext, we can now set up
1547 					 * yy_c_buf_p so that if some total
1548 					 * hoser (like flex itself) wants to
1549 					 * call the scanner after we return the
1550 					 * YY_NULL, it'll still work - another
1551 					 * YY_NULL will get returned.
1552 					 */
1553 					yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
1554 
1555 					yy_act = YY_STATE_EOF(YY_START);
1556 					goto do_action;
1557 					}
1558 
1559 				else
1560 					{
1561 					if ( ! yyg->yy_did_buffer_switch_on_eof )
1562 						YY_NEW_FILE;
1563 					}
1564 				break;
1565 				}
1566 
1567 			case EOB_ACT_CONTINUE_SCAN:
1568 				yyg->yy_c_buf_p =
1569 					yyg->yytext_ptr + yy_amount_of_matched_text;
1570 
1571 				yy_current_state = yy_get_previous_state( yyscanner );
1572 
1573 				yy_cp = yyg->yy_c_buf_p;
1574 				yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1575 				goto yy_match;
1576 
1577 			case EOB_ACT_LAST_MATCH:
1578 				yyg->yy_c_buf_p =
1579 				&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
1580 
1581 				yy_current_state = yy_get_previous_state( yyscanner );
1582 
1583 				yy_cp = yyg->yy_c_buf_p;
1584 				yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1585 				goto yy_find_action;
1586 			}
1587 		break;
1588 		}
1589 
1590 	default:
1591 		YY_FATAL_ERROR(
1592 			"fatal flex scanner internal error--no action found" );
1593 	} /* end of action switch */
1594 		} /* end of scanning one token */
1595 	} /* end of user's declarations */
1596 } /* end of yylex */
1597 
1598 /* yy_get_next_buffer - try to read in a new buffer
1599  *
1600  * Returns a code representing an action:
1601  *	EOB_ACT_LAST_MATCH -
1602  *	EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1603  *	EOB_ACT_END_OF_FILE - end of file
1604  */
yy_get_next_buffer(yyscan_t yyscanner)1605 static int yy_get_next_buffer (yyscan_t yyscanner)
1606 {
1607     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1608 	char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1609 	char *source = yyg->yytext_ptr;
1610 	int number_to_move, i;
1611 	int ret_val;
1612 
1613 	if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
1614 		YY_FATAL_ERROR(
1615 		"fatal flex scanner internal error--end of buffer missed" );
1616 
1617 	if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1618 		{ /* Don't try to fill the buffer, so this is an EOF. */
1619 		if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
1620 			{
1621 			/* We matched a single character, the EOB, so
1622 			 * treat this as a final EOF.
1623 			 */
1624 			return EOB_ACT_END_OF_FILE;
1625 			}
1626 
1627 		else
1628 			{
1629 			/* We matched some text prior to the EOB, first
1630 			 * process it.
1631 			 */
1632 			return EOB_ACT_LAST_MATCH;
1633 			}
1634 		}
1635 
1636 	/* Try to read more data. */
1637 
1638 	/* First move last chars to start of buffer. */
1639 	number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr - 1);
1640 
1641 	for ( i = 0; i < number_to_move; ++i )
1642 		*(dest++) = *(source++);
1643 
1644 	if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1645 		/* don't do the read, it's not guaranteed to return an EOF,
1646 		 * just force an EOF
1647 		 */
1648 		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
1649 
1650 	else
1651 		{
1652 			int num_to_read =
1653 			YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1654 
1655 		while ( num_to_read <= 0 )
1656 			{ /* Not enough room in the buffer - grow it. */
1657 
1658 			/* just a shorter name for the current buffer */
1659 			YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
1660 
1661 			int yy_c_buf_p_offset =
1662 				(int) (yyg->yy_c_buf_p - b->yy_ch_buf);
1663 
1664 			if ( b->yy_is_our_buffer )
1665 				{
1666 				int new_size = b->yy_buf_size * 2;
1667 
1668 				if ( new_size <= 0 )
1669 					b->yy_buf_size += b->yy_buf_size / 8;
1670 				else
1671 					b->yy_buf_size *= 2;
1672 
1673 				b->yy_ch_buf = (char *)
1674 					/* Include room in for 2 EOB chars. */
1675 					yyrealloc( (void *) b->yy_ch_buf,
1676 							 (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
1677 				}
1678 			else
1679 				/* Can't grow it, we don't own it. */
1680 				b->yy_ch_buf = NULL;
1681 
1682 			if ( ! b->yy_ch_buf )
1683 				YY_FATAL_ERROR(
1684 				"fatal error - scanner input buffer overflow" );
1685 
1686 			yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1687 
1688 			num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1689 						number_to_move - 1;
1690 
1691 			}
1692 
1693 		if ( num_to_read > YY_READ_BUF_SIZE )
1694 			num_to_read = YY_READ_BUF_SIZE;
1695 
1696 		/* Read in more data. */
1697 		YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1698 			yyg->yy_n_chars, num_to_read );
1699 
1700 		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1701 		}
1702 
1703 	if ( yyg->yy_n_chars == 0 )
1704 		{
1705 		if ( number_to_move == YY_MORE_ADJ )
1706 			{
1707 			ret_val = EOB_ACT_END_OF_FILE;
1708 			yyrestart( yyin  , yyscanner);
1709 			}
1710 
1711 		else
1712 			{
1713 			ret_val = EOB_ACT_LAST_MATCH;
1714 			YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1715 				YY_BUFFER_EOF_PENDING;
1716 			}
1717 		}
1718 
1719 	else
1720 		ret_val = EOB_ACT_CONTINUE_SCAN;
1721 
1722 	if ((yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1723 		/* Extend the array by 50%, plus the number we really need. */
1724 		int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
1725 		YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
1726 			(void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size , yyscanner );
1727 		if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1728 			YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1729 		/* "- 2" to take care of EOB's */
1730 		YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
1731 	}
1732 
1733 	yyg->yy_n_chars += number_to_move;
1734 	YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1735 	YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1736 
1737 	yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1738 
1739 	return ret_val;
1740 }
1741 
1742 /* yy_get_previous_state - get the state just before the EOB char was reached */
1743 
yy_get_previous_state(yyscan_t yyscanner)1744     static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
1745 {
1746 	yy_state_type yy_current_state;
1747 	char *yy_cp;
1748     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1749 
1750 	yy_current_state = yyg->yy_start;
1751 	yy_current_state += YY_AT_BOL();
1752 
1753 	for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
1754 		{
1755 		YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1756 		if ( yy_accept[yy_current_state] )
1757 			{
1758 			yyg->yy_last_accepting_state = yy_current_state;
1759 			yyg->yy_last_accepting_cpos = yy_cp;
1760 			}
1761 		while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1762 			{
1763 			yy_current_state = (int) yy_def[yy_current_state];
1764 			if ( yy_current_state >= 105 )
1765 				yy_c = yy_meta[yy_c];
1766 			}
1767 		yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1768 		}
1769 
1770 	return yy_current_state;
1771 }
1772 
1773 /* yy_try_NUL_trans - try to make a transition on the NUL character
1774  *
1775  * synopsis
1776  *	next_state = yy_try_NUL_trans( current_state );
1777  */
yy_try_NUL_trans(yy_state_type yy_current_state,yyscan_t yyscanner)1778     static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state , yyscan_t yyscanner)
1779 {
1780 	int yy_is_jam;
1781     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
1782 	char *yy_cp = yyg->yy_c_buf_p;
1783 
1784 	YY_CHAR yy_c = 1;
1785 	if ( yy_accept[yy_current_state] )
1786 		{
1787 		yyg->yy_last_accepting_state = yy_current_state;
1788 		yyg->yy_last_accepting_cpos = yy_cp;
1789 		}
1790 	while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1791 		{
1792 		yy_current_state = (int) yy_def[yy_current_state];
1793 		if ( yy_current_state >= 105 )
1794 			yy_c = yy_meta[yy_c];
1795 		}
1796 	yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1797 	yy_is_jam = (yy_current_state == 104);
1798 
1799 	(void)yyg;
1800 	return yy_is_jam ? 0 : yy_current_state;
1801 }
1802 
1803 #ifndef YY_NO_UNPUT
1804 
1805 #endif
1806 
1807 #ifndef YY_NO_INPUT
1808 #ifdef __cplusplus
yyinput(yyscan_t yyscanner)1809     static int yyinput (yyscan_t yyscanner)
1810 #else
1811     static int input  (yyscan_t yyscanner)
1812 #endif
1813 
1814 {
1815 	int c;
1816     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1817 
1818 	*yyg->yy_c_buf_p = yyg->yy_hold_char;
1819 
1820 	if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1821 		{
1822 		/* yy_c_buf_p now points to the character we want to return.
1823 		 * If this occurs *before* the EOB characters, then it's a
1824 		 * valid NUL; if not, then we've hit the end of the buffer.
1825 		 */
1826 		if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
1827 			/* This was really a NUL. */
1828 			*yyg->yy_c_buf_p = '\0';
1829 
1830 		else
1831 			{ /* need more input */
1832 			int offset = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr);
1833 			++yyg->yy_c_buf_p;
1834 
1835 			switch ( yy_get_next_buffer( yyscanner ) )
1836 				{
1837 				case EOB_ACT_LAST_MATCH:
1838 					/* This happens because yy_g_n_b()
1839 					 * sees that we've accumulated a
1840 					 * token and flags that we need to
1841 					 * try matching the token before
1842 					 * proceeding.  But for input(),
1843 					 * there's no matching to consider.
1844 					 * So convert the EOB_ACT_LAST_MATCH
1845 					 * to EOB_ACT_END_OF_FILE.
1846 					 */
1847 
1848 					/* Reset buffer status. */
1849 					yyrestart( yyin , yyscanner);
1850 
1851 					/*FALLTHROUGH*/
1852 
1853 				case EOB_ACT_END_OF_FILE:
1854 					{
1855 					if ( yywrap( yyscanner ) )
1856 						return 0;
1857 
1858 					if ( ! yyg->yy_did_buffer_switch_on_eof )
1859 						YY_NEW_FILE;
1860 #ifdef __cplusplus
1861 					return yyinput(yyscanner);
1862 #else
1863 					return input(yyscanner);
1864 #endif
1865 					}
1866 
1867 				case EOB_ACT_CONTINUE_SCAN:
1868 					yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
1869 					break;
1870 				}
1871 			}
1872 		}
1873 
1874 	c = *(unsigned char *) yyg->yy_c_buf_p;	/* cast for 8-bit char's */
1875 	*yyg->yy_c_buf_p = '\0';	/* preserve yytext */
1876 	yyg->yy_hold_char = *++yyg->yy_c_buf_p;
1877 
1878 	YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n');
1879 	if ( YY_CURRENT_BUFFER_LVALUE->yy_at_bol )
1880 
1881     do{ yylineno++;
1882         yycolumn=0;
1883     }while(0)
1884 ;
1885 
1886 	return c;
1887 }
1888 #endif	/* ifndef YY_NO_INPUT */
1889 
1890 /** Immediately switch to a different input stream.
1891  * @param input_file A readable stream.
1892  * @param yyscanner The scanner object.
1893  * @note This function does not reset the start condition to @c INITIAL .
1894  */
yyrestart(FILE * input_file,yyscan_t yyscanner)1895     void yyrestart  (FILE * input_file , yyscan_t yyscanner)
1896 {
1897     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1898 
1899 	if ( ! YY_CURRENT_BUFFER ){
1900         yyensure_buffer_stack (yyscanner);
1901 		YY_CURRENT_BUFFER_LVALUE =
1902             yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner);
1903 	}
1904 
1905 	yy_init_buffer( YY_CURRENT_BUFFER, input_file , yyscanner);
1906 	yy_load_buffer_state( yyscanner );
1907 }
1908 
1909 /** Switch to a different input buffer.
1910  * @param new_buffer The new input buffer.
1911  * @param yyscanner The scanner object.
1912  */
yy_switch_to_buffer(YY_BUFFER_STATE new_buffer,yyscan_t yyscanner)1913     void yy_switch_to_buffer  (YY_BUFFER_STATE  new_buffer , yyscan_t yyscanner)
1914 {
1915     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1916 
1917 	/* TODO. We should be able to replace this entire function body
1918 	 * with
1919 	 *		yypop_buffer_state();
1920 	 *		yypush_buffer_state(new_buffer);
1921      */
1922 	yyensure_buffer_stack (yyscanner);
1923 	if ( YY_CURRENT_BUFFER == new_buffer )
1924 		return;
1925 
1926 	if ( YY_CURRENT_BUFFER )
1927 		{
1928 		/* Flush out information for old buffer. */
1929 		*yyg->yy_c_buf_p = yyg->yy_hold_char;
1930 		YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
1931 		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1932 		}
1933 
1934 	YY_CURRENT_BUFFER_LVALUE = new_buffer;
1935 	yy_load_buffer_state( yyscanner );
1936 
1937 	/* We don't actually know whether we did this switch during
1938 	 * EOF (yywrap()) processing, but the only time this flag
1939 	 * is looked at is after yywrap() is called, so it's safe
1940 	 * to go ahead and always set it.
1941 	 */
1942 	yyg->yy_did_buffer_switch_on_eof = 1;
1943 }
1944 
yy_load_buffer_state(yyscan_t yyscanner)1945 static void yy_load_buffer_state  (yyscan_t yyscanner)
1946 {
1947     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1948 	yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1949 	yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1950 	yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1951 	yyg->yy_hold_char = *yyg->yy_c_buf_p;
1952 }
1953 
1954 /** Allocate and initialize an input buffer state.
1955  * @param file A readable stream.
1956  * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1957  * @param yyscanner The scanner object.
1958  * @return the allocated buffer state.
1959  */
yy_create_buffer(FILE * file,int size,yyscan_t yyscanner)1960     YY_BUFFER_STATE yy_create_buffer  (FILE * file, int  size , yyscan_t yyscanner)
1961 {
1962 	YY_BUFFER_STATE b;
1963 
1964 	b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner );
1965 	if ( ! b )
1966 		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1967 
1968 	b->yy_buf_size = size;
1969 
1970 	/* yy_ch_buf has to be 2 characters longer than the size given because
1971 	 * we need to put in 2 end-of-buffer characters.
1972 	 */
1973 	b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
1974 	if ( ! b->yy_ch_buf )
1975 		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1976 
1977 	b->yy_is_our_buffer = 1;
1978 
1979 	yy_init_buffer( b, file , yyscanner);
1980 
1981 	return b;
1982 }
1983 
1984 /** Destroy the buffer.
1985  * @param b a buffer created with yy_create_buffer()
1986  * @param yyscanner The scanner object.
1987  */
yy_delete_buffer(YY_BUFFER_STATE b,yyscan_t yyscanner)1988     void yy_delete_buffer (YY_BUFFER_STATE  b , yyscan_t yyscanner)
1989 {
1990     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1991 
1992 	if ( ! b )
1993 		return;
1994 
1995 	if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1996 		YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1997 
1998 	if ( b->yy_is_our_buffer )
1999 		yyfree( (void *) b->yy_ch_buf , yyscanner );
2000 
2001 	yyfree( (void *) b , yyscanner );
2002 }
2003 
2004 /* Initializes or reinitializes a buffer.
2005  * This function is sometimes called more than once on the same buffer,
2006  * such as during a yyrestart() or at EOF.
2007  */
yy_init_buffer(YY_BUFFER_STATE b,FILE * file,yyscan_t yyscanner)2008     static void yy_init_buffer  (YY_BUFFER_STATE  b, FILE * file , yyscan_t yyscanner)
2009 
2010 {
2011 	int oerrno = errno;
2012     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2013 
2014 	yy_flush_buffer( b , yyscanner);
2015 
2016 	b->yy_input_file = file;
2017 	b->yy_fill_buffer = 1;
2018 
2019     /* If b is the current buffer, then yy_init_buffer was _probably_
2020      * called from yyrestart() or through yy_get_next_buffer.
2021      * In that case, we don't want to reset the lineno or column.
2022      */
2023     if (b != YY_CURRENT_BUFFER){
2024         b->yy_bs_lineno = 1;
2025         b->yy_bs_column = 0;
2026     }
2027 
2028         b->yy_is_interactive = 0;
2029 
2030 	errno = oerrno;
2031 }
2032 
2033 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
2034  * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
2035  * @param yyscanner The scanner object.
2036  */
yy_flush_buffer(YY_BUFFER_STATE b,yyscan_t yyscanner)2037     void yy_flush_buffer (YY_BUFFER_STATE  b , yyscan_t yyscanner)
2038 {
2039     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2040 	if ( ! b )
2041 		return;
2042 
2043 	b->yy_n_chars = 0;
2044 
2045 	/* We always need two end-of-buffer characters.  The first causes
2046 	 * a transition to the end-of-buffer state.  The second causes
2047 	 * a jam in that state.
2048 	 */
2049 	b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
2050 	b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
2051 
2052 	b->yy_buf_pos = &b->yy_ch_buf[0];
2053 
2054 	b->yy_at_bol = 1;
2055 	b->yy_buffer_status = YY_BUFFER_NEW;
2056 
2057 	if ( b == YY_CURRENT_BUFFER )
2058 		yy_load_buffer_state( yyscanner );
2059 }
2060 
2061 /** Pushes the new state onto the stack. The new state becomes
2062  *  the current state. This function will allocate the stack
2063  *  if necessary.
2064  *  @param new_buffer The new state.
2065  *  @param yyscanner The scanner object.
2066  */
yypush_buffer_state(YY_BUFFER_STATE new_buffer,yyscan_t yyscanner)2067 void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
2068 {
2069     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2070 	if (new_buffer == NULL)
2071 		return;
2072 
2073 	yyensure_buffer_stack(yyscanner);
2074 
2075 	/* This block is copied from yy_switch_to_buffer. */
2076 	if ( YY_CURRENT_BUFFER )
2077 		{
2078 		/* Flush out information for old buffer. */
2079 		*yyg->yy_c_buf_p = yyg->yy_hold_char;
2080 		YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
2081 		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
2082 		}
2083 
2084 	/* Only push if top exists. Otherwise, replace top. */
2085 	if (YY_CURRENT_BUFFER)
2086 		yyg->yy_buffer_stack_top++;
2087 	YY_CURRENT_BUFFER_LVALUE = new_buffer;
2088 
2089 	/* copied from yy_switch_to_buffer. */
2090 	yy_load_buffer_state( yyscanner );
2091 	yyg->yy_did_buffer_switch_on_eof = 1;
2092 }
2093 
2094 /** Removes and deletes the top of the stack, if present.
2095  *  The next element becomes the new top.
2096  *  @param yyscanner The scanner object.
2097  */
yypop_buffer_state(yyscan_t yyscanner)2098 void yypop_buffer_state (yyscan_t yyscanner)
2099 {
2100     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2101 	if (!YY_CURRENT_BUFFER)
2102 		return;
2103 
2104 	yy_delete_buffer(YY_CURRENT_BUFFER , yyscanner);
2105 	YY_CURRENT_BUFFER_LVALUE = NULL;
2106 	if (yyg->yy_buffer_stack_top > 0)
2107 		--yyg->yy_buffer_stack_top;
2108 
2109 	if (YY_CURRENT_BUFFER) {
2110 		yy_load_buffer_state( yyscanner );
2111 		yyg->yy_did_buffer_switch_on_eof = 1;
2112 	}
2113 }
2114 
2115 /* Allocates the stack if it does not exist.
2116  *  Guarantees space for at least one push.
2117  */
yyensure_buffer_stack(yyscan_t yyscanner)2118 static void yyensure_buffer_stack (yyscan_t yyscanner)
2119 {
2120 	yy_size_t num_to_alloc;
2121     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2122 
2123 	if (!yyg->yy_buffer_stack) {
2124 
2125 		/* First allocation is just for 2 elements, since we don't know if this
2126 		 * scanner will even need a stack. We use 2 instead of 1 to avoid an
2127 		 * immediate realloc on the next call.
2128          */
2129       num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
2130 		yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc
2131 								(num_to_alloc * sizeof(struct yy_buffer_state*)
2132 								, yyscanner);
2133 		if ( ! yyg->yy_buffer_stack )
2134 			YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
2135 
2136 		memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
2137 
2138 		yyg->yy_buffer_stack_max = num_to_alloc;
2139 		yyg->yy_buffer_stack_top = 0;
2140 		return;
2141 	}
2142 
2143 	if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
2144 
2145 		/* Increase the buffer to prepare for a possible push. */
2146 		yy_size_t grow_size = 8 /* arbitrary grow size */;
2147 
2148 		num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
2149 		yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc
2150 								(yyg->yy_buffer_stack,
2151 								num_to_alloc * sizeof(struct yy_buffer_state*)
2152 								, yyscanner);
2153 		if ( ! yyg->yy_buffer_stack )
2154 			YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
2155 
2156 		/* zero only the new slots.*/
2157 		memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
2158 		yyg->yy_buffer_stack_max = num_to_alloc;
2159 	}
2160 }
2161 
2162 /** Setup the input buffer state to scan directly from a user-specified character buffer.
2163  * @param base the character buffer
2164  * @param size the size in bytes of the character buffer
2165  * @param yyscanner The scanner object.
2166  * @return the newly allocated buffer state object.
2167  */
yy_scan_buffer(char * base,yy_size_t size,yyscan_t yyscanner)2168 YY_BUFFER_STATE yy_scan_buffer  (char * base, yy_size_t  size , yyscan_t yyscanner)
2169 {
2170 	YY_BUFFER_STATE b;
2171 
2172 	if ( size < 2 ||
2173 	     base[size-2] != YY_END_OF_BUFFER_CHAR ||
2174 	     base[size-1] != YY_END_OF_BUFFER_CHAR )
2175 		/* They forgot to leave room for the EOB's. */
2176 		return NULL;
2177 
2178 	b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner );
2179 	if ( ! b )
2180 		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
2181 
2182 	b->yy_buf_size = (int) (size - 2);	/* "- 2" to take care of EOB's */
2183 	b->yy_buf_pos = b->yy_ch_buf = base;
2184 	b->yy_is_our_buffer = 0;
2185 	b->yy_input_file = NULL;
2186 	b->yy_n_chars = b->yy_buf_size;
2187 	b->yy_is_interactive = 0;
2188 	b->yy_at_bol = 1;
2189 	b->yy_fill_buffer = 0;
2190 	b->yy_buffer_status = YY_BUFFER_NEW;
2191 
2192 	yy_switch_to_buffer( b , yyscanner );
2193 
2194 	return b;
2195 }
2196 
2197 /** Setup the input buffer state to scan a string. The next call to yylex() will
2198  * scan from a @e copy of @a str.
2199  * @param yystr a NUL-terminated string to scan
2200  * @param yyscanner The scanner object.
2201  * @return the newly allocated buffer state object.
2202  * @note If you want to scan bytes that may contain NUL values, then use
2203  *       yy_scan_bytes() instead.
2204  */
yy_scan_string(const char * yystr,yyscan_t yyscanner)2205 YY_BUFFER_STATE yy_scan_string (const char * yystr , yyscan_t yyscanner)
2206 {
2207 
2208 	return yy_scan_bytes( yystr, (int) strlen(yystr) , yyscanner);
2209 }
2210 
2211 /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
2212  * scan from a @e copy of @a bytes.
2213  * @param yybytes the byte buffer to scan
2214  * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
2215  * @param yyscanner The scanner object.
2216  * @return the newly allocated buffer state object.
2217  */
yy_scan_bytes(const char * yybytes,int _yybytes_len,yyscan_t yyscanner)2218 YY_BUFFER_STATE yy_scan_bytes  (const char * yybytes, int  _yybytes_len , yyscan_t yyscanner)
2219 {
2220 	YY_BUFFER_STATE b;
2221 	char *buf;
2222 	yy_size_t n;
2223 	int i;
2224 
2225 	/* Get memory for full buffer, including space for trailing EOB's. */
2226 	n = (yy_size_t) (_yybytes_len + 2);
2227 	buf = (char *) yyalloc( n , yyscanner );
2228 	if ( ! buf )
2229 		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
2230 
2231 	for ( i = 0; i < _yybytes_len; ++i )
2232 		buf[i] = yybytes[i];
2233 
2234 	buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
2235 
2236 	b = yy_scan_buffer( buf, n , yyscanner);
2237 	if ( ! b )
2238 		YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
2239 
2240 	/* It's okay to grow etc. this buffer, and we should throw it
2241 	 * away when we're done.
2242 	 */
2243 	b->yy_is_our_buffer = 1;
2244 
2245 	return b;
2246 }
2247 
2248 #ifndef YY_EXIT_FAILURE
2249 #define YY_EXIT_FAILURE 2
2250 #endif
2251 
yy_fatal_error(const char * msg,yyscan_t yyscanner)2252 static void yynoreturn yy_fatal_error (const char* msg , yyscan_t yyscanner)
2253 {
2254 	struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2255 	(void)yyg;
2256 	fprintf( stderr, "%s\n", msg );
2257 	exit( YY_EXIT_FAILURE );
2258 }
2259 
2260 /* Redefine yyless() so it works in section 3 code. */
2261 
2262 #undef yyless
2263 #define yyless(n) \
2264 	do \
2265 		{ \
2266 		/* Undo effects of setting up yytext. */ \
2267         int yyless_macro_arg = (n); \
2268         YY_LESS_LINENO(yyless_macro_arg);\
2269 		yytext[yyleng] = yyg->yy_hold_char; \
2270 		yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
2271 		yyg->yy_hold_char = *yyg->yy_c_buf_p; \
2272 		*yyg->yy_c_buf_p = '\0'; \
2273 		yyleng = yyless_macro_arg; \
2274 		} \
2275 	while ( 0 )
2276 
2277 /* Accessor  methods (get/set functions) to struct members. */
2278 
2279 /** Get the user-defined data for this scanner.
2280  * @param yyscanner The scanner object.
2281  */
yyget_extra(yyscan_t yyscanner)2282 YY_EXTRA_TYPE yyget_extra  (yyscan_t yyscanner)
2283 {
2284     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2285     return yyextra;
2286 }
2287 
2288 /** Get the current line number.
2289  * @param yyscanner The scanner object.
2290  */
yyget_lineno(yyscan_t yyscanner)2291 int yyget_lineno  (yyscan_t yyscanner)
2292 {
2293     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2294 
2295         if (! YY_CURRENT_BUFFER)
2296             return 0;
2297 
2298     return yylineno;
2299 }
2300 
2301 /** Get the current column number.
2302  * @param yyscanner The scanner object.
2303  */
yyget_column(yyscan_t yyscanner)2304 int yyget_column  (yyscan_t yyscanner)
2305 {
2306     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2307 
2308         if (! YY_CURRENT_BUFFER)
2309             return 0;
2310 
2311     return yycolumn;
2312 }
2313 
2314 /** Get the input stream.
2315  * @param yyscanner The scanner object.
2316  */
yyget_in(yyscan_t yyscanner)2317 FILE *yyget_in  (yyscan_t yyscanner)
2318 {
2319     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2320     return yyin;
2321 }
2322 
2323 /** Get the output stream.
2324  * @param yyscanner The scanner object.
2325  */
yyget_out(yyscan_t yyscanner)2326 FILE *yyget_out  (yyscan_t yyscanner)
2327 {
2328     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2329     return yyout;
2330 }
2331 
2332 /** Get the length of the current token.
2333  * @param yyscanner The scanner object.
2334  */
yyget_leng(yyscan_t yyscanner)2335 int yyget_leng  (yyscan_t yyscanner)
2336 {
2337     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2338     return yyleng;
2339 }
2340 
2341 /** Get the current token.
2342  * @param yyscanner The scanner object.
2343  */
2344 
yyget_text(yyscan_t yyscanner)2345 char *yyget_text  (yyscan_t yyscanner)
2346 {
2347     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2348     return yytext;
2349 }
2350 
2351 /** Set the user-defined data. This data is never touched by the scanner.
2352  * @param user_defined The data to be associated with this scanner.
2353  * @param yyscanner The scanner object.
2354  */
yyset_extra(YY_EXTRA_TYPE user_defined,yyscan_t yyscanner)2355 void yyset_extra (YY_EXTRA_TYPE  user_defined , yyscan_t yyscanner)
2356 {
2357     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2358     yyextra = user_defined ;
2359 }
2360 
2361 /** Set the current line number.
2362  * @param _line_number line number
2363  * @param yyscanner The scanner object.
2364  */
yyset_lineno(int _line_number,yyscan_t yyscanner)2365 void yyset_lineno (int  _line_number , yyscan_t yyscanner)
2366 {
2367     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2368 
2369         /* lineno is only valid if an input buffer exists. */
2370         if (! YY_CURRENT_BUFFER )
2371            YY_FATAL_ERROR( "yyset_lineno called with no buffer" );
2372 
2373     yylineno = _line_number;
2374 }
2375 
2376 /** Set the current column.
2377  * @param _column_no column number
2378  * @param yyscanner The scanner object.
2379  */
yyset_column(int _column_no,yyscan_t yyscanner)2380 void yyset_column (int  _column_no , yyscan_t yyscanner)
2381 {
2382     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2383 
2384         /* column is only valid if an input buffer exists. */
2385         if (! YY_CURRENT_BUFFER )
2386            YY_FATAL_ERROR( "yyset_column called with no buffer" );
2387 
2388     yycolumn = _column_no;
2389 }
2390 
2391 /** Set the input stream. This does not discard the current
2392  * input buffer.
2393  * @param _in_str A readable stream.
2394  * @param yyscanner The scanner object.
2395  * @see yy_switch_to_buffer
2396  */
yyset_in(FILE * _in_str,yyscan_t yyscanner)2397 void yyset_in (FILE *  _in_str , yyscan_t yyscanner)
2398 {
2399     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2400     yyin = _in_str ;
2401 }
2402 
yyset_out(FILE * _out_str,yyscan_t yyscanner)2403 void yyset_out (FILE *  _out_str , yyscan_t yyscanner)
2404 {
2405     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2406     yyout = _out_str ;
2407 }
2408 
yyget_debug(yyscan_t yyscanner)2409 int yyget_debug  (yyscan_t yyscanner)
2410 {
2411     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2412     return yy_flex_debug;
2413 }
2414 
yyset_debug(int _bdebug,yyscan_t yyscanner)2415 void yyset_debug (int  _bdebug , yyscan_t yyscanner)
2416 {
2417     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2418     yy_flex_debug = _bdebug ;
2419 }
2420 
2421 /* Accessor methods for yylval and yylloc */
2422 
yyget_lval(yyscan_t yyscanner)2423 YYSTYPE * yyget_lval  (yyscan_t yyscanner)
2424 {
2425     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2426     return yylval;
2427 }
2428 
yyset_lval(YYSTYPE * yylval_param,yyscan_t yyscanner)2429 void yyset_lval (YYSTYPE *  yylval_param , yyscan_t yyscanner)
2430 {
2431     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2432     yylval = yylval_param;
2433 }
2434 
2435 /* User-visible API */
2436 
2437 /* yylex_init is special because it creates the scanner itself, so it is
2438  * the ONLY reentrant function that doesn't take the scanner as the last argument.
2439  * That's why we explicitly handle the declaration, instead of using our macros.
2440  */
yylex_init(yyscan_t * ptr_yy_globals)2441 int yylex_init(yyscan_t* ptr_yy_globals)
2442 {
2443     if (ptr_yy_globals == NULL){
2444         errno = EINVAL;
2445         return 1;
2446     }
2447 
2448     *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL );
2449 
2450     if (*ptr_yy_globals == NULL){
2451         errno = ENOMEM;
2452         return 1;
2453     }
2454 
2455     /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
2456     memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
2457 
2458     return yy_init_globals ( *ptr_yy_globals );
2459 }
2460 
2461 /* yylex_init_extra has the same functionality as yylex_init, but follows the
2462  * convention of taking the scanner as the last argument. Note however, that
2463  * this is a *pointer* to a scanner, as it will be allocated by this call (and
2464  * is the reason, too, why this function also must handle its own declaration).
2465  * The user defined value in the first argument will be available to yyalloc in
2466  * the yyextra field.
2467  */
yylex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t * ptr_yy_globals)2468 int yylex_init_extra( YY_EXTRA_TYPE yy_user_defined, yyscan_t* ptr_yy_globals )
2469 {
2470     struct yyguts_t dummy_yyguts;
2471 
2472     yyset_extra (yy_user_defined, &dummy_yyguts);
2473 
2474     if (ptr_yy_globals == NULL){
2475         errno = EINVAL;
2476         return 1;
2477     }
2478 
2479     *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
2480 
2481     if (*ptr_yy_globals == NULL){
2482         errno = ENOMEM;
2483         return 1;
2484     }
2485 
2486     /* By setting to 0xAA, we expose bugs in
2487     yy_init_globals. Leave at 0x00 for releases. */
2488     memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
2489 
2490     yyset_extra (yy_user_defined, *ptr_yy_globals);
2491 
2492     return yy_init_globals ( *ptr_yy_globals );
2493 }
2494 
yy_init_globals(yyscan_t yyscanner)2495 static int yy_init_globals (yyscan_t yyscanner)
2496 {
2497     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2498     /* Initialization is the same as for the non-reentrant scanner.
2499      * This function is called from yylex_destroy(), so don't allocate here.
2500      */
2501 
2502     yyg->yy_buffer_stack = NULL;
2503     yyg->yy_buffer_stack_top = 0;
2504     yyg->yy_buffer_stack_max = 0;
2505     yyg->yy_c_buf_p = NULL;
2506     yyg->yy_init = 0;
2507     yyg->yy_start = 0;
2508 
2509     yyg->yy_start_stack_ptr = 0;
2510     yyg->yy_start_stack_depth = 0;
2511     yyg->yy_start_stack =  NULL;
2512 
2513 /* Defined in main.c */
2514 #ifdef YY_STDINIT
2515     yyin = stdin;
2516     yyout = stdout;
2517 #else
2518     yyin = NULL;
2519     yyout = NULL;
2520 #endif
2521 
2522     /* For future reference: Set errno on error, since we are called by
2523      * yylex_init()
2524      */
2525     return 0;
2526 }
2527 
2528 /* yylex_destroy is for both reentrant and non-reentrant scanners. */
yylex_destroy(yyscan_t yyscanner)2529 int yylex_destroy  (yyscan_t yyscanner)
2530 {
2531     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2532 
2533     /* Pop the buffer stack, destroying each element. */
2534 	while(YY_CURRENT_BUFFER){
2535 		yy_delete_buffer( YY_CURRENT_BUFFER , yyscanner );
2536 		YY_CURRENT_BUFFER_LVALUE = NULL;
2537 		yypop_buffer_state(yyscanner);
2538 	}
2539 
2540 	/* Destroy the stack itself. */
2541 	yyfree(yyg->yy_buffer_stack , yyscanner);
2542 	yyg->yy_buffer_stack = NULL;
2543 
2544     /* Destroy the start condition stack. */
2545         yyfree( yyg->yy_start_stack , yyscanner );
2546         yyg->yy_start_stack = NULL;
2547 
2548     /* Reset the globals. This is important in a non-reentrant scanner so the next time
2549      * yylex() is called, initialization will occur. */
2550     yy_init_globals( yyscanner);
2551 
2552     /* Destroy the main struct (reentrant only). */
2553     yyfree ( yyscanner , yyscanner );
2554     yyscanner = NULL;
2555     return 0;
2556 }
2557 
2558 /*
2559  * Internal utility routines.
2560  */
2561 
2562 #ifndef yytext_ptr
yy_flex_strncpy(char * s1,const char * s2,int n,yyscan_t yyscanner)2563 static void yy_flex_strncpy (char* s1, const char * s2, int n , yyscan_t yyscanner)
2564 {
2565 	struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2566 	(void)yyg;
2567 
2568 	int i;
2569 	for ( i = 0; i < n; ++i )
2570 		s1[i] = s2[i];
2571 }
2572 #endif
2573 
2574 #ifdef YY_NEED_STRLEN
yy_flex_strlen(const char * s,yyscan_t yyscanner)2575 static int yy_flex_strlen (const char * s , yyscan_t yyscanner)
2576 {
2577 	int n;
2578 	for ( n = 0; s[n]; ++n )
2579 		;
2580 
2581 	return n;
2582 }
2583 #endif
2584 
yyalloc(yy_size_t size,yyscan_t yyscanner)2585 void *yyalloc (yy_size_t  size , yyscan_t yyscanner)
2586 {
2587 	struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2588 	(void)yyg;
2589 	return malloc(size);
2590 }
2591 
yyrealloc(void * ptr,yy_size_t size,yyscan_t yyscanner)2592 void *yyrealloc  (void * ptr, yy_size_t  size , yyscan_t yyscanner)
2593 {
2594 	struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2595 	(void)yyg;
2596 
2597 	/* The cast to (char *) in the following accommodates both
2598 	 * implementations that use char* generic pointers, and those
2599 	 * that use void* generic pointers.  It works with the latter
2600 	 * because both ANSI C and C++ allow castless assignment from
2601 	 * any pointer type to void*, and deal with argument conversions
2602 	 * as though doing an assignment.
2603 	 */
2604 	return realloc(ptr, size);
2605 }
2606 
yyfree(void * ptr,yyscan_t yyscanner)2607 void yyfree (void * ptr , yyscan_t yyscanner)
2608 {
2609 	struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2610 	(void)yyg;
2611 	free( (char *) ptr );	/* see yyrealloc() for (char *) cast */
2612 }
2613 
2614 #define YYTABLES_NAME "yytables"
2615 
2616 #line 203 "scanner.l"
2617