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