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