5 #define YY_INT_ALIGNED short int
7 /* A lexical scanner generated by flex */
10 #define YY_FLEX_MAJOR_VERSION 2
11 #define YY_FLEX_MINOR_VERSION 5
12 #define YY_FLEX_SUBMINOR_VERSION 39
13 #if YY_FLEX_SUBMINOR_VERSION > 0
17 /* First, we deal with platform-specific or compiler-specific issues. */
19 /* begin standard C headers. */
25 /* end standard C headers. */
27 /* flex integer type definitions */
32 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
34 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
36 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
37 * if you want the limit (max/min) macros for int types.
39 #ifndef __STDC_LIMIT_MACROS
40 #define __STDC_LIMIT_MACROS 1
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;
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;
58 /* Limits of integral types. */
60 #define INT8_MIN (-128)
63 #define INT16_MIN (-32767-1)
66 #define INT32_MIN (-2147483647-1)
69 #define INT8_MAX (127)
72 #define INT16_MAX (32767)
75 #define INT32_MAX (2147483647)
78 #define UINT8_MAX (255U)
81 #define UINT16_MAX (65535U)
84 #define UINT32_MAX (4294967295U)
89 #endif /* ! FLEXINT_H */
93 /* The "const" storage-class-modifier is valid. */
96 #else /* ! __cplusplus */
98 /* C99 requires __STDC__ to be defined as 1. */
99 #if defined (__STDC__)
103 #endif /* defined (__STDC__) */
104 #endif /* ! __cplusplus */
107 #define yyconst const
112 /* Returned upon end-of-file. */
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
120 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
122 /* An opaque pointer. */
123 #ifndef YY_TYPEDEF_YY_SCANNER_T
124 #define YY_TYPEDEF_YY_SCANNER_T
125 typedef void* yyscan_t;
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
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.
143 #define BEGIN yyg->yy_start = 1 + 2 *
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
149 #define YY_START ((yyg->yy_start - 1) / 2)
150 #define YYSTATE YY_START
152 /* Action number for EOF rule of a given start state. */
153 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
155 /* Special action meaning "start processing a new file". */
156 #define YY_NEW_FILE libconfig_yyrestart(yyin ,yyscanner )
158 #define YY_END_OF_BUFFER_CHAR 0
160 /* Size of default input buffer. */
162 #define YY_BUF_SIZE 16384
165 /* The state buf must be large enough to hold one state per character in the main buffer.
167 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
169 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
170 #define YY_TYPEDEF_YY_BUFFER_STATE
171 typedef struct yy_buffer_state *YY_BUFFER_STATE;
174 #ifndef YY_TYPEDEF_YY_SIZE_T
175 #define YY_TYPEDEF_YY_SIZE_T
176 typedef size_t yy_size_t;
179 #define EOB_ACT_CONTINUE_SCAN 0
180 #define EOB_ACT_END_OF_FILE 1
181 #define EOB_ACT_LAST_MATCH 2
183 /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires
184 * access to the local variable yy_act. Since yyless() is a macro, it would break
185 * existing scanners that call yyless() from OUTSIDE libconfig_yylex.
186 * One obvious solution it to make yy_act a global. I tried that, and saw
187 * a 5% performance hit in a non-yylineno scanner, because yy_act is
188 * normally declared as a register variable-- so it is not worth it.
190 #define YY_LESS_LINENO(n) \
193 for ( yyl = n; yyl < yyleng; ++yyl )\
194 if ( yytext[yyl] == '\n' )\
197 #define YY_LINENO_REWIND_TO(dst) \
200 for ( p = yy_cp-1; p >= (dst); --p)\
205 /* Return all but the first "n" matched characters back to the input stream. */
209 /* Undo effects of setting up yytext. */ \
210 int yyless_macro_arg = (n); \
211 YY_LESS_LINENO(yyless_macro_arg);\
212 *yy_cp = yyg->yy_hold_char; \
213 YY_RESTORE_YY_MORE_OFFSET \
214 yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
215 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
219 #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
221 #ifndef YY_STRUCT_YY_BUFFER_STATE
222 #define YY_STRUCT_YY_BUFFER_STATE
223 struct yy_buffer_state
227 char *yy_ch_buf; /* input buffer */
228 char *yy_buf_pos; /* current position in input buffer */
230 /* Size of input buffer in bytes, not including room for EOB
233 yy_size_t yy_buf_size;
235 /* Number of characters read into yy_ch_buf, not including EOB
238 yy_size_t yy_n_chars;
240 /* Whether we "own" the buffer - i.e., we know we created it,
241 * and can realloc() it to grow it, and should free() it to
244 int yy_is_our_buffer;
246 /* Whether this is an "interactive" input source; if so, and
247 * if we're using stdio for input, then we want to use getc()
248 * instead of fread(), to make sure we stop fetching input after
251 int yy_is_interactive;
253 /* Whether we're considered to be at the beginning of a line.
254 * If so, '^' rules will be active on the next match, otherwise
259 int yy_bs_lineno; /**< The line count. */
260 int yy_bs_column; /**< The column count. */
262 /* Whether to try to fill the input buffer when we reach the
267 int yy_buffer_status;
269 #define YY_BUFFER_NEW 0
270 #define YY_BUFFER_NORMAL 1
271 /* When an EOF's been seen but there's still some text to process
272 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
273 * shouldn't try reading from the input source any more. We might
274 * still have a bunch of tokens to match, though, because of
275 * possible backing-up.
277 * When we actually see the EOF, we change the status to "new"
278 * (via libconfig_yyrestart()), so that the user can continue scanning by
279 * just pointing yyin at a new input file.
281 #define YY_BUFFER_EOF_PENDING 2
284 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
286 /* We provide macros for accessing buffer states in case in the
287 * future we want to put the buffer states in a more general
290 * Returns the top of the stack, or NULL.
292 #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
293 ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
296 /* Same as previous macro, but useful when we know that the buffer stack is not
297 * NULL or when we need an lvalue. For internal use only.
299 #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
301 void libconfig_yyrestart (FILE *input_file ,yyscan_t yyscanner );
302 void libconfig_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
303 YY_BUFFER_STATE libconfig_yy_create_buffer (FILE *file,int size ,yyscan_t yyscanner );
304 void libconfig_yy_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
305 void libconfig_yy_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
306 void libconfig_yypush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
307 void libconfig_yypop_buffer_state (yyscan_t yyscanner );
309 static void libconfig_yyensure_buffer_stack (yyscan_t yyscanner );
310 static void libconfig_yy_load_buffer_state (yyscan_t yyscanner );
311 static void libconfig_yy_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner );
313 #define YY_FLUSH_BUFFER libconfig_yy_flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
315 YY_BUFFER_STATE libconfig_yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
316 YY_BUFFER_STATE libconfig_yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
317 YY_BUFFER_STATE libconfig_yy_scan_bytes (yyconst char *bytes,yy_size_t len ,yyscan_t yyscanner );
319 void *libconfig_yyalloc (yy_size_t ,yyscan_t yyscanner );
320 void *libconfig_yyrealloc (void *,yy_size_t ,yyscan_t yyscanner );
321 void libconfig_yyfree (void * ,yyscan_t yyscanner );
323 #define yy_new_buffer libconfig_yy_create_buffer
325 #define yy_set_interactive(is_interactive) \
327 if ( ! YY_CURRENT_BUFFER ){ \
328 libconfig_yyensure_buffer_stack (yyscanner); \
329 YY_CURRENT_BUFFER_LVALUE = \
330 libconfig_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
332 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
335 #define yy_set_bol(at_bol) \
337 if ( ! YY_CURRENT_BUFFER ){\
338 libconfig_yyensure_buffer_stack (yyscanner); \
339 YY_CURRENT_BUFFER_LVALUE = \
340 libconfig_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
342 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
345 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
347 #define libconfig_yywrap(yyscanner) 1
348 #define YY_SKIP_YYWRAP
350 typedef unsigned char YY_CHAR;
352 typedef int yy_state_type;
354 #define yytext_ptr yytext_r
356 static yy_state_type yy_get_previous_state (yyscan_t yyscanner );
357 static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner);
358 static int yy_get_next_buffer (yyscan_t yyscanner );
359 static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner );
361 /* Done after the current pattern has been matched and before the
362 * corresponding action - sets up yytext.
364 #define YY_DO_BEFORE_ACTION \
365 yyg->yytext_ptr = yy_bp; \
366 yyleng = (size_t) (yy_cp - yy_bp); \
367 yyg->yy_hold_char = *yy_cp; \
369 yyg->yy_c_buf_p = yy_cp;
371 #define YY_NUM_RULES 42
372 #define YY_END_OF_BUFFER 43
373 /* This struct is not used in this scanner,
374 but its presence is necessary. */
377 flex_int32_t yy_verify;
380 static yyconst flex_int16_t yy_accept[103] =
382 0, 0, 0, 0, 0, 0, 0, 0, 43, 41,
383 22, 21, 21, 5, 41, 37, 38, 29, 41, 24,
384 30, 41, 31, 31, 23, 39, 29, 29, 35, 36,
385 25, 26, 22, 41, 3, 4, 3, 6, 15, 14,
386 17, 20, 42, 22, 0, 40, 29, 30, 31, 30,
387 0, 1, 0, 30, 0, 32, 0, 29, 29, 22,
388 0, 0, 2, 6, 12, 0, 11, 10, 7, 8,
389 9, 17, 19, 18, 0, 30, 30, 0, 0, 30,
390 32, 33, 29, 29, 0, 0, 0, 30, 34, 29,
391 27, 0, 13, 34, 28, 0, 0, 0, 0, 0,
396 static yyconst flex_int32_t yy_ec[256] =
398 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
399 1, 4, 5, 1, 1, 1, 1, 1, 1, 1,
400 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
401 1, 2, 1, 6, 7, 1, 1, 1, 1, 8,
402 9, 10, 11, 12, 13, 14, 15, 16, 17, 17,
403 17, 17, 17, 17, 17, 17, 17, 18, 19, 1,
404 20, 1, 1, 21, 22, 23, 23, 23, 24, 25,
405 26, 26, 26, 26, 26, 27, 26, 26, 26, 26,
406 26, 28, 29, 30, 31, 26, 26, 32, 26, 26,
407 33, 34, 35, 1, 36, 1, 22, 23, 37, 38,
409 39, 40, 26, 26, 41, 26, 26, 42, 26, 43,
410 26, 26, 26, 44, 29, 45, 46, 26, 26, 32,
411 26, 26, 47, 1, 48, 1, 1, 1, 1, 1,
412 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
413 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
414 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
415 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
416 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
417 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
418 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
420 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
421 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
422 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
423 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
424 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
428 static yyconst flex_int32_t yy_meta[49] =
430 1, 1, 1, 1, 1, 2, 1, 1, 1, 3,
431 1, 1, 3, 1, 1, 4, 4, 1, 1, 1,
432 1, 4, 4, 4, 4, 3, 3, 3, 3, 3,
433 3, 3, 1, 2, 1, 3, 4, 4, 4, 4,
434 3, 3, 3, 3, 3, 3, 1, 1
437 static yyconst flex_int16_t yy_base[113] =
439 0, 47, 47, 48, 46, 47, 48, 49, 203, 204,
440 200, 204, 204, 204, 198, 204, 204, 0, 45, 204,
441 47, 50, 60, 74, 204, 204, 178, 28, 204, 204,
442 204, 204, 64, 158, 204, 204, 183, 0, 204, 63,
443 0, 204, 83, 195, 193, 204, 0, 88, 102, 98,
444 62, 204, 190, 104, 119, 162, 0, 67, 65, 121,
445 127, 124, 204, 0, 204, 0, 204, 204, 204, 204,
446 204, 0, 204, 204, 108, 117, 122, 134, 132, 136,
447 204, 139, 136, 116, 126, 0, 140, 142, 135, 130,
448 0, 102, 204, 204, 0, 85, 72, 63, 98, 158,
450 204, 204, 169, 173, 177, 181, 183, 187, 191, 89,
454 static yyconst flex_int16_t yy_def[113] =
456 102, 1, 103, 103, 104, 104, 105, 105, 102, 102,
457 102, 102, 102, 102, 106, 102, 102, 107, 102, 102,
458 102, 102, 102, 102, 102, 102, 107, 107, 102, 102,
459 102, 102, 102, 102, 102, 102, 102, 108, 102, 102,
460 109, 102, 102, 102, 106, 102, 107, 102, 102, 102,
461 102, 102, 106, 102, 102, 102, 110, 107, 107, 102,
462 102, 102, 102, 108, 102, 111, 102, 102, 102, 102,
463 102, 109, 102, 102, 102, 102, 102, 102, 102, 102,
464 102, 110, 107, 107, 102, 112, 102, 102, 102, 107,
465 107, 102, 102, 102, 107, 102, 102, 102, 102, 102,
467 102, 0, 102, 102, 102, 102, 102, 102, 102, 102,
471 static yyconst flex_int16_t yy_nxt[253] =
473 10, 11, 12, 13, 13, 14, 15, 16, 17, 18,
474 19, 20, 19, 21, 22, 23, 24, 25, 26, 25,
475 10, 18, 18, 18, 27, 18, 18, 18, 18, 28,
476 18, 18, 29, 10, 30, 10, 18, 18, 18, 27,
477 18, 18, 18, 18, 28, 18, 31, 32, 33, 36,
478 36, 39, 39, 42, 42, 59, 37, 37, 48, 52,
479 49, 49, 50, 50, 53, 60, 93, 34, 65, 86,
480 51, 59, 75, 54, 75, 49, 49, 76, 76, 40,
481 40, 43, 43, 55, 61, 51, 56, 54, 73, 49,
482 49, 57, 82, 83, 66, 84, 67, 55, 55, 100,
484 56, 99, 68, 50, 50, 69, 70, 71, 83, 98,
485 84, 51, 55, 50, 50, 54, 74, 49, 49, 77,
486 77, 51, 60, 76, 76, 55, 51, 78, 56, 79,
487 97, 79, 76, 76, 80, 80, 51, 77, 77, 91,
488 55, 61, 78, 96, 87, 78, 87, 80, 80, 88,
489 88, 80, 80, 95, 91, 88, 88, 88, 88, 100,
490 78, 94, 92, 101, 90, 89, 85, 62, 95, 35,
491 35, 35, 35, 38, 38, 38, 38, 41, 41, 41,
492 41, 45, 45, 45, 45, 47, 47, 64, 81, 64,
493 64, 72, 46, 72, 72, 46, 44, 63, 62, 58,
495 46, 44, 102, 9, 102, 102, 102, 102, 102, 102,
496 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
497 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
498 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
499 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
503 static yyconst flex_int16_t yy_chk[253] =
505 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
506 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
507 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
508 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
509 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
510 4, 5, 6, 7, 8, 28, 3, 4, 19, 22,
511 19, 19, 21, 21, 22, 33, 112, 2, 40, 111,
512 21, 28, 51, 23, 51, 23, 23, 51, 51, 5,
513 6, 7, 8, 23, 33, 21, 23, 24, 43, 24,
514 24, 23, 110, 58, 40, 59, 40, 24, 23, 99,
516 24, 98, 40, 48, 48, 40, 40, 40, 58, 97,
517 59, 48, 24, 50, 50, 49, 43, 49, 49, 54,
518 54, 50, 60, 75, 75, 49, 48, 54, 49, 55,
519 96, 55, 76, 76, 55, 55, 50, 77, 77, 84,
520 49, 60, 54, 92, 78, 77, 78, 79, 79, 78,
521 78, 80, 80, 90, 84, 87, 87, 88, 88, 100,
522 77, 89, 85, 100, 83, 82, 62, 61, 90, 103,
523 103, 103, 103, 104, 104, 104, 104, 105, 105, 105,
524 105, 106, 106, 106, 106, 107, 107, 108, 56, 108,
525 108, 109, 53, 109, 109, 45, 44, 37, 34, 27,
527 15, 11, 9, 102, 102, 102, 102, 102, 102, 102,
528 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
529 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
530 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
531 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
535 /* Table of booleans, true if rule could match eol. */
536 static yyconst flex_int32_t yy_rule_can_match_eol[43] =
538 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,
539 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
542 /* The intent behind this definition is that it'll catch
543 * any uses of REJECT which flex missed.
545 #define REJECT reject_used_but_not_detected
546 #define yymore() yymore_used_but_not_detected
547 #define YY_MORE_ADJ 0
548 #define YY_RESTORE_YY_MORE_OFFSET
550 /* -*- mode: C -*- */
551 /* --------------------------------------------------------------------------
552 libconfig - A library for processing structured configuration files
553 Copyright (C) 2005-2014 Mark A Lindner
555 This file is part of libconfig.
557 This library is free software; you can redistribute it and/or
558 modify it under the terms of the GNU Lesser General Public License
559 as published by the Free Software Foundation; either version 2.1 of
560 the License, or (at your option) any later version.
562 This library is distributed in the hope that it will be useful, but
563 WITHOUT ANY WARRANTY; without even the implied warranty of
564 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
565 Lesser General Public License for more details.
567 You should have received a copy of the GNU Library General Public
568 License along with this library; if not, see
569 <http://www.gnu.org/licenses/>.
570 ----------------------------------------------------------------------------
572 #define YY_NO_UNISTD_H 1
576 #pragma warning (disable: 4996)
582 #include "parsectx.h"
585 #include "wincompat.h"
587 #define YY_NO_INPUT // Suppress generation of useless input() function
589 static unsigned long long fromhex(const char *s)
593 /* MinGW's strtoull() seems to be broken; it only returns the lower
598 unsigned long long val = 0;
605 if(*p != 'x' && *p != 'X')
608 for(++p; isxdigit(*p); ++p)
611 val |= ((*p < 'A') ? (*p & 0xF) : (9 + (*p & 0x7)));
616 #else /* ! __MINGW32__ */
618 return(strtoull(s, NULL, 16));
620 #endif /* __MINGW32__ */
624 #line 625 "scanner.c"
631 #ifndef YY_NO_UNISTD_H
632 /* Special case for "unistd.h", since it is non-ANSI. We include it way
633 * down here because we want the user's section 1 to have been scanned first.
634 * The user has a chance to override it with an option.
639 #define YY_EXTRA_TYPE struct scan_context *
641 /* Holds the entire state of the reentrant scanner. */
645 /* User-defined. Not touched by flex. */
646 YY_EXTRA_TYPE yyextra_r;
648 /* The rest are the same as the globals declared in the non-reentrant scanner. */
649 FILE *yyin_r, *yyout_r;
650 size_t yy_buffer_stack_top; /**< index of top of stack. */
651 size_t yy_buffer_stack_max; /**< capacity of stack. */
652 YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
654 yy_size_t yy_n_chars;
659 int yy_did_buffer_switch_on_eof;
660 int yy_start_stack_ptr;
661 int yy_start_stack_depth;
663 yy_state_type yy_last_accepting_state;
664 char* yy_last_accepting_cpos;
675 }; /* end struct yyguts_t */
677 static int yy_init_globals (yyscan_t yyscanner );
679 /* This must go here because YYSTYPE and YYLTYPE are included
680 * from bison output in section 1.*/
681 # define yylval yyg->yylval_r
683 int libconfig_yylex_init (yyscan_t* scanner);
685 int libconfig_yylex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
687 /* Accessor methods to globals.
688 These are made visible to non-reentrant scanners for convenience. */
690 int libconfig_yylex_destroy (yyscan_t yyscanner );
692 int libconfig_yyget_debug (yyscan_t yyscanner );
694 void libconfig_yyset_debug (int debug_flag ,yyscan_t yyscanner );
696 YY_EXTRA_TYPE libconfig_yyget_extra (yyscan_t yyscanner );
698 void libconfig_yyset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
700 FILE *libconfig_yyget_in (yyscan_t yyscanner );
702 void libconfig_yyset_in (FILE * in_str ,yyscan_t yyscanner );
704 FILE *libconfig_yyget_out (yyscan_t yyscanner );
706 void libconfig_yyset_out (FILE * out_str ,yyscan_t yyscanner );
708 yy_size_t libconfig_yyget_leng (yyscan_t yyscanner );
710 char *libconfig_yyget_text (yyscan_t yyscanner );
712 int libconfig_yyget_lineno (yyscan_t yyscanner );
714 void libconfig_yyset_lineno (int line_number ,yyscan_t yyscanner );
716 int libconfig_yyget_column (yyscan_t yyscanner );
718 void libconfig_yyset_column (int column_no ,yyscan_t yyscanner );
720 YYSTYPE * libconfig_yyget_lval (yyscan_t yyscanner );
722 void libconfig_yyset_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner );
724 /* Macros after this point can all be overridden by user definitions in
728 #ifndef YY_SKIP_YYWRAP
730 extern "C" int libconfig_yywrap (yyscan_t yyscanner );
732 extern int libconfig_yywrap (yyscan_t yyscanner );
737 static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
740 #ifdef YY_NEED_STRLEN
741 static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
747 static int yyinput (yyscan_t yyscanner );
749 static int input (yyscan_t yyscanner );
754 /* Amount of stuff to slurp up with each read. */
755 #ifndef YY_READ_BUF_SIZE
756 #define YY_READ_BUF_SIZE 8192
759 /* Copy whatever the last rule matched to the standard output. */
761 /* This used to be an fputs(), but since the string might contain NUL's,
762 * we now use fwrite().
764 #define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
767 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
768 * is returned in "result".
771 #define YY_INPUT(buf,result,max_size) \
772 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
776 for ( n = 0; n < max_size && \
777 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
780 buf[n++] = (char) c; \
781 if ( c == EOF && ferror( yyin ) ) \
782 YY_FATAL_ERROR( "input in flex scanner failed" ); \
788 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
790 if( errno != EINTR) \
792 YY_FATAL_ERROR( "input in flex scanner failed" ); \
803 /* No semi-colon after return; correct usage is to write "yyterminate();" -
804 * we don't want an extra ';' after the "return" because that will cause
805 * some compilers to complain about unreachable statements.
808 #define yyterminate() return YY_NULL
811 /* Number of entries by which start-condition stack grows. */
812 #ifndef YY_START_STACK_INCR
813 #define YY_START_STACK_INCR 25
816 /* Report a fatal error. */
817 #ifndef YY_FATAL_ERROR
818 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
821 /* end tables serialization structures and prototypes */
823 /* Default declaration of generated scanner - a define so the user can
824 * easily add parameters.
827 #define YY_DECL_IS_OURS 1
829 extern int libconfig_yylex \
830 (YYSTYPE * yylval_param ,yyscan_t yyscanner);
832 #define YY_DECL int libconfig_yylex \
833 (YYSTYPE * yylval_param , yyscan_t yyscanner)
834 #endif /* !YY_DECL */
836 /* Code executed at the beginning of each rule, after yytext and yyleng
839 #ifndef YY_USER_ACTION
840 #define YY_USER_ACTION
843 /* Code executed at the end of each rule. */
845 #define YY_BREAK break;
848 #define YY_RULE_SETUP \
850 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
851 (yytext[yyleng - 1] == '\n'); \
854 /** The main scanner function which does all the work.
858 register yy_state_type yy_current_state;
859 register char *yy_cp, *yy_bp;
861 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
863 yylval = yylval_param;
873 if ( ! yyg->yy_start )
874 yyg->yy_start = 1; /* first start state */
882 if ( ! YY_CURRENT_BUFFER ) {
883 libconfig_yyensure_buffer_stack (yyscanner);
884 YY_CURRENT_BUFFER_LVALUE =
885 libconfig_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
888 libconfig_yy_load_buffer_state(yyscanner );
892 #line 101 "scanner.l"
895 #line 896 "scanner.c"
897 while ( 1 ) /* loops until end-of-file is reached */
899 yy_cp = yyg->yy_c_buf_p;
901 /* Support of yytext. */
902 *yy_cp = yyg->yy_hold_char;
904 /* yy_bp points to the position in yy_ch_buf of the start of
909 yy_current_state = yyg->yy_start;
910 yy_current_state += YY_AT_BOL();
914 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
915 if ( yy_accept[yy_current_state] )
917 yyg->yy_last_accepting_state = yy_current_state;
918 yyg->yy_last_accepting_cpos = yy_cp;
920 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
922 yy_current_state = (int) yy_def[yy_current_state];
923 if ( yy_current_state >= 103 )
924 yy_c = yy_meta[(unsigned int) yy_c];
926 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
929 while ( yy_current_state != 102 );
930 yy_cp = yyg->yy_last_accepting_cpos;
931 yy_current_state = yyg->yy_last_accepting_state;
934 yy_act = yy_accept[yy_current_state];
938 if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
941 for ( yyl = 0; yyl < yyleng; ++yyl )
942 if ( yytext[yyl] == '\n' )
950 do_action: /* This label is used only to access EOF actions. */
953 { /* beginning of action switch */
954 case 0: /* must back up */
955 /* undo the effects of YY_DO_BEFORE_ACTION */
956 *yy_cp = yyg->yy_hold_char;
957 yy_cp = yyg->yy_last_accepting_cpos;
958 yy_current_state = yyg->yy_last_accepting_state;
963 #line 103 "scanner.l"
968 #line 104 "scanner.l"
973 #line 105 "scanner.l"
977 /* rule 4 can match eol */
979 #line 106 "scanner.l"
984 #line 108 "scanner.l"
988 /* rule 6 can match eol */
990 #line 109 "scanner.l"
991 { scanctx_append_string(yyextra, yytext); }
995 #line 110 "scanner.l"
996 { scanctx_append_string(yyextra, "\n"); }
1000 #line 111 "scanner.l"
1001 { scanctx_append_string(yyextra, "\r"); }
1005 #line 112 "scanner.l"
1006 { scanctx_append_string(yyextra, "\t"); }
1010 #line 113 "scanner.l"
1011 { scanctx_append_string(yyextra, "\f"); }
1015 #line 114 "scanner.l"
1016 { scanctx_append_string(yyextra, "\\"); }
1020 #line 115 "scanner.l"
1021 { scanctx_append_string(yyextra, "\""); }
1025 #line 116 "scanner.l"
1027 char c[2] = { (char)(strtol(yytext + 2, NULL, 16) & 0xFF),
1029 scanctx_append_string(yyextra, c);
1034 #line 121 "scanner.l"
1035 { scanctx_append_string(yyextra, "\\"); }
1039 #line 122 "scanner.l"
1041 yylval->sval = scanctx_take_string(yyextra);
1048 #line 128 "scanner.l"
1052 /* rule 17 can match eol */
1054 #line 129 "scanner.l"
1055 { scanctx_append_string(yyextra, yytext); }
1059 #line 130 "scanner.l"
1060 { scanctx_append_string(yyextra, "\\"); }
1064 #line 131 "scanner.l"
1065 { scanctx_append_string(yyextra, "\""); }
1069 #line 132 "scanner.l"
1072 FILE *fp = scanctx_push_include(yyextra,
1073 (void *)YY_CURRENT_BUFFER,
1078 libconfig_yy_switch_to_buffer(libconfig_yy_create_buffer(yyin,YY_BUF_SIZE,yyscanner),yyscanner);
1082 yyextra->config->error_text = error;
1083 yyextra->config->error_file = scanctx_current_filename(
1085 yyextra->config->error_line = libconfig_yyget_lineno(
1093 /* rule 21 can match eol */
1095 #line 156 "scanner.l"
1100 #line 157 "scanner.l"
1105 #line 159 "scanner.l"
1106 { return(TOK_EQUALS); }
1110 #line 160 "scanner.l"
1111 { return(TOK_COMMA); }
1115 #line 161 "scanner.l"
1116 { return(TOK_GROUP_START); }
1120 #line 162 "scanner.l"
1121 { return(TOK_GROUP_END); }
1125 #line 163 "scanner.l"
1126 { yylval->ival = 1; return(TOK_BOOLEAN); }
1130 #line 164 "scanner.l"
1131 { yylval->ival = 0; return(TOK_BOOLEAN); }
1135 #line 165 "scanner.l"
1136 { yylval->sval = yytext; return(TOK_NAME); }
1140 #line 166 "scanner.l"
1141 { yylval->fval = atof(yytext); return(TOK_FLOAT); }
1145 #line 167 "scanner.l"
1146 { yylval->ival = atoi(yytext); return(TOK_INTEGER); }
1150 #line 168 "scanner.l"
1151 { yylval->llval = atoll(yytext); return(TOK_INTEGER64); }
1155 #line 169 "scanner.l"
1157 yylval->ival = strtoul(yytext, NULL, 16);
1163 #line 173 "scanner.l"
1164 { yylval->llval = fromhex(yytext); return(TOK_HEX64); }
1168 #line 174 "scanner.l"
1169 { return(TOK_ARRAY_START); }
1173 #line 175 "scanner.l"
1174 { return(TOK_ARRAY_END); }
1178 #line 176 "scanner.l"
1179 { return(TOK_LIST_START); }
1183 #line 177 "scanner.l"
1184 { return(TOK_LIST_END); }
1188 #line 178 "scanner.l"
1189 { return(TOK_SEMICOLON); }
1192 *yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
1193 yyg->yy_c_buf_p = yy_cp -= 1;
1194 YY_DO_BEFORE_ACTION; /* set up yytext again */
1196 #line 179 "scanner.l"
1201 #line 180 "scanner.l"
1202 { return(TOK_GARBAGE); }
1204 case YY_STATE_EOF(INITIAL):
1205 case YY_STATE_EOF(COMMENT):
1206 case YY_STATE_EOF(STRING):
1207 case YY_STATE_EOF(INCLUDE):
1208 #line 182 "scanner.l"
1210 YY_BUFFER_STATE buf = (YY_BUFFER_STATE)scanctx_pop_include(
1214 libconfig_yy_delete_buffer(YY_CURRENT_BUFFER,yyscanner);
1215 libconfig_yy_switch_to_buffer(buf,yyscanner);
1223 #line 193 "scanner.l"
1226 #line 1227 "scanner.c"
1228 case YY_END_OF_BUFFER:
1230 /* Amount of text matched not including the EOB char. */
1231 int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
1233 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1234 *yy_cp = yyg->yy_hold_char;
1235 YY_RESTORE_YY_MORE_OFFSET
1237 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1239 /* We're scanning a new file or input source. It's
1240 * possible that this happened because the user
1241 * just pointed yyin at a new source and called
1242 * libconfig_yylex(). If so, then we have to assure
1243 * consistency between YY_CURRENT_BUFFER and our
1244 * globals. Here is the right place to do so, because
1245 * this is the first action (other than possibly a
1246 * back-up) that will match for the new input source.
1248 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1249 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1250 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1253 /* Note that here we test for yy_c_buf_p "<=" to the position
1254 * of the first EOB in the buffer, since yy_c_buf_p will
1255 * already have been incremented past the NUL character
1256 * (since all states make transitions on EOB to the
1257 * end-of-buffer state). Contrast this with the test
1260 if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
1261 { /* This was really a NUL. */
1262 yy_state_type yy_next_state;
1264 yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
1266 yy_current_state = yy_get_previous_state( yyscanner );
1268 /* Okay, we're now positioned to make the NUL
1269 * transition. We couldn't have
1270 * yy_get_previous_state() go ahead and do it
1271 * for us because it doesn't know how to deal
1272 * with the possibility of jamming (and we don't
1273 * want to build jamming into it because then it
1274 * will run more slowly).
1277 yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
1279 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1281 if ( yy_next_state )
1283 /* Consume the NUL. */
1284 yy_cp = ++yyg->yy_c_buf_p;
1285 yy_current_state = yy_next_state;
1291 yy_cp = yyg->yy_last_accepting_cpos;
1292 yy_current_state = yyg->yy_last_accepting_state;
1293 goto yy_find_action;
1297 else switch ( yy_get_next_buffer( yyscanner ) )
1299 case EOB_ACT_END_OF_FILE:
1301 yyg->yy_did_buffer_switch_on_eof = 0;
1303 if ( libconfig_yywrap(yyscanner ) )
1305 /* Note: because we've taken care in
1306 * yy_get_next_buffer() to have set up
1307 * yytext, we can now set up
1308 * yy_c_buf_p so that if some total
1309 * hoser (like flex itself) wants to
1310 * call the scanner after we return the
1311 * YY_NULL, it'll still work - another
1312 * YY_NULL will get returned.
1314 yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
1316 yy_act = YY_STATE_EOF(YY_START);
1322 if ( ! yyg->yy_did_buffer_switch_on_eof )
1328 case EOB_ACT_CONTINUE_SCAN:
1330 yyg->yytext_ptr + yy_amount_of_matched_text;
1332 yy_current_state = yy_get_previous_state( yyscanner );
1334 yy_cp = yyg->yy_c_buf_p;
1335 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1338 case EOB_ACT_LAST_MATCH:
1340 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
1342 yy_current_state = yy_get_previous_state( yyscanner );
1344 yy_cp = yyg->yy_c_buf_p;
1345 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1346 goto yy_find_action;
1353 "fatal flex scanner internal error--no action found" );
1354 } /* end of action switch */
1355 } /* end of scanning one token */
1356 } /* end of user's declarations */
1357 } /* end of libconfig_yylex */
1359 /* yy_get_next_buffer - try to read in a new buffer
1361 * Returns a code representing an action:
1362 * EOB_ACT_LAST_MATCH -
1363 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1364 * EOB_ACT_END_OF_FILE - end of file
1366 static int yy_get_next_buffer (yyscan_t yyscanner)
1368 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1369 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1370 register char *source = yyg->yytext_ptr;
1371 register int number_to_move, i;
1374 if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
1376 "fatal flex scanner internal error--end of buffer missed" );
1378 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1379 { /* Don't try to fill the buffer, so this is an EOF. */
1380 if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
1382 /* We matched a single character, the EOB, so
1383 * treat this as a final EOF.
1385 return EOB_ACT_END_OF_FILE;
1390 /* We matched some text prior to the EOB, first
1393 return EOB_ACT_LAST_MATCH;
1397 /* Try to read more data. */
1399 /* First move last chars to start of buffer. */
1400 number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;
1402 for ( i = 0; i < number_to_move; ++i )
1403 *(dest++) = *(source++);
1405 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1406 /* don't do the read, it's not guaranteed to return an EOF,
1409 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
1413 yy_size_t num_to_read =
1414 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1416 while ( num_to_read <= 0 )
1417 { /* Not enough room in the buffer - grow it. */
1419 /* just a shorter name for the current buffer */
1420 YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
1422 int yy_c_buf_p_offset =
1423 (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
1425 if ( b->yy_is_our_buffer )
1427 yy_size_t new_size = b->yy_buf_size * 2;
1429 if ( new_size <= 0 )
1430 b->yy_buf_size += b->yy_buf_size / 8;
1432 b->yy_buf_size *= 2;
1434 b->yy_ch_buf = (char *)
1435 /* Include room in for 2 EOB chars. */
1436 libconfig_yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner );
1439 /* Can't grow it, we don't own it. */
1442 if ( ! b->yy_ch_buf )
1444 "fatal error - scanner input buffer overflow" );
1446 yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1448 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1453 if ( num_to_read > YY_READ_BUF_SIZE )
1454 num_to_read = YY_READ_BUF_SIZE;
1456 /* Read in more data. */
1457 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1458 yyg->yy_n_chars, num_to_read );
1460 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1463 if ( yyg->yy_n_chars == 0 )
1465 if ( number_to_move == YY_MORE_ADJ )
1467 ret_val = EOB_ACT_END_OF_FILE;
1468 libconfig_yyrestart(yyin ,yyscanner);
1473 ret_val = EOB_ACT_LAST_MATCH;
1474 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1475 YY_BUFFER_EOF_PENDING;
1480 ret_val = EOB_ACT_CONTINUE_SCAN;
1482 if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1483 /* Extend the array by 50%, plus the number we really need. */
1484 yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
1485 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) libconfig_yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner );
1486 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1487 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1490 yyg->yy_n_chars += number_to_move;
1491 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1492 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1494 yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1499 /* yy_get_previous_state - get the state just before the EOB char was reached */
1501 static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
1503 register yy_state_type yy_current_state;
1504 register char *yy_cp;
1505 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1507 yy_current_state = yyg->yy_start;
1508 yy_current_state += YY_AT_BOL();
1510 for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
1512 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1513 if ( yy_accept[yy_current_state] )
1515 yyg->yy_last_accepting_state = yy_current_state;
1516 yyg->yy_last_accepting_cpos = yy_cp;
1518 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1520 yy_current_state = (int) yy_def[yy_current_state];
1521 if ( yy_current_state >= 103 )
1522 yy_c = yy_meta[(unsigned int) yy_c];
1524 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1527 return yy_current_state;
1530 /* yy_try_NUL_trans - try to make a transition on the NUL character
1533 * next_state = yy_try_NUL_trans( current_state );
1535 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner)
1537 register int yy_is_jam;
1538 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
1539 register char *yy_cp = yyg->yy_c_buf_p;
1541 register YY_CHAR yy_c = 1;
1542 if ( yy_accept[yy_current_state] )
1544 yyg->yy_last_accepting_state = yy_current_state;
1545 yyg->yy_last_accepting_cpos = yy_cp;
1547 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1549 yy_current_state = (int) yy_def[yy_current_state];
1550 if ( yy_current_state >= 103 )
1551 yy_c = yy_meta[(unsigned int) yy_c];
1553 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1554 yy_is_jam = (yy_current_state == 102);
1557 return yy_is_jam ? 0 : yy_current_state;
1562 static int yyinput (yyscan_t yyscanner)
1564 static int input (yyscan_t yyscanner)
1569 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1571 *yyg->yy_c_buf_p = yyg->yy_hold_char;
1573 if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1575 /* yy_c_buf_p now points to the character we want to return.
1576 * If this occurs *before* the EOB characters, then it's a
1577 * valid NUL; if not, then we've hit the end of the buffer.
1579 if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
1580 /* This was really a NUL. */
1581 *yyg->yy_c_buf_p = '\0';
1584 { /* need more input */
1585 yy_size_t offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
1588 switch ( yy_get_next_buffer( yyscanner ) )
1590 case EOB_ACT_LAST_MATCH:
1591 /* This happens because yy_g_n_b()
1592 * sees that we've accumulated a
1593 * token and flags that we need to
1594 * try matching the token before
1595 * proceeding. But for input(),
1596 * there's no matching to consider.
1597 * So convert the EOB_ACT_LAST_MATCH
1598 * to EOB_ACT_END_OF_FILE.
1601 /* Reset buffer status. */
1602 libconfig_yyrestart(yyin ,yyscanner);
1606 case EOB_ACT_END_OF_FILE:
1608 if ( libconfig_yywrap(yyscanner ) )
1611 if ( ! yyg->yy_did_buffer_switch_on_eof )
1614 return yyinput(yyscanner);
1616 return input(yyscanner);
1620 case EOB_ACT_CONTINUE_SCAN:
1621 yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
1627 c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */
1628 *yyg->yy_c_buf_p = '\0'; /* preserve yytext */
1629 yyg->yy_hold_char = *++yyg->yy_c_buf_p;
1631 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n');
1632 if ( YY_CURRENT_BUFFER_LVALUE->yy_at_bol )
1641 #endif /* ifndef YY_NO_INPUT */
1643 /** Immediately switch to a different input stream.
1644 * @param input_file A readable stream.
1645 * @param yyscanner The scanner object.
1646 * @note This function does not reset the start condition to @c INITIAL .
1648 void libconfig_yyrestart (FILE * input_file , yyscan_t yyscanner)
1650 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1652 if ( ! YY_CURRENT_BUFFER ){
1653 libconfig_yyensure_buffer_stack (yyscanner);
1654 YY_CURRENT_BUFFER_LVALUE =
1655 libconfig_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
1658 libconfig_yy_init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
1659 libconfig_yy_load_buffer_state(yyscanner );
1662 /** Switch to a different input buffer.
1663 * @param new_buffer The new input buffer.
1664 * @param yyscanner The scanner object.
1666 void libconfig_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
1668 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1670 /* TODO. We should be able to replace this entire function body
1672 * libconfig_yypop_buffer_state();
1673 * libconfig_yypush_buffer_state(new_buffer);
1675 libconfig_yyensure_buffer_stack (yyscanner);
1676 if ( YY_CURRENT_BUFFER == new_buffer )
1679 if ( YY_CURRENT_BUFFER )
1681 /* Flush out information for old buffer. */
1682 *yyg->yy_c_buf_p = yyg->yy_hold_char;
1683 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
1684 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1687 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1688 libconfig_yy_load_buffer_state(yyscanner );
1690 /* We don't actually know whether we did this switch during
1691 * EOF (libconfig_yywrap()) processing, but the only time this flag
1692 * is looked at is after libconfig_yywrap() is called, so it's safe
1693 * to go ahead and always set it.
1695 yyg->yy_did_buffer_switch_on_eof = 1;
1698 static void libconfig_yy_load_buffer_state (yyscan_t yyscanner)
1700 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1701 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1702 yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1703 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1704 yyg->yy_hold_char = *yyg->yy_c_buf_p;
1707 /** Allocate and initialize an input buffer state.
1708 * @param file A readable stream.
1709 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1710 * @param yyscanner The scanner object.
1711 * @return the allocated buffer state.
1713 YY_BUFFER_STATE libconfig_yy_create_buffer (FILE * file, int size , yyscan_t yyscanner)
1717 b = (YY_BUFFER_STATE) libconfig_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
1719 YY_FATAL_ERROR( "out of dynamic memory in libconfig_yy_create_buffer()" );
1721 b->yy_buf_size = size;
1723 /* yy_ch_buf has to be 2 characters longer than the size given because
1724 * we need to put in 2 end-of-buffer characters.
1726 b->yy_ch_buf = (char *) libconfig_yyalloc(b->yy_buf_size + 2 ,yyscanner );
1727 if ( ! b->yy_ch_buf )
1728 YY_FATAL_ERROR( "out of dynamic memory in libconfig_yy_create_buffer()" );
1730 b->yy_is_our_buffer = 1;
1732 libconfig_yy_init_buffer(b,file ,yyscanner);
1737 /** Destroy the buffer.
1738 * @param b a buffer created with libconfig_yy_create_buffer()
1739 * @param yyscanner The scanner object.
1741 void libconfig_yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
1743 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1748 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1749 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1751 if ( b->yy_is_our_buffer )
1752 libconfig_yyfree((void *) b->yy_ch_buf ,yyscanner );
1754 libconfig_yyfree((void *) b ,yyscanner );
1757 /* Initializes or reinitializes a buffer.
1758 * This function is sometimes called more than once on the same buffer,
1759 * such as during a libconfig_yyrestart() or at EOF.
1761 static void libconfig_yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
1765 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1767 libconfig_yy_flush_buffer(b ,yyscanner);
1769 b->yy_input_file = file;
1770 b->yy_fill_buffer = 1;
1772 /* If b is the current buffer, then libconfig_yy_init_buffer was _probably_
1773 * called from libconfig_yyrestart() or through yy_get_next_buffer.
1774 * In that case, we don't want to reset the lineno or column.
1776 if (b != YY_CURRENT_BUFFER){
1777 b->yy_bs_lineno = 1;
1778 b->yy_bs_column = 0;
1781 b->yy_is_interactive = 0;
1786 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1787 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1788 * @param yyscanner The scanner object.
1790 void libconfig_yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
1792 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1798 /* We always need two end-of-buffer characters. The first causes
1799 * a transition to the end-of-buffer state. The second causes
1800 * a jam in that state.
1802 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1803 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1805 b->yy_buf_pos = &b->yy_ch_buf[0];
1808 b->yy_buffer_status = YY_BUFFER_NEW;
1810 if ( b == YY_CURRENT_BUFFER )
1811 libconfig_yy_load_buffer_state(yyscanner );
1814 /** Pushes the new state onto the stack. The new state becomes
1815 * the current state. This function will allocate the stack
1817 * @param new_buffer The new state.
1818 * @param yyscanner The scanner object.
1820 void libconfig_yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
1822 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1823 if (new_buffer == NULL)
1826 libconfig_yyensure_buffer_stack(yyscanner);
1828 /* This block is copied from libconfig_yy_switch_to_buffer. */
1829 if ( YY_CURRENT_BUFFER )
1831 /* Flush out information for old buffer. */
1832 *yyg->yy_c_buf_p = yyg->yy_hold_char;
1833 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
1834 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1837 /* Only push if top exists. Otherwise, replace top. */
1838 if (YY_CURRENT_BUFFER)
1839 yyg->yy_buffer_stack_top++;
1840 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1842 /* copied from libconfig_yy_switch_to_buffer. */
1843 libconfig_yy_load_buffer_state(yyscanner );
1844 yyg->yy_did_buffer_switch_on_eof = 1;
1847 /** Removes and deletes the top of the stack, if present.
1848 * The next element becomes the new top.
1849 * @param yyscanner The scanner object.
1851 void libconfig_yypop_buffer_state (yyscan_t yyscanner)
1853 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1854 if (!YY_CURRENT_BUFFER)
1857 libconfig_yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner);
1858 YY_CURRENT_BUFFER_LVALUE = NULL;
1859 if (yyg->yy_buffer_stack_top > 0)
1860 --yyg->yy_buffer_stack_top;
1862 if (YY_CURRENT_BUFFER) {
1863 libconfig_yy_load_buffer_state(yyscanner );
1864 yyg->yy_did_buffer_switch_on_eof = 1;
1868 /* Allocates the stack if it does not exist.
1869 * Guarantees space for at least one push.
1871 static void libconfig_yyensure_buffer_stack (yyscan_t yyscanner)
1873 yy_size_t num_to_alloc;
1874 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1876 if (!yyg->yy_buffer_stack) {
1878 /* First allocation is just for 2 elements, since we don't know if this
1879 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1880 * immediate realloc on the next call.
1883 yyg->yy_buffer_stack = (struct yy_buffer_state**)libconfig_yyalloc
1884 (num_to_alloc * sizeof(struct yy_buffer_state*)
1886 if ( ! yyg->yy_buffer_stack )
1887 YY_FATAL_ERROR( "out of dynamic memory in libconfig_yyensure_buffer_stack()" );
1889 memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1891 yyg->yy_buffer_stack_max = num_to_alloc;
1892 yyg->yy_buffer_stack_top = 0;
1896 if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
1898 /* Increase the buffer to prepare for a possible push. */
1899 int grow_size = 8 /* arbitrary grow size */;
1901 num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
1902 yyg->yy_buffer_stack = (struct yy_buffer_state**)libconfig_yyrealloc
1903 (yyg->yy_buffer_stack,
1904 num_to_alloc * sizeof(struct yy_buffer_state*)
1906 if ( ! yyg->yy_buffer_stack )
1907 YY_FATAL_ERROR( "out of dynamic memory in libconfig_yyensure_buffer_stack()" );
1909 /* zero only the new slots.*/
1910 memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
1911 yyg->yy_buffer_stack_max = num_to_alloc;
1915 /** Setup the input buffer state to scan directly from a user-specified character buffer.
1916 * @param base the character buffer
1917 * @param size the size in bytes of the character buffer
1918 * @param yyscanner The scanner object.
1919 * @return the newly allocated buffer state object.
1921 YY_BUFFER_STATE libconfig_yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
1926 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1927 base[size-1] != YY_END_OF_BUFFER_CHAR )
1928 /* They forgot to leave room for the EOB's. */
1931 b = (YY_BUFFER_STATE) libconfig_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
1933 YY_FATAL_ERROR( "out of dynamic memory in libconfig_yy_scan_buffer()" );
1935 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1936 b->yy_buf_pos = b->yy_ch_buf = base;
1937 b->yy_is_our_buffer = 0;
1938 b->yy_input_file = 0;
1939 b->yy_n_chars = b->yy_buf_size;
1940 b->yy_is_interactive = 0;
1942 b->yy_fill_buffer = 0;
1943 b->yy_buffer_status = YY_BUFFER_NEW;
1945 libconfig_yy_switch_to_buffer(b ,yyscanner );
1950 /** Setup the input buffer state to scan a string. The next call to libconfig_yylex() will
1951 * scan from a @e copy of @a str.
1952 * @param yystr a NUL-terminated string to scan
1953 * @param yyscanner The scanner object.
1954 * @return the newly allocated buffer state object.
1955 * @note If you want to scan bytes that may contain NUL values, then use
1956 * libconfig_yy_scan_bytes() instead.
1958 YY_BUFFER_STATE libconfig_yy_scan_string (yyconst char * yystr , yyscan_t yyscanner)
1961 return libconfig_yy_scan_bytes(yystr,strlen(yystr) ,yyscanner);
1964 /** Setup the input buffer state to scan the given bytes. The next call to libconfig_yylex() will
1965 * scan from a @e copy of @a bytes.
1966 * @param yybytes the byte buffer to scan
1967 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
1968 * @param yyscanner The scanner object.
1969 * @return the newly allocated buffer state object.
1971 YY_BUFFER_STATE libconfig_yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len , yyscan_t yyscanner)
1978 /* Get memory for full buffer, including space for trailing EOB's. */
1979 n = _yybytes_len + 2;
1980 buf = (char *) libconfig_yyalloc(n ,yyscanner );
1982 YY_FATAL_ERROR( "out of dynamic memory in libconfig_yy_scan_bytes()" );
1984 for ( i = 0; i < _yybytes_len; ++i )
1985 buf[i] = yybytes[i];
1987 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1989 b = libconfig_yy_scan_buffer(buf,n ,yyscanner);
1991 YY_FATAL_ERROR( "bad buffer in libconfig_yy_scan_bytes()" );
1993 /* It's okay to grow etc. this buffer, and we should throw it
1994 * away when we're done.
1996 b->yy_is_our_buffer = 1;
2001 #ifndef YY_EXIT_FAILURE
2002 #define YY_EXIT_FAILURE 2
2005 static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
2007 (void) fprintf( stderr, "%s\n", msg );
2008 exit( YY_EXIT_FAILURE );
2011 /* Redefine yyless() so it works in section 3 code. */
2017 /* Undo effects of setting up yytext. */ \
2018 int yyless_macro_arg = (n); \
2019 YY_LESS_LINENO(yyless_macro_arg);\
2020 yytext[yyleng] = yyg->yy_hold_char; \
2021 yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
2022 yyg->yy_hold_char = *yyg->yy_c_buf_p; \
2023 *yyg->yy_c_buf_p = '\0'; \
2024 yyleng = yyless_macro_arg; \
2028 /* Accessor methods (get/set functions) to struct members. */
2030 /** Get the user-defined data for this scanner.
2031 * @param yyscanner The scanner object.
2033 YY_EXTRA_TYPE libconfig_yyget_extra (yyscan_t yyscanner)
2035 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2039 /** Get the current line number.
2040 * @param yyscanner The scanner object.
2042 int libconfig_yyget_lineno (yyscan_t yyscanner)
2044 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2046 if (! YY_CURRENT_BUFFER)
2052 /** Get the current column number.
2053 * @param yyscanner The scanner object.
2055 int libconfig_yyget_column (yyscan_t yyscanner)
2057 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2059 if (! YY_CURRENT_BUFFER)
2065 /** Get the input stream.
2066 * @param yyscanner The scanner object.
2068 FILE *libconfig_yyget_in (yyscan_t yyscanner)
2070 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2074 /** Get the output stream.
2075 * @param yyscanner The scanner object.
2077 FILE *libconfig_yyget_out (yyscan_t yyscanner)
2079 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2083 /** Get the length of the current token.
2084 * @param yyscanner The scanner object.
2086 yy_size_t libconfig_yyget_leng (yyscan_t yyscanner)
2088 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2092 /** Get the current token.
2093 * @param yyscanner The scanner object.
2096 char *libconfig_yyget_text (yyscan_t yyscanner)
2098 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2102 /** Set the user-defined data. This data is never touched by the scanner.
2103 * @param user_defined The data to be associated with this scanner.
2104 * @param yyscanner The scanner object.
2106 void libconfig_yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
2108 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2109 yyextra = user_defined ;
2112 /** Set the current line number.
2113 * @param line_number
2114 * @param yyscanner The scanner object.
2116 void libconfig_yyset_lineno (int line_number , yyscan_t yyscanner)
2118 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2120 /* lineno is only valid if an input buffer exists. */
2121 if (! YY_CURRENT_BUFFER )
2122 YY_FATAL_ERROR( "libconfig_yyset_lineno called with no buffer" );
2124 yylineno = line_number;
2127 /** Set the current column.
2128 * @param line_number
2129 * @param yyscanner The scanner object.
2131 void libconfig_yyset_column (int column_no , yyscan_t yyscanner)
2133 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2135 /* column is only valid if an input buffer exists. */
2136 if (! YY_CURRENT_BUFFER )
2137 YY_FATAL_ERROR( "libconfig_yyset_column called with no buffer" );
2139 yycolumn = column_no;
2142 /** Set the input stream. This does not discard the current
2144 * @param in_str A readable stream.
2145 * @param yyscanner The scanner object.
2146 * @see libconfig_yy_switch_to_buffer
2148 void libconfig_yyset_in (FILE * in_str , yyscan_t yyscanner)
2150 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2154 void libconfig_yyset_out (FILE * out_str , yyscan_t yyscanner)
2156 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2160 int libconfig_yyget_debug (yyscan_t yyscanner)
2162 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2163 return yy_flex_debug;
2166 void libconfig_yyset_debug (int bdebug , yyscan_t yyscanner)
2168 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2169 yy_flex_debug = bdebug ;
2172 /* Accessor methods for yylval and yylloc */
2174 YYSTYPE * libconfig_yyget_lval (yyscan_t yyscanner)
2176 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2180 void libconfig_yyset_lval (YYSTYPE * yylval_param , yyscan_t yyscanner)
2182 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2183 yylval = yylval_param;
2186 /* User-visible API */
2188 /* libconfig_yylex_init is special because it creates the scanner itself, so it is
2189 * the ONLY reentrant function that doesn't take the scanner as the last argument.
2190 * That's why we explicitly handle the declaration, instead of using our macros.
2193 int libconfig_yylex_init(yyscan_t* ptr_yy_globals)
2196 if (ptr_yy_globals == NULL){
2201 *ptr_yy_globals = (yyscan_t) libconfig_yyalloc ( sizeof( struct yyguts_t ), NULL );
2203 if (*ptr_yy_globals == NULL){
2208 /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
2209 memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
2211 return yy_init_globals ( *ptr_yy_globals );
2214 /* libconfig_yylex_init_extra has the same functionality as libconfig_yylex_init, but follows the
2215 * convention of taking the scanner as the last argument. Note however, that
2216 * this is a *pointer* to a scanner, as it will be allocated by this call (and
2217 * is the reason, too, why this function also must handle its own declaration).
2218 * The user defined value in the first argument will be available to libconfig_yyalloc in
2219 * the yyextra field.
2222 int libconfig_yylex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals )
2225 struct yyguts_t dummy_yyguts;
2227 libconfig_yyset_extra (yy_user_defined, &dummy_yyguts);
2229 if (ptr_yy_globals == NULL){
2234 *ptr_yy_globals = (yyscan_t) libconfig_yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
2236 if (*ptr_yy_globals == NULL){
2241 /* By setting to 0xAA, we expose bugs in
2242 yy_init_globals. Leave at 0x00 for releases. */
2243 memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
2245 libconfig_yyset_extra (yy_user_defined, *ptr_yy_globals);
2247 return yy_init_globals ( *ptr_yy_globals );
2250 static int yy_init_globals (yyscan_t yyscanner)
2252 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2253 /* Initialization is the same as for the non-reentrant scanner.
2254 * This function is called from libconfig_yylex_destroy(), so don't allocate here.
2257 yyg->yy_buffer_stack = 0;
2258 yyg->yy_buffer_stack_top = 0;
2259 yyg->yy_buffer_stack_max = 0;
2260 yyg->yy_c_buf_p = (char *) 0;
2264 yyg->yy_start_stack_ptr = 0;
2265 yyg->yy_start_stack_depth = 0;
2266 yyg->yy_start_stack = NULL;
2268 /* Defined in main.c */
2277 /* For future reference: Set errno on error, since we are called by
2278 * libconfig_yylex_init()
2283 /* libconfig_yylex_destroy is for both reentrant and non-reentrant scanners. */
2284 int libconfig_yylex_destroy (yyscan_t yyscanner)
2286 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2288 /* Pop the buffer stack, destroying each element. */
2289 while(YY_CURRENT_BUFFER){
2290 libconfig_yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner );
2291 YY_CURRENT_BUFFER_LVALUE = NULL;
2292 libconfig_yypop_buffer_state(yyscanner);
2295 /* Destroy the stack itself. */
2296 libconfig_yyfree(yyg->yy_buffer_stack ,yyscanner);
2297 yyg->yy_buffer_stack = NULL;
2299 /* Destroy the start condition stack. */
2300 libconfig_yyfree(yyg->yy_start_stack ,yyscanner );
2301 yyg->yy_start_stack = NULL;
2303 /* Reset the globals. This is important in a non-reentrant scanner so the next time
2304 * libconfig_yylex() is called, initialization will occur. */
2305 yy_init_globals( yyscanner);
2307 /* Destroy the main struct (reentrant only). */
2308 libconfig_yyfree ( yyscanner , yyscanner );
2314 * Internal utility routines.
2318 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner)
2321 for ( i = 0; i < n; ++i )
2326 #ifdef YY_NEED_STRLEN
2327 static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
2330 for ( n = 0; s[n]; ++n )
2337 void *libconfig_yyalloc (yy_size_t size , yyscan_t yyscanner)
2339 return (void *) malloc( size );
2342 void *libconfig_yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner)
2344 /* The cast to (char *) in the following accommodates both
2345 * implementations that use char* generic pointers, and those
2346 * that use void* generic pointers. It works with the latter
2347 * because both ANSI C and C++ allow castless assignment from
2348 * any pointer type to void*, and deal with argument conversions
2349 * as though doing an assignment.
2351 return (void *) realloc( (char *) ptr, size );
2354 void libconfig_yyfree (void * ptr , yyscan_t yyscanner)
2356 free( (char *) ptr ); /* see libconfig_yyrealloc() for (char *) cast */
2359 #define YYTABLES_NAME "yytables"
2361 #line 193 "scanner.l"