e58e66a8bcc5d16a1bfc231e60645af3c54a9000
[platform/upstream/libconfig.git] / lib / scanner.c
1 #line 2 "scanner.c"
2
3 #line 4 "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 5
12 #define YY_FLEX_SUBMINOR_VERSION 39
13 #if YY_FLEX_SUBMINOR_VERSION > 0
14 #define FLEX_BETA
15 #endif
16
17 /* First, we deal with  platform-specific or compiler-specific issues. */
18
19 /* begin standard C headers. */
20 #include <stdio.h>
21 #include <string.h>
22 #include <errno.h>
23 #include <stdlib.h>
24
25 /* end standard C headers. */
26
27 /* flex integer type definitions */
28
29 #ifndef FLEXINT_H
30 #define FLEXINT_H
31
32 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
33
34 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
35
36 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
37  * if you want the limit (max/min) macros for int types. 
38  */
39 #ifndef __STDC_LIMIT_MACROS
40 #define __STDC_LIMIT_MACROS 1
41 #endif
42
43 #include <inttypes.h>
44 typedef int8_t flex_int8_t;
45 typedef uint8_t flex_uint8_t;
46 typedef int16_t flex_int16_t;
47 typedef uint16_t flex_uint16_t;
48 typedef int32_t flex_int32_t;
49 typedef uint32_t flex_uint32_t;
50 #else
51 typedef signed char flex_int8_t;
52 typedef short int flex_int16_t;
53 typedef int flex_int32_t;
54 typedef unsigned char flex_uint8_t; 
55 typedef unsigned short int flex_uint16_t;
56 typedef unsigned int flex_uint32_t;
57
58 /* Limits of integral types. */
59 #ifndef INT8_MIN
60 #define INT8_MIN               (-128)
61 #endif
62 #ifndef INT16_MIN
63 #define INT16_MIN              (-32767-1)
64 #endif
65 #ifndef INT32_MIN
66 #define INT32_MIN              (-2147483647-1)
67 #endif
68 #ifndef INT8_MAX
69 #define INT8_MAX               (127)
70 #endif
71 #ifndef INT16_MAX
72 #define INT16_MAX              (32767)
73 #endif
74 #ifndef INT32_MAX
75 #define INT32_MAX              (2147483647)
76 #endif
77 #ifndef UINT8_MAX
78 #define UINT8_MAX              (255U)
79 #endif
80 #ifndef UINT16_MAX
81 #define UINT16_MAX             (65535U)
82 #endif
83 #ifndef UINT32_MAX
84 #define UINT32_MAX             (4294967295U)
85 #endif
86
87 #endif /* ! C99 */
88
89 #endif /* ! FLEXINT_H */
90
91 #ifdef __cplusplus
92
93 /* The "const" storage-class-modifier is valid. */
94 #define YY_USE_CONST
95
96 #else   /* ! __cplusplus */
97
98 /* C99 requires __STDC__ to be defined as 1. */
99 #if defined (__STDC__)
100
101 #define YY_USE_CONST
102
103 #endif  /* defined (__STDC__) */
104 #endif  /* ! __cplusplus */
105
106 #ifdef YY_USE_CONST
107 #define yyconst const
108 #else
109 #define yyconst
110 #endif
111
112 /* Returned upon end-of-file. */
113 #define YY_NULL 0
114
115 /* Promotes a possibly negative, possibly signed char to an unsigned
116  * integer for use as an array index.  If the signed char is negative,
117  * we want to instead treat it as an 8-bit unsigned char, hence the
118  * double cast.
119  */
120 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
121
122 /* An opaque pointer. */
123 #ifndef YY_TYPEDEF_YY_SCANNER_T
124 #define YY_TYPEDEF_YY_SCANNER_T
125 typedef void* yyscan_t;
126 #endif
127
128 /* For convenience, these vars (plus the bison vars far below)
129    are macros in the reentrant scanner. */
130 #define yyin yyg->yyin_r
131 #define yyout yyg->yyout_r
132 #define yyextra yyg->yyextra_r
133 #define yyleng yyg->yyleng_r
134 #define yytext yyg->yytext_r
135 #define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
136 #define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
137 #define yy_flex_debug yyg->yy_flex_debug_r
138
139 /* Enter a start condition.  This macro really ought to take a parameter,
140  * but we do it the disgusting crufty way forced on us by the ()-less
141  * definition of BEGIN.
142  */
143 #define BEGIN yyg->yy_start = 1 + 2 *
144
145 /* Translate the current start state into a value that can be later handed
146  * to BEGIN to return to the state.  The YYSTATE alias is for lex
147  * compatibility.
148  */
149 #define YY_START ((yyg->yy_start - 1) / 2)
150 #define YYSTATE YY_START
151
152 /* Action number for EOF rule of a given start state. */
153 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
154
155 /* Special action meaning "start processing a new file". */
156 #define YY_NEW_FILE libconfig_yyrestart(yyin ,yyscanner )
157
158 #define YY_END_OF_BUFFER_CHAR 0
159
160 /* Size of default input buffer. */
161 #ifndef YY_BUF_SIZE
162 #define YY_BUF_SIZE 16384
163 #endif
164
165 /* The state buf must be large enough to hold one state per character in the main buffer.
166  */
167 #define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
168
169 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
170 #define YY_TYPEDEF_YY_BUFFER_STATE
171 typedef struct yy_buffer_state *YY_BUFFER_STATE;
172 #endif
173
174 #ifndef YY_TYPEDEF_YY_SIZE_T
175 #define YY_TYPEDEF_YY_SIZE_T
176 typedef size_t yy_size_t;
177 #endif
178
179 #define EOB_ACT_CONTINUE_SCAN 0
180 #define EOB_ACT_END_OF_FILE 1
181 #define EOB_ACT_LAST_MATCH 2
182
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.
189      */
190     #define  YY_LESS_LINENO(n) \
191             do { \
192                 int yyl;\
193                 for ( yyl = n; yyl < yyleng; ++yyl )\
194                     if ( yytext[yyl] == '\n' )\
195                         --yylineno;\
196             }while(0)
197     #define YY_LINENO_REWIND_TO(dst) \
198             do {\
199                 const char *p;\
200                 for ( p = yy_cp-1; p >= (dst); --p)\
201                     if ( *p == '\n' )\
202                         --yylineno;\
203             }while(0)
204     
205 /* Return all but the first "n" matched characters back to the input stream. */
206 #define yyless(n) \
207         do \
208                 { \
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 */ \
216                 } \
217         while ( 0 )
218
219 #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
220
221 #ifndef YY_STRUCT_YY_BUFFER_STATE
222 #define YY_STRUCT_YY_BUFFER_STATE
223 struct yy_buffer_state
224         {
225         FILE *yy_input_file;
226
227         char *yy_ch_buf;                /* input buffer */
228         char *yy_buf_pos;               /* current position in input buffer */
229
230         /* Size of input buffer in bytes, not including room for EOB
231          * characters.
232          */
233         yy_size_t yy_buf_size;
234
235         /* Number of characters read into yy_ch_buf, not including EOB
236          * characters.
237          */
238         yy_size_t yy_n_chars;
239
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
242          * delete it.
243          */
244         int yy_is_our_buffer;
245
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
249          * each newline.
250          */
251         int yy_is_interactive;
252
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
255          * not.
256          */
257         int yy_at_bol;
258
259     int yy_bs_lineno; /**< The line count. */
260     int yy_bs_column; /**< The column count. */
261     
262         /* Whether to try to fill the input buffer when we reach the
263          * end of it.
264          */
265         int yy_fill_buffer;
266
267         int yy_buffer_status;
268
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.
276          *
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.
280          */
281 #define YY_BUFFER_EOF_PENDING 2
282
283         };
284 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
285
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
288  * "scanner state".
289  *
290  * Returns the top of the stack, or NULL.
291  */
292 #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
293                           ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
294                           : NULL)
295
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.
298  */
299 #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
300
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 );
308
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 );
312
313 #define YY_FLUSH_BUFFER libconfig_yy_flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
314
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 );
318
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 );
322
323 #define yy_new_buffer libconfig_yy_create_buffer
324
325 #define yy_set_interactive(is_interactive) \
326         { \
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); \
331         } \
332         YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
333         }
334
335 #define yy_set_bol(at_bol) \
336         { \
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); \
341         } \
342         YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
343         }
344
345 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
346
347 #define libconfig_yywrap(yyscanner) 1
348 #define YY_SKIP_YYWRAP
349
350 typedef unsigned char YY_CHAR;
351
352 typedef int yy_state_type;
353
354 #define yytext_ptr yytext_r
355
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 );
360
361 /* Done after the current pattern has been matched and before the
362  * corresponding action - sets up yytext.
363  */
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; \
368         *yy_cp = '\0'; \
369         yyg->yy_c_buf_p = yy_cp;
370
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. */
375 struct yy_trans_info
376         {
377         flex_int32_t yy_verify;
378         flex_int32_t yy_nxt;
379         };
380 static yyconst flex_int16_t yy_accept[103] =
381     {   0,
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,
392
393        16,    0
394     } ;
395
396 static yyconst flex_int32_t yy_ec[256] =
397     {   0,
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,
408
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,
419
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,
425         1,    1,    1,    1,    1
426     } ;
427
428 static yyconst flex_int32_t yy_meta[49] =
429     {   0,
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
435     } ;
436
437 static yyconst flex_int16_t yy_base[113] =
438     {   0,
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,
449
450       204,  204,  169,  173,  177,  181,  183,  187,  191,   89,
451        66,   63
452     } ;
453
454 static yyconst flex_int16_t yy_def[113] =
455     {   0,
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,
466
467       102,    0,  102,  102,  102,  102,  102,  102,  102,  102,
468       102,  102
469     } ;
470
471 static yyconst flex_int16_t yy_nxt[253] =
472     {   0,
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,
483
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,
494
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,
500       102,  102
501     } ;
502
503 static yyconst flex_int16_t yy_chk[253] =
504     {   0,
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,
515
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,
526
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,
532       102,  102
533     } ;
534
535 /* Table of booleans, true if rule could match eol. */
536 static yyconst flex_int32_t yy_rule_can_match_eol[43] =
537     {   0,
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, 
540     0, 0, 0,     };
541
542 /* The intent behind this definition is that it'll catch
543  * any uses of REJECT which flex missed.
544  */
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
549 #line 1 "scanner.l"
550 /* -*- mode: C -*- */
551 /* --------------------------------------------------------------------------
552    libconfig - A library for processing structured configuration files
553    Copyright (C) 2005-2014  Mark A Lindner
554
555    This file is part of libconfig.
556
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.
561
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.
566
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    ----------------------------------------------------------------------------
571 */
572 #define YY_NO_UNISTD_H 1
573 #line 36 "scanner.l"
574
575 #ifdef _MSC_VER
576 #pragma warning (disable: 4996)
577 #endif
578
579 #include <stdlib.h>
580 #include <ctype.h>
581 #include <string.h>
582 #include "parsectx.h"
583 #include "scanctx.h"
584 #include "grammar.h"
585 #include "wincompat.h"
586
587 #define YY_NO_INPUT // Suppress generation of useless input() function
588
589 static unsigned long long fromhex(const char *s)
590 {
591 #ifdef __MINGW32__
592
593   /* MinGW's strtoull() seems to be broken; it only returns the lower
594    * 32 bits...
595    */
596
597   const char *p = s;
598   unsigned long long val = 0;
599
600   if(*p != '0')
601     return(0);
602
603   ++p;
604
605   if(*p != 'x' && *p != 'X')
606     return(0);
607
608   for(++p; isxdigit(*p); ++p)
609   {
610     val <<= 4;
611     val |= ((*p < 'A') ? (*p & 0xF) : (9 + (*p & 0x7)));
612   }
613
614   return(val);
615
616 #else /* ! __MINGW32__ */
617
618   return(strtoull(s, NULL, 16));
619
620 #endif /* __MINGW32__ */
621 }
622
623
624 #line 625 "scanner.c"
625
626 #define INITIAL 0
627 #define COMMENT 1
628 #define STRING 2
629 #define INCLUDE 3
630
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.
635  */
636 #include <unistd.h>
637 #endif
638
639 #define YY_EXTRA_TYPE struct scan_context *
640
641 /* Holds the entire state of the reentrant scanner. */
642 struct yyguts_t
643     {
644
645     /* User-defined. Not touched by flex. */
646     YY_EXTRA_TYPE yyextra_r;
647
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. */
653     char yy_hold_char;
654     yy_size_t yy_n_chars;
655     yy_size_t yyleng_r;
656     char *yy_c_buf_p;
657     int yy_init;
658     int yy_start;
659     int yy_did_buffer_switch_on_eof;
660     int yy_start_stack_ptr;
661     int yy_start_stack_depth;
662     int *yy_start_stack;
663     yy_state_type yy_last_accepting_state;
664     char* yy_last_accepting_cpos;
665
666     int yylineno_r;
667     int yy_flex_debug_r;
668
669     char *yytext_r;
670     int yy_more_flag;
671     int yy_more_len;
672
673     YYSTYPE * yylval_r;
674
675     }; /* end struct yyguts_t */
676
677 static int yy_init_globals (yyscan_t yyscanner );
678
679     /* This must go here because YYSTYPE and YYLTYPE are included
680      * from bison output in section 1.*/
681     #    define yylval yyg->yylval_r
682     
683 int libconfig_yylex_init (yyscan_t* scanner);
684
685 int libconfig_yylex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
686
687 /* Accessor methods to globals.
688    These are made visible to non-reentrant scanners for convenience. */
689
690 int libconfig_yylex_destroy (yyscan_t yyscanner );
691
692 int libconfig_yyget_debug (yyscan_t yyscanner );
693
694 void libconfig_yyset_debug (int debug_flag ,yyscan_t yyscanner );
695
696 YY_EXTRA_TYPE libconfig_yyget_extra (yyscan_t yyscanner );
697
698 void libconfig_yyset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
699
700 FILE *libconfig_yyget_in (yyscan_t yyscanner );
701
702 void libconfig_yyset_in  (FILE * in_str ,yyscan_t yyscanner );
703
704 FILE *libconfig_yyget_out (yyscan_t yyscanner );
705
706 void libconfig_yyset_out  (FILE * out_str ,yyscan_t yyscanner );
707
708 yy_size_t libconfig_yyget_leng (yyscan_t yyscanner );
709
710 char *libconfig_yyget_text (yyscan_t yyscanner );
711
712 int libconfig_yyget_lineno (yyscan_t yyscanner );
713
714 void libconfig_yyset_lineno (int line_number ,yyscan_t yyscanner );
715
716 int libconfig_yyget_column  (yyscan_t yyscanner );
717
718 void libconfig_yyset_column (int column_no ,yyscan_t yyscanner );
719
720 YYSTYPE * libconfig_yyget_lval (yyscan_t yyscanner );
721
722 void libconfig_yyset_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner );
723
724 /* Macros after this point can all be overridden by user definitions in
725  * section 1.
726  */
727
728 #ifndef YY_SKIP_YYWRAP
729 #ifdef __cplusplus
730 extern "C" int libconfig_yywrap (yyscan_t yyscanner );
731 #else
732 extern int libconfig_yywrap (yyscan_t yyscanner );
733 #endif
734 #endif
735
736 #ifndef yytext_ptr
737 static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
738 #endif
739
740 #ifdef YY_NEED_STRLEN
741 static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
742 #endif
743
744 #ifndef YY_NO_INPUT
745
746 #ifdef __cplusplus
747 static int yyinput (yyscan_t yyscanner );
748 #else
749 static int input (yyscan_t yyscanner );
750 #endif
751
752 #endif
753
754 /* Amount of stuff to slurp up with each read. */
755 #ifndef YY_READ_BUF_SIZE
756 #define YY_READ_BUF_SIZE 8192
757 #endif
758
759 /* Copy whatever the last rule matched to the standard output. */
760 #ifndef ECHO
761 /* This used to be an fputs(), but since the string might contain NUL's,
762  * we now use fwrite().
763  */
764 #define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
765 #endif
766
767 /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
768  * is returned in "result".
769  */
770 #ifndef YY_INPUT
771 #define YY_INPUT(buf,result,max_size) \
772         if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
773                 { \
774                 int c = '*'; \
775                 size_t n; \
776                 for ( n = 0; n < max_size && \
777                              (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
778                         buf[n] = (char) c; \
779                 if ( c == '\n' ) \
780                         buf[n++] = (char) c; \
781                 if ( c == EOF && ferror( yyin ) ) \
782                         YY_FATAL_ERROR( "input in flex scanner failed" ); \
783                 result = n; \
784                 } \
785         else \
786                 { \
787                 errno=0; \
788                 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
789                         { \
790                         if( errno != EINTR) \
791                                 { \
792                                 YY_FATAL_ERROR( "input in flex scanner failed" ); \
793                                 break; \
794                                 } \
795                         errno=0; \
796                         clearerr(yyin); \
797                         } \
798                 }\
799 \
800
801 #endif
802
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.
806  */
807 #ifndef yyterminate
808 #define yyterminate() return YY_NULL
809 #endif
810
811 /* Number of entries by which start-condition stack grows. */
812 #ifndef YY_START_STACK_INCR
813 #define YY_START_STACK_INCR 25
814 #endif
815
816 /* Report a fatal error. */
817 #ifndef YY_FATAL_ERROR
818 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
819 #endif
820
821 /* end tables serialization structures and prototypes */
822
823 /* Default declaration of generated scanner - a define so the user can
824  * easily add parameters.
825  */
826 #ifndef YY_DECL
827 #define YY_DECL_IS_OURS 1
828
829 extern int libconfig_yylex \
830                (YYSTYPE * yylval_param ,yyscan_t yyscanner);
831
832 #define YY_DECL int libconfig_yylex \
833                (YYSTYPE * yylval_param , yyscan_t yyscanner)
834 #endif /* !YY_DECL */
835
836 /* Code executed at the beginning of each rule, after yytext and yyleng
837  * have been set up.
838  */
839 #ifndef YY_USER_ACTION
840 #define YY_USER_ACTION
841 #endif
842
843 /* Code executed at the end of each rule. */
844 #ifndef YY_BREAK
845 #define YY_BREAK break;
846 #endif
847
848 #define YY_RULE_SETUP \
849         if ( yyleng > 0 ) \
850                 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
851                                 (yytext[yyleng - 1] == '\n'); \
852         YY_USER_ACTION
853
854 /** The main scanner function which does all the work.
855  */
856 YY_DECL
857 {
858         register yy_state_type yy_current_state;
859         register char *yy_cp, *yy_bp;
860         register int yy_act;
861     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
862
863     yylval = yylval_param;
864
865         if ( !yyg->yy_init )
866                 {
867                 yyg->yy_init = 1;
868
869 #ifdef YY_USER_INIT
870                 YY_USER_INIT;
871 #endif
872
873                 if ( ! yyg->yy_start )
874                         yyg->yy_start = 1;      /* first start state */
875
876                 if ( ! yyin )
877                         yyin = stdin;
878
879                 if ( ! yyout )
880                         yyout = stdout;
881
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);
886                 }
887
888                 libconfig_yy_load_buffer_state(yyscanner );
889                 }
890
891         {
892 #line 101 "scanner.l"
893
894
895 #line 896 "scanner.c"
896
897         while ( 1 )             /* loops until end-of-file is reached */
898                 {
899                 yy_cp = yyg->yy_c_buf_p;
900
901                 /* Support of yytext. */
902                 *yy_cp = yyg->yy_hold_char;
903
904                 /* yy_bp points to the position in yy_ch_buf of the start of
905                  * the current run.
906                  */
907                 yy_bp = yy_cp;
908
909                 yy_current_state = yyg->yy_start;
910                 yy_current_state += YY_AT_BOL();
911 yy_match:
912                 do
913                         {
914                         register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
915                         if ( yy_accept[yy_current_state] )
916                                 {
917                                 yyg->yy_last_accepting_state = yy_current_state;
918                                 yyg->yy_last_accepting_cpos = yy_cp;
919                                 }
920                         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
921                                 {
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];
925                                 }
926                         yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
927                         ++yy_cp;
928                         }
929                 while ( yy_current_state != 102 );
930                 yy_cp = yyg->yy_last_accepting_cpos;
931                 yy_current_state = yyg->yy_last_accepting_state;
932
933 yy_find_action:
934                 yy_act = yy_accept[yy_current_state];
935
936                 YY_DO_BEFORE_ACTION;
937
938                 if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
939                         {
940                         yy_size_t yyl;
941                         for ( yyl = 0; yyl < yyleng; ++yyl )
942                                 if ( yytext[yyl] == '\n' )
943                                            
944     do{ yylineno++;
945         yycolumn=0;
946     }while(0)
947 ;
948                         }
949
950 do_action:      /* This label is used only to access EOF actions. */
951
952                 switch ( yy_act )
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;
959                         goto yy_find_action;
960
961 case 1:
962 YY_RULE_SETUP
963 #line 103 "scanner.l"
964 { BEGIN COMMENT; }
965         YY_BREAK
966 case 2:
967 YY_RULE_SETUP
968 #line 104 "scanner.l"
969 { BEGIN INITIAL; }
970         YY_BREAK
971 case 3:
972 YY_RULE_SETUP
973 #line 105 "scanner.l"
974 { /* ignore */ }
975         YY_BREAK
976 case 4:
977 /* rule 4 can match eol */
978 YY_RULE_SETUP
979 #line 106 "scanner.l"
980 { /* ignore */ }
981         YY_BREAK
982 case 5:
983 YY_RULE_SETUP
984 #line 108 "scanner.l"
985 { BEGIN STRING; }
986         YY_BREAK
987 case 6:
988 /* rule 6 can match eol */
989 YY_RULE_SETUP
990 #line 109 "scanner.l"
991 { scanctx_append_string(yyextra, yytext); }
992         YY_BREAK
993 case 7:
994 YY_RULE_SETUP
995 #line 110 "scanner.l"
996 { scanctx_append_string(yyextra, "\n"); }
997         YY_BREAK
998 case 8:
999 YY_RULE_SETUP
1000 #line 111 "scanner.l"
1001 { scanctx_append_string(yyextra, "\r"); }
1002         YY_BREAK
1003 case 9:
1004 YY_RULE_SETUP
1005 #line 112 "scanner.l"
1006 { scanctx_append_string(yyextra, "\t"); }
1007         YY_BREAK
1008 case 10:
1009 YY_RULE_SETUP
1010 #line 113 "scanner.l"
1011 { scanctx_append_string(yyextra, "\f"); }
1012         YY_BREAK
1013 case 11:
1014 YY_RULE_SETUP
1015 #line 114 "scanner.l"
1016 { scanctx_append_string(yyextra, "\\"); }
1017         YY_BREAK
1018 case 12:
1019 YY_RULE_SETUP
1020 #line 115 "scanner.l"
1021 { scanctx_append_string(yyextra, "\""); }
1022         YY_BREAK
1023 case 13:
1024 YY_RULE_SETUP
1025 #line 116 "scanner.l"
1026 {
1027                     char c[2] = { (char)(strtol(yytext + 2, NULL, 16) & 0xFF),
1028                                   0 };
1029                     scanctx_append_string(yyextra, c);
1030                   }
1031         YY_BREAK
1032 case 14:
1033 YY_RULE_SETUP
1034 #line 121 "scanner.l"
1035 { scanctx_append_string(yyextra, "\\"); }
1036         YY_BREAK
1037 case 15:
1038 YY_RULE_SETUP
1039 #line 122 "scanner.l"
1040 {
1041                     yylval->sval = scanctx_take_string(yyextra);
1042                     BEGIN INITIAL;
1043                     return(TOK_STRING);
1044                   }
1045         YY_BREAK
1046 case 16:
1047 YY_RULE_SETUP
1048 #line 128 "scanner.l"
1049 { BEGIN INCLUDE; }
1050         YY_BREAK
1051 case 17:
1052 /* rule 17 can match eol */
1053 YY_RULE_SETUP
1054 #line 129 "scanner.l"
1055 { scanctx_append_string(yyextra, yytext); }
1056         YY_BREAK
1057 case 18:
1058 YY_RULE_SETUP
1059 #line 130 "scanner.l"
1060 { scanctx_append_string(yyextra, "\\"); }
1061         YY_BREAK
1062 case 19:
1063 YY_RULE_SETUP
1064 #line 131 "scanner.l"
1065 { scanctx_append_string(yyextra, "\""); }
1066         YY_BREAK
1067 case 20:
1068 YY_RULE_SETUP
1069 #line 132 "scanner.l"
1070 {
1071                     const char *error;
1072                     FILE *fp = scanctx_push_include(yyextra,
1073                                                     (void *)YY_CURRENT_BUFFER,
1074                                                     &error);
1075                     if(fp)
1076                     {
1077                       yyin = fp;
1078                       libconfig_yy_switch_to_buffer(libconfig_yy_create_buffer(yyin,YY_BUF_SIZE,yyscanner),yyscanner);
1079                     }
1080                     else
1081                     {
1082                       yyextra->config->error_text = error;
1083                       yyextra->config->error_file = scanctx_current_filename(
1084                         yyextra);
1085                       yyextra->config->error_line = libconfig_yyget_lineno(
1086                         yyscanner);
1087                       return TOK_ERROR;
1088                     }
1089                     BEGIN INITIAL;
1090                   }
1091         YY_BREAK
1092 case 21:
1093 /* rule 21 can match eol */
1094 YY_RULE_SETUP
1095 #line 156 "scanner.l"
1096 { /* ignore */ }
1097         YY_BREAK
1098 case 22:
1099 YY_RULE_SETUP
1100 #line 157 "scanner.l"
1101 { /* ignore */ }
1102         YY_BREAK
1103 case 23:
1104 YY_RULE_SETUP
1105 #line 159 "scanner.l"
1106 { return(TOK_EQUALS); }
1107         YY_BREAK
1108 case 24:
1109 YY_RULE_SETUP
1110 #line 160 "scanner.l"
1111 { return(TOK_COMMA); }
1112         YY_BREAK
1113 case 25:
1114 YY_RULE_SETUP
1115 #line 161 "scanner.l"
1116 { return(TOK_GROUP_START); }
1117         YY_BREAK
1118 case 26:
1119 YY_RULE_SETUP
1120 #line 162 "scanner.l"
1121 { return(TOK_GROUP_END); }
1122         YY_BREAK
1123 case 27:
1124 YY_RULE_SETUP
1125 #line 163 "scanner.l"
1126 { yylval->ival = 1; return(TOK_BOOLEAN); }
1127         YY_BREAK
1128 case 28:
1129 YY_RULE_SETUP
1130 #line 164 "scanner.l"
1131 { yylval->ival = 0; return(TOK_BOOLEAN); }
1132         YY_BREAK
1133 case 29:
1134 YY_RULE_SETUP
1135 #line 165 "scanner.l"
1136 { yylval->sval = yytext; return(TOK_NAME); }
1137         YY_BREAK
1138 case 30:
1139 YY_RULE_SETUP
1140 #line 166 "scanner.l"
1141 { yylval->fval = atof(yytext); return(TOK_FLOAT); }
1142         YY_BREAK
1143 case 31:
1144 YY_RULE_SETUP
1145 #line 167 "scanner.l"
1146 { yylval->ival = atoi(yytext); return(TOK_INTEGER); }
1147         YY_BREAK
1148 case 32:
1149 YY_RULE_SETUP
1150 #line 168 "scanner.l"
1151 { yylval->llval = atoll(yytext); return(TOK_INTEGER64); }
1152         YY_BREAK
1153 case 33:
1154 YY_RULE_SETUP
1155 #line 169 "scanner.l"
1156 {
1157                     yylval->ival = strtoul(yytext, NULL, 16);
1158                     return(TOK_HEX);
1159                   }
1160         YY_BREAK
1161 case 34:
1162 YY_RULE_SETUP
1163 #line 173 "scanner.l"
1164 { yylval->llval = fromhex(yytext); return(TOK_HEX64); }
1165         YY_BREAK
1166 case 35:
1167 YY_RULE_SETUP
1168 #line 174 "scanner.l"
1169 { return(TOK_ARRAY_START); }
1170         YY_BREAK
1171 case 36:
1172 YY_RULE_SETUP
1173 #line 175 "scanner.l"
1174 { return(TOK_ARRAY_END); }
1175         YY_BREAK
1176 case 37:
1177 YY_RULE_SETUP
1178 #line 176 "scanner.l"
1179 { return(TOK_LIST_START); }
1180         YY_BREAK
1181 case 38:
1182 YY_RULE_SETUP
1183 #line 177 "scanner.l"
1184 { return(TOK_LIST_END); }
1185         YY_BREAK
1186 case 39:
1187 YY_RULE_SETUP
1188 #line 178 "scanner.l"
1189 { return(TOK_SEMICOLON); }
1190         YY_BREAK
1191 case 40:
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 */
1195 YY_RULE_SETUP
1196 #line 179 "scanner.l"
1197 { /* ignore */ }
1198         YY_BREAK
1199 case 41:
1200 YY_RULE_SETUP
1201 #line 180 "scanner.l"
1202 { return(TOK_GARBAGE); }
1203         YY_BREAK
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"
1209 {
1210                     YY_BUFFER_STATE buf = (YY_BUFFER_STATE)scanctx_pop_include(
1211                       yyextra);
1212                     if(buf)
1213                     {
1214                       libconfig_yy_delete_buffer(YY_CURRENT_BUFFER,yyscanner);
1215                       libconfig_yy_switch_to_buffer(buf,yyscanner);
1216                     }
1217                     else
1218                       yyterminate();
1219                   }
1220         YY_BREAK
1221 case 42:
1222 YY_RULE_SETUP
1223 #line 193 "scanner.l"
1224 ECHO;
1225         YY_BREAK
1226 #line 1227 "scanner.c"
1227
1228         case YY_END_OF_BUFFER:
1229                 {
1230                 /* Amount of text matched not including the EOB char. */
1231                 int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
1232
1233                 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1234                 *yy_cp = yyg->yy_hold_char;
1235                 YY_RESTORE_YY_MORE_OFFSET
1236
1237                 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1238                         {
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.
1247                          */
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;
1251                         }
1252
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
1258                  * in input().
1259                  */
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;
1263
1264                         yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
1265
1266                         yy_current_state = yy_get_previous_state( yyscanner );
1267
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).
1275                          */
1276
1277                         yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
1278
1279                         yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1280
1281                         if ( yy_next_state )
1282                                 {
1283                                 /* Consume the NUL. */
1284                                 yy_cp = ++yyg->yy_c_buf_p;
1285                                 yy_current_state = yy_next_state;
1286                                 goto yy_match;
1287                                 }
1288
1289                         else
1290                                 {
1291                                 yy_cp = yyg->yy_last_accepting_cpos;
1292                                 yy_current_state = yyg->yy_last_accepting_state;
1293                                 goto yy_find_action;
1294                                 }
1295                         }
1296
1297                 else switch ( yy_get_next_buffer( yyscanner ) )
1298                         {
1299                         case EOB_ACT_END_OF_FILE:
1300                                 {
1301                                 yyg->yy_did_buffer_switch_on_eof = 0;
1302
1303                                 if ( libconfig_yywrap(yyscanner ) )
1304                                         {
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.
1313                                          */
1314                                         yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
1315
1316                                         yy_act = YY_STATE_EOF(YY_START);
1317                                         goto do_action;
1318                                         }
1319
1320                                 else
1321                                         {
1322                                         if ( ! yyg->yy_did_buffer_switch_on_eof )
1323                                                 YY_NEW_FILE;
1324                                         }
1325                                 break;
1326                                 }
1327
1328                         case EOB_ACT_CONTINUE_SCAN:
1329                                 yyg->yy_c_buf_p =
1330                                         yyg->yytext_ptr + yy_amount_of_matched_text;
1331
1332                                 yy_current_state = yy_get_previous_state( yyscanner );
1333
1334                                 yy_cp = yyg->yy_c_buf_p;
1335                                 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1336                                 goto yy_match;
1337
1338                         case EOB_ACT_LAST_MATCH:
1339                                 yyg->yy_c_buf_p =
1340                                 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
1341
1342                                 yy_current_state = yy_get_previous_state( yyscanner );
1343
1344                                 yy_cp = yyg->yy_c_buf_p;
1345                                 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1346                                 goto yy_find_action;
1347                         }
1348                 break;
1349                 }
1350
1351         default:
1352                 YY_FATAL_ERROR(
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 */
1358
1359 /* yy_get_next_buffer - try to read in a new buffer
1360  *
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
1365  */
1366 static int yy_get_next_buffer (yyscan_t yyscanner)
1367 {
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;
1372         int ret_val;
1373
1374         if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
1375                 YY_FATAL_ERROR(
1376                 "fatal flex scanner internal error--end of buffer missed" );
1377
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 )
1381                         {
1382                         /* We matched a single character, the EOB, so
1383                          * treat this as a final EOF.
1384                          */
1385                         return EOB_ACT_END_OF_FILE;
1386                         }
1387
1388                 else
1389                         {
1390                         /* We matched some text prior to the EOB, first
1391                          * process it.
1392                          */
1393                         return EOB_ACT_LAST_MATCH;
1394                         }
1395                 }
1396
1397         /* Try to read more data. */
1398
1399         /* First move last chars to start of buffer. */
1400         number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;
1401
1402         for ( i = 0; i < number_to_move; ++i )
1403                 *(dest++) = *(source++);
1404
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,
1407                  * just force an EOF
1408                  */
1409                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
1410
1411         else
1412                 {
1413                         yy_size_t num_to_read =
1414                         YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1415
1416                 while ( num_to_read <= 0 )
1417                         { /* Not enough room in the buffer - grow it. */
1418
1419                         /* just a shorter name for the current buffer */
1420                         YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
1421
1422                         int yy_c_buf_p_offset =
1423                                 (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
1424
1425                         if ( b->yy_is_our_buffer )
1426                                 {
1427                                 yy_size_t new_size = b->yy_buf_size * 2;
1428
1429                                 if ( new_size <= 0 )
1430                                         b->yy_buf_size += b->yy_buf_size / 8;
1431                                 else
1432                                         b->yy_buf_size *= 2;
1433
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 );
1437                                 }
1438                         else
1439                                 /* Can't grow it, we don't own it. */
1440                                 b->yy_ch_buf = 0;
1441
1442                         if ( ! b->yy_ch_buf )
1443                                 YY_FATAL_ERROR(
1444                                 "fatal error - scanner input buffer overflow" );
1445
1446                         yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1447
1448                         num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1449                                                 number_to_move - 1;
1450
1451                         }
1452
1453                 if ( num_to_read > YY_READ_BUF_SIZE )
1454                         num_to_read = YY_READ_BUF_SIZE;
1455
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 );
1459
1460                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1461                 }
1462
1463         if ( yyg->yy_n_chars == 0 )
1464                 {
1465                 if ( number_to_move == YY_MORE_ADJ )
1466                         {
1467                         ret_val = EOB_ACT_END_OF_FILE;
1468                         libconfig_yyrestart(yyin  ,yyscanner);
1469                         }
1470
1471                 else
1472                         {
1473                         ret_val = EOB_ACT_LAST_MATCH;
1474                         YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1475                                 YY_BUFFER_EOF_PENDING;
1476                         }
1477                 }
1478
1479         else
1480                 ret_val = EOB_ACT_CONTINUE_SCAN;
1481
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()" );
1488         }
1489
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;
1493
1494         yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1495
1496         return ret_val;
1497 }
1498
1499 /* yy_get_previous_state - get the state just before the EOB char was reached */
1500
1501     static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
1502 {
1503         register yy_state_type yy_current_state;
1504         register char *yy_cp;
1505     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1506
1507         yy_current_state = yyg->yy_start;
1508         yy_current_state += YY_AT_BOL();
1509
1510         for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
1511                 {
1512                 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1513                 if ( yy_accept[yy_current_state] )
1514                         {
1515                         yyg->yy_last_accepting_state = yy_current_state;
1516                         yyg->yy_last_accepting_cpos = yy_cp;
1517                         }
1518                 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1519                         {
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];
1523                         }
1524                 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1525                 }
1526
1527         return yy_current_state;
1528 }
1529
1530 /* yy_try_NUL_trans - try to make a transition on the NUL character
1531  *
1532  * synopsis
1533  *      next_state = yy_try_NUL_trans( current_state );
1534  */
1535     static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state , yyscan_t yyscanner)
1536 {
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;
1540
1541         register YY_CHAR yy_c = 1;
1542         if ( yy_accept[yy_current_state] )
1543                 {
1544                 yyg->yy_last_accepting_state = yy_current_state;
1545                 yyg->yy_last_accepting_cpos = yy_cp;
1546                 }
1547         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1548                 {
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];
1552                 }
1553         yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1554         yy_is_jam = (yy_current_state == 102);
1555
1556         (void)yyg;
1557         return yy_is_jam ? 0 : yy_current_state;
1558 }
1559
1560 #ifndef YY_NO_INPUT
1561 #ifdef __cplusplus
1562     static int yyinput (yyscan_t yyscanner)
1563 #else
1564     static int input  (yyscan_t yyscanner)
1565 #endif
1566
1567 {
1568         int c;
1569     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1570
1571         *yyg->yy_c_buf_p = yyg->yy_hold_char;
1572
1573         if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1574                 {
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.
1578                  */
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';
1582
1583                 else
1584                         { /* need more input */
1585                         yy_size_t offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
1586                         ++yyg->yy_c_buf_p;
1587
1588                         switch ( yy_get_next_buffer( yyscanner ) )
1589                                 {
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.
1599                                          */
1600
1601                                         /* Reset buffer status. */
1602                                         libconfig_yyrestart(yyin ,yyscanner);
1603
1604                                         /*FALLTHROUGH*/
1605
1606                                 case EOB_ACT_END_OF_FILE:
1607                                         {
1608                                         if ( libconfig_yywrap(yyscanner ) )
1609                                                 return EOF;
1610
1611                                         if ( ! yyg->yy_did_buffer_switch_on_eof )
1612                                                 YY_NEW_FILE;
1613 #ifdef __cplusplus
1614                                         return yyinput(yyscanner);
1615 #else
1616                                         return input(yyscanner);
1617 #endif
1618                                         }
1619
1620                                 case EOB_ACT_CONTINUE_SCAN:
1621                                         yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
1622                                         break;
1623                                 }
1624                         }
1625                 }
1626
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;
1630
1631         YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n');
1632         if ( YY_CURRENT_BUFFER_LVALUE->yy_at_bol )
1633                    
1634     do{ yylineno++;
1635         yycolumn=0;
1636     }while(0)
1637 ;
1638
1639         return c;
1640 }
1641 #endif  /* ifndef YY_NO_INPUT */
1642
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 .
1647  */
1648     void libconfig_yyrestart  (FILE * input_file , yyscan_t yyscanner)
1649 {
1650     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1651
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);
1656         }
1657
1658         libconfig_yy_init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
1659         libconfig_yy_load_buffer_state(yyscanner );
1660 }
1661
1662 /** Switch to a different input buffer.
1663  * @param new_buffer The new input buffer.
1664  * @param yyscanner The scanner object.
1665  */
1666     void libconfig_yy_switch_to_buffer  (YY_BUFFER_STATE  new_buffer , yyscan_t yyscanner)
1667 {
1668     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1669
1670         /* TODO. We should be able to replace this entire function body
1671          * with
1672          *              libconfig_yypop_buffer_state();
1673          *              libconfig_yypush_buffer_state(new_buffer);
1674      */
1675         libconfig_yyensure_buffer_stack (yyscanner);
1676         if ( YY_CURRENT_BUFFER == new_buffer )
1677                 return;
1678
1679         if ( YY_CURRENT_BUFFER )
1680                 {
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;
1685                 }
1686
1687         YY_CURRENT_BUFFER_LVALUE = new_buffer;
1688         libconfig_yy_load_buffer_state(yyscanner );
1689
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.
1694          */
1695         yyg->yy_did_buffer_switch_on_eof = 1;
1696 }
1697
1698 static void libconfig_yy_load_buffer_state  (yyscan_t yyscanner)
1699 {
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;
1705 }
1706
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.
1712  */
1713     YY_BUFFER_STATE libconfig_yy_create_buffer  (FILE * file, int  size , yyscan_t yyscanner)
1714 {
1715         YY_BUFFER_STATE b;
1716     
1717         b = (YY_BUFFER_STATE) libconfig_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
1718         if ( ! b )
1719                 YY_FATAL_ERROR( "out of dynamic memory in libconfig_yy_create_buffer()" );
1720
1721         b->yy_buf_size = size;
1722
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.
1725          */
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()" );
1729
1730         b->yy_is_our_buffer = 1;
1731
1732         libconfig_yy_init_buffer(b,file ,yyscanner);
1733
1734         return b;
1735 }
1736
1737 /** Destroy the buffer.
1738  * @param b a buffer created with libconfig_yy_create_buffer()
1739  * @param yyscanner The scanner object.
1740  */
1741     void libconfig_yy_delete_buffer (YY_BUFFER_STATE  b , yyscan_t yyscanner)
1742 {
1743     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1744
1745         if ( ! b )
1746                 return;
1747
1748         if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1749                 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1750
1751         if ( b->yy_is_our_buffer )
1752                 libconfig_yyfree((void *) b->yy_ch_buf ,yyscanner );
1753
1754         libconfig_yyfree((void *) b ,yyscanner );
1755 }
1756
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.
1760  */
1761     static void libconfig_yy_init_buffer  (YY_BUFFER_STATE  b, FILE * file , yyscan_t yyscanner)
1762
1763 {
1764         int oerrno = errno;
1765     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1766
1767         libconfig_yy_flush_buffer(b ,yyscanner);
1768
1769         b->yy_input_file = file;
1770         b->yy_fill_buffer = 1;
1771
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.
1775      */
1776     if (b != YY_CURRENT_BUFFER){
1777         b->yy_bs_lineno = 1;
1778         b->yy_bs_column = 0;
1779     }
1780
1781         b->yy_is_interactive = 0;
1782     
1783         errno = oerrno;
1784 }
1785
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.
1789  */
1790     void libconfig_yy_flush_buffer (YY_BUFFER_STATE  b , yyscan_t yyscanner)
1791 {
1792     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1793         if ( ! b )
1794                 return;
1795
1796         b->yy_n_chars = 0;
1797
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.
1801          */
1802         b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1803         b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1804
1805         b->yy_buf_pos = &b->yy_ch_buf[0];
1806
1807         b->yy_at_bol = 1;
1808         b->yy_buffer_status = YY_BUFFER_NEW;
1809
1810         if ( b == YY_CURRENT_BUFFER )
1811                 libconfig_yy_load_buffer_state(yyscanner );
1812 }
1813
1814 /** Pushes the new state onto the stack. The new state becomes
1815  *  the current state. This function will allocate the stack
1816  *  if necessary.
1817  *  @param new_buffer The new state.
1818  *  @param yyscanner The scanner object.
1819  */
1820 void libconfig_yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
1821 {
1822     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1823         if (new_buffer == NULL)
1824                 return;
1825
1826         libconfig_yyensure_buffer_stack(yyscanner);
1827
1828         /* This block is copied from libconfig_yy_switch_to_buffer. */
1829         if ( YY_CURRENT_BUFFER )
1830                 {
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;
1835                 }
1836
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;
1841
1842         /* copied from libconfig_yy_switch_to_buffer. */
1843         libconfig_yy_load_buffer_state(yyscanner );
1844         yyg->yy_did_buffer_switch_on_eof = 1;
1845 }
1846
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.
1850  */
1851 void libconfig_yypop_buffer_state (yyscan_t yyscanner)
1852 {
1853     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1854         if (!YY_CURRENT_BUFFER)
1855                 return;
1856
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;
1861
1862         if (YY_CURRENT_BUFFER) {
1863                 libconfig_yy_load_buffer_state(yyscanner );
1864                 yyg->yy_did_buffer_switch_on_eof = 1;
1865         }
1866 }
1867
1868 /* Allocates the stack if it does not exist.
1869  *  Guarantees space for at least one push.
1870  */
1871 static void libconfig_yyensure_buffer_stack (yyscan_t yyscanner)
1872 {
1873         yy_size_t num_to_alloc;
1874     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1875
1876         if (!yyg->yy_buffer_stack) {
1877
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.
1881          */
1882                 num_to_alloc = 1;
1883                 yyg->yy_buffer_stack = (struct yy_buffer_state**)libconfig_yyalloc
1884                                                                 (num_to_alloc * sizeof(struct yy_buffer_state*)
1885                                                                 , yyscanner);
1886                 if ( ! yyg->yy_buffer_stack )
1887                         YY_FATAL_ERROR( "out of dynamic memory in libconfig_yyensure_buffer_stack()" );
1888                                                                   
1889                 memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1890                                 
1891                 yyg->yy_buffer_stack_max = num_to_alloc;
1892                 yyg->yy_buffer_stack_top = 0;
1893                 return;
1894         }
1895
1896         if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
1897
1898                 /* Increase the buffer to prepare for a possible push. */
1899                 int grow_size = 8 /* arbitrary grow size */;
1900
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*)
1905                                                                 , yyscanner);
1906                 if ( ! yyg->yy_buffer_stack )
1907                         YY_FATAL_ERROR( "out of dynamic memory in libconfig_yyensure_buffer_stack()" );
1908
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;
1912         }
1913 }
1914
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. 
1920  */
1921 YY_BUFFER_STATE libconfig_yy_scan_buffer  (char * base, yy_size_t  size , yyscan_t yyscanner)
1922 {
1923         YY_BUFFER_STATE b;
1924     
1925         if ( size < 2 ||
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. */
1929                 return 0;
1930
1931         b = (YY_BUFFER_STATE) libconfig_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
1932         if ( ! b )
1933                 YY_FATAL_ERROR( "out of dynamic memory in libconfig_yy_scan_buffer()" );
1934
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;
1941         b->yy_at_bol = 1;
1942         b->yy_fill_buffer = 0;
1943         b->yy_buffer_status = YY_BUFFER_NEW;
1944
1945         libconfig_yy_switch_to_buffer(b ,yyscanner );
1946
1947         return b;
1948 }
1949
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.
1957  */
1958 YY_BUFFER_STATE libconfig_yy_scan_string (yyconst char * yystr , yyscan_t yyscanner)
1959 {
1960     
1961         return libconfig_yy_scan_bytes(yystr,strlen(yystr) ,yyscanner);
1962 }
1963
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.
1970  */
1971 YY_BUFFER_STATE libconfig_yy_scan_bytes  (yyconst char * yybytes, yy_size_t  _yybytes_len , yyscan_t yyscanner)
1972 {
1973         YY_BUFFER_STATE b;
1974         char *buf;
1975         yy_size_t n;
1976         yy_size_t i;
1977     
1978         /* Get memory for full buffer, including space for trailing EOB's. */
1979         n = _yybytes_len + 2;
1980         buf = (char *) libconfig_yyalloc(n ,yyscanner );
1981         if ( ! buf )
1982                 YY_FATAL_ERROR( "out of dynamic memory in libconfig_yy_scan_bytes()" );
1983
1984         for ( i = 0; i < _yybytes_len; ++i )
1985                 buf[i] = yybytes[i];
1986
1987         buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1988
1989         b = libconfig_yy_scan_buffer(buf,n ,yyscanner);
1990         if ( ! b )
1991                 YY_FATAL_ERROR( "bad buffer in libconfig_yy_scan_bytes()" );
1992
1993         /* It's okay to grow etc. this buffer, and we should throw it
1994          * away when we're done.
1995          */
1996         b->yy_is_our_buffer = 1;
1997
1998         return b;
1999 }
2000
2001 #ifndef YY_EXIT_FAILURE
2002 #define YY_EXIT_FAILURE 2
2003 #endif
2004
2005 static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
2006 {
2007         (void) fprintf( stderr, "%s\n", msg );
2008         exit( YY_EXIT_FAILURE );
2009 }
2010
2011 /* Redefine yyless() so it works in section 3 code. */
2012
2013 #undef yyless
2014 #define yyless(n) \
2015         do \
2016                 { \
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; \
2025                 } \
2026         while ( 0 )
2027
2028 /* Accessor  methods (get/set functions) to struct members. */
2029
2030 /** Get the user-defined data for this scanner.
2031  * @param yyscanner The scanner object.
2032  */
2033 YY_EXTRA_TYPE libconfig_yyget_extra  (yyscan_t yyscanner)
2034 {
2035     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2036     return yyextra;
2037 }
2038
2039 /** Get the current line number.
2040  * @param yyscanner The scanner object.
2041  */
2042 int libconfig_yyget_lineno  (yyscan_t yyscanner)
2043 {
2044     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2045     
2046         if (! YY_CURRENT_BUFFER)
2047             return 0;
2048     
2049     return yylineno;
2050 }
2051
2052 /** Get the current column number.
2053  * @param yyscanner The scanner object.
2054  */
2055 int libconfig_yyget_column  (yyscan_t yyscanner)
2056 {
2057     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2058     
2059         if (! YY_CURRENT_BUFFER)
2060             return 0;
2061     
2062     return yycolumn;
2063 }
2064
2065 /** Get the input stream.
2066  * @param yyscanner The scanner object.
2067  */
2068 FILE *libconfig_yyget_in  (yyscan_t yyscanner)
2069 {
2070     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2071     return yyin;
2072 }
2073
2074 /** Get the output stream.
2075  * @param yyscanner The scanner object.
2076  */
2077 FILE *libconfig_yyget_out  (yyscan_t yyscanner)
2078 {
2079     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2080     return yyout;
2081 }
2082
2083 /** Get the length of the current token.
2084  * @param yyscanner The scanner object.
2085  */
2086 yy_size_t libconfig_yyget_leng  (yyscan_t yyscanner)
2087 {
2088     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2089     return yyleng;
2090 }
2091
2092 /** Get the current token.
2093  * @param yyscanner The scanner object.
2094  */
2095
2096 char *libconfig_yyget_text  (yyscan_t yyscanner)
2097 {
2098     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2099     return yytext;
2100 }
2101
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.
2105  */
2106 void libconfig_yyset_extra (YY_EXTRA_TYPE  user_defined , yyscan_t yyscanner)
2107 {
2108     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2109     yyextra = user_defined ;
2110 }
2111
2112 /** Set the current line number.
2113  * @param line_number
2114  * @param yyscanner The scanner object.
2115  */
2116 void libconfig_yyset_lineno (int  line_number , yyscan_t yyscanner)
2117 {
2118     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2119
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" );
2123     
2124     yylineno = line_number;
2125 }
2126
2127 /** Set the current column.
2128  * @param line_number
2129  * @param yyscanner The scanner object.
2130  */
2131 void libconfig_yyset_column (int  column_no , yyscan_t yyscanner)
2132 {
2133     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2134
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" );
2138     
2139     yycolumn = column_no;
2140 }
2141
2142 /** Set the input stream. This does not discard the current
2143  * input buffer.
2144  * @param in_str A readable stream.
2145  * @param yyscanner The scanner object.
2146  * @see libconfig_yy_switch_to_buffer
2147  */
2148 void libconfig_yyset_in (FILE *  in_str , yyscan_t yyscanner)
2149 {
2150     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2151     yyin = in_str ;
2152 }
2153
2154 void libconfig_yyset_out (FILE *  out_str , yyscan_t yyscanner)
2155 {
2156     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2157     yyout = out_str ;
2158 }
2159
2160 int libconfig_yyget_debug  (yyscan_t yyscanner)
2161 {
2162     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2163     return yy_flex_debug;
2164 }
2165
2166 void libconfig_yyset_debug (int  bdebug , yyscan_t yyscanner)
2167 {
2168     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2169     yy_flex_debug = bdebug ;
2170 }
2171
2172 /* Accessor methods for yylval and yylloc */
2173
2174 YYSTYPE * libconfig_yyget_lval  (yyscan_t yyscanner)
2175 {
2176     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2177     return yylval;
2178 }
2179
2180 void libconfig_yyset_lval (YYSTYPE *  yylval_param , yyscan_t yyscanner)
2181 {
2182     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2183     yylval = yylval_param;
2184 }
2185
2186 /* User-visible API */
2187
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.
2191  */
2192
2193 int libconfig_yylex_init(yyscan_t* ptr_yy_globals)
2194
2195 {
2196     if (ptr_yy_globals == NULL){
2197         errno = EINVAL;
2198         return 1;
2199     }
2200
2201     *ptr_yy_globals = (yyscan_t) libconfig_yyalloc ( sizeof( struct yyguts_t ), NULL );
2202
2203     if (*ptr_yy_globals == NULL){
2204         errno = ENOMEM;
2205         return 1;
2206     }
2207
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));
2210
2211     return yy_init_globals ( *ptr_yy_globals );
2212 }
2213
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.
2220  */
2221
2222 int libconfig_yylex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals )
2223
2224 {
2225     struct yyguts_t dummy_yyguts;
2226
2227     libconfig_yyset_extra (yy_user_defined, &dummy_yyguts);
2228
2229     if (ptr_yy_globals == NULL){
2230         errno = EINVAL;
2231         return 1;
2232     }
2233         
2234     *ptr_yy_globals = (yyscan_t) libconfig_yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
2235         
2236     if (*ptr_yy_globals == NULL){
2237         errno = ENOMEM;
2238         return 1;
2239     }
2240     
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));
2244     
2245     libconfig_yyset_extra (yy_user_defined, *ptr_yy_globals);
2246     
2247     return yy_init_globals ( *ptr_yy_globals );
2248 }
2249
2250 static int yy_init_globals (yyscan_t yyscanner)
2251 {
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.
2255      */
2256
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;
2261     yyg->yy_init = 0;
2262     yyg->yy_start = 0;
2263
2264     yyg->yy_start_stack_ptr = 0;
2265     yyg->yy_start_stack_depth = 0;
2266     yyg->yy_start_stack =  NULL;
2267
2268 /* Defined in main.c */
2269 #ifdef YY_STDINIT
2270     yyin = stdin;
2271     yyout = stdout;
2272 #else
2273     yyin = (FILE *) 0;
2274     yyout = (FILE *) 0;
2275 #endif
2276
2277     /* For future reference: Set errno on error, since we are called by
2278      * libconfig_yylex_init()
2279      */
2280     return 0;
2281 }
2282
2283 /* libconfig_yylex_destroy is for both reentrant and non-reentrant scanners. */
2284 int libconfig_yylex_destroy  (yyscan_t yyscanner)
2285 {
2286     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2287
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);
2293         }
2294
2295         /* Destroy the stack itself. */
2296         libconfig_yyfree(yyg->yy_buffer_stack ,yyscanner);
2297         yyg->yy_buffer_stack = NULL;
2298
2299     /* Destroy the start condition stack. */
2300         libconfig_yyfree(yyg->yy_start_stack ,yyscanner );
2301         yyg->yy_start_stack = NULL;
2302
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);
2306
2307     /* Destroy the main struct (reentrant only). */
2308     libconfig_yyfree ( yyscanner , yyscanner );
2309     yyscanner = NULL;
2310     return 0;
2311 }
2312
2313 /*
2314  * Internal utility routines.
2315  */
2316
2317 #ifndef yytext_ptr
2318 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner)
2319 {
2320         register int i;
2321         for ( i = 0; i < n; ++i )
2322                 s1[i] = s2[i];
2323 }
2324 #endif
2325
2326 #ifdef YY_NEED_STRLEN
2327 static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
2328 {
2329         register int n;
2330         for ( n = 0; s[n]; ++n )
2331                 ;
2332
2333         return n;
2334 }
2335 #endif
2336
2337 void *libconfig_yyalloc (yy_size_t  size , yyscan_t yyscanner)
2338 {
2339         return (void *) malloc( size );
2340 }
2341
2342 void *libconfig_yyrealloc  (void * ptr, yy_size_t  size , yyscan_t yyscanner)
2343 {
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.
2350          */
2351         return (void *) realloc( (char *) ptr, size );
2352 }
2353
2354 void libconfig_yyfree (void * ptr , yyscan_t yyscanner)
2355 {
2356         free( (char *) ptr );   /* see libconfig_yyrealloc() for (char *) cast */
2357 }
2358
2359 #define YYTABLES_NAME "yytables"
2360
2361 #line 193 "scanner.l"