1 #line 2 "lc_config_lexer.c"
3 #line 4 "lc_config_lexer.c"
5 #define YY_INT_ALIGNED short int
7 /* A lexical scanner generated by flex */
9 #define yy_create_buffer _lc_opt__create_buffer
10 #define yy_delete_buffer _lc_opt__delete_buffer
11 #define yy_flex_debug _lc_opt__flex_debug
12 #define yy_init_buffer _lc_opt__init_buffer
13 #define yy_flush_buffer _lc_opt__flush_buffer
14 #define yy_load_buffer_state _lc_opt__load_buffer_state
15 #define yy_switch_to_buffer _lc_opt__switch_to_buffer
16 #define yyin _lc_opt_in
17 #define yyleng _lc_opt_leng
18 #define yylex _lc_opt_lex
19 #define yylineno _lc_opt_lineno
20 #define yyout _lc_opt_out
21 #define yyrestart _lc_opt_restart
22 #define yytext _lc_opt_text
23 #define yywrap _lc_opt_wrap
24 #define yyalloc _lc_opt_alloc
25 #define yyrealloc _lc_opt_realloc
26 #define yyfree _lc_opt_free
29 #define YY_FLEX_MAJOR_VERSION 2
30 #define YY_FLEX_MINOR_VERSION 5
31 #define YY_FLEX_SUBMINOR_VERSION 35
32 #if YY_FLEX_SUBMINOR_VERSION > 0
36 /* First, we deal with platform-specific or compiler-specific issues. */
38 /* begin standard C headers. */
44 /* end standard C headers. */
46 /* flex integer type definitions */
51 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
53 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
55 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
56 * if you want the limit (max/min) macros for int types.
58 #ifndef __STDC_LIMIT_MACROS
59 #define __STDC_LIMIT_MACROS 1
63 typedef int8_t flex_int8_t;
64 typedef uint8_t flex_uint8_t;
65 typedef int16_t flex_int16_t;
66 typedef uint16_t flex_uint16_t;
67 typedef int32_t flex_int32_t;
68 typedef uint32_t flex_uint32_t;
70 typedef signed char flex_int8_t;
71 typedef short int flex_int16_t;
72 typedef int flex_int32_t;
73 typedef unsigned char flex_uint8_t;
74 typedef unsigned short int flex_uint16_t;
75 typedef unsigned int flex_uint32_t;
77 /* Limits of integral types. */
79 #define INT8_MIN (-128)
82 #define INT16_MIN (-32767-1)
85 #define INT32_MIN (-2147483647-1)
88 #define INT8_MAX (127)
91 #define INT16_MAX (32767)
94 #define INT32_MAX (2147483647)
97 #define UINT8_MAX (255U)
100 #define UINT16_MAX (65535U)
103 #define UINT32_MAX (4294967295U)
108 #endif /* ! FLEXINT_H */
112 /* The "const" storage-class-modifier is valid. */
115 #else /* ! __cplusplus */
117 /* C99 requires __STDC__ to be defined as 1. */
118 #if defined (__STDC__)
122 #endif /* defined (__STDC__) */
123 #endif /* ! __cplusplus */
126 #define yyconst const
131 /* Returned upon end-of-file. */
134 /* Promotes a possibly negative, possibly signed char to an unsigned
135 * integer for use as an array index. If the signed char is negative,
136 * we want to instead treat it as an 8-bit unsigned char, hence the
139 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
141 /* Enter a start condition. This macro really ought to take a parameter,
142 * but we do it the disgusting crufty way forced on us by the ()-less
143 * definition of BEGIN.
145 #define BEGIN (yy_start) = 1 + 2 *
147 /* Translate the current start state into a value that can be later handed
148 * to BEGIN to return to the state. The YYSTATE alias is for lex
151 #define YY_START (((yy_start) - 1) / 2)
152 #define YYSTATE YY_START
154 /* Action number for EOF rule of a given start state. */
155 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
157 /* Special action meaning "start processing a new file". */
158 #define YY_NEW_FILE _lc_opt_restart(_lc_opt_in )
160 #define YY_END_OF_BUFFER_CHAR 0
162 /* Size of default input buffer. */
165 /* On IA-64, the buffer size is 16k, not 8k.
166 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
167 * Ditto for the __ia64__ case accordingly.
169 #define YY_BUF_SIZE 32768
171 #define YY_BUF_SIZE 16384
172 #endif /* __ia64__ */
175 /* The state buf must be large enough to hold one state per character in the main buffer.
177 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
179 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
180 #define YY_TYPEDEF_YY_BUFFER_STATE
181 typedef struct yy_buffer_state *YY_BUFFER_STATE;
184 extern int _lc_opt_leng;
186 extern FILE *_lc_opt_in, *_lc_opt_out;
188 #define EOB_ACT_CONTINUE_SCAN 0
189 #define EOB_ACT_END_OF_FILE 1
190 #define EOB_ACT_LAST_MATCH 2
192 #define YY_LESS_LINENO(n)
194 /* Return all but the first "n" matched characters back to the input stream. */
198 /* Undo effects of setting up _lc_opt_text. */ \
199 int yyless_macro_arg = (n); \
200 YY_LESS_LINENO(yyless_macro_arg);\
201 *yy_cp = (yy_hold_char); \
202 YY_RESTORE_YY_MORE_OFFSET \
203 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
204 YY_DO_BEFORE_ACTION; /* set up _lc_opt_text again */ \
208 #define unput(c) yyunput( c, (yytext_ptr) )
210 #ifndef YY_TYPEDEF_YY_SIZE_T
211 #define YY_TYPEDEF_YY_SIZE_T
212 typedef size_t yy_size_t;
215 #ifndef YY_STRUCT_YY_BUFFER_STATE
216 #define YY_STRUCT_YY_BUFFER_STATE
217 struct yy_buffer_state
221 char *yy_ch_buf; /* input buffer */
222 char *yy_buf_pos; /* current position in input buffer */
224 /* Size of input buffer in bytes, not including room for EOB
227 yy_size_t yy_buf_size;
229 /* Number of characters read into yy_ch_buf, not including EOB
234 /* Whether we "own" the buffer - i.e., we know we created it,
235 * and can realloc() it to grow it, and should free() it to
238 int yy_is_our_buffer;
240 /* Whether this is an "interactive" input source; if so, and
241 * if we're using stdio for input, then we want to use getc()
242 * instead of fread(), to make sure we stop fetching input after
245 int yy_is_interactive;
247 /* Whether we're considered to be at the beginning of a line.
248 * If so, '^' rules will be active on the next match, otherwise
253 int yy_bs_lineno; /**< The line count. */
254 int yy_bs_column; /**< The column count. */
256 /* Whether to try to fill the input buffer when we reach the
261 int yy_buffer_status;
263 #define YY_BUFFER_NEW 0
264 #define YY_BUFFER_NORMAL 1
265 /* When an EOF's been seen but there's still some text to process
266 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
267 * shouldn't try reading from the input source any more. We might
268 * still have a bunch of tokens to match, though, because of
269 * possible backing-up.
271 * When we actually see the EOF, we change the status to "new"
272 * (via _lc_opt_restart()), so that the user can continue scanning by
273 * just pointing _lc_opt_in at a new input file.
275 #define YY_BUFFER_EOF_PENDING 2
278 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
280 /* Stack of input buffers. */
281 static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
282 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
283 static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
285 /* We provide macros for accessing buffer states in case in the
286 * future we want to put the buffer states in a more general
289 * Returns the top of the stack, or NULL.
291 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
292 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
295 /* Same as previous macro, but useful when we know that the buffer stack is not
296 * NULL or when we need an lvalue. For internal use only.
298 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
300 /* yy_hold_char holds the character lost when _lc_opt_text is formed. */
301 static char yy_hold_char;
302 static int yy_n_chars; /* number of characters read into yy_ch_buf */
305 /* Points to current character in buffer. */
306 static char *yy_c_buf_p = (char *) 0;
307 static int yy_init = 0; /* whether we need to initialize */
308 static int yy_start = 0; /* start state number */
310 /* Flag which is used to allow _lc_opt_wrap()'s to do buffer switches
311 * instead of setting up a fresh _lc_opt_in. A bit of a hack ...
313 static int yy_did_buffer_switch_on_eof;
315 void _lc_opt_restart (FILE *input_file );
316 void _lc_opt__switch_to_buffer (YY_BUFFER_STATE new_buffer );
317 YY_BUFFER_STATE _lc_opt__create_buffer (FILE *file,int size );
318 void _lc_opt__delete_buffer (YY_BUFFER_STATE b );
319 void _lc_opt__flush_buffer (YY_BUFFER_STATE b );
320 void _lc_opt_push_buffer_state (YY_BUFFER_STATE new_buffer );
321 void _lc_opt_pop_buffer_state (void );
323 static void _lc_opt_ensure_buffer_stack (void );
324 static void _lc_opt__load_buffer_state (void );
325 static void _lc_opt__init_buffer (YY_BUFFER_STATE b,FILE *file );
327 #define YY_FLUSH_BUFFER _lc_opt__flush_buffer(YY_CURRENT_BUFFER )
329 YY_BUFFER_STATE _lc_opt__scan_buffer (char *base,yy_size_t size );
330 YY_BUFFER_STATE _lc_opt__scan_string (yyconst char *yy_str );
331 YY_BUFFER_STATE _lc_opt__scan_bytes (yyconst char *bytes,int len );
333 void *_lc_opt_alloc (yy_size_t );
334 void *_lc_opt_realloc (void *,yy_size_t );
335 void _lc_opt_free (void * );
337 #define yy_new_buffer _lc_opt__create_buffer
339 #define yy_set_interactive(is_interactive) \
341 if ( ! YY_CURRENT_BUFFER ){ \
342 _lc_opt_ensure_buffer_stack (); \
343 YY_CURRENT_BUFFER_LVALUE = \
344 _lc_opt__create_buffer(_lc_opt_in,YY_BUF_SIZE ); \
346 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
349 #define yy_set_bol(at_bol) \
351 if ( ! YY_CURRENT_BUFFER ){\
352 _lc_opt_ensure_buffer_stack (); \
353 YY_CURRENT_BUFFER_LVALUE = \
354 _lc_opt__create_buffer(_lc_opt_in,YY_BUF_SIZE ); \
356 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
359 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
361 /* Begin user sect3 */
363 typedef unsigned char YY_CHAR;
365 FILE *_lc_opt_in = (FILE *) 0, *_lc_opt_out = (FILE *) 0;
367 typedef int yy_state_type;
369 extern int _lc_opt_lineno;
371 int _lc_opt_lineno = 1;
373 extern char *_lc_opt_text;
374 #define yytext_ptr _lc_opt_text
376 static yy_state_type yy_get_previous_state (void );
377 static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
378 static int yy_get_next_buffer (void );
379 static void yy_fatal_error (yyconst char msg[] );
381 /* Done after the current pattern has been matched and before the
382 * corresponding action - sets up _lc_opt_text.
384 #define YY_DO_BEFORE_ACTION \
385 (yytext_ptr) = yy_bp; \
386 _lc_opt_leng = (size_t) (yy_cp - yy_bp); \
387 (yy_hold_char) = *yy_cp; \
389 (yy_c_buf_p) = yy_cp;
391 #define YY_NUM_RULES 28
392 #define YY_END_OF_BUFFER 29
393 /* This struct is not used in this scanner,
394 but its presence is necessary. */
397 flex_int32_t yy_verify;
400 static yyconst flex_int16_t yy_accept[49] =
402 25, 25, 0, 0, 0, 0, 0, 0, 0, 0,
403 0, 0, 29, 27, 25, 26, 5, 23, 24, 24,
404 8, 7, 6, 4, 3, 4, 11, 12, 9, 10,
405 14, 13, 22, 15, 22, 25, 23, 1, 5, 8,
406 2, 21, 19, 20, 16, 17, 18, 0
409 static yyconst flex_int32_t yy_ec[256] =
411 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
412 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
413 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
414 1, 2, 1, 4, 5, 6, 1, 1, 1, 1,
415 1, 7, 1, 1, 1, 8, 9, 10, 10, 10,
416 10, 10, 10, 10, 10, 10, 10, 11, 1, 1,
417 11, 1, 1, 1, 6, 6, 6, 6, 6, 6,
418 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
419 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
420 1, 12, 1, 1, 6, 1, 6, 13, 6, 6,
422 6, 14, 6, 6, 6, 6, 6, 6, 6, 15,
423 6, 6, 6, 16, 6, 17, 6, 6, 6, 6,
424 6, 6, 1, 1, 1, 1, 1, 1, 1, 1,
425 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
426 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
427 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
428 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
429 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
430 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
431 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
433 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
434 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
435 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
436 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
437 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
441 static yyconst flex_int32_t yy_meta[18] =
443 1, 1, 2, 1, 1, 3, 1, 1, 1, 3,
447 static yyconst flex_int16_t yy_base[56] =
449 0, 0, 62, 39, 15, 16, 21, 31, 38, 37,
450 16, 17, 39, 67, 36, 67, 67, 0, 67, 23,
451 35, 67, 67, 67, 67, 27, 67, 67, 67, 67,
452 67, 67, 67, 67, 31, 29, 0, 67, 67, 25,
453 67, 67, 67, 67, 67, 67, 67, 67, 48, 51,
457 static yyconst flex_int16_t yy_def[56] =
459 48, 1, 49, 49, 50, 50, 51, 51, 52, 52,
460 53, 53, 48, 48, 48, 48, 48, 54, 48, 48,
461 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
462 48, 48, 48, 48, 55, 48, 54, 48, 48, 48,
463 48, 48, 48, 48, 48, 48, 48, 0, 48, 48,
467 static yyconst flex_int16_t yy_nxt[85] =
469 14, 15, 16, 14, 17, 18, 14, 19, 20, 14,
470 21, 14, 18, 18, 18, 18, 18, 25, 25, 34,
471 34, 26, 26, 28, 29, 37, 40, 35, 35, 38,
472 36, 39, 30, 28, 29, 41, 40, 36, 48, 32,
473 32, 23, 30, 43, 44, 45, 46, 47, 22, 22,
474 22, 24, 24, 24, 27, 27, 27, 31, 31, 31,
475 33, 33, 33, 42, 23, 42, 13, 48, 48, 48,
476 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
480 static yyconst flex_int16_t yy_chk[85] =
482 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
483 1, 1, 1, 1, 1, 1, 1, 5, 6, 11,
484 12, 5, 6, 7, 7, 54, 40, 11, 12, 20,
485 36, 20, 7, 8, 8, 26, 21, 15, 13, 10,
486 9, 4, 8, 35, 35, 35, 35, 35, 49, 49,
487 49, 50, 50, 50, 51, 51, 51, 52, 52, 52,
488 53, 53, 53, 55, 3, 55, 48, 48, 48, 48,
489 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
493 static yy_state_type yy_last_accepting_state;
494 static char *yy_last_accepting_cpos;
496 extern int _lc_opt__flex_debug;
497 int _lc_opt__flex_debug = 0;
499 /* The intent behind this definition is that it'll catch
500 * any uses of REJECT which flex missed.
502 #define REJECT reject_used_but_not_detected
503 #define yymore() yymore_used_but_not_detected
504 #define YY_MORE_ADJ 0
505 #define YY_RESTORE_YY_MORE_OFFSET
507 #line 1 "lc_config_lexer.l"
508 #line 5 "lc_config_lexer.l"
511 libcore: library for basic data structures and algorithms.
512 Copyright (C) 2005 IPD Goos, Universit"at Karlsruhe, Germany
514 This library is free software; you can redistribute it and/or
515 modify it under the terms of the GNU Lesser General Public
516 License as published by the Free Software Foundation; either
517 version 2.1 of the License, or (at your option) any later version.
519 This library is distributed in the hope that it will be useful,
520 but WITHOUT ANY WARRANTY; without even the implied warranty of
521 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
522 Lesser General Public License for more details.
524 You should have received a copy of the GNU Lesser General Public
525 License along with this library; if not, write to the Free Software
526 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
533 #include <unistd.h> /* flex generated code wants a declaration of isatty... */
535 #include "lc_parser_t.h"
536 #include "lc_config_parser.h"
538 #define YY_NO_UNISTD_H
544 static int _lc_opt_wrap(void);
554 #line 555 "lc_config_lexer.c"
557 #define LINE_COMMENT 1
558 #define BIG_COMMENT 2
563 #ifndef YY_NO_UNISTD_H
564 /* Special case for "unistd.h", since it is non-ANSI. We include it way
565 * down here because we want the user's section 1 to have been scanned first.
566 * The user has a chance to override it with an option.
571 #ifndef YY_EXTRA_TYPE
572 #define YY_EXTRA_TYPE void *
575 static int yy_init_globals (void );
577 /* Accessor methods to globals.
578 These are made visible to non-reentrant scanners for convenience. */
580 int _lc_opt_lex_destroy (void );
582 int _lc_opt_get_debug (void );
584 void _lc_opt_set_debug (int debug_flag );
586 YY_EXTRA_TYPE _lc_opt_get_extra (void );
588 void _lc_opt_set_extra (YY_EXTRA_TYPE user_defined );
590 FILE *_lc_opt_get_in (void );
592 void _lc_opt_set_in (FILE * in_str );
594 FILE *_lc_opt_get_out (void );
596 void _lc_opt_set_out (FILE * out_str );
598 int _lc_opt_get_leng (void );
600 char *_lc_opt_get_text (void );
602 int _lc_opt_get_lineno (void );
604 void _lc_opt_set_lineno (int line_number );
606 /* Macros after this point can all be overridden by user definitions in
610 #ifndef YY_SKIP_YYWRAP
612 extern "C" int _lc_opt_wrap (void );
614 extern int _lc_opt_wrap (void );
618 static void yyunput (int c,char *buf_ptr );
621 static void yy_flex_strncpy (char *,yyconst char *,int );
624 #ifdef YY_NEED_STRLEN
625 static int yy_flex_strlen (yyconst char * );
631 static int yyinput (void );
633 static int input (void );
638 /* Amount of stuff to slurp up with each read. */
639 #ifndef YY_READ_BUF_SIZE
641 /* On IA-64, the buffer size is 16k, not 8k */
642 #define YY_READ_BUF_SIZE 16384
644 #define YY_READ_BUF_SIZE 8192
645 #endif /* __ia64__ */
648 /* Copy whatever the last rule matched to the standard output. */
650 /* This used to be an fputs(), but since the string might contain NUL's,
651 * we now use fwrite().
653 #define ECHO do { if (fwrite( _lc_opt_text, _lc_opt_leng, 1, _lc_opt_out )) {} } while (0)
656 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
657 * is returned in "result".
660 #define YY_INPUT(buf,result,max_size) \
661 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
665 for ( n = 0; n < max_size && \
666 (c = getc( _lc_opt_in )) != EOF && c != '\n'; ++n ) \
669 buf[n++] = (char) c; \
670 if ( c == EOF && ferror( _lc_opt_in ) ) \
671 YY_FATAL_ERROR( "input in flex scanner failed" ); \
677 while ( (result = fread(buf, 1, max_size, _lc_opt_in))==0 && ferror(_lc_opt_in)) \
679 if( errno != EINTR) \
681 YY_FATAL_ERROR( "input in flex scanner failed" ); \
685 clearerr(_lc_opt_in); \
692 /* No semi-colon after return; correct usage is to write "yyterminate();" -
693 * we don't want an extra ';' after the "return" because that will cause
694 * some compilers to complain about unreachable statements.
697 #define yyterminate() return YY_NULL
700 /* Number of entries by which start-condition stack grows. */
701 #ifndef YY_START_STACK_INCR
702 #define YY_START_STACK_INCR 25
705 /* Report a fatal error. */
706 #ifndef YY_FATAL_ERROR
707 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
710 /* end tables serialization structures and prototypes */
712 /* Default declaration of generated scanner - a define so the user can
713 * easily add parameters.
716 #define YY_DECL_IS_OURS 1
718 extern int _lc_opt_lex (void);
720 #define YY_DECL int _lc_opt_lex (void)
721 #endif /* !YY_DECL */
723 /* Code executed at the beginning of each rule, after _lc_opt_text and _lc_opt_leng
726 #ifndef YY_USER_ACTION
727 #define YY_USER_ACTION
730 /* Code executed at the end of each rule. */
732 #define YY_BREAK break;
735 #define YY_RULE_SETUP \
738 /** The main scanner function which does all the work.
742 register yy_state_type yy_current_state;
743 register char *yy_cp, *yy_bp;
746 #line 62 "lc_config_lexer.l"
749 #line 750 "lc_config_lexer.c"
760 (yy_start) = 1; /* first start state */
766 _lc_opt_out = stdout;
768 if ( ! YY_CURRENT_BUFFER ) {
769 _lc_opt_ensure_buffer_stack ();
770 YY_CURRENT_BUFFER_LVALUE =
771 _lc_opt__create_buffer(_lc_opt_in,YY_BUF_SIZE );
774 _lc_opt__load_buffer_state( );
777 while ( 1 ) /* loops until end-of-file is reached */
779 yy_cp = (yy_c_buf_p);
781 /* Support of _lc_opt_text. */
782 *yy_cp = (yy_hold_char);
784 /* yy_bp points to the position in yy_ch_buf of the start of
789 yy_current_state = (yy_start);
793 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
794 if ( yy_accept[yy_current_state] )
796 (yy_last_accepting_state) = yy_current_state;
797 (yy_last_accepting_cpos) = yy_cp;
799 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
801 yy_current_state = (int) yy_def[yy_current_state];
802 if ( yy_current_state >= 49 )
803 yy_c = yy_meta[(unsigned int) yy_c];
805 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
808 while ( yy_base[yy_current_state] != 67 );
811 yy_act = yy_accept[yy_current_state];
813 { /* have to back up */
814 yy_cp = (yy_last_accepting_cpos);
815 yy_current_state = (yy_last_accepting_state);
816 yy_act = yy_accept[yy_current_state];
821 do_action: /* This label is used only to access EOF actions. */
824 { /* beginning of action switch */
825 case 0: /* must back up */
826 /* undo the effects of YY_DO_BEFORE_ACTION */
827 *yy_cp = (yy_hold_char);
828 yy_cp = (yy_last_accepting_cpos);
829 yy_current_state = (yy_last_accepting_state);
834 #line 64 "lc_config_lexer.l"
835 { BEGIN(BIG_COMMENT); }
839 #line 65 "lc_config_lexer.l"
843 /* rule 3 can match eol */
845 #line 66 "lc_config_lexer.l"
850 #line 67 "lc_config_lexer.l"
855 #line 69 "lc_config_lexer.l"
856 { BEGIN(LINE_COMMENT); }
859 /* rule 6 can match eol */
861 #line 70 "lc_config_lexer.l"
862 { BEGIN(INITIAL); PMANGLE(linenr)++; }
866 #line 71 "lc_config_lexer.l"
871 #line 74 "lc_config_lexer.l"
876 #line 75 "lc_config_lexer.l"
881 #line 76 "lc_config_lexer.l"
886 #line 77 "lc_config_lexer.l"
887 { _lc_opt_add_to_data_char(PMANGLE(text)[0]); }
890 /* rule 12 can match eol */
892 #line 78 "lc_config_lexer.l"
896 _lc_opt_add_to_data_char('\0');
901 /* rule 13 can match eol */
903 #line 84 "lc_config_lexer.l"
904 { BEGIN(DAT); PMANGLE(linenr)++; }
908 #line 85 "lc_config_lexer.l"
913 #line 88 "lc_config_lexer.l"
916 _lc_opt_add_to_data_char('\0');
922 #line 94 "lc_config_lexer.l"
923 _lc_opt_add_to_data_char('\n');
927 #line 95 "lc_config_lexer.l"
928 _lc_opt_add_to_data_char('\r');
932 #line 96 "lc_config_lexer.l"
933 _lc_opt_add_to_data_char('\t');
937 #line 97 "lc_config_lexer.l"
938 _lc_opt_add_to_data_char('\b');
942 #line 98 "lc_config_lexer.l"
943 _lc_opt_add_to_data_char('\f');
947 #line 99 "lc_config_lexer.l"
948 _lc_opt_add_to_data_char(_lc_opt_text[1]);
951 /* rule 22 can match eol */
953 #line 100 "lc_config_lexer.l"
954 _lc_opt_add_to_data_char(_lc_opt_text[0]);
958 #line 102 "lc_config_lexer.l"
960 PMANGLE(lval).text.str = PMANGLE(text);
961 PMANGLE(lval).text.len = PMANGLE(leng);
967 #line 107 "lc_config_lexer.l"
972 #line 109 "lc_config_lexer.l"
976 /* rule 26 can match eol */
978 #line 110 "lc_config_lexer.l"
983 #line 112 "lc_config_lexer.l"
984 return _lc_opt_text[0];
988 #line 114 "lc_config_lexer.l"
991 #line 992 "lc_config_lexer.c"
992 case YY_STATE_EOF(INITIAL):
993 case YY_STATE_EOF(LINE_COMMENT):
994 case YY_STATE_EOF(BIG_COMMENT):
995 case YY_STATE_EOF(DAT):
996 case YY_STATE_EOF(DAT_CONT):
997 case YY_STATE_EOF(STR):
1000 case YY_END_OF_BUFFER:
1002 /* Amount of text matched not including the EOB char. */
1003 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
1005 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1006 *yy_cp = (yy_hold_char);
1007 YY_RESTORE_YY_MORE_OFFSET
1009 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1011 /* We're scanning a new file or input source. It's
1012 * possible that this happened because the user
1013 * just pointed _lc_opt_in at a new source and called
1014 * _lc_opt_lex(). If so, then we have to assure
1015 * consistency between YY_CURRENT_BUFFER and our
1016 * globals. Here is the right place to do so, because
1017 * this is the first action (other than possibly a
1018 * back-up) that will match for the new input source.
1020 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1021 YY_CURRENT_BUFFER_LVALUE->yy_input_file = _lc_opt_in;
1022 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1025 /* Note that here we test for yy_c_buf_p "<=" to the position
1026 * of the first EOB in the buffer, since yy_c_buf_p will
1027 * already have been incremented past the NUL character
1028 * (since all states make transitions on EOB to the
1029 * end-of-buffer state). Contrast this with the test
1032 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1033 { /* This was really a NUL. */
1034 yy_state_type yy_next_state;
1036 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1038 yy_current_state = yy_get_previous_state( );
1040 /* Okay, we're now positioned to make the NUL
1041 * transition. We couldn't have
1042 * yy_get_previous_state() go ahead and do it
1043 * for us because it doesn't know how to deal
1044 * with the possibility of jamming (and we don't
1045 * want to build jamming into it because then it
1046 * will run more slowly).
1049 yy_next_state = yy_try_NUL_trans( yy_current_state );
1051 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1053 if ( yy_next_state )
1055 /* Consume the NUL. */
1056 yy_cp = ++(yy_c_buf_p);
1057 yy_current_state = yy_next_state;
1063 yy_cp = (yy_c_buf_p);
1064 goto yy_find_action;
1068 else switch ( yy_get_next_buffer( ) )
1070 case EOB_ACT_END_OF_FILE:
1072 (yy_did_buffer_switch_on_eof) = 0;
1074 if ( _lc_opt_wrap( ) )
1076 /* Note: because we've taken care in
1077 * yy_get_next_buffer() to have set up
1078 * _lc_opt_text, we can now set up
1079 * yy_c_buf_p so that if some total
1080 * hoser (like flex itself) wants to
1081 * call the scanner after we return the
1082 * YY_NULL, it'll still work - another
1083 * YY_NULL will get returned.
1085 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1087 yy_act = YY_STATE_EOF(YY_START);
1093 if ( ! (yy_did_buffer_switch_on_eof) )
1099 case EOB_ACT_CONTINUE_SCAN:
1101 (yytext_ptr) + yy_amount_of_matched_text;
1103 yy_current_state = yy_get_previous_state( );
1105 yy_cp = (yy_c_buf_p);
1106 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1109 case EOB_ACT_LAST_MATCH:
1111 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1113 yy_current_state = yy_get_previous_state( );
1115 yy_cp = (yy_c_buf_p);
1116 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1117 goto yy_find_action;
1124 "fatal flex scanner internal error--no action found" );
1125 } /* end of action switch */
1126 } /* end of scanning one token */
1127 } /* end of _lc_opt_lex */
1129 /* yy_get_next_buffer - try to read in a new buffer
1131 * Returns a code representing an action:
1132 * EOB_ACT_LAST_MATCH -
1133 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1134 * EOB_ACT_END_OF_FILE - end of file
1136 static int yy_get_next_buffer (void)
1138 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1139 register char *source = (yytext_ptr);
1140 register int number_to_move, i;
1143 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1145 "fatal flex scanner internal error--end of buffer missed" );
1147 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1148 { /* Don't try to fill the buffer, so this is an EOF. */
1149 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1151 /* We matched a single character, the EOB, so
1152 * treat this as a final EOF.
1154 return EOB_ACT_END_OF_FILE;
1159 /* We matched some text prior to the EOB, first
1162 return EOB_ACT_LAST_MATCH;
1166 /* Try to read more data. */
1168 /* First move last chars to start of buffer. */
1169 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1171 for ( i = 0; i < number_to_move; ++i )
1172 *(dest++) = *(source++);
1174 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1175 /* don't do the read, it's not guaranteed to return an EOF,
1178 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1183 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1185 while ( num_to_read <= 0 )
1186 { /* Not enough room in the buffer - grow it. */
1188 /* just a shorter name for the current buffer */
1189 YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1191 int yy_c_buf_p_offset =
1192 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1194 if ( b->yy_is_our_buffer )
1196 int new_size = b->yy_buf_size * 2;
1198 if ( new_size <= 0 )
1199 b->yy_buf_size += b->yy_buf_size / 8;
1201 b->yy_buf_size *= 2;
1203 b->yy_ch_buf = (char *)
1204 /* Include room in for 2 EOB chars. */
1205 _lc_opt_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
1208 /* Can't grow it, we don't own it. */
1211 if ( ! b->yy_ch_buf )
1213 "fatal error - scanner input buffer overflow" );
1215 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1217 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1222 if ( num_to_read > YY_READ_BUF_SIZE )
1223 num_to_read = YY_READ_BUF_SIZE;
1225 /* Read in more data. */
1226 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1227 (yy_n_chars), (size_t) num_to_read );
1229 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1232 if ( (yy_n_chars) == 0 )
1234 if ( number_to_move == YY_MORE_ADJ )
1236 ret_val = EOB_ACT_END_OF_FILE;
1237 _lc_opt_restart(_lc_opt_in );
1242 ret_val = EOB_ACT_LAST_MATCH;
1243 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1244 YY_BUFFER_EOF_PENDING;
1249 ret_val = EOB_ACT_CONTINUE_SCAN;
1251 if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1252 /* Extend the array by 50%, plus the number we really need. */
1253 yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1254 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) _lc_opt_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
1255 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1256 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1259 (yy_n_chars) += number_to_move;
1260 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1261 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1263 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1268 /* yy_get_previous_state - get the state just before the EOB char was reached */
1270 static yy_state_type yy_get_previous_state (void)
1272 register yy_state_type yy_current_state;
1273 register char *yy_cp;
1275 yy_current_state = (yy_start);
1277 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1279 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1280 if ( yy_accept[yy_current_state] )
1282 (yy_last_accepting_state) = yy_current_state;
1283 (yy_last_accepting_cpos) = yy_cp;
1285 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1287 yy_current_state = (int) yy_def[yy_current_state];
1288 if ( yy_current_state >= 49 )
1289 yy_c = yy_meta[(unsigned int) yy_c];
1291 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1294 return yy_current_state;
1297 /* yy_try_NUL_trans - try to make a transition on the NUL character
1300 * next_state = yy_try_NUL_trans( current_state );
1302 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1304 register int yy_is_jam;
1305 register char *yy_cp = (yy_c_buf_p);
1307 register YY_CHAR yy_c = 1;
1308 if ( yy_accept[yy_current_state] )
1310 (yy_last_accepting_state) = yy_current_state;
1311 (yy_last_accepting_cpos) = yy_cp;
1313 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1315 yy_current_state = (int) yy_def[yy_current_state];
1316 if ( yy_current_state >= 49 )
1317 yy_c = yy_meta[(unsigned int) yy_c];
1319 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1320 yy_is_jam = (yy_current_state == 48);
1322 return yy_is_jam ? 0 : yy_current_state;
1325 static void yyunput (int c, register char * yy_bp )
1327 register char *yy_cp;
1329 yy_cp = (yy_c_buf_p);
1331 /* undo effects of setting up _lc_opt_text */
1332 *yy_cp = (yy_hold_char);
1334 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1335 { /* need to shift things up to make room */
1336 /* +2 for EOB chars. */
1337 register int number_to_move = (yy_n_chars) + 2;
1338 register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1339 YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1340 register char *source =
1341 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1343 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1344 *--dest = *--source;
1346 yy_cp += (int) (dest - source);
1347 yy_bp += (int) (dest - source);
1348 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1349 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1351 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1352 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1355 *--yy_cp = (char) c;
1357 (yytext_ptr) = yy_bp;
1358 (yy_hold_char) = *yy_cp;
1359 (yy_c_buf_p) = yy_cp;
1364 static int yyinput (void)
1366 static int input (void)
1372 *(yy_c_buf_p) = (yy_hold_char);
1374 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1376 /* yy_c_buf_p now points to the character we want to return.
1377 * If this occurs *before* the EOB characters, then it's a
1378 * valid NUL; if not, then we've hit the end of the buffer.
1380 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1381 /* This was really a NUL. */
1382 *(yy_c_buf_p) = '\0';
1385 { /* need more input */
1386 int offset = (yy_c_buf_p) - (yytext_ptr);
1389 switch ( yy_get_next_buffer( ) )
1391 case EOB_ACT_LAST_MATCH:
1392 /* This happens because yy_g_n_b()
1393 * sees that we've accumulated a
1394 * token and flags that we need to
1395 * try matching the token before
1396 * proceeding. But for input(),
1397 * there's no matching to consider.
1398 * So convert the EOB_ACT_LAST_MATCH
1399 * to EOB_ACT_END_OF_FILE.
1402 /* Reset buffer status. */
1403 _lc_opt_restart(_lc_opt_in );
1407 case EOB_ACT_END_OF_FILE:
1409 if ( _lc_opt_wrap( ) )
1412 if ( ! (yy_did_buffer_switch_on_eof) )
1421 case EOB_ACT_CONTINUE_SCAN:
1422 (yy_c_buf_p) = (yytext_ptr) + offset;
1428 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1429 *(yy_c_buf_p) = '\0'; /* preserve _lc_opt_text */
1430 (yy_hold_char) = *++(yy_c_buf_p);
1434 #endif /* ifndef YY_NO_INPUT */
1436 /** Immediately switch to a different input stream.
1437 * @param input_file A readable stream.
1439 * @note This function does not reset the start condition to @c INITIAL .
1441 void _lc_opt_restart (FILE * input_file )
1444 if ( ! YY_CURRENT_BUFFER ){
1445 _lc_opt_ensure_buffer_stack ();
1446 YY_CURRENT_BUFFER_LVALUE =
1447 _lc_opt__create_buffer(_lc_opt_in,YY_BUF_SIZE );
1450 _lc_opt__init_buffer(YY_CURRENT_BUFFER,input_file );
1451 _lc_opt__load_buffer_state( );
1454 /** Switch to a different input buffer.
1455 * @param new_buffer The new input buffer.
1458 void _lc_opt__switch_to_buffer (YY_BUFFER_STATE new_buffer )
1461 /* TODO. We should be able to replace this entire function body
1463 * _lc_opt_pop_buffer_state();
1464 * _lc_opt_push_buffer_state(new_buffer);
1466 _lc_opt_ensure_buffer_stack ();
1467 if ( YY_CURRENT_BUFFER == new_buffer )
1470 if ( YY_CURRENT_BUFFER )
1472 /* Flush out information for old buffer. */
1473 *(yy_c_buf_p) = (yy_hold_char);
1474 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1475 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1478 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1479 _lc_opt__load_buffer_state( );
1481 /* We don't actually know whether we did this switch during
1482 * EOF (_lc_opt_wrap()) processing, but the only time this flag
1483 * is looked at is after _lc_opt_wrap() is called, so it's safe
1484 * to go ahead and always set it.
1486 (yy_did_buffer_switch_on_eof) = 1;
1489 static void _lc_opt__load_buffer_state (void)
1491 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1492 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1493 _lc_opt_in = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1494 (yy_hold_char) = *(yy_c_buf_p);
1497 /** Allocate and initialize an input buffer state.
1498 * @param file A readable stream.
1499 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1501 * @return the allocated buffer state.
1503 YY_BUFFER_STATE _lc_opt__create_buffer (FILE * file, int size )
1507 b = (YY_BUFFER_STATE) _lc_opt_alloc(sizeof( struct yy_buffer_state ) );
1509 YY_FATAL_ERROR( "out of dynamic memory in _lc_opt__create_buffer()" );
1511 b->yy_buf_size = size;
1513 /* yy_ch_buf has to be 2 characters longer than the size given because
1514 * we need to put in 2 end-of-buffer characters.
1516 b->yy_ch_buf = (char *) _lc_opt_alloc(b->yy_buf_size + 2 );
1517 if ( ! b->yy_ch_buf )
1518 YY_FATAL_ERROR( "out of dynamic memory in _lc_opt__create_buffer()" );
1520 b->yy_is_our_buffer = 1;
1522 _lc_opt__init_buffer(b,file );
1527 /** Destroy the buffer.
1528 * @param b a buffer created with _lc_opt__create_buffer()
1531 void _lc_opt__delete_buffer (YY_BUFFER_STATE b )
1537 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1538 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1540 if ( b->yy_is_our_buffer )
1541 _lc_opt_free((void *) b->yy_ch_buf );
1543 _lc_opt_free((void *) b );
1547 extern int isatty (int );
1548 #endif /* __cplusplus */
1550 /* Initializes or reinitializes a buffer.
1551 * This function is sometimes called more than once on the same buffer,
1552 * such as during a _lc_opt_restart() or at EOF.
1554 static void _lc_opt__init_buffer (YY_BUFFER_STATE b, FILE * file )
1559 _lc_opt__flush_buffer(b );
1561 b->yy_input_file = file;
1562 b->yy_fill_buffer = 1;
1564 /* If b is the current buffer, then _lc_opt__init_buffer was _probably_
1565 * called from _lc_opt_restart() or through yy_get_next_buffer.
1566 * In that case, we don't want to reset the lineno or column.
1568 if (b != YY_CURRENT_BUFFER){
1569 b->yy_bs_lineno = 1;
1570 b->yy_bs_column = 0;
1573 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1578 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1579 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1582 void _lc_opt__flush_buffer (YY_BUFFER_STATE b )
1589 /* We always need two end-of-buffer characters. The first causes
1590 * a transition to the end-of-buffer state. The second causes
1591 * a jam in that state.
1593 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1594 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1596 b->yy_buf_pos = &b->yy_ch_buf[0];
1599 b->yy_buffer_status = YY_BUFFER_NEW;
1601 if ( b == YY_CURRENT_BUFFER )
1602 _lc_opt__load_buffer_state( );
1605 /** Pushes the new state onto the stack. The new state becomes
1606 * the current state. This function will allocate the stack
1608 * @param new_buffer The new state.
1611 void _lc_opt_push_buffer_state (YY_BUFFER_STATE new_buffer )
1613 if (new_buffer == NULL)
1616 _lc_opt_ensure_buffer_stack();
1618 /* This block is copied from _lc_opt__switch_to_buffer. */
1619 if ( YY_CURRENT_BUFFER )
1621 /* Flush out information for old buffer. */
1622 *(yy_c_buf_p) = (yy_hold_char);
1623 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1624 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1627 /* Only push if top exists. Otherwise, replace top. */
1628 if (YY_CURRENT_BUFFER)
1629 (yy_buffer_stack_top)++;
1630 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1632 /* copied from _lc_opt__switch_to_buffer. */
1633 _lc_opt__load_buffer_state( );
1634 (yy_did_buffer_switch_on_eof) = 1;
1637 /** Removes and deletes the top of the stack, if present.
1638 * The next element becomes the new top.
1641 void _lc_opt_pop_buffer_state (void)
1643 if (!YY_CURRENT_BUFFER)
1646 _lc_opt__delete_buffer(YY_CURRENT_BUFFER );
1647 YY_CURRENT_BUFFER_LVALUE = NULL;
1648 if ((yy_buffer_stack_top) > 0)
1649 --(yy_buffer_stack_top);
1651 if (YY_CURRENT_BUFFER) {
1652 _lc_opt__load_buffer_state( );
1653 (yy_did_buffer_switch_on_eof) = 1;
1657 /* Allocates the stack if it does not exist.
1658 * Guarantees space for at least one push.
1660 static void _lc_opt_ensure_buffer_stack (void)
1664 if (!(yy_buffer_stack)) {
1666 /* First allocation is just for 2 elements, since we don't know if this
1667 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1668 * immediate realloc on the next call.
1671 (yy_buffer_stack) = (struct yy_buffer_state**)_lc_opt_alloc
1672 (num_to_alloc * sizeof(struct yy_buffer_state*)
1674 if ( ! (yy_buffer_stack) )
1675 YY_FATAL_ERROR( "out of dynamic memory in _lc_opt_ensure_buffer_stack()" );
1677 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1679 (yy_buffer_stack_max) = num_to_alloc;
1680 (yy_buffer_stack_top) = 0;
1684 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1686 /* Increase the buffer to prepare for a possible push. */
1687 int grow_size = 8 /* arbitrary grow size */;
1689 num_to_alloc = (yy_buffer_stack_max) + grow_size;
1690 (yy_buffer_stack) = (struct yy_buffer_state**)_lc_opt_realloc
1692 num_to_alloc * sizeof(struct yy_buffer_state*)
1694 if ( ! (yy_buffer_stack) )
1695 YY_FATAL_ERROR( "out of dynamic memory in _lc_opt_ensure_buffer_stack()" );
1697 /* zero only the new slots.*/
1698 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1699 (yy_buffer_stack_max) = num_to_alloc;
1703 /** Setup the input buffer state to scan directly from a user-specified character buffer.
1704 * @param base the character buffer
1705 * @param size the size in bytes of the character buffer
1707 * @return the newly allocated buffer state object.
1709 YY_BUFFER_STATE _lc_opt__scan_buffer (char * base, yy_size_t size )
1714 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1715 base[size-1] != YY_END_OF_BUFFER_CHAR )
1716 /* They forgot to leave room for the EOB's. */
1719 b = (YY_BUFFER_STATE) _lc_opt_alloc(sizeof( struct yy_buffer_state ) );
1721 YY_FATAL_ERROR( "out of dynamic memory in _lc_opt__scan_buffer()" );
1723 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1724 b->yy_buf_pos = b->yy_ch_buf = base;
1725 b->yy_is_our_buffer = 0;
1726 b->yy_input_file = 0;
1727 b->yy_n_chars = b->yy_buf_size;
1728 b->yy_is_interactive = 0;
1730 b->yy_fill_buffer = 0;
1731 b->yy_buffer_status = YY_BUFFER_NEW;
1733 _lc_opt__switch_to_buffer(b );
1738 /** Setup the input buffer state to scan a string. The next call to _lc_opt_lex() will
1739 * scan from a @e copy of @a str.
1740 * @param yystr a NUL-terminated string to scan
1742 * @return the newly allocated buffer state object.
1743 * @note If you want to scan bytes that may contain NUL values, then use
1744 * _lc_opt__scan_bytes() instead.
1746 YY_BUFFER_STATE _lc_opt__scan_string (yyconst char * yystr )
1749 return _lc_opt__scan_bytes(yystr,strlen(yystr) );
1752 /** Setup the input buffer state to scan the given bytes. The next call to _lc_opt_lex() will
1753 * scan from a @e copy of @a bytes.
1754 * @param yybytes the byte buffer to scan
1755 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
1757 * @return the newly allocated buffer state object.
1759 YY_BUFFER_STATE _lc_opt__scan_bytes (yyconst char * yybytes, int _yybytes_len )
1766 /* Get memory for full buffer, including space for trailing EOB's. */
1767 n = _yybytes_len + 2;
1768 buf = (char *) _lc_opt_alloc(n );
1770 YY_FATAL_ERROR( "out of dynamic memory in _lc_opt__scan_bytes()" );
1772 for ( i = 0; i < _yybytes_len; ++i )
1773 buf[i] = yybytes[i];
1775 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1777 b = _lc_opt__scan_buffer(buf,n );
1779 YY_FATAL_ERROR( "bad buffer in _lc_opt__scan_bytes()" );
1781 /* It's okay to grow etc. this buffer, and we should throw it
1782 * away when we're done.
1784 b->yy_is_our_buffer = 1;
1789 #ifndef YY_EXIT_FAILURE
1790 #define YY_EXIT_FAILURE 2
1793 static void yy_fatal_error (yyconst char* msg )
1795 (void) fprintf( stderr, "%s\n", msg );
1796 exit( YY_EXIT_FAILURE );
1799 /* Redefine yyless() so it works in section 3 code. */
1805 /* Undo effects of setting up _lc_opt_text. */ \
1806 int yyless_macro_arg = (n); \
1807 YY_LESS_LINENO(yyless_macro_arg);\
1808 _lc_opt_text[_lc_opt_leng] = (yy_hold_char); \
1809 (yy_c_buf_p) = _lc_opt_text + yyless_macro_arg; \
1810 (yy_hold_char) = *(yy_c_buf_p); \
1811 *(yy_c_buf_p) = '\0'; \
1812 _lc_opt_leng = yyless_macro_arg; \
1816 /* Accessor methods (get/set functions) to struct members. */
1818 /** Get the current line number.
1821 int _lc_opt_get_lineno (void)
1824 return _lc_opt_lineno;
1827 /** Get the input stream.
1830 FILE *_lc_opt_get_in (void)
1835 /** Get the output stream.
1838 FILE *_lc_opt_get_out (void)
1843 /** Get the length of the current token.
1846 int _lc_opt_get_leng (void)
1848 return _lc_opt_leng;
1851 /** Get the current token.
1855 char *_lc_opt_get_text (void)
1857 return _lc_opt_text;
1860 /** Set the current line number.
1861 * @param line_number
1864 void _lc_opt_set_lineno (int line_number )
1867 _lc_opt_lineno = line_number;
1870 /** Set the input stream. This does not discard the current
1872 * @param in_str A readable stream.
1874 * @see _lc_opt__switch_to_buffer
1876 void _lc_opt_set_in (FILE * in_str )
1878 _lc_opt_in = in_str ;
1881 void _lc_opt_set_out (FILE * out_str )
1883 _lc_opt_out = out_str ;
1886 int _lc_opt_get_debug (void)
1888 return _lc_opt__flex_debug;
1891 void _lc_opt_set_debug (int bdebug )
1893 _lc_opt__flex_debug = bdebug ;
1896 static int yy_init_globals (void)
1898 /* Initialization is the same as for the non-reentrant scanner.
1899 * This function is called from _lc_opt_lex_destroy(), so don't allocate here.
1902 (yy_buffer_stack) = 0;
1903 (yy_buffer_stack_top) = 0;
1904 (yy_buffer_stack_max) = 0;
1905 (yy_c_buf_p) = (char *) 0;
1909 /* Defined in main.c */
1912 _lc_opt_out = stdout;
1914 _lc_opt_in = (FILE *) 0;
1915 _lc_opt_out = (FILE *) 0;
1918 /* For future reference: Set errno on error, since we are called by
1919 * _lc_opt_lex_init()
1924 /* _lc_opt_lex_destroy is for both reentrant and non-reentrant scanners. */
1925 int _lc_opt_lex_destroy (void)
1928 /* Pop the buffer stack, destroying each element. */
1929 while(YY_CURRENT_BUFFER){
1930 _lc_opt__delete_buffer(YY_CURRENT_BUFFER );
1931 YY_CURRENT_BUFFER_LVALUE = NULL;
1932 _lc_opt_pop_buffer_state();
1935 /* Destroy the stack itself. */
1936 _lc_opt_free((yy_buffer_stack) );
1937 (yy_buffer_stack) = NULL;
1939 /* Reset the globals. This is important in a non-reentrant scanner so the next time
1940 * _lc_opt_lex() is called, initialization will occur. */
1947 * Internal utility routines.
1951 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
1954 for ( i = 0; i < n; ++i )
1959 #ifdef YY_NEED_STRLEN
1960 static int yy_flex_strlen (yyconst char * s )
1963 for ( n = 0; s[n]; ++n )
1970 void *_lc_opt_alloc (yy_size_t size )
1972 return (void *) malloc( size );
1975 void *_lc_opt_realloc (void * ptr, yy_size_t size )
1977 /* The cast to (char *) in the following accommodates both
1978 * implementations that use char* generic pointers, and those
1979 * that use void* generic pointers. It works with the latter
1980 * because both ANSI C and C++ allow castless assignment from
1981 * any pointer type to void*, and deal with argument conversions
1982 * as though doing an assignment.
1984 return (void *) realloc( (char *) ptr, size );
1987 void _lc_opt_free (void * ptr )
1989 free( (char *) ptr ); /* see _lc_opt_realloc() for (char *) cast */
1992 #define YYTABLES_NAME "yytables"
1994 #line 114 "lc_config_lexer.l"
1998 static int _lc_opt_wrap(void)