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. */
164 #define YY_BUF_SIZE 16384
167 /* The state buf must be large enough to hold one state per character in the main buffer.
169 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
171 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
172 #define YY_TYPEDEF_YY_BUFFER_STATE
173 typedef struct yy_buffer_state *YY_BUFFER_STATE;
176 extern int _lc_opt_leng;
178 extern FILE *_lc_opt_in, *_lc_opt_out;
180 #define EOB_ACT_CONTINUE_SCAN 0
181 #define EOB_ACT_END_OF_FILE 1
182 #define EOB_ACT_LAST_MATCH 2
184 #define YY_LESS_LINENO(n)
186 /* Return all but the first "n" matched characters back to the input stream. */
190 /* Undo effects of setting up _lc_opt_text. */ \
191 int yyless_macro_arg = (n); \
192 YY_LESS_LINENO(yyless_macro_arg);\
193 *yy_cp = (yy_hold_char); \
194 YY_RESTORE_YY_MORE_OFFSET \
195 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
196 YY_DO_BEFORE_ACTION; /* set up _lc_opt_text again */ \
200 #define unput(c) yyunput( c, (yytext_ptr) )
202 #ifndef YY_TYPEDEF_YY_SIZE_T
203 #define YY_TYPEDEF_YY_SIZE_T
204 typedef size_t yy_size_t;
207 #ifndef YY_STRUCT_YY_BUFFER_STATE
208 #define YY_STRUCT_YY_BUFFER_STATE
209 struct yy_buffer_state
213 char *yy_ch_buf; /* input buffer */
214 char *yy_buf_pos; /* current position in input buffer */
216 /* Size of input buffer in bytes, not including room for EOB
219 yy_size_t yy_buf_size;
221 /* Number of characters read into yy_ch_buf, not including EOB
226 /* Whether we "own" the buffer - i.e., we know we created it,
227 * and can realloc() it to grow it, and should free() it to
230 int yy_is_our_buffer;
232 /* Whether this is an "interactive" input source; if so, and
233 * if we're using stdio for input, then we want to use getc()
234 * instead of fread(), to make sure we stop fetching input after
237 int yy_is_interactive;
239 /* Whether we're considered to be at the beginning of a line.
240 * If so, '^' rules will be active on the next match, otherwise
245 int yy_bs_lineno; /**< The line count. */
246 int yy_bs_column; /**< The column count. */
248 /* Whether to try to fill the input buffer when we reach the
253 int yy_buffer_status;
255 #define YY_BUFFER_NEW 0
256 #define YY_BUFFER_NORMAL 1
257 /* When an EOF's been seen but there's still some text to process
258 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
259 * shouldn't try reading from the input source any more. We might
260 * still have a bunch of tokens to match, though, because of
261 * possible backing-up.
263 * When we actually see the EOF, we change the status to "new"
264 * (via _lc_opt_restart()), so that the user can continue scanning by
265 * just pointing _lc_opt_in at a new input file.
267 #define YY_BUFFER_EOF_PENDING 2
270 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
272 /* Stack of input buffers. */
273 static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
274 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
275 static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
277 /* We provide macros for accessing buffer states in case in the
278 * future we want to put the buffer states in a more general
281 * Returns the top of the stack, or NULL.
283 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
284 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
287 /* Same as previous macro, but useful when we know that the buffer stack is not
288 * NULL or when we need an lvalue. For internal use only.
290 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
292 /* yy_hold_char holds the character lost when _lc_opt_text is formed. */
293 static char yy_hold_char;
294 static int yy_n_chars; /* number of characters read into yy_ch_buf */
297 /* Points to current character in buffer. */
298 static char *yy_c_buf_p = (char *) 0;
299 static int yy_init = 0; /* whether we need to initialize */
300 static int yy_start = 0; /* start state number */
302 /* Flag which is used to allow _lc_opt_wrap()'s to do buffer switches
303 * instead of setting up a fresh _lc_opt_in. A bit of a hack ...
305 static int yy_did_buffer_switch_on_eof;
307 void _lc_opt_restart (FILE *input_file );
308 void _lc_opt__switch_to_buffer (YY_BUFFER_STATE new_buffer );
309 YY_BUFFER_STATE _lc_opt__create_buffer (FILE *file,int size );
310 void _lc_opt__delete_buffer (YY_BUFFER_STATE b );
311 void _lc_opt__flush_buffer (YY_BUFFER_STATE b );
312 void _lc_opt_push_buffer_state (YY_BUFFER_STATE new_buffer );
313 void _lc_opt_pop_buffer_state (void );
315 static void _lc_opt_ensure_buffer_stack (void );
316 static void _lc_opt__load_buffer_state (void );
317 static void _lc_opt__init_buffer (YY_BUFFER_STATE b,FILE *file );
319 #define YY_FLUSH_BUFFER _lc_opt__flush_buffer(YY_CURRENT_BUFFER )
321 YY_BUFFER_STATE _lc_opt__scan_buffer (char *base,yy_size_t size );
322 YY_BUFFER_STATE _lc_opt__scan_string (yyconst char *yy_str );
323 YY_BUFFER_STATE _lc_opt__scan_bytes (yyconst char *bytes,int len );
325 void *_lc_opt_alloc (yy_size_t );
326 void *_lc_opt_realloc (void *,yy_size_t );
327 void _lc_opt_free (void * );
329 #define yy_new_buffer _lc_opt__create_buffer
331 #define yy_set_interactive(is_interactive) \
333 if ( ! YY_CURRENT_BUFFER ){ \
334 _lc_opt_ensure_buffer_stack (); \
335 YY_CURRENT_BUFFER_LVALUE = \
336 _lc_opt__create_buffer(_lc_opt_in,YY_BUF_SIZE ); \
338 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
341 #define yy_set_bol(at_bol) \
343 if ( ! YY_CURRENT_BUFFER ){\
344 _lc_opt_ensure_buffer_stack (); \
345 YY_CURRENT_BUFFER_LVALUE = \
346 _lc_opt__create_buffer(_lc_opt_in,YY_BUF_SIZE ); \
348 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
351 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
353 /* Begin user sect3 */
355 typedef unsigned char YY_CHAR;
357 FILE *_lc_opt_in = (FILE *) 0, *_lc_opt_out = (FILE *) 0;
359 typedef int yy_state_type;
361 extern int _lc_opt_lineno;
363 int _lc_opt_lineno = 1;
365 extern char *_lc_opt_text;
366 #define yytext_ptr _lc_opt_text
368 static yy_state_type yy_get_previous_state (void );
369 static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
370 static int yy_get_next_buffer (void );
371 static void yy_fatal_error (yyconst char msg[] );
373 /* Done after the current pattern has been matched and before the
374 * corresponding action - sets up _lc_opt_text.
376 #define YY_DO_BEFORE_ACTION \
377 (yytext_ptr) = yy_bp; \
378 _lc_opt_leng = (size_t) (yy_cp - yy_bp); \
379 (yy_hold_char) = *yy_cp; \
381 (yy_c_buf_p) = yy_cp;
383 #define YY_NUM_RULES 28
384 #define YY_END_OF_BUFFER 29
385 /* This struct is not used in this scanner,
386 but its presence is necessary. */
389 flex_int32_t yy_verify;
392 static yyconst flex_int16_t yy_accept[49] =
394 25, 25, 0, 0, 0, 0, 0, 0, 0, 0,
395 0, 0, 29, 27, 25, 26, 5, 23, 24, 24,
396 8, 7, 6, 4, 3, 4, 11, 12, 9, 10,
397 14, 13, 22, 15, 22, 25, 23, 1, 5, 8,
398 2, 21, 19, 20, 16, 17, 18, 0
401 static yyconst flex_int32_t yy_ec[256] =
403 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
404 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
405 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
406 1, 2, 1, 4, 5, 6, 1, 1, 1, 1,
407 1, 7, 1, 1, 1, 8, 9, 10, 10, 10,
408 10, 10, 10, 10, 10, 10, 10, 11, 1, 1,
409 11, 1, 1, 1, 6, 6, 6, 6, 6, 6,
410 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
411 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
412 1, 12, 1, 1, 6, 1, 6, 13, 6, 6,
414 6, 14, 6, 6, 6, 6, 6, 6, 6, 15,
415 6, 6, 6, 16, 6, 17, 6, 6, 6, 6,
416 6, 6, 1, 1, 1, 1, 1, 1, 1, 1,
417 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
418 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
419 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
420 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
421 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
422 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
423 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
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,
433 static yyconst flex_int32_t yy_meta[18] =
435 1, 1, 2, 1, 1, 3, 1, 1, 1, 3,
439 static yyconst flex_int16_t yy_base[56] =
441 0, 0, 62, 39, 15, 16, 21, 31, 38, 37,
442 16, 17, 39, 67, 36, 67, 67, 0, 67, 23,
443 35, 67, 67, 67, 67, 27, 67, 67, 67, 67,
444 67, 67, 67, 67, 31, 29, 0, 67, 67, 25,
445 67, 67, 67, 67, 67, 67, 67, 67, 48, 51,
449 static yyconst flex_int16_t yy_def[56] =
451 48, 1, 49, 49, 50, 50, 51, 51, 52, 52,
452 53, 53, 48, 48, 48, 48, 48, 54, 48, 48,
453 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
454 48, 48, 48, 48, 55, 48, 54, 48, 48, 48,
455 48, 48, 48, 48, 48, 48, 48, 0, 48, 48,
459 static yyconst flex_int16_t yy_nxt[85] =
461 14, 15, 16, 14, 17, 18, 14, 19, 20, 14,
462 21, 14, 18, 18, 18, 18, 18, 25, 25, 34,
463 34, 26, 26, 28, 29, 37, 40, 35, 35, 38,
464 36, 39, 30, 28, 29, 41, 40, 36, 48, 32,
465 32, 23, 30, 43, 44, 45, 46, 47, 22, 22,
466 22, 24, 24, 24, 27, 27, 27, 31, 31, 31,
467 33, 33, 33, 42, 23, 42, 13, 48, 48, 48,
468 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
472 static yyconst flex_int16_t yy_chk[85] =
474 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
475 1, 1, 1, 1, 1, 1, 1, 5, 6, 11,
476 12, 5, 6, 7, 7, 54, 40, 11, 12, 20,
477 36, 20, 7, 8, 8, 26, 21, 15, 13, 10,
478 9, 4, 8, 35, 35, 35, 35, 35, 49, 49,
479 49, 50, 50, 50, 51, 51, 51, 52, 52, 52,
480 53, 53, 53, 55, 3, 55, 48, 48, 48, 48,
481 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
485 static yy_state_type yy_last_accepting_state;
486 static char *yy_last_accepting_cpos;
488 extern int _lc_opt__flex_debug;
489 int _lc_opt__flex_debug = 0;
491 /* The intent behind this definition is that it'll catch
492 * any uses of REJECT which flex missed.
494 #define REJECT reject_used_but_not_detected
495 #define yymore() yymore_used_but_not_detected
496 #define YY_MORE_ADJ 0
497 #define YY_RESTORE_YY_MORE_OFFSET
499 #line 1 "lc_config_lexer.l"
500 #line 5 "lc_config_lexer.l"
503 libcore: library for basic data structures and algorithms.
504 Copyright (C) 2005 IPD Goos, Universit"at Karlsruhe, Germany
506 This library is free software; you can redistribute it and/or
507 modify it under the terms of the GNU Lesser General Public
508 License as published by the Free Software Foundation; either
509 version 2.1 of the License, or (at your option) any later version.
511 This library is distributed in the hope that it will be useful,
512 but WITHOUT ANY WARRANTY; without even the implied warranty of
513 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
514 Lesser General Public License for more details.
516 You should have received a copy of the GNU Lesser General Public
517 License along with this library; if not, write to the Free Software
518 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
526 #include "lc_parser_t.h"
527 #include "lc_config_parser.h"
529 static int _lc_opt_wrap(void)
539 #line 540 "lc_config_lexer.c"
542 #define LINE_COMMENT 1
543 #define BIG_COMMENT 2
548 #ifndef YY_NO_UNISTD_H
549 /* Special case for "unistd.h", since it is non-ANSI. We include it way
550 * down here because we want the user's section 1 to have been scanned first.
551 * The user has a chance to override it with an option.
556 #ifndef YY_EXTRA_TYPE
557 #define YY_EXTRA_TYPE void *
560 static int yy_init_globals (void );
562 /* Accessor methods to globals.
563 These are made visible to non-reentrant scanners for convenience. */
565 int _lc_opt_lex_destroy (void );
567 int _lc_opt_get_debug (void );
569 void _lc_opt_set_debug (int debug_flag );
571 YY_EXTRA_TYPE _lc_opt_get_extra (void );
573 void _lc_opt_set_extra (YY_EXTRA_TYPE user_defined );
575 FILE *_lc_opt_get_in (void );
577 void _lc_opt_set_in (FILE * in_str );
579 FILE *_lc_opt_get_out (void );
581 void _lc_opt_set_out (FILE * out_str );
583 int _lc_opt_get_leng (void );
585 char *_lc_opt_get_text (void );
587 int _lc_opt_get_lineno (void );
589 void _lc_opt_set_lineno (int line_number );
591 /* Macros after this point can all be overridden by user definitions in
595 #ifndef YY_SKIP_YYWRAP
597 extern "C" int _lc_opt_wrap (void );
599 extern int _lc_opt_wrap (void );
603 static void yyunput (int c,char *buf_ptr );
606 static void yy_flex_strncpy (char *,yyconst char *,int );
609 #ifdef YY_NEED_STRLEN
610 static int yy_flex_strlen (yyconst char * );
616 static int yyinput (void );
618 static int input (void );
623 /* Amount of stuff to slurp up with each read. */
624 #ifndef YY_READ_BUF_SIZE
625 #define YY_READ_BUF_SIZE 8192
628 /* Copy whatever the last rule matched to the standard output. */
630 /* This used to be an fputs(), but since the string might contain NUL's,
631 * we now use fwrite().
633 #define ECHO fwrite( _lc_opt_text, _lc_opt_leng, 1, _lc_opt_out )
636 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
637 * is returned in "result".
640 #define YY_INPUT(buf,result,max_size) \
641 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
645 for ( n = 0; n < max_size && \
646 (c = getc( _lc_opt_in )) != EOF && c != '\n'; ++n ) \
649 buf[n++] = (char) c; \
650 if ( c == EOF && ferror( _lc_opt_in ) ) \
651 YY_FATAL_ERROR( "input in flex scanner failed" ); \
657 while ( (result = fread(buf, 1, max_size, _lc_opt_in))==0 && ferror(_lc_opt_in)) \
659 if( errno != EINTR) \
661 YY_FATAL_ERROR( "input in flex scanner failed" ); \
665 clearerr(_lc_opt_in); \
672 /* No semi-colon after return; correct usage is to write "yyterminate();" -
673 * we don't want an extra ';' after the "return" because that will cause
674 * some compilers to complain about unreachable statements.
677 #define yyterminate() return YY_NULL
680 /* Number of entries by which start-condition stack grows. */
681 #ifndef YY_START_STACK_INCR
682 #define YY_START_STACK_INCR 25
685 /* Report a fatal error. */
686 #ifndef YY_FATAL_ERROR
687 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
690 /* end tables serialization structures and prototypes */
692 /* Default declaration of generated scanner - a define so the user can
693 * easily add parameters.
696 #define YY_DECL_IS_OURS 1
698 extern int _lc_opt_lex (void);
700 #define YY_DECL int _lc_opt_lex (void)
701 #endif /* !YY_DECL */
703 /* Code executed at the beginning of each rule, after _lc_opt_text and _lc_opt_leng
706 #ifndef YY_USER_ACTION
707 #define YY_USER_ACTION
710 /* Code executed at the end of each rule. */
712 #define YY_BREAK break;
715 #define YY_RULE_SETUP \
718 /** The main scanner function which does all the work.
722 register yy_state_type yy_current_state;
723 register char *yy_cp, *yy_bp;
726 #line 55 "lc_config_lexer.l"
729 #line 730 "lc_config_lexer.c"
740 (yy_start) = 1; /* first start state */
746 _lc_opt_out = stdout;
748 if ( ! YY_CURRENT_BUFFER ) {
749 _lc_opt_ensure_buffer_stack ();
750 YY_CURRENT_BUFFER_LVALUE =
751 _lc_opt__create_buffer(_lc_opt_in,YY_BUF_SIZE );
754 _lc_opt__load_buffer_state( );
757 while ( 1 ) /* loops until end-of-file is reached */
759 yy_cp = (yy_c_buf_p);
761 /* Support of _lc_opt_text. */
762 *yy_cp = (yy_hold_char);
764 /* yy_bp points to the position in yy_ch_buf of the start of
769 yy_current_state = (yy_start);
773 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
774 if ( yy_accept[yy_current_state] )
776 (yy_last_accepting_state) = yy_current_state;
777 (yy_last_accepting_cpos) = yy_cp;
779 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
781 yy_current_state = (int) yy_def[yy_current_state];
782 if ( yy_current_state >= 49 )
783 yy_c = yy_meta[(unsigned int) yy_c];
785 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
788 while ( yy_base[yy_current_state] != 67 );
791 yy_act = yy_accept[yy_current_state];
793 { /* have to back up */
794 yy_cp = (yy_last_accepting_cpos);
795 yy_current_state = (yy_last_accepting_state);
796 yy_act = yy_accept[yy_current_state];
801 do_action: /* This label is used only to access EOF actions. */
804 { /* beginning of action switch */
805 case 0: /* must back up */
806 /* undo the effects of YY_DO_BEFORE_ACTION */
807 *yy_cp = (yy_hold_char);
808 yy_cp = (yy_last_accepting_cpos);
809 yy_current_state = (yy_last_accepting_state);
814 #line 57 "lc_config_lexer.l"
815 { BEGIN(BIG_COMMENT); }
819 #line 58 "lc_config_lexer.l"
823 /* rule 3 can match eol */
825 #line 59 "lc_config_lexer.l"
830 #line 60 "lc_config_lexer.l"
835 #line 62 "lc_config_lexer.l"
836 { BEGIN(LINE_COMMENT); }
839 /* rule 6 can match eol */
841 #line 63 "lc_config_lexer.l"
842 { BEGIN(INITIAL); PMANGLE(linenr)++; }
846 #line 64 "lc_config_lexer.l"
851 #line 67 "lc_config_lexer.l"
856 #line 68 "lc_config_lexer.l"
861 #line 69 "lc_config_lexer.l"
866 #line 70 "lc_config_lexer.l"
867 { _lc_opt_add_to_data_char(PMANGLE(text)[0]); }
870 /* rule 12 can match eol */
872 #line 71 "lc_config_lexer.l"
876 _lc_opt_add_to_data_char('\0');
881 /* rule 13 can match eol */
883 #line 77 "lc_config_lexer.l"
884 { BEGIN(DAT); PMANGLE(linenr)++; }
888 #line 78 "lc_config_lexer.l"
893 #line 81 "lc_config_lexer.l"
896 _lc_opt_add_to_data_char('\0');
902 #line 87 "lc_config_lexer.l"
903 _lc_opt_add_to_data_char('\n');
907 #line 88 "lc_config_lexer.l"
908 _lc_opt_add_to_data_char('\r');
912 #line 89 "lc_config_lexer.l"
913 _lc_opt_add_to_data_char('\t');
917 #line 90 "lc_config_lexer.l"
918 _lc_opt_add_to_data_char('\b');
922 #line 91 "lc_config_lexer.l"
923 _lc_opt_add_to_data_char('\f');
927 #line 92 "lc_config_lexer.l"
928 _lc_opt_add_to_data_char(_lc_opt_text[1]);
931 /* rule 22 can match eol */
933 #line 93 "lc_config_lexer.l"
934 _lc_opt_add_to_data_char(_lc_opt_text[0]);
938 #line 95 "lc_config_lexer.l"
940 PMANGLE(lval).text.str = PMANGLE(text);
941 PMANGLE(lval).text.len = PMANGLE(leng);
947 #line 100 "lc_config_lexer.l"
952 #line 102 "lc_config_lexer.l"
956 /* rule 26 can match eol */
958 #line 103 "lc_config_lexer.l"
963 #line 105 "lc_config_lexer.l"
964 return _lc_opt_text[0];
968 #line 107 "lc_config_lexer.l"
971 #line 972 "lc_config_lexer.c"
972 case YY_STATE_EOF(INITIAL):
973 case YY_STATE_EOF(LINE_COMMENT):
974 case YY_STATE_EOF(BIG_COMMENT):
975 case YY_STATE_EOF(DAT):
976 case YY_STATE_EOF(DAT_CONT):
977 case YY_STATE_EOF(STR):
980 case YY_END_OF_BUFFER:
982 /* Amount of text matched not including the EOB char. */
983 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
985 /* Undo the effects of YY_DO_BEFORE_ACTION. */
986 *yy_cp = (yy_hold_char);
987 YY_RESTORE_YY_MORE_OFFSET
989 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
991 /* We're scanning a new file or input source. It's
992 * possible that this happened because the user
993 * just pointed _lc_opt_in at a new source and called
994 * _lc_opt_lex(). If so, then we have to assure
995 * consistency between YY_CURRENT_BUFFER and our
996 * globals. Here is the right place to do so, because
997 * this is the first action (other than possibly a
998 * back-up) that will match for the new input source.
1000 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1001 YY_CURRENT_BUFFER_LVALUE->yy_input_file = _lc_opt_in;
1002 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1005 /* Note that here we test for yy_c_buf_p "<=" to the position
1006 * of the first EOB in the buffer, since yy_c_buf_p will
1007 * already have been incremented past the NUL character
1008 * (since all states make transitions on EOB to the
1009 * end-of-buffer state). Contrast this with the test
1012 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1013 { /* This was really a NUL. */
1014 yy_state_type yy_next_state;
1016 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1018 yy_current_state = yy_get_previous_state( );
1020 /* Okay, we're now positioned to make the NUL
1021 * transition. We couldn't have
1022 * yy_get_previous_state() go ahead and do it
1023 * for us because it doesn't know how to deal
1024 * with the possibility of jamming (and we don't
1025 * want to build jamming into it because then it
1026 * will run more slowly).
1029 yy_next_state = yy_try_NUL_trans( yy_current_state );
1031 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1033 if ( yy_next_state )
1035 /* Consume the NUL. */
1036 yy_cp = ++(yy_c_buf_p);
1037 yy_current_state = yy_next_state;
1043 yy_cp = (yy_c_buf_p);
1044 goto yy_find_action;
1048 else switch ( yy_get_next_buffer( ) )
1050 case EOB_ACT_END_OF_FILE:
1052 (yy_did_buffer_switch_on_eof) = 0;
1054 if ( _lc_opt_wrap( ) )
1056 /* Note: because we've taken care in
1057 * yy_get_next_buffer() to have set up
1058 * _lc_opt_text, we can now set up
1059 * yy_c_buf_p so that if some total
1060 * hoser (like flex itself) wants to
1061 * call the scanner after we return the
1062 * YY_NULL, it'll still work - another
1063 * YY_NULL will get returned.
1065 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1067 yy_act = YY_STATE_EOF(YY_START);
1073 if ( ! (yy_did_buffer_switch_on_eof) )
1079 case EOB_ACT_CONTINUE_SCAN:
1081 (yytext_ptr) + yy_amount_of_matched_text;
1083 yy_current_state = yy_get_previous_state( );
1085 yy_cp = (yy_c_buf_p);
1086 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1089 case EOB_ACT_LAST_MATCH:
1091 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1093 yy_current_state = yy_get_previous_state( );
1095 yy_cp = (yy_c_buf_p);
1096 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1097 goto yy_find_action;
1104 "fatal flex scanner internal error--no action found" );
1105 } /* end of action switch */
1106 } /* end of scanning one token */
1107 } /* end of _lc_opt_lex */
1109 /* yy_get_next_buffer - try to read in a new buffer
1111 * Returns a code representing an action:
1112 * EOB_ACT_LAST_MATCH -
1113 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1114 * EOB_ACT_END_OF_FILE - end of file
1116 static int yy_get_next_buffer (void)
1118 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1119 register char *source = (yytext_ptr);
1120 register int number_to_move, i;
1123 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1125 "fatal flex scanner internal error--end of buffer missed" );
1127 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1128 { /* Don't try to fill the buffer, so this is an EOF. */
1129 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1131 /* We matched a single character, the EOB, so
1132 * treat this as a final EOF.
1134 return EOB_ACT_END_OF_FILE;
1139 /* We matched some text prior to the EOB, first
1142 return EOB_ACT_LAST_MATCH;
1146 /* Try to read more data. */
1148 /* First move last chars to start of buffer. */
1149 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1151 for ( i = 0; i < number_to_move; ++i )
1152 *(dest++) = *(source++);
1154 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1155 /* don't do the read, it's not guaranteed to return an EOF,
1158 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1163 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1165 while ( num_to_read <= 0 )
1166 { /* Not enough room in the buffer - grow it. */
1168 /* just a shorter name for the current buffer */
1169 YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1171 int yy_c_buf_p_offset =
1172 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1174 if ( b->yy_is_our_buffer )
1176 int new_size = b->yy_buf_size * 2;
1178 if ( new_size <= 0 )
1179 b->yy_buf_size += b->yy_buf_size / 8;
1181 b->yy_buf_size *= 2;
1183 b->yy_ch_buf = (char *)
1184 /* Include room in for 2 EOB chars. */
1185 _lc_opt_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
1188 /* Can't grow it, we don't own it. */
1191 if ( ! b->yy_ch_buf )
1193 "fatal error - scanner input buffer overflow" );
1195 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1197 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1202 if ( num_to_read > YY_READ_BUF_SIZE )
1203 num_to_read = YY_READ_BUF_SIZE;
1205 /* Read in more data. */
1206 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1207 (yy_n_chars), (size_t) num_to_read );
1209 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1212 if ( (yy_n_chars) == 0 )
1214 if ( number_to_move == YY_MORE_ADJ )
1216 ret_val = EOB_ACT_END_OF_FILE;
1217 _lc_opt_restart(_lc_opt_in );
1222 ret_val = EOB_ACT_LAST_MATCH;
1223 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1224 YY_BUFFER_EOF_PENDING;
1229 ret_val = EOB_ACT_CONTINUE_SCAN;
1231 if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1232 /* Extend the array by 50%, plus the number we really need. */
1233 yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1234 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) _lc_opt_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
1235 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1236 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1239 (yy_n_chars) += number_to_move;
1240 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1241 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1243 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1248 /* yy_get_previous_state - get the state just before the EOB char was reached */
1250 static yy_state_type yy_get_previous_state (void)
1252 register yy_state_type yy_current_state;
1253 register char *yy_cp;
1255 yy_current_state = (yy_start);
1257 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1259 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1260 if ( yy_accept[yy_current_state] )
1262 (yy_last_accepting_state) = yy_current_state;
1263 (yy_last_accepting_cpos) = yy_cp;
1265 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1267 yy_current_state = (int) yy_def[yy_current_state];
1268 if ( yy_current_state >= 49 )
1269 yy_c = yy_meta[(unsigned int) yy_c];
1271 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1274 return yy_current_state;
1277 /* yy_try_NUL_trans - try to make a transition on the NUL character
1280 * next_state = yy_try_NUL_trans( current_state );
1282 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1284 register int yy_is_jam;
1285 register char *yy_cp = (yy_c_buf_p);
1287 register YY_CHAR yy_c = 1;
1288 if ( yy_accept[yy_current_state] )
1290 (yy_last_accepting_state) = yy_current_state;
1291 (yy_last_accepting_cpos) = yy_cp;
1293 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1295 yy_current_state = (int) yy_def[yy_current_state];
1296 if ( yy_current_state >= 49 )
1297 yy_c = yy_meta[(unsigned int) yy_c];
1299 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1300 yy_is_jam = (yy_current_state == 48);
1302 return yy_is_jam ? 0 : yy_current_state;
1305 static void yyunput (int c, register char * yy_bp )
1307 register char *yy_cp;
1309 yy_cp = (yy_c_buf_p);
1311 /* undo effects of setting up _lc_opt_text */
1312 *yy_cp = (yy_hold_char);
1314 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1315 { /* need to shift things up to make room */
1316 /* +2 for EOB chars. */
1317 register int number_to_move = (yy_n_chars) + 2;
1318 register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1319 YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1320 register char *source =
1321 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1323 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1324 *--dest = *--source;
1326 yy_cp += (int) (dest - source);
1327 yy_bp += (int) (dest - source);
1328 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1329 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1331 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1332 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1335 *--yy_cp = (char) c;
1337 (yytext_ptr) = yy_bp;
1338 (yy_hold_char) = *yy_cp;
1339 (yy_c_buf_p) = yy_cp;
1344 static int yyinput (void)
1346 static int input (void)
1352 *(yy_c_buf_p) = (yy_hold_char);
1354 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1356 /* yy_c_buf_p now points to the character we want to return.
1357 * If this occurs *before* the EOB characters, then it's a
1358 * valid NUL; if not, then we've hit the end of the buffer.
1360 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1361 /* This was really a NUL. */
1362 *(yy_c_buf_p) = '\0';
1365 { /* need more input */
1366 int offset = (yy_c_buf_p) - (yytext_ptr);
1369 switch ( yy_get_next_buffer( ) )
1371 case EOB_ACT_LAST_MATCH:
1372 /* This happens because yy_g_n_b()
1373 * sees that we've accumulated a
1374 * token and flags that we need to
1375 * try matching the token before
1376 * proceeding. But for input(),
1377 * there's no matching to consider.
1378 * So convert the EOB_ACT_LAST_MATCH
1379 * to EOB_ACT_END_OF_FILE.
1382 /* Reset buffer status. */
1383 _lc_opt_restart(_lc_opt_in );
1387 case EOB_ACT_END_OF_FILE:
1389 if ( _lc_opt_wrap( ) )
1392 if ( ! (yy_did_buffer_switch_on_eof) )
1401 case EOB_ACT_CONTINUE_SCAN:
1402 (yy_c_buf_p) = (yytext_ptr) + offset;
1408 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1409 *(yy_c_buf_p) = '\0'; /* preserve _lc_opt_text */
1410 (yy_hold_char) = *++(yy_c_buf_p);
1414 #endif /* ifndef YY_NO_INPUT */
1416 /** Immediately switch to a different input stream.
1417 * @param input_file A readable stream.
1419 * @note This function does not reset the start condition to @c INITIAL .
1421 void _lc_opt_restart (FILE * input_file )
1424 if ( ! YY_CURRENT_BUFFER ){
1425 _lc_opt_ensure_buffer_stack ();
1426 YY_CURRENT_BUFFER_LVALUE =
1427 _lc_opt__create_buffer(_lc_opt_in,YY_BUF_SIZE );
1430 _lc_opt__init_buffer(YY_CURRENT_BUFFER,input_file );
1431 _lc_opt__load_buffer_state( );
1434 /** Switch to a different input buffer.
1435 * @param new_buffer The new input buffer.
1438 void _lc_opt__switch_to_buffer (YY_BUFFER_STATE new_buffer )
1441 /* TODO. We should be able to replace this entire function body
1443 * _lc_opt_pop_buffer_state();
1444 * _lc_opt_push_buffer_state(new_buffer);
1446 _lc_opt_ensure_buffer_stack ();
1447 if ( YY_CURRENT_BUFFER == new_buffer )
1450 if ( YY_CURRENT_BUFFER )
1452 /* Flush out information for old buffer. */
1453 *(yy_c_buf_p) = (yy_hold_char);
1454 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1455 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1458 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1459 _lc_opt__load_buffer_state( );
1461 /* We don't actually know whether we did this switch during
1462 * EOF (_lc_opt_wrap()) processing, but the only time this flag
1463 * is looked at is after _lc_opt_wrap() is called, so it's safe
1464 * to go ahead and always set it.
1466 (yy_did_buffer_switch_on_eof) = 1;
1469 static void _lc_opt__load_buffer_state (void)
1471 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1472 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1473 _lc_opt_in = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1474 (yy_hold_char) = *(yy_c_buf_p);
1477 /** Allocate and initialize an input buffer state.
1478 * @param file A readable stream.
1479 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1481 * @return the allocated buffer state.
1483 YY_BUFFER_STATE _lc_opt__create_buffer (FILE * file, int size )
1487 b = (YY_BUFFER_STATE) _lc_opt_alloc(sizeof( struct yy_buffer_state ) );
1489 YY_FATAL_ERROR( "out of dynamic memory in _lc_opt__create_buffer()" );
1491 b->yy_buf_size = size;
1493 /* yy_ch_buf has to be 2 characters longer than the size given because
1494 * we need to put in 2 end-of-buffer characters.
1496 b->yy_ch_buf = (char *) _lc_opt_alloc(b->yy_buf_size + 2 );
1497 if ( ! b->yy_ch_buf )
1498 YY_FATAL_ERROR( "out of dynamic memory in _lc_opt__create_buffer()" );
1500 b->yy_is_our_buffer = 1;
1502 _lc_opt__init_buffer(b,file );
1507 /** Destroy the buffer.
1508 * @param b a buffer created with _lc_opt__create_buffer()
1511 void _lc_opt__delete_buffer (YY_BUFFER_STATE b )
1517 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1518 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1520 if ( b->yy_is_our_buffer )
1521 _lc_opt_free((void *) b->yy_ch_buf );
1523 _lc_opt_free((void *) b );
1527 extern int isatty (int );
1528 #endif /* __cplusplus */
1530 /* Initializes or reinitializes a buffer.
1531 * This function is sometimes called more than once on the same buffer,
1532 * such as during a _lc_opt_restart() or at EOF.
1534 static void _lc_opt__init_buffer (YY_BUFFER_STATE b, FILE * file )
1539 _lc_opt__flush_buffer(b );
1541 b->yy_input_file = file;
1542 b->yy_fill_buffer = 1;
1544 /* If b is the current buffer, then _lc_opt__init_buffer was _probably_
1545 * called from _lc_opt_restart() or through yy_get_next_buffer.
1546 * In that case, we don't want to reset the lineno or column.
1548 if (b != YY_CURRENT_BUFFER){
1549 b->yy_bs_lineno = 1;
1550 b->yy_bs_column = 0;
1553 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1558 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1559 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1562 void _lc_opt__flush_buffer (YY_BUFFER_STATE b )
1569 /* We always need two end-of-buffer characters. The first causes
1570 * a transition to the end-of-buffer state. The second causes
1571 * a jam in that state.
1573 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1574 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1576 b->yy_buf_pos = &b->yy_ch_buf[0];
1579 b->yy_buffer_status = YY_BUFFER_NEW;
1581 if ( b == YY_CURRENT_BUFFER )
1582 _lc_opt__load_buffer_state( );
1585 /** Pushes the new state onto the stack. The new state becomes
1586 * the current state. This function will allocate the stack
1588 * @param new_buffer The new state.
1591 void _lc_opt_push_buffer_state (YY_BUFFER_STATE new_buffer )
1593 if (new_buffer == NULL)
1596 _lc_opt_ensure_buffer_stack();
1598 /* This block is copied from _lc_opt__switch_to_buffer. */
1599 if ( YY_CURRENT_BUFFER )
1601 /* Flush out information for old buffer. */
1602 *(yy_c_buf_p) = (yy_hold_char);
1603 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1604 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1607 /* Only push if top exists. Otherwise, replace top. */
1608 if (YY_CURRENT_BUFFER)
1609 (yy_buffer_stack_top)++;
1610 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1612 /* copied from _lc_opt__switch_to_buffer. */
1613 _lc_opt__load_buffer_state( );
1614 (yy_did_buffer_switch_on_eof) = 1;
1617 /** Removes and deletes the top of the stack, if present.
1618 * The next element becomes the new top.
1621 void _lc_opt_pop_buffer_state (void)
1623 if (!YY_CURRENT_BUFFER)
1626 _lc_opt__delete_buffer(YY_CURRENT_BUFFER );
1627 YY_CURRENT_BUFFER_LVALUE = NULL;
1628 if ((yy_buffer_stack_top) > 0)
1629 --(yy_buffer_stack_top);
1631 if (YY_CURRENT_BUFFER) {
1632 _lc_opt__load_buffer_state( );
1633 (yy_did_buffer_switch_on_eof) = 1;
1637 /* Allocates the stack if it does not exist.
1638 * Guarantees space for at least one push.
1640 static void _lc_opt_ensure_buffer_stack (void)
1644 if (!(yy_buffer_stack)) {
1646 /* First allocation is just for 2 elements, since we don't know if this
1647 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1648 * immediate realloc on the next call.
1651 (yy_buffer_stack) = (struct yy_buffer_state**)_lc_opt_alloc
1652 (num_to_alloc * sizeof(struct yy_buffer_state*)
1654 if ( ! (yy_buffer_stack) )
1655 YY_FATAL_ERROR( "out of dynamic memory in _lc_opt_ensure_buffer_stack()" );
1657 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1659 (yy_buffer_stack_max) = num_to_alloc;
1660 (yy_buffer_stack_top) = 0;
1664 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1666 /* Increase the buffer to prepare for a possible push. */
1667 int grow_size = 8 /* arbitrary grow size */;
1669 num_to_alloc = (yy_buffer_stack_max) + grow_size;
1670 (yy_buffer_stack) = (struct yy_buffer_state**)_lc_opt_realloc
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 /* zero only the new slots.*/
1678 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1679 (yy_buffer_stack_max) = num_to_alloc;
1683 /** Setup the input buffer state to scan directly from a user-specified character buffer.
1684 * @param base the character buffer
1685 * @param size the size in bytes of the character buffer
1687 * @return the newly allocated buffer state object.
1689 YY_BUFFER_STATE _lc_opt__scan_buffer (char * base, yy_size_t size )
1694 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1695 base[size-1] != YY_END_OF_BUFFER_CHAR )
1696 /* They forgot to leave room for the EOB's. */
1699 b = (YY_BUFFER_STATE) _lc_opt_alloc(sizeof( struct yy_buffer_state ) );
1701 YY_FATAL_ERROR( "out of dynamic memory in _lc_opt__scan_buffer()" );
1703 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1704 b->yy_buf_pos = b->yy_ch_buf = base;
1705 b->yy_is_our_buffer = 0;
1706 b->yy_input_file = 0;
1707 b->yy_n_chars = b->yy_buf_size;
1708 b->yy_is_interactive = 0;
1710 b->yy_fill_buffer = 0;
1711 b->yy_buffer_status = YY_BUFFER_NEW;
1713 _lc_opt__switch_to_buffer(b );
1718 /** Setup the input buffer state to scan a string. The next call to _lc_opt_lex() will
1719 * scan from a @e copy of @a str.
1720 * @param yystr a NUL-terminated string to scan
1722 * @return the newly allocated buffer state object.
1723 * @note If you want to scan bytes that may contain NUL values, then use
1724 * _lc_opt__scan_bytes() instead.
1726 YY_BUFFER_STATE _lc_opt__scan_string (yyconst char * yystr )
1729 return _lc_opt__scan_bytes(yystr,strlen(yystr) );
1732 /** Setup the input buffer state to scan the given bytes. The next call to _lc_opt_lex() will
1733 * scan from a @e copy of @a bytes.
1734 * @param bytes the byte buffer to scan
1735 * @param len the number of bytes in the buffer pointed to by @a bytes.
1737 * @return the newly allocated buffer state object.
1739 YY_BUFFER_STATE _lc_opt__scan_bytes (yyconst char * yybytes, int _yybytes_len )
1746 /* Get memory for full buffer, including space for trailing EOB's. */
1747 n = _yybytes_len + 2;
1748 buf = (char *) _lc_opt_alloc(n );
1750 YY_FATAL_ERROR( "out of dynamic memory in _lc_opt__scan_bytes()" );
1752 for ( i = 0; i < _yybytes_len; ++i )
1753 buf[i] = yybytes[i];
1755 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1757 b = _lc_opt__scan_buffer(buf,n );
1759 YY_FATAL_ERROR( "bad buffer in _lc_opt__scan_bytes()" );
1761 /* It's okay to grow etc. this buffer, and we should throw it
1762 * away when we're done.
1764 b->yy_is_our_buffer = 1;
1769 #ifndef YY_EXIT_FAILURE
1770 #define YY_EXIT_FAILURE 2
1773 static void yy_fatal_error (yyconst char* msg )
1775 (void) fprintf( stderr, "%s\n", msg );
1776 exit( YY_EXIT_FAILURE );
1779 /* Redefine yyless() so it works in section 3 code. */
1785 /* Undo effects of setting up _lc_opt_text. */ \
1786 int yyless_macro_arg = (n); \
1787 YY_LESS_LINENO(yyless_macro_arg);\
1788 _lc_opt_text[_lc_opt_leng] = (yy_hold_char); \
1789 (yy_c_buf_p) = _lc_opt_text + yyless_macro_arg; \
1790 (yy_hold_char) = *(yy_c_buf_p); \
1791 *(yy_c_buf_p) = '\0'; \
1792 _lc_opt_leng = yyless_macro_arg; \
1796 /* Accessor methods (get/set functions) to struct members. */
1798 /** Get the current line number.
1801 int _lc_opt_get_lineno (void)
1804 return _lc_opt_lineno;
1807 /** Get the input stream.
1810 FILE *_lc_opt_get_in (void)
1815 /** Get the output stream.
1818 FILE *_lc_opt_get_out (void)
1823 /** Get the length of the current token.
1826 int _lc_opt_get_leng (void)
1828 return _lc_opt_leng;
1831 /** Get the current token.
1835 char *_lc_opt_get_text (void)
1837 return _lc_opt_text;
1840 /** Set the current line number.
1841 * @param line_number
1844 void _lc_opt_set_lineno (int line_number )
1847 _lc_opt_lineno = line_number;
1850 /** Set the input stream. This does not discard the current
1852 * @param in_str A readable stream.
1854 * @see _lc_opt__switch_to_buffer
1856 void _lc_opt_set_in (FILE * in_str )
1858 _lc_opt_in = in_str ;
1861 void _lc_opt_set_out (FILE * out_str )
1863 _lc_opt_out = out_str ;
1866 int _lc_opt_get_debug (void)
1868 return _lc_opt__flex_debug;
1871 void _lc_opt_set_debug (int bdebug )
1873 _lc_opt__flex_debug = bdebug ;
1876 static int yy_init_globals (void)
1878 /* Initialization is the same as for the non-reentrant scanner.
1879 * This function is called from _lc_opt_lex_destroy(), so don't allocate here.
1882 (yy_buffer_stack) = 0;
1883 (yy_buffer_stack_top) = 0;
1884 (yy_buffer_stack_max) = 0;
1885 (yy_c_buf_p) = (char *) 0;
1889 /* Defined in main.c */
1892 _lc_opt_out = stdout;
1894 _lc_opt_in = (FILE *) 0;
1895 _lc_opt_out = (FILE *) 0;
1898 /* For future reference: Set errno on error, since we are called by
1899 * _lc_opt_lex_init()
1904 /* _lc_opt_lex_destroy is for both reentrant and non-reentrant scanners. */
1905 int _lc_opt_lex_destroy (void)
1908 /* Pop the buffer stack, destroying each element. */
1909 while(YY_CURRENT_BUFFER){
1910 _lc_opt__delete_buffer(YY_CURRENT_BUFFER );
1911 YY_CURRENT_BUFFER_LVALUE = NULL;
1912 _lc_opt_pop_buffer_state();
1915 /* Destroy the stack itself. */
1916 _lc_opt_free((yy_buffer_stack) );
1917 (yy_buffer_stack) = NULL;
1919 /* Reset the globals. This is important in a non-reentrant scanner so the next time
1920 * _lc_opt_lex() is called, initialization will occur. */
1927 * Internal utility routines.
1931 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
1934 for ( i = 0; i < n; ++i )
1939 #ifdef YY_NEED_STRLEN
1940 static int yy_flex_strlen (yyconst char * s )
1943 for ( n = 0; s[n]; ++n )
1950 void *_lc_opt_alloc (yy_size_t size )
1952 return (void *) malloc( size );
1955 void *_lc_opt_realloc (void * ptr, yy_size_t size )
1957 /* The cast to (char *) in the following accommodates both
1958 * implementations that use char* generic pointers, and those
1959 * that use void* generic pointers. It works with the latter
1960 * because both ANSI C and C++ allow castless assignment from
1961 * any pointer type to void*, and deal with argument conversions
1962 * as though doing an assignment.
1964 return (void *) realloc( (char *) ptr, size );
1967 void _lc_opt_free (void * ptr )
1969 free( (char *) ptr ); /* see _lc_opt_realloc() for (char *) cast */
1972 #define YYTABLES_NAME "yytables"
1974 #line 107 "lc_config_lexer.l"