1 #line 2 "lib/cfg-lex.c"
2
3 #line 4 "lib/cfg-lex.c"
4
5 #define YY_INT_ALIGNED short int
6
7 /* A lexical scanner generated by flex */
8
9 #define FLEX_SCANNER
10 #define YY_FLEX_MAJOR_VERSION 2
11 #define YY_FLEX_MINOR_VERSION 6
12 #define YY_FLEX_SUBMINOR_VERSION 4
13 #if YY_FLEX_SUBMINOR_VERSION > 0
14 #define FLEX_BETA
15 #endif
16
17 #ifdef yy_create_buffer
18 #define _cfg_lexer__create_buffer_ALREADY_DEFINED
19 #else
20 #define yy_create_buffer _cfg_lexer__create_buffer
21 #endif
22
23 #ifdef yy_delete_buffer
24 #define _cfg_lexer__delete_buffer_ALREADY_DEFINED
25 #else
26 #define yy_delete_buffer _cfg_lexer__delete_buffer
27 #endif
28
29 #ifdef yy_scan_buffer
30 #define _cfg_lexer__scan_buffer_ALREADY_DEFINED
31 #else
32 #define yy_scan_buffer _cfg_lexer__scan_buffer
33 #endif
34
35 #ifdef yy_scan_string
36 #define _cfg_lexer__scan_string_ALREADY_DEFINED
37 #else
38 #define yy_scan_string _cfg_lexer__scan_string
39 #endif
40
41 #ifdef yy_scan_bytes
42 #define _cfg_lexer__scan_bytes_ALREADY_DEFINED
43 #else
44 #define yy_scan_bytes _cfg_lexer__scan_bytes
45 #endif
46
47 #ifdef yy_init_buffer
48 #define _cfg_lexer__init_buffer_ALREADY_DEFINED
49 #else
50 #define yy_init_buffer _cfg_lexer__init_buffer
51 #endif
52
53 #ifdef yy_flush_buffer
54 #define _cfg_lexer__flush_buffer_ALREADY_DEFINED
55 #else
56 #define yy_flush_buffer _cfg_lexer__flush_buffer
57 #endif
58
59 #ifdef yy_load_buffer_state
60 #define _cfg_lexer__load_buffer_state_ALREADY_DEFINED
61 #else
62 #define yy_load_buffer_state _cfg_lexer__load_buffer_state
63 #endif
64
65 #ifdef yy_switch_to_buffer
66 #define _cfg_lexer__switch_to_buffer_ALREADY_DEFINED
67 #else
68 #define yy_switch_to_buffer _cfg_lexer__switch_to_buffer
69 #endif
70
71 #ifdef yypush_buffer_state
72 #define _cfg_lexer_push_buffer_state_ALREADY_DEFINED
73 #else
74 #define yypush_buffer_state _cfg_lexer_push_buffer_state
75 #endif
76
77 #ifdef yypop_buffer_state
78 #define _cfg_lexer_pop_buffer_state_ALREADY_DEFINED
79 #else
80 #define yypop_buffer_state _cfg_lexer_pop_buffer_state
81 #endif
82
83 #ifdef yyensure_buffer_stack
84 #define _cfg_lexer_ensure_buffer_stack_ALREADY_DEFINED
85 #else
86 #define yyensure_buffer_stack _cfg_lexer_ensure_buffer_stack
87 #endif
88
89 #ifdef yylex
90 #define _cfg_lexer_lex_ALREADY_DEFINED
91 #else
92 #define yylex _cfg_lexer_lex
93 #endif
94
95 #ifdef yyrestart
96 #define _cfg_lexer_restart_ALREADY_DEFINED
97 #else
98 #define yyrestart _cfg_lexer_restart
99 #endif
100
101 #ifdef yylex_init
102 #define _cfg_lexer_lex_init_ALREADY_DEFINED
103 #else
104 #define yylex_init _cfg_lexer_lex_init
105 #endif
106
107 #ifdef yylex_init_extra
108 #define _cfg_lexer_lex_init_extra_ALREADY_DEFINED
109 #else
110 #define yylex_init_extra _cfg_lexer_lex_init_extra
111 #endif
112
113 #ifdef yylex_destroy
114 #define _cfg_lexer_lex_destroy_ALREADY_DEFINED
115 #else
116 #define yylex_destroy _cfg_lexer_lex_destroy
117 #endif
118
119 #ifdef yyget_debug
120 #define _cfg_lexer_get_debug_ALREADY_DEFINED
121 #else
122 #define yyget_debug _cfg_lexer_get_debug
123 #endif
124
125 #ifdef yyset_debug
126 #define _cfg_lexer_set_debug_ALREADY_DEFINED
127 #else
128 #define yyset_debug _cfg_lexer_set_debug
129 #endif
130
131 #ifdef yyget_extra
132 #define _cfg_lexer_get_extra_ALREADY_DEFINED
133 #else
134 #define yyget_extra _cfg_lexer_get_extra
135 #endif
136
137 #ifdef yyset_extra
138 #define _cfg_lexer_set_extra_ALREADY_DEFINED
139 #else
140 #define yyset_extra _cfg_lexer_set_extra
141 #endif
142
143 #ifdef yyget_in
144 #define _cfg_lexer_get_in_ALREADY_DEFINED
145 #else
146 #define yyget_in _cfg_lexer_get_in
147 #endif
148
149 #ifdef yyset_in
150 #define _cfg_lexer_set_in_ALREADY_DEFINED
151 #else
152 #define yyset_in _cfg_lexer_set_in
153 #endif
154
155 #ifdef yyget_out
156 #define _cfg_lexer_get_out_ALREADY_DEFINED
157 #else
158 #define yyget_out _cfg_lexer_get_out
159 #endif
160
161 #ifdef yyset_out
162 #define _cfg_lexer_set_out_ALREADY_DEFINED
163 #else
164 #define yyset_out _cfg_lexer_set_out
165 #endif
166
167 #ifdef yyget_leng
168 #define _cfg_lexer_get_leng_ALREADY_DEFINED
169 #else
170 #define yyget_leng _cfg_lexer_get_leng
171 #endif
172
173 #ifdef yyget_text
174 #define _cfg_lexer_get_text_ALREADY_DEFINED
175 #else
176 #define yyget_text _cfg_lexer_get_text
177 #endif
178
179 #ifdef yyget_lineno
180 #define _cfg_lexer_get_lineno_ALREADY_DEFINED
181 #else
182 #define yyget_lineno _cfg_lexer_get_lineno
183 #endif
184
185 #ifdef yyset_lineno
186 #define _cfg_lexer_set_lineno_ALREADY_DEFINED
187 #else
188 #define yyset_lineno _cfg_lexer_set_lineno
189 #endif
190
191 #ifdef yyget_column
192 #define _cfg_lexer_get_column_ALREADY_DEFINED
193 #else
194 #define yyget_column _cfg_lexer_get_column
195 #endif
196
197 #ifdef yyset_column
198 #define _cfg_lexer_set_column_ALREADY_DEFINED
199 #else
200 #define yyset_column _cfg_lexer_set_column
201 #endif
202
203 #ifdef yywrap
204 #define _cfg_lexer_wrap_ALREADY_DEFINED
205 #else
206 #define yywrap _cfg_lexer_wrap
207 #endif
208
209 #ifdef yyget_lval
210 #define _cfg_lexer_get_lval_ALREADY_DEFINED
211 #else
212 #define yyget_lval _cfg_lexer_get_lval
213 #endif
214
215 #ifdef yyset_lval
216 #define _cfg_lexer_set_lval_ALREADY_DEFINED
217 #else
218 #define yyset_lval _cfg_lexer_set_lval
219 #endif
220
221 #ifdef yyget_lloc
222 #define _cfg_lexer_get_lloc_ALREADY_DEFINED
223 #else
224 #define yyget_lloc _cfg_lexer_get_lloc
225 #endif
226
227 #ifdef yyset_lloc
228 #define _cfg_lexer_set_lloc_ALREADY_DEFINED
229 #else
230 #define yyset_lloc _cfg_lexer_set_lloc
231 #endif
232
233 #ifdef yyalloc
234 #define _cfg_lexer_alloc_ALREADY_DEFINED
235 #else
236 #define yyalloc _cfg_lexer_alloc
237 #endif
238
239 #ifdef yyrealloc
240 #define _cfg_lexer_realloc_ALREADY_DEFINED
241 #else
242 #define yyrealloc _cfg_lexer_realloc
243 #endif
244
245 #ifdef yyfree
246 #define _cfg_lexer_free_ALREADY_DEFINED
247 #else
248 #define yyfree _cfg_lexer_free
249 #endif
250
251 /* First, we deal with platform-specific or compiler-specific issues. */
252
253 /* begin standard C headers. */
254 #include <stdio.h>
255 #include <string.h>
256 #include <errno.h>
257 #include <stdlib.h>
258
259 /* end standard C headers. */
260
261 /* flex integer type definitions */
262
263 #ifndef FLEXINT_H
264 #define FLEXINT_H
265
266 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
267
268 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
269
270 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
271 * if you want the limit (max/min) macros for int types.
272 */
273 #ifndef __STDC_LIMIT_MACROS
274 #define __STDC_LIMIT_MACROS 1
275 #endif
276
277 #include <inttypes.h>
278 typedef int8_t flex_int8_t;
279 typedef uint8_t flex_uint8_t;
280 typedef int16_t flex_int16_t;
281 typedef uint16_t flex_uint16_t;
282 typedef int32_t flex_int32_t;
283 typedef uint32_t flex_uint32_t;
284 #else
285 typedef signed char flex_int8_t;
286 typedef short int flex_int16_t;
287 typedef int flex_int32_t;
288 typedef unsigned char flex_uint8_t;
289 typedef unsigned short int flex_uint16_t;
290 typedef unsigned int flex_uint32_t;
291
292 /* Limits of integral types. */
293 #ifndef INT8_MIN
294 #define INT8_MIN (-128)
295 #endif
296 #ifndef INT16_MIN
297 #define INT16_MIN (-32767-1)
298 #endif
299 #ifndef INT32_MIN
300 #define INT32_MIN (-2147483647-1)
301 #endif
302 #ifndef INT8_MAX
303 #define INT8_MAX (127)
304 #endif
305 #ifndef INT16_MAX
306 #define INT16_MAX (32767)
307 #endif
308 #ifndef INT32_MAX
309 #define INT32_MAX (2147483647)
310 #endif
311 #ifndef UINT8_MAX
312 #define UINT8_MAX (255U)
313 #endif
314 #ifndef UINT16_MAX
315 #define UINT16_MAX (65535U)
316 #endif
317 #ifndef UINT32_MAX
318 #define UINT32_MAX (4294967295U)
319 #endif
320
321 #ifndef SIZE_MAX
322 #define SIZE_MAX (~(size_t)0)
323 #endif
324
325 #endif /* ! C99 */
326
327 #endif /* ! FLEXINT_H */
328
329 /* begin standard C++ headers. */
330
331 /* TODO: this is always defined, so inline it */
332 #define yyconst const
333
334 #if defined(__GNUC__) && __GNUC__ >= 3
335 #define yynoreturn __attribute__((__noreturn__))
336 #else
337 #define yynoreturn
338 #endif
339
340 /* Returned upon end-of-file. */
341 #define YY_NULL 0
342
343 /* Promotes a possibly negative, possibly signed char to an
344 * integer in range [0..255] for use as an array index.
345 */
346 #define YY_SC_TO_UI(c) ((YY_CHAR) (c))
347
348 /* An opaque pointer. */
349 #ifndef YY_TYPEDEF_YY_SCANNER_T
350 #define YY_TYPEDEF_YY_SCANNER_T
351 typedef void* yyscan_t;
352 #endif
353
354 /* For convenience, these vars (plus the bison vars far below)
355 are macros in the reentrant scanner. */
356 #define yyin yyg->yyin_r
357 #define yyout yyg->yyout_r
358 #define yyextra yyg->yyextra_r
359 #define yyleng yyg->yyleng_r
360 #define yytext yyg->yytext_r
361 #define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
362 #define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
363 #define yy_flex_debug yyg->yy_flex_debug_r
364
365 /* Enter a start condition. This macro really ought to take a parameter,
366 * but we do it the disgusting crufty way forced on us by the ()-less
367 * definition of BEGIN.
368 */
369 #define BEGIN yyg->yy_start = 1 + 2 *
370 /* Translate the current start state into a value that can be later handed
371 * to BEGIN to return to the state. The YYSTATE alias is for lex
372 * compatibility.
373 */
374 #define YY_START ((yyg->yy_start - 1) / 2)
375 #define YYSTATE YY_START
376 /* Action number for EOF rule of a given start state. */
377 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
378 /* Special action meaning "start processing a new file". */
379 #define YY_NEW_FILE yyrestart( yyin , yyscanner )
380 #define YY_END_OF_BUFFER_CHAR 0
381
382 /* Size of default input buffer. */
383 #ifndef YY_BUF_SIZE
384 #ifdef __ia64__
385 /* On IA-64, the buffer size is 16k, not 8k.
386 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
387 * Ditto for the __ia64__ case accordingly.
388 */
389 #define YY_BUF_SIZE 32768
390 #else
391 #define YY_BUF_SIZE 16384
392 #endif /* __ia64__ */
393 #endif
394
395 /* The state buf must be large enough to hold one state per character in the main buffer.
396 */
397 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
398
399 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
400 #define YY_TYPEDEF_YY_BUFFER_STATE
401 typedef struct yy_buffer_state *YY_BUFFER_STATE;
402 #endif
403
404 #ifndef YY_TYPEDEF_YY_SIZE_T
405 #define YY_TYPEDEF_YY_SIZE_T
406 typedef size_t yy_size_t;
407 #endif
408
409 #define EOB_ACT_CONTINUE_SCAN 0
410 #define EOB_ACT_END_OF_FILE 1
411 #define EOB_ACT_LAST_MATCH 2
412
413 #define YY_LESS_LINENO(n)
414 #define YY_LINENO_REWIND_TO(ptr)
415
416 /* Return all but the first "n" matched characters back to the input stream. */
417 #define yyless(n) \
418 do \
419 { \
420 /* Undo effects of setting up yytext. */ \
421 int yyless_macro_arg = (n); \
422 YY_LESS_LINENO(yyless_macro_arg);\
423 *yy_cp = yyg->yy_hold_char; \
424 YY_RESTORE_YY_MORE_OFFSET \
425 yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
426 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
427 } \
428 while ( 0 )
429 #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
430
431 #ifndef YY_STRUCT_YY_BUFFER_STATE
432 #define YY_STRUCT_YY_BUFFER_STATE
433 struct yy_buffer_state
434 {
435 FILE *yy_input_file;
436
437 char *yy_ch_buf; /* input buffer */
438 char *yy_buf_pos; /* current position in input buffer */
439
440 /* Size of input buffer in bytes, not including room for EOB
441 * characters.
442 */
443 int yy_buf_size;
444
445 /* Number of characters read into yy_ch_buf, not including EOB
446 * characters.
447 */
448 int yy_n_chars;
449
450 /* Whether we "own" the buffer - i.e., we know we created it,
451 * and can realloc() it to grow it, and should free() it to
452 * delete it.
453 */
454 int yy_is_our_buffer;
455
456 /* Whether this is an "interactive" input source; if so, and
457 * if we're using stdio for input, then we want to use getc()
458 * instead of fread(), to make sure we stop fetching input after
459 * each newline.
460 */
461 int yy_is_interactive;
462
463 /* Whether we're considered to be at the beginning of a line.
464 * If so, '^' rules will be active on the next match, otherwise
465 * not.
466 */
467 int yy_at_bol;
468
469 int yy_bs_lineno; /**< The line count. */
470 int yy_bs_column; /**< The column count. */
471
472 /* Whether to try to fill the input buffer when we reach the
473 * end of it.
474 */
475 int yy_fill_buffer;
476
477 int yy_buffer_status;
478
479 #define YY_BUFFER_NEW 0
480 #define YY_BUFFER_NORMAL 1
481 /* When an EOF's been seen but there's still some text to process
482 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
483 * shouldn't try reading from the input source any more. We might
484 * still have a bunch of tokens to match, though, because of
485 * possible backing-up.
486 *
487 * When we actually see the EOF, we change the status to "new"
488 * (via yyrestart()), so that the user can continue scanning by
489 * just pointing yyin at a new input file.
490 */
491 #define YY_BUFFER_EOF_PENDING 2
492
493 };
494 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
495
496 /* We provide macros for accessing buffer states in case in the
497 * future we want to put the buffer states in a more general
498 * "scanner state".
499 *
500 * Returns the top of the stack, or NULL.
501 */
502 #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
503 ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
504 : NULL)
505 /* Same as previous macro, but useful when we know that the buffer stack is not
506 * NULL or when we need an lvalue. For internal use only.
507 */
508 #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
509
510 void yyrestart ( FILE *input_file , yyscan_t yyscanner );
511 void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
512 YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner );
513 void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
514 void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
515 void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
516 void yypop_buffer_state ( yyscan_t yyscanner );
517
518 static void yyensure_buffer_stack ( yyscan_t yyscanner );
519 static void yy_load_buffer_state ( yyscan_t yyscanner );
520 static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file , yyscan_t yyscanner );
521 #define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER , yyscanner)
522
523 YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner );
524 YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner );
525 YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner );
526
527 void *yyalloc ( yy_size_t , yyscan_t yyscanner );
528 void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner );
529 void yyfree ( void * , yyscan_t yyscanner );
530
531 #define yy_new_buffer yy_create_buffer
532 #define yy_set_interactive(is_interactive) \
533 { \
534 if ( ! YY_CURRENT_BUFFER ){ \
535 yyensure_buffer_stack (yyscanner); \
536 YY_CURRENT_BUFFER_LVALUE = \
537 yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \
538 } \
539 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
540 }
541 #define yy_set_bol(at_bol) \
542 { \
543 if ( ! YY_CURRENT_BUFFER ){\
544 yyensure_buffer_stack (yyscanner); \
545 YY_CURRENT_BUFFER_LVALUE = \
546 yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \
547 } \
548 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
549 }
550 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
551
552 /* Begin user sect3 */
553
554 #define _cfg_lexer_wrap(yyscanner) (/*CONSTCOND*/1)
555 #define YY_SKIP_YYWRAP
556 typedef flex_uint8_t YY_CHAR;
557
558 typedef int yy_state_type;
559
560 #define yytext_ptr yytext_r
561
562 static yy_state_type yy_get_previous_state ( yyscan_t yyscanner );
563 static yy_state_type yy_try_NUL_trans ( yy_state_type current_state , yyscan_t yyscanner);
564 static int yy_get_next_buffer ( yyscan_t yyscanner );
565 static void yynoreturn yy_fatal_error ( const char* msg , yyscan_t yyscanner );
566
567 /* Done after the current pattern has been matched and before the
568 * corresponding action - sets up yytext.
569 */
570 #define YY_DO_BEFORE_ACTION \
571 yyg->yytext_ptr = yy_bp; \
572 yyleng = (int) (yy_cp - yy_bp); \
573 yyg->yy_hold_char = *yy_cp; \
574 *yy_cp = '\0'; \
575 yyg->yy_c_buf_p = yy_cp;
576 #define YY_NUM_RULES 53
577 #define YY_END_OF_BUFFER 54
578 /* This struct is not used in this scanner,
579 but its presence is necessary. */
580 struct yy_trans_info
581 {
582 flex_int32_t yy_verify;
583 flex_int32_t yy_nxt;
584 };
585 static const flex_int16_t yy_acclist[160] =
586 { 0,
587 54, 13, 17, 53, 5, 17, 53, 4, 53, 17,
588 53, 15, 17, 53, 1, 17, 53, 16, 17, 53,
589 17, 53, 13, 17, 53, 14, 17, 53, 17, 53,
590 12, 13, 17, 53, 12, 13, 17, 53, 13, 17,
591 53, 17, 53, 2, 17, 53, 28, 53, 31, 53,
592 53, 27, 53, 53, 29, 53, 30, 53, 29, 53,
593 35, 53, 34, 53, 36, 53, 53, 40, 53, 35,
594 53, 40, 53, 46, 53, 52, 53, 53, 41, 53,
595 43, 53, 42, 53, 44, 53, 45, 53, 46, 53,
596 47, 53, 49, 53, 53, 51, 53, 50, 53, 51,
597
598 53, 13, 5, 4, 12, 13, 6, 11, 12, 13,
599 12, 13, 12, 13, 12, 13, 13, 8, 13, 3,
600 28, 31, 26, 18, 26, 26, 19, 20, 26, 21,
601 22, 23, 26, 29, 18, 35, 34, 36, 37, 32,
602 46, 52, 47, 48, 33, 48, 51, 7, 9, 13,
603 10, 13, 25, 24, 25, 24, 38, 39, 25
604 } ;
605
606 static const flex_int16_t yy_accept[125] =
607 { 0,
608 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
609 1, 1, 1, 1, 1, 2, 5, 8, 10, 12,
610 15, 18, 21, 23, 26, 29, 31, 35, 39, 42,
611 44, 47, 49, 51, 52, 54, 55, 57, 59, 61,
612 63, 65, 67, 68, 70, 72, 74, 76, 78, 79,
613 81, 83, 85, 87, 89, 91, 93, 95, 96, 98,
614 100, 102, 103, 103, 104, 105, 107, 108, 108, 111,
615 113, 115, 117, 118, 120, 121, 121, 122, 123, 124,
616 126, 127, 128, 129, 130, 131, 132, 133, 134, 135,
617 136, 136, 137, 138, 139, 139, 139, 139, 140, 141,
618
619 141, 142, 143, 144, 145, 146, 147, 148, 148, 149,
620 151, 153, 154, 155, 155, 155, 156, 157, 157, 158,
621 158, 159, 160, 160
622 } ;
623
624 static const YY_CHAR yy_ec[256] =
625 { 0,
626 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
627 1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
628 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
629 1, 2, 1, 5, 6, 1, 1, 1, 7, 8,
630 9, 1, 10, 11, 12, 13, 1, 14, 15, 15,
631 15, 15, 15, 15, 15, 16, 16, 17, 17, 1,
632 18, 19, 1, 20, 21, 22, 21, 21, 21, 21,
633 23, 1, 24, 1, 25, 1, 26, 1, 1, 1,
634 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
635 17, 27, 17, 1, 1, 1, 28, 29, 21, 21,
636
637 21, 21, 30, 1, 31, 1, 32, 1, 33, 34,
638 35, 1, 1, 36, 1, 37, 1, 38, 1, 39,
639 1, 1, 40, 17, 41, 1, 1, 1, 1, 1,
640 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
641 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
642 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
643 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
644 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
645 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
646 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
647
648 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
649 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
650 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
651 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
652 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
653 1, 1, 1, 1, 1
654 } ;
655
656 static const YY_CHAR yy_meta[42] =
657 { 0,
658 1, 2, 3, 3, 4, 5, 6, 7, 5, 1,
659 8, 1, 1, 9, 9, 9, 8, 1, 1, 8,
660 9, 9, 1, 1, 1, 1, 10, 9, 9, 1,
661 1, 1, 1, 1, 1, 1, 1, 1, 1, 7,
662 5
663 } ;
664
665 static const flex_int16_t yy_base[141] =
666 { 0,
667 0, 204, 39, 42, 45, 47, 53, 56, 94, 133,
668 81, 84, 64, 102, 223, 209, 219, 415, 217, 415,
669 415, 415, 415, 62, 415, 206, 174, 80, 60, 59,
670 415, 0, 415, 215, 415, 211, 0, 415, 78, 0,
671 215, 415, 213, 105, 112, 415, 0, 415, 198, 415,
672 415, 415, 415, 415, 114, 0, 415, 119, 0, 415,
673 121, 181, 178, 183, 415, 112, 170, 117, 143, 168,
674 130, 91, 238, 167, 415, 176, 0, 415, 415, 415,
675 175, 415, 415, 130, 415, 415, 415, 0, 0, 415,
676 169, 0, 166, 415, 148, 151, 121, 415, 415, 89,
677
678 0, 415, 0, 415, 415, 87, 0, 67, 415, 133,
679 0, 148, 0, 156, 162, 152, 415, 167, 415, 168,
680 415, 415, 415, 267, 277, 287, 297, 307, 317, 327,
681 336, 345, 355, 365, 375, 385, 394, 404, 56, 44
682 } ;
683
684 static const flex_int16_t yy_def[141] =
685 { 0,
686 123, 1, 124, 124, 125, 125, 126, 126, 127, 127,
687 128, 128, 129, 129, 123, 130, 123, 123, 123, 123,
688 123, 123, 123, 130, 123, 123, 123, 27, 130, 123,
689 123, 131, 123, 123, 123, 132, 133, 123, 133, 134,
690 123, 123, 123, 123, 134, 123, 135, 123, 123, 123,
691 123, 123, 123, 123, 135, 136, 123, 137, 138, 123,
692 138, 130, 130, 123, 123, 27, 123, 130, 27, 130,
693 130, 130, 130, 130, 123, 123, 131, 123, 123, 123,
694 123, 123, 123, 123, 123, 123, 123, 139, 133, 123,
695 123, 134, 123, 123, 123, 123, 123, 123, 123, 123,
696
697 135, 123, 136, 123, 123, 123, 138, 123, 123, 130,
698 73, 123, 140, 123, 123, 123, 123, 123, 123, 123,
699 123, 123, 0, 123, 123, 123, 123, 123, 123, 123,
700 123, 123, 123, 123, 123, 123, 123, 123, 123, 123
701 } ;
702
703 static const flex_int16_t yy_nxt[457] =
704 { 0,
705 16, 17, 18, 19, 20, 21, 22, 23, 23, 24,
706 25, 24, 26, 27, 28, 28, 23, 29, 16, 23,
707 16, 16, 16, 16, 16, 16, 30, 16, 16, 16,
708 16, 16, 16, 16, 16, 16, 16, 16, 16, 23,
709 23, 33, 34, 35, 33, 34, 35, 33, 34, 33,
710 34, 38, 117, 38, 41, 42, 43, 41, 42, 43,
711 44, 75, 76, 44, 113, 36, 48, 49, 36, 105,
712 60, 39, 63, 39, 63, 66, 66, 66, 74, 45,
713 90, 91, 45, 48, 49, 57, 48, 49, 57, 105,
714 61, 99, 46, 66, 66, 46, 48, 49, 50, 51,
715
716 52, 53, 54, 63, 48, 49, 95, 58, 60, 96,
717 58, 97, 70, 98, 99, 100, 99, 100, 62, 70,
718 55, 105, 106, 105, 108, 66, 66, 115, 61, 123,
719 110, 110, 110, 53, 54, 48, 49, 50, 51, 52,
720 53, 54, 63, 112, 112, 63, 110, 110, 110, 95,
721 62, 70, 96, 72, 97, 114, 98, 118, 70, 55,
722 72, 116, 116, 120, 119, 122, 122, 93, 118, 120,
723 121, 90, 53, 54, 62, 119, 121, 90, 75, 63,
724 63, 62, 109, 62, 64, 62, 68, 69, 69, 66,
725 123, 62, 62, 63, 62, 70, 71, 72, 71, 71,
726
727 102, 62, 70, 71, 72, 71, 71, 62, 62, 62,
728 62, 62, 73, 80, 81, 94, 93, 78, 67, 65,
729 64, 63, 123, 31, 123, 123, 123, 123, 123, 123,
730 123, 123, 123, 123, 123, 123, 123, 123, 82, 123,
731 123, 123, 123, 123, 83, 84, 85, 86, 87, 88,
732 63, 111, 111, 111, 123, 123, 123, 123, 111, 111,
733 123, 123, 123, 123, 123, 111, 111, 32, 32, 32,
734 32, 32, 32, 32, 32, 32, 32, 37, 37, 37,
735 37, 37, 37, 37, 37, 37, 37, 40, 40, 40,
736 40, 40, 40, 40, 40, 40, 40, 47, 47, 47,
737
738 47, 47, 47, 47, 47, 47, 47, 56, 56, 56,
739 56, 56, 56, 56, 56, 56, 56, 59, 59, 59,
740 59, 59, 59, 59, 59, 59, 59, 62, 123, 123,
741 123, 123, 123, 123, 123, 62, 77, 77, 123, 123,
742 77, 77, 77, 77, 77, 79, 79, 79, 79, 79,
743 79, 79, 79, 79, 79, 89, 89, 123, 89, 89,
744 123, 89, 89, 89, 89, 92, 123, 123, 92, 92,
745 92, 123, 92, 92, 92, 101, 101, 123, 123, 123,
746 123, 123, 101, 101, 101, 103, 103, 123, 123, 103,
747 103, 103, 103, 103, 104, 104, 104, 104, 104, 104,
748
749 104, 104, 104, 104, 107, 107, 123, 107, 107, 123,
750 107, 107, 107, 107, 15, 123, 123, 123, 123, 123,
751 123, 123, 123, 123, 123, 123, 123, 123, 123, 123,
752 123, 123, 123, 123, 123, 123, 123, 123, 123, 123,
753 123, 123, 123, 123, 123, 123, 123, 123, 123, 123,
754 123, 123, 123, 123, 123, 123
755 } ;
756
757 static const flex_int16_t yy_chk[457] =
758 { 0,
759 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
760 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
761 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
762 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
763 1, 3, 3, 3, 4, 4, 4, 5, 5, 6,
764 6, 5, 140, 6, 7, 7, 7, 8, 8, 8,
765 7, 30, 30, 8, 139, 3, 13, 13, 4, 108,
766 13, 5, 29, 6, 24, 24, 24, 24, 29, 7,
767 39, 39, 8, 11, 11, 11, 12, 12, 12, 106,
768 13, 100, 7, 28, 28, 8, 9, 9, 9, 9,
769
770 9, 9, 9, 72, 14, 14, 44, 11, 14, 44,
771 12, 44, 72, 44, 45, 45, 55, 55, 28, 72,
772 9, 58, 58, 61, 61, 66, 66, 97, 14, 68,
773 68, 68, 68, 9, 9, 10, 10, 10, 10, 10,
774 10, 10, 71, 84, 84, 110, 110, 110, 110, 95,
775 66, 71, 95, 71, 95, 96, 95, 114, 71, 10,
776 71, 112, 112, 115, 114, 116, 116, 93, 118, 120,
777 115, 91, 10, 10, 27, 118, 120, 81, 76, 74,
778 70, 69, 67, 27, 64, 27, 27, 27, 27, 27,
779 63, 27, 27, 62, 27, 27, 27, 27, 27, 27,
780
781 49, 27, 27, 27, 27, 27, 27, 27, 27, 27,
782 27, 27, 27, 36, 36, 43, 41, 34, 26, 19,
783 17, 16, 15, 2, 0, 0, 0, 0, 0, 0,
784 0, 0, 0, 0, 0, 0, 0, 0, 36, 0,
785 0, 0, 0, 0, 36, 36, 36, 36, 36, 36,
786 73, 73, 73, 73, 0, 0, 0, 0, 73, 73,
787 0, 0, 0, 0, 0, 73, 73, 124, 124, 124,
788 124, 124, 124, 124, 124, 124, 124, 125, 125, 125,
789 125, 125, 125, 125, 125, 125, 125, 126, 126, 126,
790 126, 126, 126, 126, 126, 126, 126, 127, 127, 127,
791
792 127, 127, 127, 127, 127, 127, 127, 128, 128, 128,
793 128, 128, 128, 128, 128, 128, 128, 129, 129, 129,
794 129, 129, 129, 129, 129, 129, 129, 130, 0, 0,
795 0, 0, 0, 0, 0, 130, 131, 131, 0, 0,
796 131, 131, 131, 131, 131, 132, 132, 132, 132, 132,
797 132, 132, 132, 132, 132, 133, 133, 0, 133, 133,
798 0, 133, 133, 133, 133, 134, 0, 0, 134, 134,
799 134, 0, 134, 134, 134, 135, 135, 0, 0, 0,
800 0, 0, 135, 135, 135, 136, 136, 0, 0, 136,
801 136, 136, 136, 136, 137, 137, 137, 137, 137, 137,
802
803 137, 137, 137, 137, 138, 138, 0, 138, 138, 0,
804 138, 138, 138, 138, 123, 123, 123, 123, 123, 123,
805 123, 123, 123, 123, 123, 123, 123, 123, 123, 123,
806 123, 123, 123, 123, 123, 123, 123, 123, 123, 123,
807 123, 123, 123, 123, 123, 123, 123, 123, 123, 123,
808 123, 123, 123, 123, 123, 123
809 } ;
810
811 #define REJECT \
812 { \
813 *yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */ \
814 yy_cp = yyg->yy_full_match; /* restore poss. backed-over text */ \
815 ++yyg->yy_lp; \
816 goto find_rule; \
817 }
818
819 #define yymore() yymore_used_but_not_detected
820 #define YY_MORE_ADJ 0
821 #define YY_RESTORE_YY_MORE_OFFSET
822 #line 1 "/source/lib/cfg-lex.l"
823 /*
824 * Copyright (c) 2002-2013 Balabit
825 * Copyright (c) 1998-2011 Balázs Scheidler
826 *
827 * This library is free software; you can redistribute it and/or
828 * modify it under the terms of the GNU Lesser General Public
829 * License as published by the Free Software Foundation; either
830 * version 2.1 of the License, or (at your option) any later version.
831 *
832 * This library is distributed in the hope that it will be useful,
833 * but WITHOUT ANY WARRANTY; without even the implied warranty of
834 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
835 * Lesser General Public License for more details.
836 *
837 * You should have received a copy of the GNU Lesser General Public
838 * License along with this library; if not, write to the Free Software
839 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
840 *
841 * As an additional exemption you are allowed to compile & link against the
842 * OpenSSL libraries as published by the OpenSSL project. See the file
843 * COPYING for details.
844 *
845 */
846 #line 25 "/source/lib/cfg-lex.l"
847
848 #include "syslog-ng.h"
849 #include "cfg-lexer.h"
850 #include "cfg-lexer-subst.h"
851 #include "cfg-grammar.h"
852 #include "messages.h"
853 #include "parse-number.h"
854
855 #include <string.h>
856 #include <strings.h>
857
858 static gboolean
yy_input_run_backtick_substitution(CfgLexer * self,gchar * buf,gsize buf_size,gsize * len)859 yy_input_run_backtick_substitution(CfgLexer *self, gchar *buf, gsize buf_size, gsize *len)
860 {
861 gchar *res;
862 GError *error = NULL;
863 CFG_LTYPE *cur_lloc = &self->include_stack[self->include_depth].lloc;
864
865 res = cfg_lexer_subst_args_in_input(self->cfg->globals, NULL, NULL, buf, -1, len, &error);
866 if (!res)
867 {
868 msg_error("Error performing backtick substitution in configuration file",
869 evt_tag_str("error", error->message),
870 evt_tag_str("filename", cur_lloc->level->name),
871 evt_tag_printf("line", "%d:%d", cur_lloc->first_line, cur_lloc->first_column));
872 g_clear_error(&error);
873 goto error;
874 }
875 else
876 {
877 if (*len > buf_size)
878 {
879 msg_error("Error performing backtick substitution in configuration file, the target buffer is too small",
880 evt_tag_int("buf_size", buf_size),
881 evt_tag_str("filename", cur_lloc->level->name),
882 evt_tag_printf("line", "%d:%d", cur_lloc->first_line, cur_lloc->first_column));
883 goto error;
884 }
885 else
886 {
887 memcpy(buf, res, *len);
888 }
889 g_free(res);
890 return TRUE;
891 }
892 error:
893 return FALSE;
894 }
895
896 static gboolean
yy_patch_include_statement(CfgLexer * self,gchar * buf,gsize buf_size,gsize * len)897 yy_patch_include_statement(CfgLexer *self, gchar *buf, gsize buf_size, gsize *len)
898 {
899 CFG_LTYPE *cur_lloc = &self->include_stack[self->include_depth].lloc;
900
901 gchar *p = buf;
902 p += strspn(p, " \t");
903 if (strncmp(p, "include", 7) != 0)
904 return TRUE;
905 p += 7;
906 if (*p != ' ' && *p != '\t')
907 return TRUE;
908
909 p = strrchr(p, ';');
910 if (!p)
911 return TRUE;
912 *p = ' ';
913
914 if (!cfg_is_config_version_older(configuration, VERSION_VALUE_3_20))
915 {
916 msg_error("Error parsing old style include statement (e.g. the one without the '@' prefix), "
917 "support for it was removed in " VERSION_3_20 ", just add a '@' in front or revert to @version "
918 VERSION_3_19 " or older",
919 evt_tag_str("filename", cur_lloc->level->name),
920 evt_tag_printf("line", "%d:%d", cur_lloc->first_line, cur_lloc->first_column));
921
922 return FALSE;
923 }
924
925 if (*len + 1 > buf_size)
926 {
927 msg_error("Error performing the `include' patching to @include, the target buffer is too small",
928 evt_tag_int("buf_size", buf_size),
929 evt_tag_str("filename", cur_lloc->level->name),
930 evt_tag_printf("line", "%d:%d", cur_lloc->first_line, cur_lloc->first_column));
931 return FALSE;
932 }
933
934 memmove(buf + 1, buf, *len);
935 buf[0] = '@';
936 *len += 1;
937
938 msg_warning("WARNING: the `include' keyword based inclusion syntax (e.g. the one without a '@' "
939 "character in front) has been removed in " VERSION_3_20 ". Please prepend a '@' "
940 "character in front of your include statement while updating your configuration "
941 "to match the new version",
942 evt_tag_str("filename", cur_lloc->level->name),
943 evt_tag_printf("line", "%d:%d", cur_lloc->first_line, cur_lloc->first_column));
944 return TRUE;
945 }
946
947 static gint
yy_filter_input(CfgLexer * self,gchar * buf,gsize buf_size)948 yy_filter_input(CfgLexer *self, gchar *buf, gsize buf_size)
949 {
950 gsize len = strlen(buf);
951
952 if (!yy_input_run_backtick_substitution(self, buf, buf_size, &len))
953 return -1;
954 if (!yy_patch_include_statement(self, buf, buf_size, &len))
955 return -1;
956 return len;
957 }
958
959 #define YY_INPUT(buf, result, max_size) \
960 do \
961 { \
962 if (!fgets(buf, max_size, yyin)) \
963 result = YY_NULL; \
964 else if (YY_START >= block) \
965 result = strlen(buf); \
966 else \
967 { \
968 gint rc; \
969 rc = yy_filter_input(yyextra, buf, max_size); \
970 if (rc < 0) \
971 { \
972 YY_FATAL_ERROR("configuration input filtering failure"); \
973 } \
974 else \
975 { \
976 result = rc; \
977 } \
978 } \
979 } while(0)
980
981 #define YY_USER_ACTION \
982 do { \
983 CFG_LTYPE *cur_lloc = &yyextra->include_stack[yyextra->include_depth].lloc; \
984 if (YY_START == INITIAL) \
985 { \
986 cur_lloc->first_column = cur_lloc->last_column; \
987 } \
988 cur_lloc->last_column = cur_lloc->last_column + yyleng; \
989 if (yyextra->token_text) \
990 g_string_append_len(yyextra->token_text, yytext, yyleng); \
991 *yylloc = *cur_lloc; \
992 } while(0);
993
994 #define YY_BREAK \
995 do { \
996 if (yyextra->token_text && YY_START == INITIAL) \
997 { \
998 g_string_append_len(yyextra->token_pretext, yyextra->token_text->str, yyextra->token_text->len); \
999 g_string_truncate(yyextra->token_text, 0); \
1000 } \
1001 } while (0); \
1002 break;
1003
1004 #define YY_FATAL_ERROR(msg) \
1005 do { \
1006 struct yyguts_t * __yyg = (struct yyguts_t*) yyscanner; \
1007 \
1008 msg_error("Fatal error in configuration lexer, giving up", \
1009 evt_tag_str("error", msg)); \
1010 longjmp(__yyg->yyextra_r->fatal_error, 1); \
1011 } while(0)
1012
1013 #define _process_commented_line(scanner,content,cond) \
1014 do { \
1015 int ch; \
1016 \
1017 ch = input(scanner); \
1018 while (ch != '\n' && ch != EOF && ch != 0) \
1019 { \
1020 if (cond) \
1021 g_string_append_c(content, ch); \
1022 ch = input(scanner); \
1023 } \
1024 if (ch == '\n') \
1025 { \
1026 unput(ch); \
1027 } \
1028 } while (0)
1029
1030
1031 static void
_cfg_lex_move_token_location_to_new_line(CfgLexer * lexer)1032 _cfg_lex_move_token_location_to_new_line(CfgLexer *lexer)
1033 {
1034 CfgIncludeLevel *level = &lexer->include_stack[lexer->include_depth];
1035
1036 /* if the last token span multiple lines (e.g. block references), it
1037 * might happen that last_line != first_line, in that case, initialize the
1038 * first_line of the token to the subsequent line after last_line */
1039
1040 level->lloc.first_line = level->lloc.last_line + 1;
1041 level->lloc.last_line = level->lloc.first_line;
1042 level->lloc.first_column = 1;
1043 level->lloc.last_column = 1;
1044 }
1045
1046 static void
_cfg_lex_extend_token_location_to_next_line(CfgLexer * lexer)1047 _cfg_lex_extend_token_location_to_next_line(CfgLexer *lexer)
1048 {
1049 CfgIncludeLevel *level = &lexer->include_stack[lexer->include_depth];
1050
1051 /* this function is used when encountering an NL character within a
1052 * multi-line string literal.
1053 *
1054 * Example:
1055 * | "this is the start of the literal\
1056 * | and this is the end"
1057 *
1058 *
1059 * In this case the string contains a escaped NL character, causing the
1060 * literal to span two distinct lines in the source file, which would be
1061 * dropped from the parsed string.
1062 *
1063 * In this case, we need to move yylloc to point from the end of the
1064 * current line to the beginning of the next line. This way, by the time
1065 * we return the entire token, yylloc would be spanning the
1066 * starting-ending lines of the string literal as needed.
1067 * */
1068
1069 level->lloc.last_line++;
1070 level->lloc.last_column = 1;
1071 }
1072
1073 #define YYSTYPE CFG_STYPE
1074 #define YYLTYPE CFG_LTYPE
1075
1076 #line 1077 "lib/cfg-lex.c"
1077 /* block related states must be last, as we use this fact in YY_INPUT */
1078
1079 #line 1080 "lib/cfg-lex.c"
1080
1081 #define INITIAL 0
1082 #define string 1
1083 #define qstring 2
1084 #define block 3
1085 #define block_content 4
1086 #define block_string 5
1087 #define block_qstring 6
1088
1089 #ifndef YY_NO_UNISTD_H
1090 /* Special case for "unistd.h", since it is non-ANSI. We include it way
1091 * down here because we want the user's section 1 to have been scanned first.
1092 * The user has a chance to override it with an option.
1093 */
1094 #include <unistd.h>
1095 #endif
1096
1097 #define YY_EXTRA_TYPE CfgLexer *
1098
1099 /* Holds the entire state of the reentrant scanner. */
1100 struct yyguts_t
1101 {
1102
1103 /* User-defined. Not touched by flex. */
1104 YY_EXTRA_TYPE yyextra_r;
1105
1106 /* The rest are the same as the globals declared in the non-reentrant scanner. */
1107 FILE *yyin_r, *yyout_r;
1108 size_t yy_buffer_stack_top; /**< index of top of stack. */
1109 size_t yy_buffer_stack_max; /**< capacity of stack. */
1110 YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
1111 char yy_hold_char;
1112 int yy_n_chars;
1113 int yyleng_r;
1114 char *yy_c_buf_p;
1115 int yy_init;
1116 int yy_start;
1117 int yy_did_buffer_switch_on_eof;
1118 int yy_start_stack_ptr;
1119 int yy_start_stack_depth;
1120 int *yy_start_stack;
1121 yy_state_type yy_last_accepting_state;
1122 char* yy_last_accepting_cpos;
1123
1124 int yylineno_r;
1125 int yy_flex_debug_r;
1126
1127 yy_state_type *yy_state_buf;
1128 yy_state_type *yy_state_ptr;
1129 char *yy_full_match;
1130 int yy_lp;
1131
1132 /* These are only needed for trailing context rules,
1133 * but there's no conditional variable for that yet. */
1134 int yy_looking_for_trail_begin;
1135 int yy_full_lp;
1136 int *yy_full_state;
1137
1138 char *yytext_r;
1139 int yy_more_flag;
1140 int yy_more_len;
1141
1142 YYSTYPE * yylval_r;
1143
1144 YYLTYPE * yylloc_r;
1145
1146 }; /* end struct yyguts_t */
1147
1148 static int yy_init_globals ( yyscan_t yyscanner );
1149
1150 /* This must go here because YYSTYPE and YYLTYPE are included
1151 * from bison output in section 1.*/
1152 # define yylval yyg->yylval_r
1153
1154 # define yylloc yyg->yylloc_r
1155
1156 int yylex_init (yyscan_t* scanner);
1157
1158 int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner);
1159
1160 /* Accessor methods to globals.
1161 These are made visible to non-reentrant scanners for convenience. */
1162
1163 int yylex_destroy ( yyscan_t yyscanner );
1164
1165 int yyget_debug ( yyscan_t yyscanner );
1166
1167 void yyset_debug ( int debug_flag , yyscan_t yyscanner );
1168
1169 YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner );
1170
1171 void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner );
1172
1173 FILE *yyget_in ( yyscan_t yyscanner );
1174
1175 void yyset_in ( FILE * _in_str , yyscan_t yyscanner );
1176
1177 FILE *yyget_out ( yyscan_t yyscanner );
1178
1179 void yyset_out ( FILE * _out_str , yyscan_t yyscanner );
1180
1181 int yyget_leng ( yyscan_t yyscanner );
1182
1183 char *yyget_text ( yyscan_t yyscanner );
1184
1185 int yyget_lineno ( yyscan_t yyscanner );
1186
1187 void yyset_lineno ( int _line_number , yyscan_t yyscanner );
1188
1189 int yyget_column ( yyscan_t yyscanner );
1190
1191 void yyset_column ( int _column_no , yyscan_t yyscanner );
1192
1193 YYSTYPE * yyget_lval ( yyscan_t yyscanner );
1194
1195 void yyset_lval ( YYSTYPE * yylval_param , yyscan_t yyscanner );
1196
1197 YYLTYPE *yyget_lloc ( yyscan_t yyscanner );
1198
1199 void yyset_lloc ( YYLTYPE * yylloc_param , yyscan_t yyscanner );
1200
1201 /* Macros after this point can all be overridden by user definitions in
1202 * section 1.
1203 */
1204
1205 #ifndef YY_SKIP_YYWRAP
1206 #ifdef __cplusplus
1207 extern "C" int yywrap ( yyscan_t yyscanner );
1208 #else
1209 extern int yywrap ( yyscan_t yyscanner );
1210 #endif
1211 #endif
1212
1213 #ifndef YY_NO_UNPUT
1214
1215 static void yyunput ( int c, char *buf_ptr , yyscan_t yyscanner);
1216
1217 #endif
1218
1219 #ifndef yytext_ptr
1220 static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner);
1221 #endif
1222
1223 #ifdef YY_NEED_STRLEN
1224 static int yy_flex_strlen ( const char * , yyscan_t yyscanner);
1225 #endif
1226
1227 #ifndef YY_NO_INPUT
1228 #ifdef __cplusplus
1229 static int yyinput ( yyscan_t yyscanner );
1230 #else
1231 static int input ( yyscan_t yyscanner );
1232 #endif
1233
1234 #endif
1235
1236 static void yy_push_state ( int _new_state , yyscan_t yyscanner);
1237
1238 static void yy_pop_state ( yyscan_t yyscanner );
1239
1240 static int yy_top_state ( yyscan_t yyscanner );
1241
1242 /* Amount of stuff to slurp up with each read. */
1243 #ifndef YY_READ_BUF_SIZE
1244 #ifdef __ia64__
1245 /* On IA-64, the buffer size is 16k, not 8k */
1246 #define YY_READ_BUF_SIZE 16384
1247 #else
1248 #define YY_READ_BUF_SIZE 8192
1249 #endif /* __ia64__ */
1250 #endif
1251
1252 /* Copy whatever the last rule matched to the standard output. */
1253 #ifndef ECHO
1254 /* This used to be an fputs(), but since the string might contain NUL's,
1255 * we now use fwrite().
1256 */
1257 #define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
1258 #endif
1259
1260 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
1261 * is returned in "result".
1262 */
1263 #ifndef YY_INPUT
1264 #define YY_INPUT(buf,result,max_size) \
1265 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
1266 { \
1267 int c = '*'; \
1268 int n; \
1269 for ( n = 0; n < max_size && \
1270 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
1271 buf[n] = (char) c; \
1272 if ( c == '\n' ) \
1273 buf[n++] = (char) c; \
1274 if ( c == EOF && ferror( yyin ) ) \
1275 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1276 result = n; \
1277 } \
1278 else \
1279 { \
1280 errno=0; \
1281 while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
1282 { \
1283 if( errno != EINTR) \
1284 { \
1285 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1286 break; \
1287 } \
1288 errno=0; \
1289 clearerr(yyin); \
1290 } \
1291 }\
1292 \
1293
1294 #endif
1295
1296 /* No semi-colon after return; correct usage is to write "yyterminate();" -
1297 * we don't want an extra ';' after the "return" because that will cause
1298 * some compilers to complain about unreachable statements.
1299 */
1300 #ifndef yyterminate
1301 #define yyterminate() return YY_NULL
1302 #endif
1303
1304 /* Number of entries by which start-condition stack grows. */
1305 #ifndef YY_START_STACK_INCR
1306 #define YY_START_STACK_INCR 25
1307 #endif
1308
1309 /* Report a fatal error. */
1310 #ifndef YY_FATAL_ERROR
1311 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
1312 #endif
1313
1314 /* end tables serialization structures and prototypes */
1315
1316 /* Default declaration of generated scanner - a define so the user can
1317 * easily add parameters.
1318 */
1319 #ifndef YY_DECL
1320 #define YY_DECL_IS_OURS 1
1321
1322 extern int yylex \
1323 (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner);
1324
1325 #define YY_DECL int yylex \
1326 (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner)
1327 #endif /* !YY_DECL */
1328
1329 /* Code executed at the beginning of each rule, after yytext and yyleng
1330 * have been set up.
1331 */
1332 #ifndef YY_USER_ACTION
1333 #define YY_USER_ACTION
1334 #endif
1335
1336 /* Code executed at the end of each rule. */
1337 #ifndef YY_BREAK
1338 #define YY_BREAK /*LINTED*/break;
1339 #endif
1340
1341 #define YY_RULE_SETUP \
1342 if ( yyleng > 0 ) \
1343 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
1344 (yytext[yyleng - 1] == '\n'); \
1345 YY_USER_ACTION
1346
1347 /** The main scanner function which does all the work.
1348 */
1349 YY_DECL
1350 {
1351 yy_state_type yy_current_state;
1352 char *yy_cp, *yy_bp;
1353 int yy_act;
1354 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1355
1356 yylval = yylval_param;
1357
1358 yylloc = yylloc_param;
1359
1360 if ( !yyg->yy_init )
1361 {
1362 yyg->yy_init = 1;
1363
1364 #ifdef YY_USER_INIT
1365 YY_USER_INIT;
1366 #endif
1367
1368 /* Create the reject buffer large enough to save one state per allowed character. */
1369 if ( ! yyg->yy_state_buf )
1370 yyg->yy_state_buf = (yy_state_type *)yyalloc(YY_STATE_BUF_SIZE , yyscanner);
1371 if ( ! yyg->yy_state_buf )
1372 YY_FATAL_ERROR( "out of dynamic memory in yylex()" );
1373
1374 if ( ! yyg->yy_start )
1375 yyg->yy_start = 1; /* first start state */
1376
1377 if ( ! yyin )
1378 yyin = stdin;
1379
1380 if ( ! yyout )
1381 yyout = stdout;
1382
1383 if ( ! YY_CURRENT_BUFFER ) {
1384 yyensure_buffer_stack (yyscanner);
1385 YY_CURRENT_BUFFER_LVALUE =
1386 yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner);
1387 }
1388
1389 yy_load_buffer_state( yyscanner );
1390 }
1391
1392 {
1393 #line 279 "/source/lib/cfg-lex.l"
1394
1395
1396 #line 1397 "lib/cfg-lex.c"
1397
1398 while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
1399 {
1400 yy_cp = yyg->yy_c_buf_p;
1401
1402 /* Support of yytext. */
1403 *yy_cp = yyg->yy_hold_char;
1404
1405 /* yy_bp points to the position in yy_ch_buf of the start of
1406 * the current run.
1407 */
1408 yy_bp = yy_cp;
1409
1410 yy_current_state = yyg->yy_start;
1411 yy_current_state += YY_AT_BOL();
1412
1413 yyg->yy_state_ptr = yyg->yy_state_buf;
1414 *yyg->yy_state_ptr++ = yy_current_state;
1415
1416 yy_match:
1417 do
1418 {
1419 YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
1420 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1421 {
1422 yy_current_state = (int) yy_def[yy_current_state];
1423 if ( yy_current_state >= 124 )
1424 yy_c = yy_meta[yy_c];
1425 }
1426 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1427 *yyg->yy_state_ptr++ = yy_current_state;
1428 ++yy_cp;
1429 }
1430 while ( yy_base[yy_current_state] != 415 );
1431
1432 yy_find_action:
1433 yy_current_state = *--yyg->yy_state_ptr;
1434 yyg->yy_lp = yy_accept[yy_current_state];
1435
1436 find_rule: /* we branch to this label when backing up */
1437
1438 for ( ; ; ) /* until we find what rule we matched */
1439 {
1440 if ( yyg->yy_lp && yyg->yy_lp < yy_accept[yy_current_state + 1] )
1441 {
1442 yy_act = yy_acclist[yyg->yy_lp];
1443 {
1444 yyg->yy_full_match = yy_cp;
1445 break;
1446 }
1447 }
1448 --yy_cp;
1449 yy_current_state = *--yyg->yy_state_ptr;
1450 yyg->yy_lp = yy_accept[yy_current_state];
1451 }
1452
1453 YY_DO_BEFORE_ACTION;
1454
1455 do_action: /* This label is used only to access EOF actions. */
1456
1457 switch ( yy_act )
1458 { /* beginning of action switch */
1459 case 1:
1460 YY_RULE_SETUP
1461 #line 281 "/source/lib/cfg-lex.l"
1462 {
1463 _process_commented_line(yyscanner,yyextra->token_text,yyextra->token_text);
1464 }
1465 YY_BREAK
1466 case 2:
1467 YY_RULE_SETUP
1468 #line 284 "/source/lib/cfg-lex.l"
1469 {
1470 return LL_PRAGMA;
1471 }
1472 YY_BREAK
1473 /* continuation line: just move the location and skip the newline character */
1474 case 3:
1475 /* rule 3 can match eol */
1476 YY_RULE_SETUP
1477 #line 289 "/source/lib/cfg-lex.l"
1478 { _cfg_lex_extend_token_location_to_next_line(yyextra); }
1479 YY_BREAK
1480 case 4:
1481 /* rule 4 can match eol */
1482 YY_RULE_SETUP
1483 #line 290 "/source/lib/cfg-lex.l"
1484 {
1485 *yylloc = yyextra->include_stack[yyextra->include_depth].lloc;
1486 _cfg_lex_move_token_location_to_new_line(yyextra);
1487 if (yyextra->tokenize_eol)
1488 return LL_EOL;
1489 else
1490 g_string_append(yyextra->string_buffer, yytext);
1491 }
1492 YY_BREAK
1493 case 5:
1494 YY_RULE_SETUP
1495 #line 298 "/source/lib/cfg-lex.l"
1496 ;
1497 YY_BREAK
1498 case 6:
1499 YY_RULE_SETUP
1500 #line 299 "/source/lib/cfg-lex.l"
1501 { return LL_DOTDOT; }
1502 YY_BREAK
1503 case 7:
1504 YY_RULE_SETUP
1505 #line 300 "/source/lib/cfg-lex.l"
1506 { return LL_DOTDOTDOT; }
1507 YY_BREAK
1508 case 8:
1509 YY_RULE_SETUP
1510 #line 301 "/source/lib/cfg-lex.l"
1511 { return LL_ARROW; }
1512 YY_BREAK
1513 case 9:
1514 YY_RULE_SETUP
1515 #line 302 "/source/lib/cfg-lex.l"
1516 { yylval->fnum = strtod(yytext, NULL); return LL_FLOAT; }
1517 YY_BREAK
1518 case 10:
1519 YY_RULE_SETUP
1520 #line 303 "/source/lib/cfg-lex.l"
1521 {
1522 if (!parse_number_with_suffix(yytext, &yylval->num))
1523 {
1524 return LL_ERROR;
1525 }
1526 return LL_NUMBER;
1527 }
1528 YY_BREAK
1529 case 11:
1530 YY_RULE_SETUP
1531 #line 310 "/source/lib/cfg-lex.l"
1532 {
1533 if (!parse_number_with_suffix(yytext, &yylval->num))
1534 {
1535 return LL_ERROR;
1536 }
1537 return LL_NUMBER;
1538 }
1539 YY_BREAK
1540 case 12:
1541 YY_RULE_SETUP
1542 #line 317 "/source/lib/cfg-lex.l"
1543 {
1544 if (!parse_number_with_suffix(yytext, &yylval->num))
1545 {
1546 return LL_ERROR;
1547 }
1548 return LL_NUMBER;
1549 }
1550 YY_BREAK
1551 case 13:
1552 YY_RULE_SETUP
1553 #line 324 "/source/lib/cfg-lex.l"
1554 { return cfg_lexer_lookup_keyword(yyextra, yylval, yylloc, yytext); }
1555 YY_BREAK
1556 case 14:
1557 YY_RULE_SETUP
1558 #line 325 "/source/lib/cfg-lex.l"
1559 ;
1560 YY_BREAK
1561 case 15:
1562 YY_RULE_SETUP
1563 #line 327 "/source/lib/cfg-lex.l"
1564 {
1565 g_string_truncate(yyextra->string_buffer, 0);
1566 yy_push_state(string, yyscanner);
1567 }
1568 YY_BREAK
1569 case 16:
1570 YY_RULE_SETUP
1571 #line 331 "/source/lib/cfg-lex.l"
1572 {
1573 g_string_truncate(yyextra->string_buffer, 0);
1574 yy_push_state(qstring, yyscanner);
1575 }
1576 YY_BREAK
1577 case 17:
1578 YY_RULE_SETUP
1579 #line 335 "/source/lib/cfg-lex.l"
1580 { return (unsigned char) yytext[0]; }
1581 YY_BREAK
1582 /* continuation line within a string: just move the location and skip the newline character as if it was never there */
1583 case 18:
1584 /* rule 18 can match eol */
1585 YY_RULE_SETUP
1586 #line 338 "/source/lib/cfg-lex.l"
1587 { _cfg_lex_extend_token_location_to_next_line(yyextra); }
1588 YY_BREAK
1589 case 19:
1590 YY_RULE_SETUP
1591 #line 339 "/source/lib/cfg-lex.l"
1592 { g_string_append_c(yyextra->string_buffer, 7); }
1593 YY_BREAK
1594 case 20:
1595 YY_RULE_SETUP
1596 #line 340 "/source/lib/cfg-lex.l"
1597 { g_string_append_c(yyextra->string_buffer, 10); }
1598 YY_BREAK
1599 case 21:
1600 YY_RULE_SETUP
1601 #line 341 "/source/lib/cfg-lex.l"
1602 { g_string_append_c(yyextra->string_buffer, 13); }
1603 YY_BREAK
1604 case 22:
1605 YY_RULE_SETUP
1606 #line 342 "/source/lib/cfg-lex.l"
1607 { g_string_append_c(yyextra->string_buffer, 9); }
1608 YY_BREAK
1609 case 23:
1610 YY_RULE_SETUP
1611 #line 343 "/source/lib/cfg-lex.l"
1612 { g_string_append_c(yyextra->string_buffer, 11); }
1613 YY_BREAK
1614 case 24:
1615 YY_RULE_SETUP
1616 #line 344 "/source/lib/cfg-lex.l"
1617 { g_string_append_c(yyextra->string_buffer, strtol(yytext+2, NULL, 16)); }
1618 YY_BREAK
1619 case 25:
1620 YY_RULE_SETUP
1621 #line 345 "/source/lib/cfg-lex.l"
1622 { g_string_append_c(yyextra->string_buffer, strtol(yytext+2, NULL, 8)); }
1623 YY_BREAK
1624 case 26:
1625 /* rule 26 can match eol */
1626 YY_RULE_SETUP
1627 #line 346 "/source/lib/cfg-lex.l"
1628 { g_string_append_c(yyextra->string_buffer, yytext[1]); }
1629 YY_BREAK
1630 case 27:
1631 YY_RULE_SETUP
1632 #line 347 "/source/lib/cfg-lex.l"
1633 {
1634 yy_pop_state(yyscanner);
1635 yylval->cptr = strdup(yyextra->string_buffer->str);
1636 return LL_STRING;
1637 }
1638 YY_BREAK
1639 case 28:
1640 YY_RULE_SETUP
1641 #line 352 "/source/lib/cfg-lex.l"
1642 { g_string_append(yyextra->string_buffer, yytext); }
1643 YY_BREAK
1644 case 29:
1645 YY_RULE_SETUP
1646 #line 353 "/source/lib/cfg-lex.l"
1647 { g_string_append(yyextra->string_buffer, yytext); }
1648 YY_BREAK
1649 case 30:
1650 YY_RULE_SETUP
1651 #line 354 "/source/lib/cfg-lex.l"
1652 {
1653 yy_pop_state(yyscanner);
1654 yylval->cptr = strdup(yyextra->string_buffer->str);
1655 return LL_STRING;
1656 }
1657 YY_BREAK
1658 /* the rule below will only be applied to embedded newlines within
1659 * string/qstring. There's a difference how we handle backslash quotation
1660 * of newline though.
1661 *
1662 * If a \\\n sequence is in a <string> (e.g. quoted newline)
1663 * - the backslash is explicitly not allowed in the greedy rule that eats string characters
1664 * - thus <*>\\\r?\n rule gets applied, at the top of the file, removing the newline
1665 * - location tracking is preserved
1666 *
1667 * If a \n sequence is in a <string> (e.g. embedded newline)
1668 * - the newline character is processed by the rule below, thus it is
1669 * included as a literal newline
1670 *
1671 * If a \\\n sequence is in a <qstring> (e.g. quotation is not supported)
1672 * - the backslash is eaten by the greedy rule for qstring
1673 * - <*>\\\r?\n is not matching as the backslash is not there
1674 * - the rule below gets matched and the newline is included in the string
1675 *
1676 * If a \n sequence is in a <qstring> (e.g. embedded newline)
1677 * - the rule below gets matched and the newline is included in the string
1678 */
1679 case 31:
1680 /* rule 31 can match eol */
1681 YY_RULE_SETUP
1682 #line 382 "/source/lib/cfg-lex.l"
1683 {
1684 g_string_append(yyextra->string_buffer, yytext);
1685 _cfg_lex_extend_token_location_to_next_line(yyextra);
1686 }
1687 YY_BREAK
1688 /* continuation line within blocks: in the block header we just ignore
1689 * the continuation line, whereas in string/qstring we retain them
1690 * literally. */
1691 case 32:
1692 /* rule 32 can match eol */
1693 YY_RULE_SETUP
1694 #line 391 "/source/lib/cfg-lex.l"
1695 { _cfg_lex_extend_token_location_to_next_line(yyextra); }
1696 YY_BREAK
1697 case 33:
1698 /* rule 33 can match eol */
1699 YY_RULE_SETUP
1700 #line 392 "/source/lib/cfg-lex.l"
1701 { g_string_append(yyextra->string_buffer, yytext); _cfg_lex_extend_token_location_to_next_line(yyextra); }
1702 YY_BREAK
1703 /* rules to parse a block as a LL_BLOCK token */
1704 case 34:
1705 YY_RULE_SETUP
1706 #line 395 "/source/lib/cfg-lex.l"
1707 ;
1708 YY_BREAK
1709 case 35:
1710 YY_RULE_SETUP
1711 #line 396 "/source/lib/cfg-lex.l"
1712 { YY_FATAL_ERROR("Expected opening bracket as block boundary, e.g. opening brace or parenthesis"); }
1713 YY_BREAK
1714 case 36:
1715 /* rule 36 can match eol */
1716 YY_RULE_SETUP
1717 #line 397 "/source/lib/cfg-lex.l"
1718 { _cfg_lex_move_token_location_to_new_line(yyextra); };
1719 YY_BREAK
1720 case 37:
1721 YY_RULE_SETUP
1722 #line 398 "/source/lib/cfg-lex.l"
1723 { yy_pop_state(yyscanner); yylval->cptr = NULL; return LL_BLOCK; }
1724 YY_BREAK
1725 case 38:
1726 YY_RULE_SETUP
1727 #line 399 "/source/lib/cfg-lex.l"
1728 { yy_pop_state(yyscanner); yylval->cptr = g_strdup(""); return LL_BLOCK; }
1729 YY_BREAK
1730 case 39:
1731 YY_RULE_SETUP
1732 #line 400 "/source/lib/cfg-lex.l"
1733 { yy_pop_state(yyscanner); yylval->cptr = g_strdup(""); return LL_BLOCK; }
1734 YY_BREAK
1735 /* start character of the block */
1736 case 40:
1737 YY_RULE_SETUP
1738 #line 403 "/source/lib/cfg-lex.l"
1739 {
1740 if (yytext[0] != yyextra->block_boundary[0])
1741 REJECT;
1742 g_string_truncate(yyextra->string_buffer, 0);
1743 yyextra->brace_count = 1;
1744 yy_push_state(block_content, yyscanner);
1745 }
1746 YY_BREAK
1747 /* block_content, handle embedded string/qstring/comments properly, count
1748 * braces so we only end the block if they are pairing up, unless they are
1749 * in a string/qstring/comment. */
1750 case 41:
1751 YY_RULE_SETUP
1752 #line 415 "/source/lib/cfg-lex.l"
1753 {
1754 g_string_append_c(yyextra->string_buffer, yytext[0]);
1755 yy_push_state(block_string, yyscanner);
1756 }
1757 YY_BREAK
1758 case 42:
1759 YY_RULE_SETUP
1760 #line 420 "/source/lib/cfg-lex.l"
1761 {
1762 g_string_append_c(yyextra->string_buffer, yytext[0]);
1763 yy_push_state(block_qstring, yyscanner);
1764 }
1765 YY_BREAK
1766 case 43:
1767 YY_RULE_SETUP
1768 #line 425 "/source/lib/cfg-lex.l"
1769 {
1770 g_string_append_c(yyextra->string_buffer, yytext[0]);
1771 _process_commented_line(yyscanner, yyextra->string_buffer, TRUE);
1772 }
1773 YY_BREAK
1774 case 44:
1775 YY_RULE_SETUP
1776 #line 430 "/source/lib/cfg-lex.l"
1777 {
1778 g_string_append_c(yyextra->string_buffer, yytext[0]);
1779 if (yytext[0] == yyextra->block_boundary[0])
1780 yyextra->brace_count++;
1781 }
1782 YY_BREAK
1783 case 45:
1784 YY_RULE_SETUP
1785 #line 435 "/source/lib/cfg-lex.l"
1786 {
1787 if (yytext[0] == yyextra->block_boundary[1])
1788 yyextra->brace_count--;
1789 if (yyextra->brace_count == 0)
1790 {
1791 yy_pop_state(yyscanner);
1792 yy_pop_state(yyscanner);
1793 yylval->cptr = strdup(yyextra->string_buffer->str);
1794 return LL_BLOCK;
1795 }
1796 else
1797 {
1798 g_string_append_c(yyextra->string_buffer, yytext[0]);
1799 }
1800
1801 }
1802 YY_BREAK
1803 case 46:
1804 YY_RULE_SETUP
1805 #line 453 "/source/lib/cfg-lex.l"
1806 {
1807 g_string_append(yyextra->string_buffer, yytext);
1808 }
1809 YY_BREAK
1810 case 47:
1811 YY_RULE_SETUP
1812 #line 457 "/source/lib/cfg-lex.l"
1813 { g_string_append(yyextra->string_buffer, yytext); }
1814 YY_BREAK
1815 case 48:
1816 YY_RULE_SETUP
1817 #line 458 "/source/lib/cfg-lex.l"
1818 { g_string_append(yyextra->string_buffer, yytext); }
1819 YY_BREAK
1820 case 49:
1821 YY_RULE_SETUP
1822 #line 459 "/source/lib/cfg-lex.l"
1823 {
1824 g_string_append_c(yyextra->string_buffer, yytext[0]);
1825 yy_pop_state(yyscanner);
1826 }
1827 YY_BREAK
1828 case 50:
1829 YY_RULE_SETUP
1830 #line 464 "/source/lib/cfg-lex.l"
1831 {
1832 g_string_append_c(yyextra->string_buffer, yytext[0]);
1833 yy_pop_state(yyscanner);
1834 }
1835 YY_BREAK
1836 case 51:
1837 YY_RULE_SETUP
1838 #line 468 "/source/lib/cfg-lex.l"
1839 {
1840 g_string_append(yyextra->string_buffer, yytext);
1841 }
1842 YY_BREAK
1843 /* The newlines embedded in block_string/block_qstring/block_content is
1844 * literally coped into the block token, even if there's backslash as the
1845 * last character. Basically we behave just as if the entire block was a
1846 * qstring.
1847 */
1848 case 52:
1849 /* rule 52 can match eol */
1850 YY_RULE_SETUP
1851 #line 477 "/source/lib/cfg-lex.l"
1852 {
1853 g_string_append(yyextra->string_buffer, yytext);
1854 _cfg_lex_extend_token_location_to_next_line(yyextra);
1855 }
1856 YY_BREAK
1857 case YY_STATE_EOF(INITIAL):
1858 #line 482 "/source/lib/cfg-lex.l"
1859 {
1860 if (!cfg_lexer_start_next_include(yyextra))
1861 {
1862 if (yyextra->include_depth == 0)
1863 {
1864 *yylloc = yyextra->include_stack[0].lloc;
1865 yyterminate();
1866 }
1867 else
1868 return LL_ERROR;
1869 }
1870 }
1871 YY_BREAK
1872 case 53:
1873 YY_RULE_SETUP
1874 #line 495 "/source/lib/cfg-lex.l"
1875 ECHO;
1876 YY_BREAK
1877 #line 1878 "lib/cfg-lex.c"
1878 case YY_STATE_EOF(string):
1879 case YY_STATE_EOF(qstring):
1880 case YY_STATE_EOF(block):
1881 case YY_STATE_EOF(block_content):
1882 case YY_STATE_EOF(block_string):
1883 case YY_STATE_EOF(block_qstring):
1884 yyterminate();
1885
1886 case YY_END_OF_BUFFER:
1887 {
1888 /* Amount of text matched not including the EOB char. */
1889 int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
1890
1891 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1892 *yy_cp = yyg->yy_hold_char;
1893 YY_RESTORE_YY_MORE_OFFSET
1894
1895 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1896 {
1897 /* We're scanning a new file or input source. It's
1898 * possible that this happened because the user
1899 * just pointed yyin at a new source and called
1900 * yylex(). If so, then we have to assure
1901 * consistency between YY_CURRENT_BUFFER and our
1902 * globals. Here is the right place to do so, because
1903 * this is the first action (other than possibly a
1904 * back-up) that will match for the new input source.
1905 */
1906 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1907 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1908 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1909 }
1910
1911 /* Note that here we test for yy_c_buf_p "<=" to the position
1912 * of the first EOB in the buffer, since yy_c_buf_p will
1913 * already have been incremented past the NUL character
1914 * (since all states make transitions on EOB to the
1915 * end-of-buffer state). Contrast this with the test
1916 * in input().
1917 */
1918 if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
1919 { /* This was really a NUL. */
1920 yy_state_type yy_next_state;
1921
1922 yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
1923
1924 yy_current_state = yy_get_previous_state( yyscanner );
1925
1926 /* Okay, we're now positioned to make the NUL
1927 * transition. We couldn't have
1928 * yy_get_previous_state() go ahead and do it
1929 * for us because it doesn't know how to deal
1930 * with the possibility of jamming (and we don't
1931 * want to build jamming into it because then it
1932 * will run more slowly).
1933 */
1934
1935 yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
1936
1937 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1938
1939 if ( yy_next_state )
1940 {
1941 /* Consume the NUL. */
1942 yy_cp = ++yyg->yy_c_buf_p;
1943 yy_current_state = yy_next_state;
1944 goto yy_match;
1945 }
1946
1947 else
1948 {
1949 yy_cp = yyg->yy_c_buf_p;
1950 goto yy_find_action;
1951 }
1952 }
1953
1954 else switch ( yy_get_next_buffer( yyscanner ) )
1955 {
1956 case EOB_ACT_END_OF_FILE:
1957 {
1958 yyg->yy_did_buffer_switch_on_eof = 0;
1959
1960 if ( yywrap( yyscanner ) )
1961 {
1962 /* Note: because we've taken care in
1963 * yy_get_next_buffer() to have set up
1964 * yytext, we can now set up
1965 * yy_c_buf_p so that if some total
1966 * hoser (like flex itself) wants to
1967 * call the scanner after we return the
1968 * YY_NULL, it'll still work - another
1969 * YY_NULL will get returned.
1970 */
1971 yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
1972
1973 yy_act = YY_STATE_EOF(YY_START);
1974 goto do_action;
1975 }
1976
1977 else
1978 {
1979 if ( ! yyg->yy_did_buffer_switch_on_eof )
1980 YY_NEW_FILE;
1981 }
1982 break;
1983 }
1984
1985 case EOB_ACT_CONTINUE_SCAN:
1986 yyg->yy_c_buf_p =
1987 yyg->yytext_ptr + yy_amount_of_matched_text;
1988
1989 yy_current_state = yy_get_previous_state( yyscanner );
1990
1991 yy_cp = yyg->yy_c_buf_p;
1992 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1993 goto yy_match;
1994
1995 case EOB_ACT_LAST_MATCH:
1996 yyg->yy_c_buf_p =
1997 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
1998
1999 yy_current_state = yy_get_previous_state( yyscanner );
2000
2001 yy_cp = yyg->yy_c_buf_p;
2002 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
2003 goto yy_find_action;
2004 }
2005 break;
2006 }
2007
2008 default:
2009 YY_FATAL_ERROR(
2010 "fatal flex scanner internal error--no action found" );
2011 } /* end of action switch */
2012 } /* end of scanning one token */
2013 } /* end of user's declarations */
2014 } /* end of yylex */
2015
2016 /* yy_get_next_buffer - try to read in a new buffer
2017 *
2018 * Returns a code representing an action:
2019 * EOB_ACT_LAST_MATCH -
2020 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
2021 * EOB_ACT_END_OF_FILE - end of file
2022 */
yy_get_next_buffer(yyscan_t yyscanner)2023 static int yy_get_next_buffer (yyscan_t yyscanner)
2024 {
2025 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2026 char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
2027 char *source = yyg->yytext_ptr;
2028 int number_to_move, i;
2029 int ret_val;
2030
2031 if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
2032 YY_FATAL_ERROR(
2033 "fatal flex scanner internal error--end of buffer missed" );
2034
2035 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
2036 { /* Don't try to fill the buffer, so this is an EOF. */
2037 if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
2038 {
2039 /* We matched a single character, the EOB, so
2040 * treat this as a final EOF.
2041 */
2042 return EOB_ACT_END_OF_FILE;
2043 }
2044
2045 else
2046 {
2047 /* We matched some text prior to the EOB, first
2048 * process it.
2049 */
2050 return EOB_ACT_LAST_MATCH;
2051 }
2052 }
2053
2054 /* Try to read more data. */
2055
2056 /* First move last chars to start of buffer. */
2057 number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr - 1);
2058
2059 for ( i = 0; i < number_to_move; ++i )
2060 *(dest++) = *(source++);
2061
2062 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
2063 /* don't do the read, it's not guaranteed to return an EOF,
2064 * just force an EOF
2065 */
2066 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
2067
2068 else
2069 {
2070 int num_to_read =
2071 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
2072
2073 while ( num_to_read <= 0 )
2074 { /* Not enough room in the buffer - grow it. */
2075
2076 YY_FATAL_ERROR(
2077 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
2078
2079 }
2080
2081 if ( num_to_read > YY_READ_BUF_SIZE )
2082 num_to_read = YY_READ_BUF_SIZE;
2083
2084 /* Read in more data. */
2085 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
2086 yyg->yy_n_chars, num_to_read );
2087
2088 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
2089 }
2090
2091 if ( yyg->yy_n_chars == 0 )
2092 {
2093 if ( number_to_move == YY_MORE_ADJ )
2094 {
2095 ret_val = EOB_ACT_END_OF_FILE;
2096 yyrestart( yyin , yyscanner);
2097 }
2098
2099 else
2100 {
2101 ret_val = EOB_ACT_LAST_MATCH;
2102 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
2103 YY_BUFFER_EOF_PENDING;
2104 }
2105 }
2106
2107 else
2108 ret_val = EOB_ACT_CONTINUE_SCAN;
2109
2110 if ((yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
2111 /* Extend the array by 50%, plus the number we really need. */
2112 int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
2113 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
2114 (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size , yyscanner );
2115 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
2116 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
2117 /* "- 2" to take care of EOB's */
2118 YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
2119 }
2120
2121 yyg->yy_n_chars += number_to_move;
2122 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
2123 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
2124
2125 yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
2126
2127 return ret_val;
2128 }
2129
2130 /* yy_get_previous_state - get the state just before the EOB char was reached */
2131
yy_get_previous_state(yyscan_t yyscanner)2132 static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
2133 {
2134 yy_state_type yy_current_state;
2135 char *yy_cp;
2136 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2137
2138 yy_current_state = yyg->yy_start;
2139 yy_current_state += YY_AT_BOL();
2140
2141 yyg->yy_state_ptr = yyg->yy_state_buf;
2142 *yyg->yy_state_ptr++ = yy_current_state;
2143
2144 for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
2145 {
2146 YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
2147 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2148 {
2149 yy_current_state = (int) yy_def[yy_current_state];
2150 if ( yy_current_state >= 124 )
2151 yy_c = yy_meta[yy_c];
2152 }
2153 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
2154 *yyg->yy_state_ptr++ = yy_current_state;
2155 }
2156
2157 return yy_current_state;
2158 }
2159
2160 /* yy_try_NUL_trans - try to make a transition on the NUL character
2161 *
2162 * synopsis
2163 * next_state = yy_try_NUL_trans( current_state );
2164 */
yy_try_NUL_trans(yy_state_type yy_current_state,yyscan_t yyscanner)2165 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner)
2166 {
2167 int yy_is_jam;
2168 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
2169
2170 YY_CHAR yy_c = 1;
2171 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2172 {
2173 yy_current_state = (int) yy_def[yy_current_state];
2174 if ( yy_current_state >= 124 )
2175 yy_c = yy_meta[yy_c];
2176 }
2177 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
2178 yy_is_jam = (yy_current_state == 123);
2179 if ( ! yy_is_jam )
2180 *yyg->yy_state_ptr++ = yy_current_state;
2181
2182 (void)yyg;
2183 return yy_is_jam ? 0 : yy_current_state;
2184 }
2185
2186 #ifndef YY_NO_UNPUT
2187
yyunput(int c,char * yy_bp,yyscan_t yyscanner)2188 static void yyunput (int c, char * yy_bp , yyscan_t yyscanner)
2189 {
2190 char *yy_cp;
2191 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2192
2193 yy_cp = yyg->yy_c_buf_p;
2194
2195 /* undo effects of setting up yytext */
2196 *yy_cp = yyg->yy_hold_char;
2197
2198 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
2199 { /* need to shift things up to make room */
2200 /* +2 for EOB chars. */
2201 int number_to_move = yyg->yy_n_chars + 2;
2202 char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
2203 YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
2204 char *source =
2205 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
2206
2207 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
2208 *--dest = *--source;
2209
2210 yy_cp += (int) (dest - source);
2211 yy_bp += (int) (dest - source);
2212 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
2213 yyg->yy_n_chars = (int) YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
2214
2215 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
2216 YY_FATAL_ERROR( "flex scanner push-back overflow" );
2217 }
2218
2219 *--yy_cp = (char) c;
2220
2221 yyg->yytext_ptr = yy_bp;
2222 yyg->yy_hold_char = *yy_cp;
2223 yyg->yy_c_buf_p = yy_cp;
2224 }
2225
2226 #endif
2227
2228 #ifndef YY_NO_INPUT
2229 #ifdef __cplusplus
yyinput(yyscan_t yyscanner)2230 static int yyinput (yyscan_t yyscanner)
2231 #else
2232 static int input (yyscan_t yyscanner)
2233 #endif
2234
2235 {
2236 int c;
2237 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2238
2239 *yyg->yy_c_buf_p = yyg->yy_hold_char;
2240
2241 if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
2242 {
2243 /* yy_c_buf_p now points to the character we want to return.
2244 * If this occurs *before* the EOB characters, then it's a
2245 * valid NUL; if not, then we've hit the end of the buffer.
2246 */
2247 if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
2248 /* This was really a NUL. */
2249 *yyg->yy_c_buf_p = '\0';
2250
2251 else
2252 { /* need more input */
2253 int offset = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr);
2254 ++yyg->yy_c_buf_p;
2255
2256 switch ( yy_get_next_buffer( yyscanner ) )
2257 {
2258 case EOB_ACT_LAST_MATCH:
2259 /* This happens because yy_g_n_b()
2260 * sees that we've accumulated a
2261 * token and flags that we need to
2262 * try matching the token before
2263 * proceeding. But for input(),
2264 * there's no matching to consider.
2265 * So convert the EOB_ACT_LAST_MATCH
2266 * to EOB_ACT_END_OF_FILE.
2267 */
2268
2269 /* Reset buffer status. */
2270 yyrestart( yyin , yyscanner);
2271
2272 /*FALLTHROUGH*/
2273
2274 case EOB_ACT_END_OF_FILE:
2275 {
2276 if ( yywrap( yyscanner ) )
2277 return 0;
2278
2279 if ( ! yyg->yy_did_buffer_switch_on_eof )
2280 YY_NEW_FILE;
2281 #ifdef __cplusplus
2282 return yyinput(yyscanner);
2283 #else
2284 return input(yyscanner);
2285 #endif
2286 }
2287
2288 case EOB_ACT_CONTINUE_SCAN:
2289 yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
2290 break;
2291 }
2292 }
2293 }
2294
2295 c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */
2296 *yyg->yy_c_buf_p = '\0'; /* preserve yytext */
2297 yyg->yy_hold_char = *++yyg->yy_c_buf_p;
2298
2299 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n');
2300
2301 return c;
2302 }
2303 #endif /* ifndef YY_NO_INPUT */
2304
2305 /** Immediately switch to a different input stream.
2306 * @param input_file A readable stream.
2307 * @param yyscanner The scanner object.
2308 * @note This function does not reset the start condition to @c INITIAL .
2309 */
yyrestart(FILE * input_file,yyscan_t yyscanner)2310 void yyrestart (FILE * input_file , yyscan_t yyscanner)
2311 {
2312 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2313
2314 if ( ! YY_CURRENT_BUFFER ){
2315 yyensure_buffer_stack (yyscanner);
2316 YY_CURRENT_BUFFER_LVALUE =
2317 yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner);
2318 }
2319
2320 yy_init_buffer( YY_CURRENT_BUFFER, input_file , yyscanner);
2321 yy_load_buffer_state( yyscanner );
2322 }
2323
2324 /** Switch to a different input buffer.
2325 * @param new_buffer The new input buffer.
2326 * @param yyscanner The scanner object.
2327 */
yy_switch_to_buffer(YY_BUFFER_STATE new_buffer,yyscan_t yyscanner)2328 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
2329 {
2330 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2331
2332 /* TODO. We should be able to replace this entire function body
2333 * with
2334 * yypop_buffer_state();
2335 * yypush_buffer_state(new_buffer);
2336 */
2337 yyensure_buffer_stack (yyscanner);
2338 if ( YY_CURRENT_BUFFER == new_buffer )
2339 return;
2340
2341 if ( YY_CURRENT_BUFFER )
2342 {
2343 /* Flush out information for old buffer. */
2344 *yyg->yy_c_buf_p = yyg->yy_hold_char;
2345 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
2346 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
2347 }
2348
2349 YY_CURRENT_BUFFER_LVALUE = new_buffer;
2350 yy_load_buffer_state( yyscanner );
2351
2352 /* We don't actually know whether we did this switch during
2353 * EOF (yywrap()) processing, but the only time this flag
2354 * is looked at is after yywrap() is called, so it's safe
2355 * to go ahead and always set it.
2356 */
2357 yyg->yy_did_buffer_switch_on_eof = 1;
2358 }
2359
yy_load_buffer_state(yyscan_t yyscanner)2360 static void yy_load_buffer_state (yyscan_t yyscanner)
2361 {
2362 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2363 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2364 yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
2365 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
2366 yyg->yy_hold_char = *yyg->yy_c_buf_p;
2367 }
2368
2369 /** Allocate and initialize an input buffer state.
2370 * @param file A readable stream.
2371 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
2372 * @param yyscanner The scanner object.
2373 * @return the allocated buffer state.
2374 */
yy_create_buffer(FILE * file,int size,yyscan_t yyscanner)2375 YY_BUFFER_STATE yy_create_buffer (FILE * file, int size , yyscan_t yyscanner)
2376 {
2377 YY_BUFFER_STATE b;
2378
2379 b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner );
2380 if ( ! b )
2381 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2382
2383 b->yy_buf_size = size;
2384
2385 /* yy_ch_buf has to be 2 characters longer than the size given because
2386 * we need to put in 2 end-of-buffer characters.
2387 */
2388 b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
2389 if ( ! b->yy_ch_buf )
2390 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2391
2392 b->yy_is_our_buffer = 1;
2393
2394 yy_init_buffer( b, file , yyscanner);
2395
2396 return b;
2397 }
2398
2399 /** Destroy the buffer.
2400 * @param b a buffer created with yy_create_buffer()
2401 * @param yyscanner The scanner object.
2402 */
yy_delete_buffer(YY_BUFFER_STATE b,yyscan_t yyscanner)2403 void yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
2404 {
2405 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2406
2407 if ( ! b )
2408 return;
2409
2410 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
2411 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
2412
2413 if ( b->yy_is_our_buffer )
2414 yyfree( (void *) b->yy_ch_buf , yyscanner );
2415
2416 yyfree( (void *) b , yyscanner );
2417 }
2418
2419 /* Initializes or reinitializes a buffer.
2420 * This function is sometimes called more than once on the same buffer,
2421 * such as during a yyrestart() or at EOF.
2422 */
yy_init_buffer(YY_BUFFER_STATE b,FILE * file,yyscan_t yyscanner)2423 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
2424
2425 {
2426 int oerrno = errno;
2427 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2428
2429 yy_flush_buffer( b , yyscanner);
2430
2431 b->yy_input_file = file;
2432 b->yy_fill_buffer = 1;
2433
2434 /* If b is the current buffer, then yy_init_buffer was _probably_
2435 * called from yyrestart() or through yy_get_next_buffer.
2436 * In that case, we don't want to reset the lineno or column.
2437 */
2438 if (b != YY_CURRENT_BUFFER){
2439 b->yy_bs_lineno = 1;
2440 b->yy_bs_column = 0;
2441 }
2442
2443 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
2444
2445 errno = oerrno;
2446 }
2447
2448 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
2449 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
2450 * @param yyscanner The scanner object.
2451 */
yy_flush_buffer(YY_BUFFER_STATE b,yyscan_t yyscanner)2452 void yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
2453 {
2454 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2455 if ( ! b )
2456 return;
2457
2458 b->yy_n_chars = 0;
2459
2460 /* We always need two end-of-buffer characters. The first causes
2461 * a transition to the end-of-buffer state. The second causes
2462 * a jam in that state.
2463 */
2464 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
2465 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
2466
2467 b->yy_buf_pos = &b->yy_ch_buf[0];
2468
2469 b->yy_at_bol = 1;
2470 b->yy_buffer_status = YY_BUFFER_NEW;
2471
2472 if ( b == YY_CURRENT_BUFFER )
2473 yy_load_buffer_state( yyscanner );
2474 }
2475
2476 /** Pushes the new state onto the stack. The new state becomes
2477 * the current state. This function will allocate the stack
2478 * if necessary.
2479 * @param new_buffer The new state.
2480 * @param yyscanner The scanner object.
2481 */
yypush_buffer_state(YY_BUFFER_STATE new_buffer,yyscan_t yyscanner)2482 void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
2483 {
2484 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2485 if (new_buffer == NULL)
2486 return;
2487
2488 yyensure_buffer_stack(yyscanner);
2489
2490 /* This block is copied from yy_switch_to_buffer. */
2491 if ( YY_CURRENT_BUFFER )
2492 {
2493 /* Flush out information for old buffer. */
2494 *yyg->yy_c_buf_p = yyg->yy_hold_char;
2495 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
2496 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
2497 }
2498
2499 /* Only push if top exists. Otherwise, replace top. */
2500 if (YY_CURRENT_BUFFER)
2501 yyg->yy_buffer_stack_top++;
2502 YY_CURRENT_BUFFER_LVALUE = new_buffer;
2503
2504 /* copied from yy_switch_to_buffer. */
2505 yy_load_buffer_state( yyscanner );
2506 yyg->yy_did_buffer_switch_on_eof = 1;
2507 }
2508
2509 /** Removes and deletes the top of the stack, if present.
2510 * The next element becomes the new top.
2511 * @param yyscanner The scanner object.
2512 */
yypop_buffer_state(yyscan_t yyscanner)2513 void yypop_buffer_state (yyscan_t yyscanner)
2514 {
2515 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2516 if (!YY_CURRENT_BUFFER)
2517 return;
2518
2519 yy_delete_buffer(YY_CURRENT_BUFFER , yyscanner);
2520 YY_CURRENT_BUFFER_LVALUE = NULL;
2521 if (yyg->yy_buffer_stack_top > 0)
2522 --yyg->yy_buffer_stack_top;
2523
2524 if (YY_CURRENT_BUFFER) {
2525 yy_load_buffer_state( yyscanner );
2526 yyg->yy_did_buffer_switch_on_eof = 1;
2527 }
2528 }
2529
2530 /* Allocates the stack if it does not exist.
2531 * Guarantees space for at least one push.
2532 */
yyensure_buffer_stack(yyscan_t yyscanner)2533 static void yyensure_buffer_stack (yyscan_t yyscanner)
2534 {
2535 yy_size_t num_to_alloc;
2536 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2537
2538 if (!yyg->yy_buffer_stack) {
2539
2540 /* First allocation is just for 2 elements, since we don't know if this
2541 * scanner will even need a stack. We use 2 instead of 1 to avoid an
2542 * immediate realloc on the next call.
2543 */
2544 num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
2545 yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc
2546 (num_to_alloc * sizeof(struct yy_buffer_state*)
2547 , yyscanner);
2548 if ( ! yyg->yy_buffer_stack )
2549 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
2550
2551 memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
2552
2553 yyg->yy_buffer_stack_max = num_to_alloc;
2554 yyg->yy_buffer_stack_top = 0;
2555 return;
2556 }
2557
2558 if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
2559
2560 /* Increase the buffer to prepare for a possible push. */
2561 yy_size_t grow_size = 8 /* arbitrary grow size */;
2562
2563 num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
2564 yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc
2565 (yyg->yy_buffer_stack,
2566 num_to_alloc * sizeof(struct yy_buffer_state*)
2567 , yyscanner);
2568 if ( ! yyg->yy_buffer_stack )
2569 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
2570
2571 /* zero only the new slots.*/
2572 memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
2573 yyg->yy_buffer_stack_max = num_to_alloc;
2574 }
2575 }
2576
2577 /** Setup the input buffer state to scan directly from a user-specified character buffer.
2578 * @param base the character buffer
2579 * @param size the size in bytes of the character buffer
2580 * @param yyscanner The scanner object.
2581 * @return the newly allocated buffer state object.
2582 */
yy_scan_buffer(char * base,yy_size_t size,yyscan_t yyscanner)2583 YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
2584 {
2585 YY_BUFFER_STATE b;
2586
2587 if ( size < 2 ||
2588 base[size-2] != YY_END_OF_BUFFER_CHAR ||
2589 base[size-1] != YY_END_OF_BUFFER_CHAR )
2590 /* They forgot to leave room for the EOB's. */
2591 return NULL;
2592
2593 b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner );
2594 if ( ! b )
2595 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
2596
2597 b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */
2598 b->yy_buf_pos = b->yy_ch_buf = base;
2599 b->yy_is_our_buffer = 0;
2600 b->yy_input_file = NULL;
2601 b->yy_n_chars = b->yy_buf_size;
2602 b->yy_is_interactive = 0;
2603 b->yy_at_bol = 1;
2604 b->yy_fill_buffer = 0;
2605 b->yy_buffer_status = YY_BUFFER_NEW;
2606
2607 yy_switch_to_buffer( b , yyscanner );
2608
2609 return b;
2610 }
2611
2612 /** Setup the input buffer state to scan a string. The next call to yylex() will
2613 * scan from a @e copy of @a str.
2614 * @param yystr a NUL-terminated string to scan
2615 * @param yyscanner The scanner object.
2616 * @return the newly allocated buffer state object.
2617 * @note If you want to scan bytes that may contain NUL values, then use
2618 * yy_scan_bytes() instead.
2619 */
yy_scan_string(const char * yystr,yyscan_t yyscanner)2620 YY_BUFFER_STATE yy_scan_string (const char * yystr , yyscan_t yyscanner)
2621 {
2622
2623 return yy_scan_bytes( yystr, (int) strlen(yystr) , yyscanner);
2624 }
2625
2626 /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
2627 * scan from a @e copy of @a bytes.
2628 * @param yybytes the byte buffer to scan
2629 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
2630 * @param yyscanner The scanner object.
2631 * @return the newly allocated buffer state object.
2632 */
yy_scan_bytes(const char * yybytes,int _yybytes_len,yyscan_t yyscanner)2633 YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len , yyscan_t yyscanner)
2634 {
2635 YY_BUFFER_STATE b;
2636 char *buf;
2637 yy_size_t n;
2638 int i;
2639
2640 /* Get memory for full buffer, including space for trailing EOB's. */
2641 n = (yy_size_t) (_yybytes_len + 2);
2642 buf = (char *) yyalloc( n , yyscanner );
2643 if ( ! buf )
2644 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
2645
2646 for ( i = 0; i < _yybytes_len; ++i )
2647 buf[i] = yybytes[i];
2648
2649 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
2650
2651 b = yy_scan_buffer( buf, n , yyscanner);
2652 if ( ! b )
2653 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
2654
2655 /* It's okay to grow etc. this buffer, and we should throw it
2656 * away when we're done.
2657 */
2658 b->yy_is_our_buffer = 1;
2659
2660 return b;
2661 }
2662
yy_push_state(int _new_state,yyscan_t yyscanner)2663 static void yy_push_state (int _new_state , yyscan_t yyscanner)
2664 {
2665 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2666 if ( yyg->yy_start_stack_ptr >= yyg->yy_start_stack_depth )
2667 {
2668 yy_size_t new_size;
2669
2670 yyg->yy_start_stack_depth += YY_START_STACK_INCR;
2671 new_size = (yy_size_t) yyg->yy_start_stack_depth * sizeof( int );
2672
2673 if ( ! yyg->yy_start_stack )
2674 yyg->yy_start_stack = (int *) yyalloc( new_size , yyscanner );
2675
2676 else
2677 yyg->yy_start_stack = (int *) yyrealloc(
2678 (void *) yyg->yy_start_stack, new_size , yyscanner );
2679
2680 if ( ! yyg->yy_start_stack )
2681 YY_FATAL_ERROR( "out of memory expanding start-condition stack" );
2682 }
2683
2684 yyg->yy_start_stack[yyg->yy_start_stack_ptr++] = YY_START;
2685
2686 BEGIN(_new_state);
2687 }
2688
yy_pop_state(yyscan_t yyscanner)2689 static void yy_pop_state (yyscan_t yyscanner)
2690 {
2691 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2692 if ( --yyg->yy_start_stack_ptr < 0 )
2693 YY_FATAL_ERROR( "start-condition stack underflow" );
2694
2695 BEGIN(yyg->yy_start_stack[yyg->yy_start_stack_ptr]);
2696 }
2697
yy_top_state(yyscan_t yyscanner)2698 static int yy_top_state (yyscan_t yyscanner)
2699 {
2700 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2701 return yyg->yy_start_stack[yyg->yy_start_stack_ptr - 1];
2702 }
2703
2704 #ifndef YY_EXIT_FAILURE
2705 #define YY_EXIT_FAILURE 2
2706 #endif
2707
yy_fatal_error(const char * msg,yyscan_t yyscanner)2708 static void yynoreturn yy_fatal_error (const char* msg , yyscan_t yyscanner)
2709 {
2710 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2711 (void)yyg;
2712 fprintf( stderr, "%s\n", msg );
2713 exit( YY_EXIT_FAILURE );
2714 }
2715
2716 /* Redefine yyless() so it works in section 3 code. */
2717
2718 #undef yyless
2719 #define yyless(n) \
2720 do \
2721 { \
2722 /* Undo effects of setting up yytext. */ \
2723 int yyless_macro_arg = (n); \
2724 YY_LESS_LINENO(yyless_macro_arg);\
2725 yytext[yyleng] = yyg->yy_hold_char; \
2726 yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
2727 yyg->yy_hold_char = *yyg->yy_c_buf_p; \
2728 *yyg->yy_c_buf_p = '\0'; \
2729 yyleng = yyless_macro_arg; \
2730 } \
2731 while ( 0 )
2732
2733 /* Accessor methods (get/set functions) to struct members. */
2734
2735 /** Get the user-defined data for this scanner.
2736 * @param yyscanner The scanner object.
2737 */
yyget_extra(yyscan_t yyscanner)2738 YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner)
2739 {
2740 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2741 return yyextra;
2742 }
2743
2744 /** Get the current line number.
2745 * @param yyscanner The scanner object.
2746 */
yyget_lineno(yyscan_t yyscanner)2747 int yyget_lineno (yyscan_t yyscanner)
2748 {
2749 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2750
2751 if (! YY_CURRENT_BUFFER)
2752 return 0;
2753
2754 return yylineno;
2755 }
2756
2757 /** Get the current column number.
2758 * @param yyscanner The scanner object.
2759 */
yyget_column(yyscan_t yyscanner)2760 int yyget_column (yyscan_t yyscanner)
2761 {
2762 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2763
2764 if (! YY_CURRENT_BUFFER)
2765 return 0;
2766
2767 return yycolumn;
2768 }
2769
2770 /** Get the input stream.
2771 * @param yyscanner The scanner object.
2772 */
yyget_in(yyscan_t yyscanner)2773 FILE *yyget_in (yyscan_t yyscanner)
2774 {
2775 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2776 return yyin;
2777 }
2778
2779 /** Get the output stream.
2780 * @param yyscanner The scanner object.
2781 */
yyget_out(yyscan_t yyscanner)2782 FILE *yyget_out (yyscan_t yyscanner)
2783 {
2784 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2785 return yyout;
2786 }
2787
2788 /** Get the length of the current token.
2789 * @param yyscanner The scanner object.
2790 */
yyget_leng(yyscan_t yyscanner)2791 int yyget_leng (yyscan_t yyscanner)
2792 {
2793 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2794 return yyleng;
2795 }
2796
2797 /** Get the current token.
2798 * @param yyscanner The scanner object.
2799 */
2800
yyget_text(yyscan_t yyscanner)2801 char *yyget_text (yyscan_t yyscanner)
2802 {
2803 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2804 return yytext;
2805 }
2806
2807 /** Set the user-defined data. This data is never touched by the scanner.
2808 * @param user_defined The data to be associated with this scanner.
2809 * @param yyscanner The scanner object.
2810 */
yyset_extra(YY_EXTRA_TYPE user_defined,yyscan_t yyscanner)2811 void yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
2812 {
2813 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2814 yyextra = user_defined ;
2815 }
2816
2817 /** Set the current line number.
2818 * @param _line_number line number
2819 * @param yyscanner The scanner object.
2820 */
yyset_lineno(int _line_number,yyscan_t yyscanner)2821 void yyset_lineno (int _line_number , yyscan_t yyscanner)
2822 {
2823 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2824
2825 /* lineno is only valid if an input buffer exists. */
2826 if (! YY_CURRENT_BUFFER )
2827 YY_FATAL_ERROR( "yyset_lineno called with no buffer" );
2828
2829 yylineno = _line_number;
2830 }
2831
2832 /** Set the current column.
2833 * @param _column_no column number
2834 * @param yyscanner The scanner object.
2835 */
yyset_column(int _column_no,yyscan_t yyscanner)2836 void yyset_column (int _column_no , yyscan_t yyscanner)
2837 {
2838 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2839
2840 /* column is only valid if an input buffer exists. */
2841 if (! YY_CURRENT_BUFFER )
2842 YY_FATAL_ERROR( "yyset_column called with no buffer" );
2843
2844 yycolumn = _column_no;
2845 }
2846
2847 /** Set the input stream. This does not discard the current
2848 * input buffer.
2849 * @param _in_str A readable stream.
2850 * @param yyscanner The scanner object.
2851 * @see yy_switch_to_buffer
2852 */
yyset_in(FILE * _in_str,yyscan_t yyscanner)2853 void yyset_in (FILE * _in_str , yyscan_t yyscanner)
2854 {
2855 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2856 yyin = _in_str ;
2857 }
2858
yyset_out(FILE * _out_str,yyscan_t yyscanner)2859 void yyset_out (FILE * _out_str , yyscan_t yyscanner)
2860 {
2861 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2862 yyout = _out_str ;
2863 }
2864
yyget_debug(yyscan_t yyscanner)2865 int yyget_debug (yyscan_t yyscanner)
2866 {
2867 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2868 return yy_flex_debug;
2869 }
2870
yyset_debug(int _bdebug,yyscan_t yyscanner)2871 void yyset_debug (int _bdebug , yyscan_t yyscanner)
2872 {
2873 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2874 yy_flex_debug = _bdebug ;
2875 }
2876
2877 /* Accessor methods for yylval and yylloc */
2878
yyget_lval(yyscan_t yyscanner)2879 YYSTYPE * yyget_lval (yyscan_t yyscanner)
2880 {
2881 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2882 return yylval;
2883 }
2884
yyset_lval(YYSTYPE * yylval_param,yyscan_t yyscanner)2885 void yyset_lval (YYSTYPE * yylval_param , yyscan_t yyscanner)
2886 {
2887 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2888 yylval = yylval_param;
2889 }
2890
yyget_lloc(yyscan_t yyscanner)2891 YYLTYPE *yyget_lloc (yyscan_t yyscanner)
2892 {
2893 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2894 return yylloc;
2895 }
2896
yyset_lloc(YYLTYPE * yylloc_param,yyscan_t yyscanner)2897 void yyset_lloc (YYLTYPE * yylloc_param , yyscan_t yyscanner)
2898 {
2899 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2900 yylloc = yylloc_param;
2901 }
2902
2903 /* User-visible API */
2904
2905 /* yylex_init is special because it creates the scanner itself, so it is
2906 * the ONLY reentrant function that doesn't take the scanner as the last argument.
2907 * That's why we explicitly handle the declaration, instead of using our macros.
2908 */
yylex_init(yyscan_t * ptr_yy_globals)2909 int yylex_init(yyscan_t* ptr_yy_globals)
2910 {
2911 if (ptr_yy_globals == NULL){
2912 errno = EINVAL;
2913 return 1;
2914 }
2915
2916 *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL );
2917
2918 if (*ptr_yy_globals == NULL){
2919 errno = ENOMEM;
2920 return 1;
2921 }
2922
2923 /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
2924 memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
2925
2926 return yy_init_globals ( *ptr_yy_globals );
2927 }
2928
2929 /* yylex_init_extra has the same functionality as yylex_init, but follows the
2930 * convention of taking the scanner as the last argument. Note however, that
2931 * this is a *pointer* to a scanner, as it will be allocated by this call (and
2932 * is the reason, too, why this function also must handle its own declaration).
2933 * The user defined value in the first argument will be available to yyalloc in
2934 * the yyextra field.
2935 */
yylex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t * ptr_yy_globals)2936 int yylex_init_extra( YY_EXTRA_TYPE yy_user_defined, yyscan_t* ptr_yy_globals )
2937 {
2938 struct yyguts_t dummy_yyguts;
2939
2940 yyset_extra (yy_user_defined, &dummy_yyguts);
2941
2942 if (ptr_yy_globals == NULL){
2943 errno = EINVAL;
2944 return 1;
2945 }
2946
2947 *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
2948
2949 if (*ptr_yy_globals == NULL){
2950 errno = ENOMEM;
2951 return 1;
2952 }
2953
2954 /* By setting to 0xAA, we expose bugs in
2955 yy_init_globals. Leave at 0x00 for releases. */
2956 memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
2957
2958 yyset_extra (yy_user_defined, *ptr_yy_globals);
2959
2960 return yy_init_globals ( *ptr_yy_globals );
2961 }
2962
yy_init_globals(yyscan_t yyscanner)2963 static int yy_init_globals (yyscan_t yyscanner)
2964 {
2965 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2966 /* Initialization is the same as for the non-reentrant scanner.
2967 * This function is called from yylex_destroy(), so don't allocate here.
2968 */
2969
2970 yyg->yy_buffer_stack = NULL;
2971 yyg->yy_buffer_stack_top = 0;
2972 yyg->yy_buffer_stack_max = 0;
2973 yyg->yy_c_buf_p = NULL;
2974 yyg->yy_init = 0;
2975 yyg->yy_start = 0;
2976
2977 yyg->yy_start_stack_ptr = 0;
2978 yyg->yy_start_stack_depth = 0;
2979 yyg->yy_start_stack = NULL;
2980
2981 yyg->yy_state_buf = 0;
2982 yyg->yy_state_ptr = 0;
2983 yyg->yy_full_match = 0;
2984 yyg->yy_lp = 0;
2985
2986 /* Defined in main.c */
2987 #ifdef YY_STDINIT
2988 yyin = stdin;
2989 yyout = stdout;
2990 #else
2991 yyin = NULL;
2992 yyout = NULL;
2993 #endif
2994
2995 /* For future reference: Set errno on error, since we are called by
2996 * yylex_init()
2997 */
2998 return 0;
2999 }
3000
3001 /* yylex_destroy is for both reentrant and non-reentrant scanners. */
yylex_destroy(yyscan_t yyscanner)3002 int yylex_destroy (yyscan_t yyscanner)
3003 {
3004 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3005
3006 /* Pop the buffer stack, destroying each element. */
3007 while(YY_CURRENT_BUFFER){
3008 yy_delete_buffer( YY_CURRENT_BUFFER , yyscanner );
3009 YY_CURRENT_BUFFER_LVALUE = NULL;
3010 yypop_buffer_state(yyscanner);
3011 }
3012
3013 /* Destroy the stack itself. */
3014 yyfree(yyg->yy_buffer_stack , yyscanner);
3015 yyg->yy_buffer_stack = NULL;
3016
3017 /* Destroy the start condition stack. */
3018 yyfree( yyg->yy_start_stack , yyscanner );
3019 yyg->yy_start_stack = NULL;
3020
3021 yyfree ( yyg->yy_state_buf , yyscanner);
3022 yyg->yy_state_buf = NULL;
3023
3024 /* Reset the globals. This is important in a non-reentrant scanner so the next time
3025 * yylex() is called, initialization will occur. */
3026 yy_init_globals( yyscanner);
3027
3028 /* Destroy the main struct (reentrant only). */
3029 yyfree ( yyscanner , yyscanner );
3030 yyscanner = NULL;
3031 return 0;
3032 }
3033
3034 /*
3035 * Internal utility routines.
3036 */
3037
3038 #ifndef yytext_ptr
yy_flex_strncpy(char * s1,const char * s2,int n,yyscan_t yyscanner)3039 static void yy_flex_strncpy (char* s1, const char * s2, int n , yyscan_t yyscanner)
3040 {
3041 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3042 (void)yyg;
3043
3044 int i;
3045 for ( i = 0; i < n; ++i )
3046 s1[i] = s2[i];
3047 }
3048 #endif
3049
3050 #ifdef YY_NEED_STRLEN
yy_flex_strlen(const char * s,yyscan_t yyscanner)3051 static int yy_flex_strlen (const char * s , yyscan_t yyscanner)
3052 {
3053 int n;
3054 for ( n = 0; s[n]; ++n )
3055 ;
3056
3057 return n;
3058 }
3059 #endif
3060
yyalloc(yy_size_t size,yyscan_t yyscanner)3061 void *yyalloc (yy_size_t size , yyscan_t yyscanner)
3062 {
3063 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3064 (void)yyg;
3065 return malloc(size);
3066 }
3067
yyrealloc(void * ptr,yy_size_t size,yyscan_t yyscanner)3068 void *yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner)
3069 {
3070 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3071 (void)yyg;
3072
3073 /* The cast to (char *) in the following accommodates both
3074 * implementations that use char* generic pointers, and those
3075 * that use void* generic pointers. It works with the latter
3076 * because both ANSI C and C++ allow castless assignment from
3077 * any pointer type to void*, and deal with argument conversions
3078 * as though doing an assignment.
3079 */
3080 return realloc(ptr, size);
3081 }
3082
yyfree(void * ptr,yyscan_t yyscanner)3083 void yyfree (void * ptr , yyscan_t yyscanner)
3084 {
3085 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3086 (void)yyg;
3087 free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
3088 }
3089
3090 #define YYTABLES_NAME "yytables"
3091
3092 #line 495 "/source/lib/cfg-lex.l"
3093
3094
3095
3096 void
cfg_lexer_unput_string(CfgLexer * self,const char * str)3097 cfg_lexer_unput_string(CfgLexer *self, const char *str)
3098 {
3099 int len = strlen(str);
3100 int i;
3101
3102 for (i = len - 1; i >= 0; i--)
3103 {
3104 yyunput(str[i], _cfg_lexer_get_text(self->state), self->state);
3105 self->include_stack[self->include_depth].lloc.first_column--;
3106 self->include_stack[self->include_depth].lloc.last_column--;
3107 }
3108 }
3109
3110 void
cfg_lexer_start_block_state(CfgLexer * self,const gchar block_boundary[2])3111 cfg_lexer_start_block_state(CfgLexer *self, const gchar block_boundary[2])
3112 {
3113 memcpy(&self->block_boundary, block_boundary, sizeof(self->block_boundary));
3114 yy_push_state(block, self->state);
3115 }
3116
3117 /* avoid warnings of unused symbols */
3118 gpointer __dummy[] = { yy_top_state, yy_fatal_error };
3119
3120