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 */
10 #define YY_FLEX_MAJOR_VERSION 2
11 #define YY_FLEX_MINOR_VERSION 5
12 #define YY_FLEX_SUBMINOR_VERSION 33
13 #if YY_FLEX_SUBMINOR_VERSION > 0
17 /* First, we deal with platform-specific or compiler-specific issues. */
19 /* begin standard C headers. */
25 /* end standard C headers. */
27 /* flex integer type definitions */
32 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
34 #if __STDC_VERSION__ >= 199901L
36 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
37 * if you want the limit (max/min) macros for int types.
39 #ifndef __STDC_LIMIT_MACROS
40 #define __STDC_LIMIT_MACROS 1
44 typedef int8_t flex_int8_t;
45 typedef uint8_t flex_uint8_t;
46 typedef int16_t flex_int16_t;
47 typedef uint16_t flex_uint16_t;
48 typedef int32_t flex_int32_t;
49 typedef uint32_t flex_uint32_t;
51 typedef signed char flex_int8_t;
52 typedef short int flex_int16_t;
53 typedef int flex_int32_t;
54 typedef unsigned char flex_uint8_t;
55 typedef unsigned short int flex_uint16_t;
56 typedef unsigned int flex_uint32_t;
59 /* Limits of integral types. */
61 #define INT8_MIN (-128)
64 #define INT16_MIN (-32767-1)
67 #define INT32_MIN (-2147483647-1)
70 #define INT8_MAX (127)
73 #define INT16_MAX (32767)
76 #define INT32_MAX (2147483647)
79 #define UINT8_MAX (255U)
82 #define UINT16_MAX (65535U)
85 #define UINT32_MAX (4294967295U)
88 #endif /* ! FLEXINT_H */
92 /* The "const" storage-class-modifier is valid. */
95 #else /* ! __cplusplus */
101 #endif /* __STDC__ */
102 #endif /* ! __cplusplus */
105 #define yyconst const
110 /* Returned upon end-of-file. */
113 /* Promotes a possibly negative, possibly signed char to an unsigned
114 * integer for use as an array index. If the signed char is negative,
115 * we want to instead treat it as an 8-bit unsigned char, hence the
118 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
120 /* Enter a start condition. This macro really ought to take a parameter,
121 * but we do it the disgusting crufty way forced on us by the ()-less
122 * definition of BEGIN.
124 #define BEGIN (yy_start) = 1 + 2 *
126 /* Translate the current start state into a value that can be later handed
127 * to BEGIN to return to the state. The YYSTATE alias is for lex
130 #define YY_START (((yy_start) - 1) / 2)
131 #define YYSTATE YY_START
133 /* Action number for EOF rule of a given start state. */
134 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
136 /* Special action meaning "start processing a new file". */
137 #define YY_NEW_FILE _lc_opt_restart(_lc_opt_in )
139 #define YY_END_OF_BUFFER_CHAR 0
141 /* Size of default input buffer. */
143 #define YY_BUF_SIZE 16384
146 /* The state buf must be large enough to hold one state per character in the main buffer.
148 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
150 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
151 #define YY_TYPEDEF_YY_BUFFER_STATE
152 typedef struct yy_buffer_state *YY_BUFFER_STATE;
155 extern int _lc_opt_leng;
157 extern FILE *_lc_opt_in, *_lc_opt_out;
159 #define EOB_ACT_CONTINUE_SCAN 0
160 #define EOB_ACT_END_OF_FILE 1
161 #define EOB_ACT_LAST_MATCH 2
163 #define YY_LESS_LINENO(n)
165 /* Return all but the first "n" matched characters back to the input stream. */
169 /* Undo effects of setting up _lc_opt_text. */ \
170 int yyless_macro_arg = (n); \
171 YY_LESS_LINENO(yyless_macro_arg);\
172 *yy_cp = (yy_hold_char); \
173 YY_RESTORE_YY_MORE_OFFSET \
174 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
175 YY_DO_BEFORE_ACTION; /* set up _lc_opt_text again */ \
179 #define unput(c) yyunput( c, (yytext_ptr) )
181 /* The following is because we cannot portably get our hands on size_t
182 * (without autoconf's help, which isn't available because we want
183 * flex-generated scanners to compile on their own).
186 #ifndef YY_TYPEDEF_YY_SIZE_T
187 #define YY_TYPEDEF_YY_SIZE_T
188 typedef unsigned int yy_size_t;
191 #ifndef YY_STRUCT_YY_BUFFER_STATE
192 #define YY_STRUCT_YY_BUFFER_STATE
193 struct yy_buffer_state
197 char *yy_ch_buf; /* input buffer */
198 char *yy_buf_pos; /* current position in input buffer */
200 /* Size of input buffer in bytes, not including room for EOB
203 yy_size_t yy_buf_size;
205 /* Number of characters read into yy_ch_buf, not including EOB
210 /* Whether we "own" the buffer - i.e., we know we created it,
211 * and can realloc() it to grow it, and should free() it to
214 int yy_is_our_buffer;
216 /* Whether this is an "interactive" input source; if so, and
217 * if we're using stdio for input, then we want to use getc()
218 * instead of fread(), to make sure we stop fetching input after
221 int yy_is_interactive;
223 /* Whether we're considered to be at the beginning of a line.
224 * If so, '^' rules will be active on the next match, otherwise
229 int yy_bs_lineno; /**< The line count. */
230 int yy_bs_column; /**< The column count. */
232 /* Whether to try to fill the input buffer when we reach the
237 int yy_buffer_status;
239 #define YY_BUFFER_NEW 0
240 #define YY_BUFFER_NORMAL 1
241 /* When an EOF's been seen but there's still some text to process
242 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
243 * shouldn't try reading from the input source any more. We might
244 * still have a bunch of tokens to match, though, because of
245 * possible backing-up.
247 * When we actually see the EOF, we change the status to "new"
248 * (via _lc_opt_restart()), so that the user can continue scanning by
249 * just pointing _lc_opt_in at a new input file.
251 #define YY_BUFFER_EOF_PENDING 2
254 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
256 /* Stack of input buffers. */
257 static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
258 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
259 static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
261 /* We provide macros for accessing buffer states in case in the
262 * future we want to put the buffer states in a more general
265 * Returns the top of the stack, or NULL.
267 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
268 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
271 /* Same as previous macro, but useful when we know that the buffer stack is not
272 * NULL or when we need an lvalue. For internal use only.
274 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
276 /* yy_hold_char holds the character lost when _lc_opt_text is formed. */
277 static char yy_hold_char;
278 static int yy_n_chars; /* number of characters read into yy_ch_buf */
281 /* Points to current character in buffer. */
282 static char *yy_c_buf_p = (char *) 0;
283 static int yy_init = 0; /* whether we need to initialize */
284 static int yy_start = 0; /* start state number */
286 /* Flag which is used to allow _lc_opt_wrap()'s to do buffer switches
287 * instead of setting up a fresh _lc_opt_in. A bit of a hack ...
289 static int yy_did_buffer_switch_on_eof;
291 void _lc_opt_restart (FILE *input_file );
292 void _lc_opt__switch_to_buffer (YY_BUFFER_STATE new_buffer );
293 YY_BUFFER_STATE _lc_opt__create_buffer (FILE *file,int size );
294 void _lc_opt__delete_buffer (YY_BUFFER_STATE b );
295 void _lc_opt__flush_buffer (YY_BUFFER_STATE b );
296 void _lc_opt_push_buffer_state (YY_BUFFER_STATE new_buffer );
297 void _lc_opt_pop_buffer_state (void );
299 static void _lc_opt_ensure_buffer_stack (void );
300 static void _lc_opt__load_buffer_state (void );
301 static void _lc_opt__init_buffer (YY_BUFFER_STATE b,FILE *file );
303 #define YY_FLUSH_BUFFER _lc_opt__flush_buffer(YY_CURRENT_BUFFER )
305 YY_BUFFER_STATE _lc_opt__scan_buffer (char *base,yy_size_t size );
306 YY_BUFFER_STATE _lc_opt__scan_string (yyconst char *yy_str );
307 YY_BUFFER_STATE _lc_opt__scan_bytes (yyconst char *bytes,int len );
309 void *_lc_opt_alloc (yy_size_t );
310 void *_lc_opt_realloc (void *,yy_size_t );
311 void _lc_opt_free (void * );
313 #define yy_new_buffer _lc_opt__create_buffer
315 #define yy_set_interactive(is_interactive) \
317 if ( ! YY_CURRENT_BUFFER ){ \
318 _lc_opt_ensure_buffer_stack (); \
319 YY_CURRENT_BUFFER_LVALUE = \
320 _lc_opt__create_buffer(_lc_opt_in,YY_BUF_SIZE ); \
322 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
325 #define yy_set_bol(at_bol) \
327 if ( ! YY_CURRENT_BUFFER ){\
328 _lc_opt_ensure_buffer_stack (); \
329 YY_CURRENT_BUFFER_LVALUE = \
330 _lc_opt__create_buffer(_lc_opt_in,YY_BUF_SIZE ); \
332 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
335 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
337 /* Begin user sect3 */
339 typedef unsigned char YY_CHAR;
341 FILE *_lc_opt_in = (FILE *) 0, *_lc_opt_out = (FILE *) 0;
343 typedef int yy_state_type;
345 extern int _lc_opt_lineno;
347 int _lc_opt_lineno = 1;
349 extern char *_lc_opt_text;
350 #define yytext_ptr _lc_opt_text
352 static yy_state_type yy_get_previous_state (void );
353 static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
354 static int yy_get_next_buffer (void );
355 static void yy_fatal_error (yyconst char msg[] );
357 /* Done after the current pattern has been matched and before the
358 * corresponding action - sets up _lc_opt_text.
360 #define YY_DO_BEFORE_ACTION \
361 (yytext_ptr) = yy_bp; \
362 _lc_opt_leng = (size_t) (yy_cp - yy_bp); \
363 (yy_hold_char) = *yy_cp; \
365 (yy_c_buf_p) = yy_cp;
367 #define YY_NUM_RULES 28
368 #define YY_END_OF_BUFFER 29
369 /* This struct is not used in this scanner,
370 but its presence is necessary. */
373 flex_int32_t yy_verify;
376 static yyconst flex_int16_t yy_accept[49] =
378 25, 25, 0, 0, 0, 0, 0, 0, 0, 0,
379 0, 0, 29, 27, 25, 26, 5, 23, 24, 24,
380 8, 7, 6, 4, 3, 4, 11, 12, 9, 10,
381 14, 13, 22, 15, 22, 25, 23, 1, 5, 8,
382 2, 21, 19, 20, 16, 17, 18, 0
385 static yyconst flex_int32_t yy_ec[256] =
387 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
388 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
389 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
390 1, 2, 1, 4, 5, 6, 1, 1, 1, 1,
391 1, 7, 1, 1, 1, 8, 9, 10, 10, 10,
392 10, 10, 10, 10, 10, 10, 10, 11, 1, 1,
393 11, 1, 1, 1, 6, 6, 6, 6, 6, 6,
394 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
395 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
396 1, 12, 1, 1, 6, 1, 6, 13, 6, 6,
398 6, 14, 6, 6, 6, 6, 6, 6, 6, 15,
399 6, 6, 6, 16, 6, 17, 6, 6, 6, 6,
400 6, 6, 1, 1, 1, 1, 1, 1, 1, 1,
401 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
402 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
403 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
404 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
405 1, 1, 1, 1, 1, 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,
409 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
410 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
411 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
412 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
413 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
417 static yyconst flex_int32_t yy_meta[18] =
419 1, 1, 2, 1, 1, 3, 1, 1, 1, 3,
423 static yyconst flex_int16_t yy_base[56] =
425 0, 0, 62, 39, 15, 16, 21, 31, 38, 37,
426 16, 17, 39, 67, 36, 67, 67, 0, 67, 23,
427 35, 67, 67, 67, 67, 27, 67, 67, 67, 67,
428 67, 67, 67, 67, 31, 29, 0, 67, 67, 25,
429 67, 67, 67, 67, 67, 67, 67, 67, 48, 51,
433 static yyconst flex_int16_t yy_def[56] =
435 48, 1, 49, 49, 50, 50, 51, 51, 52, 52,
436 53, 53, 48, 48, 48, 48, 48, 54, 48, 48,
437 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
438 48, 48, 48, 48, 55, 48, 54, 48, 48, 48,
439 48, 48, 48, 48, 48, 48, 48, 0, 48, 48,
443 static yyconst flex_int16_t yy_nxt[85] =
445 14, 15, 16, 14, 17, 18, 14, 19, 20, 14,
446 21, 14, 18, 18, 18, 18, 18, 25, 25, 34,
447 34, 26, 26, 28, 29, 37, 40, 35, 35, 38,
448 36, 39, 30, 28, 29, 41, 40, 36, 48, 32,
449 32, 23, 30, 43, 44, 45, 46, 47, 22, 22,
450 22, 24, 24, 24, 27, 27, 27, 31, 31, 31,
451 33, 33, 33, 42, 23, 42, 13, 48, 48, 48,
452 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
456 static yyconst flex_int16_t yy_chk[85] =
458 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
459 1, 1, 1, 1, 1, 1, 1, 5, 6, 11,
460 12, 5, 6, 7, 7, 54, 40, 11, 12, 20,
461 36, 20, 7, 8, 8, 26, 21, 15, 13, 10,
462 9, 4, 8, 35, 35, 35, 35, 35, 49, 49,
463 49, 50, 50, 50, 51, 51, 51, 52, 52, 52,
464 53, 53, 53, 55, 3, 55, 48, 48, 48, 48,
465 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
469 static yy_state_type yy_last_accepting_state;
470 static char *yy_last_accepting_cpos;
472 extern int _lc_opt__flex_debug;
473 int _lc_opt__flex_debug = 0;
475 /* The intent behind this definition is that it'll catch
476 * any uses of REJECT which flex missed.
478 #define REJECT reject_used_but_not_detected
479 #define yymore() yymore_used_but_not_detected
480 #define YY_MORE_ADJ 0
481 #define YY_RESTORE_YY_MORE_OFFSET
483 #line 1 "lc_config_lexer.l"
484 #line 5 "lc_config_lexer.l"
487 libcore: library for basic data structures and algorithms.
488 Copyright (C) 2005 IPD Goos, Universit"at Karlsruhe, Germany
490 This library is free software; you can redistribute it and/or
491 modify it under the terms of the GNU Lesser General Public
492 License as published by the Free Software Foundation; either
493 version 2.1 of the License, or (at your option) any later version.
495 This library is distributed in the hope that it will be useful,
496 but WITHOUT ANY WARRANTY; without even the implied warranty of
497 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
498 Lesser General Public License for more details.
500 You should have received a copy of the GNU Lesser General Public
501 License along with this library; if not, write to the Free Software
502 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
508 #include "lc_parser_t.h"
509 #include "lc_config_parser.h"
511 static int _lc_opt_wrap(void)
521 #line 522 "lc_config_lexer.c"
524 #define LINE_COMMENT 1
525 #define BIG_COMMENT 2
530 #ifndef YY_NO_UNISTD_H
531 /* Special case for "unistd.h", since it is non-ANSI. We include it way
532 * down here because we want the user's section 1 to have been scanned first.
533 * The user has a chance to override it with an option.
538 #ifndef YY_EXTRA_TYPE
539 #define YY_EXTRA_TYPE void *
542 static int yy_init_globals (void );
544 /* Macros after this point can all be overridden by user definitions in
548 #ifndef YY_SKIP_YYWRAP
550 extern "C" int _lc_opt_wrap (void );
552 extern int _lc_opt_wrap (void );
556 static void yyunput (int c,char *buf_ptr );
559 static void yy_flex_strncpy (char *,yyconst char *,int );
562 #ifdef YY_NEED_STRLEN
563 static int yy_flex_strlen (yyconst char * );
569 static int yyinput (void );
571 static int input (void );
576 /* Amount of stuff to slurp up with each read. */
577 #ifndef YY_READ_BUF_SIZE
578 #define YY_READ_BUF_SIZE 8192
581 /* Copy whatever the last rule matched to the standard output. */
583 /* This used to be an fputs(), but since the string might contain NUL's,
584 * we now use fwrite().
586 #define ECHO (void) fwrite( _lc_opt_text, _lc_opt_leng, 1, _lc_opt_out )
589 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
590 * is returned in "result".
593 #define YY_INPUT(buf,result,max_size) \
594 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
598 for ( n = 0; n < max_size && \
599 (c = getc( _lc_opt_in )) != EOF && c != '\n'; ++n ) \
602 buf[n++] = (char) c; \
603 if ( c == EOF && ferror( _lc_opt_in ) ) \
604 YY_FATAL_ERROR( "input in flex scanner failed" ); \
610 while ( (result = fread(buf, 1, max_size, _lc_opt_in))==0 && ferror(_lc_opt_in)) \
612 if( errno != EINTR) \
614 YY_FATAL_ERROR( "input in flex scanner failed" ); \
618 clearerr(_lc_opt_in); \
625 /* No semi-colon after return; correct usage is to write "yyterminate();" -
626 * we don't want an extra ';' after the "return" because that will cause
627 * some compilers to complain about unreachable statements.
630 #define yyterminate() return YY_NULL
633 /* Number of entries by which start-condition stack grows. */
634 #ifndef YY_START_STACK_INCR
635 #define YY_START_STACK_INCR 25
638 /* Report a fatal error. */
639 #ifndef YY_FATAL_ERROR
640 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
643 /* end tables serialization structures and prototypes */
645 /* Default declaration of generated scanner - a define so the user can
646 * easily add parameters.
649 #define YY_DECL_IS_OURS 1
651 extern int _lc_opt_lex (void);
653 #define YY_DECL int _lc_opt_lex (void)
654 #endif /* !YY_DECL */
656 /* Code executed at the beginning of each rule, after _lc_opt_text and _lc_opt_leng
659 #ifndef YY_USER_ACTION
660 #define YY_USER_ACTION
663 /* Code executed at the end of each rule. */
665 #define YY_BREAK break;
668 #define YY_RULE_SETUP \
671 /** The main scanner function which does all the work.
675 register yy_state_type yy_current_state;
676 register char *yy_cp, *yy_bp;
679 #line 53 "lc_config_lexer.l"
682 #line 683 "lc_config_lexer.c"
693 (yy_start) = 1; /* first start state */
699 _lc_opt_out = stdout;
701 if ( ! YY_CURRENT_BUFFER ) {
702 _lc_opt_ensure_buffer_stack ();
703 YY_CURRENT_BUFFER_LVALUE =
704 _lc_opt__create_buffer(_lc_opt_in,YY_BUF_SIZE );
707 _lc_opt__load_buffer_state( );
710 while ( 1 ) /* loops until end-of-file is reached */
712 yy_cp = (yy_c_buf_p);
714 /* Support of _lc_opt_text. */
715 *yy_cp = (yy_hold_char);
717 /* yy_bp points to the position in yy_ch_buf of the start of
722 yy_current_state = (yy_start);
726 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
727 if ( yy_accept[yy_current_state] )
729 (yy_last_accepting_state) = yy_current_state;
730 (yy_last_accepting_cpos) = yy_cp;
732 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
734 yy_current_state = (int) yy_def[yy_current_state];
735 if ( yy_current_state >= 49 )
736 yy_c = yy_meta[(unsigned int) yy_c];
738 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
741 while ( yy_base[yy_current_state] != 67 );
744 yy_act = yy_accept[yy_current_state];
746 { /* have to back up */
747 yy_cp = (yy_last_accepting_cpos);
748 yy_current_state = (yy_last_accepting_state);
749 yy_act = yy_accept[yy_current_state];
754 do_action: /* This label is used only to access EOF actions. */
757 { /* beginning of action switch */
758 case 0: /* must back up */
759 /* undo the effects of YY_DO_BEFORE_ACTION */
760 *yy_cp = (yy_hold_char);
761 yy_cp = (yy_last_accepting_cpos);
762 yy_current_state = (yy_last_accepting_state);
767 #line 55 "lc_config_lexer.l"
768 { BEGIN(BIG_COMMENT); }
772 #line 56 "lc_config_lexer.l"
776 /* rule 3 can match eol */
778 #line 57 "lc_config_lexer.l"
783 #line 58 "lc_config_lexer.l"
788 #line 60 "lc_config_lexer.l"
789 { BEGIN(LINE_COMMENT); }
792 /* rule 6 can match eol */
794 #line 61 "lc_config_lexer.l"
795 { BEGIN(INITIAL); PMANGLE(linenr)++; }
799 #line 62 "lc_config_lexer.l"
804 #line 65 "lc_config_lexer.l"
809 #line 66 "lc_config_lexer.l"
814 #line 67 "lc_config_lexer.l"
819 #line 68 "lc_config_lexer.l"
820 { _lc_opt_add_to_data_char(PMANGLE(text)[0]); }
823 /* rule 12 can match eol */
825 #line 69 "lc_config_lexer.l"
829 _lc_opt_add_to_data_char('\0');
834 /* rule 13 can match eol */
836 #line 75 "lc_config_lexer.l"
837 { BEGIN(DAT); PMANGLE(linenr)++; }
841 #line 76 "lc_config_lexer.l"
846 #line 79 "lc_config_lexer.l"
849 _lc_opt_add_to_data_char('\0');
855 #line 85 "lc_config_lexer.l"
856 _lc_opt_add_to_data_char('\n');
860 #line 86 "lc_config_lexer.l"
861 _lc_opt_add_to_data_char('\r');
865 #line 87 "lc_config_lexer.l"
866 _lc_opt_add_to_data_char('\t');
870 #line 88 "lc_config_lexer.l"
871 _lc_opt_add_to_data_char('\b');
875 #line 89 "lc_config_lexer.l"
876 _lc_opt_add_to_data_char('\f');
880 #line 90 "lc_config_lexer.l"
881 _lc_opt_add_to_data_char(_lc_opt_text[1]);
884 /* rule 22 can match eol */
886 #line 91 "lc_config_lexer.l"
887 _lc_opt_add_to_data_char(_lc_opt_text[0]);
891 #line 93 "lc_config_lexer.l"
893 PMANGLE(lval).text.str = PMANGLE(text);
894 PMANGLE(lval).text.len = PMANGLE(leng);
900 #line 98 "lc_config_lexer.l"
905 #line 100 "lc_config_lexer.l"
909 /* rule 26 can match eol */
911 #line 101 "lc_config_lexer.l"
916 #line 103 "lc_config_lexer.l"
917 return _lc_opt_text[0];
921 #line 105 "lc_config_lexer.l"
924 #line 925 "lc_config_lexer.c"
925 case YY_STATE_EOF(INITIAL):
926 case YY_STATE_EOF(LINE_COMMENT):
927 case YY_STATE_EOF(BIG_COMMENT):
928 case YY_STATE_EOF(DAT):
929 case YY_STATE_EOF(DAT_CONT):
930 case YY_STATE_EOF(STR):
933 case YY_END_OF_BUFFER:
935 /* Amount of text matched not including the EOB char. */
936 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
938 /* Undo the effects of YY_DO_BEFORE_ACTION. */
939 *yy_cp = (yy_hold_char);
940 YY_RESTORE_YY_MORE_OFFSET
942 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
944 /* We're scanning a new file or input source. It's
945 * possible that this happened because the user
946 * just pointed _lc_opt_in at a new source and called
947 * _lc_opt_lex(). If so, then we have to assure
948 * consistency between YY_CURRENT_BUFFER and our
949 * globals. Here is the right place to do so, because
950 * this is the first action (other than possibly a
951 * back-up) that will match for the new input source.
953 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
954 YY_CURRENT_BUFFER_LVALUE->yy_input_file = _lc_opt_in;
955 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
958 /* Note that here we test for yy_c_buf_p "<=" to the position
959 * of the first EOB in the buffer, since yy_c_buf_p will
960 * already have been incremented past the NUL character
961 * (since all states make transitions on EOB to the
962 * end-of-buffer state). Contrast this with the test
965 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
966 { /* This was really a NUL. */
967 yy_state_type yy_next_state;
969 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
971 yy_current_state = yy_get_previous_state( );
973 /* Okay, we're now positioned to make the NUL
974 * transition. We couldn't have
975 * yy_get_previous_state() go ahead and do it
976 * for us because it doesn't know how to deal
977 * with the possibility of jamming (and we don't
978 * want to build jamming into it because then it
979 * will run more slowly).
982 yy_next_state = yy_try_NUL_trans( yy_current_state );
984 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
988 /* Consume the NUL. */
989 yy_cp = ++(yy_c_buf_p);
990 yy_current_state = yy_next_state;
996 yy_cp = (yy_c_buf_p);
1001 else switch ( yy_get_next_buffer( ) )
1003 case EOB_ACT_END_OF_FILE:
1005 (yy_did_buffer_switch_on_eof) = 0;
1007 if ( _lc_opt_wrap( ) )
1009 /* Note: because we've taken care in
1010 * yy_get_next_buffer() to have set up
1011 * _lc_opt_text, we can now set up
1012 * yy_c_buf_p so that if some total
1013 * hoser (like flex itself) wants to
1014 * call the scanner after we return the
1015 * YY_NULL, it'll still work - another
1016 * YY_NULL will get returned.
1018 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1020 yy_act = YY_STATE_EOF(YY_START);
1026 if ( ! (yy_did_buffer_switch_on_eof) )
1032 case EOB_ACT_CONTINUE_SCAN:
1034 (yytext_ptr) + yy_amount_of_matched_text;
1036 yy_current_state = yy_get_previous_state( );
1038 yy_cp = (yy_c_buf_p);
1039 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1042 case EOB_ACT_LAST_MATCH:
1044 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1046 yy_current_state = yy_get_previous_state( );
1048 yy_cp = (yy_c_buf_p);
1049 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1050 goto yy_find_action;
1057 "fatal flex scanner internal error--no action found" );
1058 } /* end of action switch */
1059 } /* end of scanning one token */
1060 } /* end of _lc_opt_lex */
1062 /* yy_get_next_buffer - try to read in a new buffer
1064 * Returns a code representing an action:
1065 * EOB_ACT_LAST_MATCH -
1066 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1067 * EOB_ACT_END_OF_FILE - end of file
1069 static int yy_get_next_buffer (void)
1071 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1072 register char *source = (yytext_ptr);
1073 register int number_to_move, i;
1076 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1078 "fatal flex scanner internal error--end of buffer missed" );
1080 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1081 { /* Don't try to fill the buffer, so this is an EOF. */
1082 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1084 /* We matched a single character, the EOB, so
1085 * treat this as a final EOF.
1087 return EOB_ACT_END_OF_FILE;
1092 /* We matched some text prior to the EOB, first
1095 return EOB_ACT_LAST_MATCH;
1099 /* Try to read more data. */
1101 /* First move last chars to start of buffer. */
1102 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1104 for ( i = 0; i < number_to_move; ++i )
1105 *(dest++) = *(source++);
1107 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1108 /* don't do the read, it's not guaranteed to return an EOF,
1111 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1116 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1118 while ( num_to_read <= 0 )
1119 { /* Not enough room in the buffer - grow it. */
1121 /* just a shorter name for the current buffer */
1122 YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1124 int yy_c_buf_p_offset =
1125 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1127 if ( b->yy_is_our_buffer )
1129 int new_size = b->yy_buf_size * 2;
1131 if ( new_size <= 0 )
1132 b->yy_buf_size += b->yy_buf_size / 8;
1134 b->yy_buf_size *= 2;
1136 b->yy_ch_buf = (char *)
1137 /* Include room in for 2 EOB chars. */
1138 _lc_opt_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
1141 /* Can't grow it, we don't own it. */
1144 if ( ! b->yy_ch_buf )
1146 "fatal error - scanner input buffer overflow" );
1148 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1150 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1155 if ( num_to_read > YY_READ_BUF_SIZE )
1156 num_to_read = YY_READ_BUF_SIZE;
1158 /* Read in more data. */
1159 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1160 (yy_n_chars), (size_t) num_to_read );
1162 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1165 if ( (yy_n_chars) == 0 )
1167 if ( number_to_move == YY_MORE_ADJ )
1169 ret_val = EOB_ACT_END_OF_FILE;
1170 _lc_opt_restart(_lc_opt_in );
1175 ret_val = EOB_ACT_LAST_MATCH;
1176 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1177 YY_BUFFER_EOF_PENDING;
1182 ret_val = EOB_ACT_CONTINUE_SCAN;
1184 (yy_n_chars) += number_to_move;
1185 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1186 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1188 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1193 /* yy_get_previous_state - get the state just before the EOB char was reached */
1195 static yy_state_type yy_get_previous_state (void)
1197 register yy_state_type yy_current_state;
1198 register char *yy_cp;
1200 yy_current_state = (yy_start);
1202 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1204 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1205 if ( yy_accept[yy_current_state] )
1207 (yy_last_accepting_state) = yy_current_state;
1208 (yy_last_accepting_cpos) = yy_cp;
1210 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1212 yy_current_state = (int) yy_def[yy_current_state];
1213 if ( yy_current_state >= 49 )
1214 yy_c = yy_meta[(unsigned int) yy_c];
1216 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1219 return yy_current_state;
1222 /* yy_try_NUL_trans - try to make a transition on the NUL character
1225 * next_state = yy_try_NUL_trans( current_state );
1227 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1229 register int yy_is_jam;
1230 register char *yy_cp = (yy_c_buf_p);
1232 register YY_CHAR yy_c = 1;
1233 if ( yy_accept[yy_current_state] )
1235 (yy_last_accepting_state) = yy_current_state;
1236 (yy_last_accepting_cpos) = yy_cp;
1238 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1240 yy_current_state = (int) yy_def[yy_current_state];
1241 if ( yy_current_state >= 49 )
1242 yy_c = yy_meta[(unsigned int) yy_c];
1244 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1245 yy_is_jam = (yy_current_state == 48);
1247 return yy_is_jam ? 0 : yy_current_state;
1250 static void yyunput (int c, register char * yy_bp )
1252 register char *yy_cp;
1254 yy_cp = (yy_c_buf_p);
1256 /* undo effects of setting up _lc_opt_text */
1257 *yy_cp = (yy_hold_char);
1259 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1260 { /* need to shift things up to make room */
1261 /* +2 for EOB chars. */
1262 register int number_to_move = (yy_n_chars) + 2;
1263 register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1264 YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1265 register char *source =
1266 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1268 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1269 *--dest = *--source;
1271 yy_cp += (int) (dest - source);
1272 yy_bp += (int) (dest - source);
1273 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1274 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1276 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1277 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1280 *--yy_cp = (char) c;
1282 (yytext_ptr) = yy_bp;
1283 (yy_hold_char) = *yy_cp;
1284 (yy_c_buf_p) = yy_cp;
1289 static int yyinput (void)
1291 static int input (void)
1297 *(yy_c_buf_p) = (yy_hold_char);
1299 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1301 /* yy_c_buf_p now points to the character we want to return.
1302 * If this occurs *before* the EOB characters, then it's a
1303 * valid NUL; if not, then we've hit the end of the buffer.
1305 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1306 /* This was really a NUL. */
1307 *(yy_c_buf_p) = '\0';
1310 { /* need more input */
1311 int offset = (yy_c_buf_p) - (yytext_ptr);
1314 switch ( yy_get_next_buffer( ) )
1316 case EOB_ACT_LAST_MATCH:
1317 /* This happens because yy_g_n_b()
1318 * sees that we've accumulated a
1319 * token and flags that we need to
1320 * try matching the token before
1321 * proceeding. But for input(),
1322 * there's no matching to consider.
1323 * So convert the EOB_ACT_LAST_MATCH
1324 * to EOB_ACT_END_OF_FILE.
1327 /* Reset buffer status. */
1328 _lc_opt_restart(_lc_opt_in );
1332 case EOB_ACT_END_OF_FILE:
1334 if ( _lc_opt_wrap( ) )
1337 if ( ! (yy_did_buffer_switch_on_eof) )
1346 case EOB_ACT_CONTINUE_SCAN:
1347 (yy_c_buf_p) = (yytext_ptr) + offset;
1353 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1354 *(yy_c_buf_p) = '\0'; /* preserve _lc_opt_text */
1355 (yy_hold_char) = *++(yy_c_buf_p);
1359 #endif /* ifndef YY_NO_INPUT */
1361 /** Immediately switch to a different input stream.
1362 * @param input_file A readable stream.
1364 * @note This function does not reset the start condition to @c INITIAL .
1366 void _lc_opt_restart (FILE * input_file )
1369 if ( ! YY_CURRENT_BUFFER ){
1370 _lc_opt_ensure_buffer_stack ();
1371 YY_CURRENT_BUFFER_LVALUE =
1372 _lc_opt__create_buffer(_lc_opt_in,YY_BUF_SIZE );
1375 _lc_opt__init_buffer(YY_CURRENT_BUFFER,input_file );
1376 _lc_opt__load_buffer_state( );
1379 /** Switch to a different input buffer.
1380 * @param new_buffer The new input buffer.
1383 void _lc_opt__switch_to_buffer (YY_BUFFER_STATE new_buffer )
1386 /* TODO. We should be able to replace this entire function body
1388 * _lc_opt_pop_buffer_state();
1389 * _lc_opt_push_buffer_state(new_buffer);
1391 _lc_opt_ensure_buffer_stack ();
1392 if ( YY_CURRENT_BUFFER == new_buffer )
1395 if ( YY_CURRENT_BUFFER )
1397 /* Flush out information for old buffer. */
1398 *(yy_c_buf_p) = (yy_hold_char);
1399 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1400 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1403 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1404 _lc_opt__load_buffer_state( );
1406 /* We don't actually know whether we did this switch during
1407 * EOF (_lc_opt_wrap()) processing, but the only time this flag
1408 * is looked at is after _lc_opt_wrap() is called, so it's safe
1409 * to go ahead and always set it.
1411 (yy_did_buffer_switch_on_eof) = 1;
1414 static void _lc_opt__load_buffer_state (void)
1416 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1417 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1418 _lc_opt_in = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1419 (yy_hold_char) = *(yy_c_buf_p);
1422 /** Allocate and initialize an input buffer state.
1423 * @param file A readable stream.
1424 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1426 * @return the allocated buffer state.
1428 YY_BUFFER_STATE _lc_opt__create_buffer (FILE * file, int size )
1432 b = (YY_BUFFER_STATE) _lc_opt_alloc(sizeof( struct yy_buffer_state ) );
1434 YY_FATAL_ERROR( "out of dynamic memory in _lc_opt__create_buffer()" );
1436 b->yy_buf_size = size;
1438 /* yy_ch_buf has to be 2 characters longer than the size given because
1439 * we need to put in 2 end-of-buffer characters.
1441 b->yy_ch_buf = (char *) _lc_opt_alloc(b->yy_buf_size + 2 );
1442 if ( ! b->yy_ch_buf )
1443 YY_FATAL_ERROR( "out of dynamic memory in _lc_opt__create_buffer()" );
1445 b->yy_is_our_buffer = 1;
1447 _lc_opt__init_buffer(b,file );
1452 /** Destroy the buffer.
1453 * @param b a buffer created with _lc_opt__create_buffer()
1456 void _lc_opt__delete_buffer (YY_BUFFER_STATE b )
1462 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1463 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1465 if ( b->yy_is_our_buffer )
1466 _lc_opt_free((void *) b->yy_ch_buf );
1468 _lc_opt_free((void *) b );
1472 extern int isatty (int );
1473 #endif /* __cplusplus */
1475 /* Initializes or reinitializes a buffer.
1476 * This function is sometimes called more than once on the same buffer,
1477 * such as during a _lc_opt_restart() or at EOF.
1479 static void _lc_opt__init_buffer (YY_BUFFER_STATE b, FILE * file )
1484 _lc_opt__flush_buffer(b );
1486 b->yy_input_file = file;
1487 b->yy_fill_buffer = 1;
1489 /* If b is the current buffer, then _lc_opt__init_buffer was _probably_
1490 * called from _lc_opt_restart() or through yy_get_next_buffer.
1491 * In that case, we don't want to reset the lineno or column.
1493 if (b != YY_CURRENT_BUFFER){
1494 b->yy_bs_lineno = 1;
1495 b->yy_bs_column = 0;
1498 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1503 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1504 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1507 void _lc_opt__flush_buffer (YY_BUFFER_STATE b )
1514 /* We always need two end-of-buffer characters. The first causes
1515 * a transition to the end-of-buffer state. The second causes
1516 * a jam in that state.
1518 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1519 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1521 b->yy_buf_pos = &b->yy_ch_buf[0];
1524 b->yy_buffer_status = YY_BUFFER_NEW;
1526 if ( b == YY_CURRENT_BUFFER )
1527 _lc_opt__load_buffer_state( );
1530 /** Pushes the new state onto the stack. The new state becomes
1531 * the current state. This function will allocate the stack
1533 * @param new_buffer The new state.
1536 void _lc_opt_push_buffer_state (YY_BUFFER_STATE new_buffer )
1538 if (new_buffer == NULL)
1541 _lc_opt_ensure_buffer_stack();
1543 /* This block is copied from _lc_opt__switch_to_buffer. */
1544 if ( YY_CURRENT_BUFFER )
1546 /* Flush out information for old buffer. */
1547 *(yy_c_buf_p) = (yy_hold_char);
1548 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1549 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1552 /* Only push if top exists. Otherwise, replace top. */
1553 if (YY_CURRENT_BUFFER)
1554 (yy_buffer_stack_top)++;
1555 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1557 /* copied from _lc_opt__switch_to_buffer. */
1558 _lc_opt__load_buffer_state( );
1559 (yy_did_buffer_switch_on_eof) = 1;
1562 /** Removes and deletes the top of the stack, if present.
1563 * The next element becomes the new top.
1566 void _lc_opt_pop_buffer_state (void)
1568 if (!YY_CURRENT_BUFFER)
1571 _lc_opt__delete_buffer(YY_CURRENT_BUFFER );
1572 YY_CURRENT_BUFFER_LVALUE = NULL;
1573 if ((yy_buffer_stack_top) > 0)
1574 --(yy_buffer_stack_top);
1576 if (YY_CURRENT_BUFFER) {
1577 _lc_opt__load_buffer_state( );
1578 (yy_did_buffer_switch_on_eof) = 1;
1582 /* Allocates the stack if it does not exist.
1583 * Guarantees space for at least one push.
1585 static void _lc_opt_ensure_buffer_stack (void)
1589 if (!(yy_buffer_stack)) {
1591 /* First allocation is just for 2 elements, since we don't know if this
1592 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1593 * immediate realloc on the next call.
1596 (yy_buffer_stack) = (struct yy_buffer_state**)_lc_opt_alloc
1597 (num_to_alloc * sizeof(struct yy_buffer_state*)
1600 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1602 (yy_buffer_stack_max) = num_to_alloc;
1603 (yy_buffer_stack_top) = 0;
1607 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1609 /* Increase the buffer to prepare for a possible push. */
1610 int grow_size = 8 /* arbitrary grow size */;
1612 num_to_alloc = (yy_buffer_stack_max) + grow_size;
1613 (yy_buffer_stack) = (struct yy_buffer_state**)_lc_opt_realloc
1615 num_to_alloc * sizeof(struct yy_buffer_state*)
1618 /* zero only the new slots.*/
1619 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1620 (yy_buffer_stack_max) = num_to_alloc;
1624 /** Setup the input buffer state to scan directly from a user-specified character buffer.
1625 * @param base the character buffer
1626 * @param size the size in bytes of the character buffer
1628 * @return the newly allocated buffer state object.
1630 YY_BUFFER_STATE _lc_opt__scan_buffer (char * base, yy_size_t size )
1635 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1636 base[size-1] != YY_END_OF_BUFFER_CHAR )
1637 /* They forgot to leave room for the EOB's. */
1640 b = (YY_BUFFER_STATE) _lc_opt_alloc(sizeof( struct yy_buffer_state ) );
1642 YY_FATAL_ERROR( "out of dynamic memory in _lc_opt__scan_buffer()" );
1644 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1645 b->yy_buf_pos = b->yy_ch_buf = base;
1646 b->yy_is_our_buffer = 0;
1647 b->yy_input_file = 0;
1648 b->yy_n_chars = b->yy_buf_size;
1649 b->yy_is_interactive = 0;
1651 b->yy_fill_buffer = 0;
1652 b->yy_buffer_status = YY_BUFFER_NEW;
1654 _lc_opt__switch_to_buffer(b );
1659 /** Setup the input buffer state to scan a string. The next call to _lc_opt_lex() will
1660 * scan from a @e copy of @a str.
1661 * @param yystr a NUL-terminated string to scan
1663 * @return the newly allocated buffer state object.
1664 * @note If you want to scan bytes that may contain NUL values, then use
1665 * _lc_opt__scan_bytes() instead.
1667 YY_BUFFER_STATE _lc_opt__scan_string (yyconst char * yystr )
1670 return _lc_opt__scan_bytes(yystr,strlen(yystr) );
1673 /** Setup the input buffer state to scan the given bytes. The next call to _lc_opt_lex() will
1674 * scan from a @e copy of @a bytes.
1675 * @param bytes the byte buffer to scan
1676 * @param len the number of bytes in the buffer pointed to by @a bytes.
1678 * @return the newly allocated buffer state object.
1680 YY_BUFFER_STATE _lc_opt__scan_bytes (yyconst char * yybytes, int _yybytes_len )
1687 /* Get memory for full buffer, including space for trailing EOB's. */
1688 n = _yybytes_len + 2;
1689 buf = (char *) _lc_opt_alloc(n );
1691 YY_FATAL_ERROR( "out of dynamic memory in _lc_opt__scan_bytes()" );
1693 for ( i = 0; i < _yybytes_len; ++i )
1694 buf[i] = yybytes[i];
1696 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1698 b = _lc_opt__scan_buffer(buf,n );
1700 YY_FATAL_ERROR( "bad buffer in _lc_opt__scan_bytes()" );
1702 /* It's okay to grow etc. this buffer, and we should throw it
1703 * away when we're done.
1705 b->yy_is_our_buffer = 1;
1710 #ifndef YY_EXIT_FAILURE
1711 #define YY_EXIT_FAILURE 2
1714 static void yy_fatal_error (yyconst char* msg )
1716 (void) fprintf( stderr, "%s\n", msg );
1717 exit( YY_EXIT_FAILURE );
1720 /* Redefine yyless() so it works in section 3 code. */
1726 /* Undo effects of setting up _lc_opt_text. */ \
1727 int yyless_macro_arg = (n); \
1728 YY_LESS_LINENO(yyless_macro_arg);\
1729 _lc_opt_text[_lc_opt_leng] = (yy_hold_char); \
1730 (yy_c_buf_p) = _lc_opt_text + yyless_macro_arg; \
1731 (yy_hold_char) = *(yy_c_buf_p); \
1732 *(yy_c_buf_p) = '\0'; \
1733 _lc_opt_leng = yyless_macro_arg; \
1737 /* Accessor methods (get/set functions) to struct members. */
1739 /** Get the current line number.
1742 int _lc_opt_get_lineno (void)
1745 return _lc_opt_lineno;
1748 /** Get the input stream.
1751 FILE *_lc_opt_get_in (void)
1756 /** Get the output stream.
1759 FILE *_lc_opt_get_out (void)
1764 /** Get the length of the current token.
1767 int _lc_opt_get_leng (void)
1769 return _lc_opt_leng;
1772 /** Get the current token.
1776 char *_lc_opt_get_text (void)
1778 return _lc_opt_text;
1781 /** Set the current line number.
1782 * @param line_number
1785 void _lc_opt_set_lineno (int line_number )
1788 _lc_opt_lineno = line_number;
1791 /** Set the input stream. This does not discard the current
1793 * @param in_str A readable stream.
1795 * @see _lc_opt__switch_to_buffer
1797 void _lc_opt_set_in (FILE * in_str )
1799 _lc_opt_in = in_str ;
1802 void _lc_opt_set_out (FILE * out_str )
1804 _lc_opt_out = out_str ;
1807 int _lc_opt_get_debug (void)
1809 return _lc_opt__flex_debug;
1812 void _lc_opt_set_debug (int bdebug )
1814 _lc_opt__flex_debug = bdebug ;
1817 static int yy_init_globals (void)
1819 /* Initialization is the same as for the non-reentrant scanner.
1820 * This function is called from _lc_opt_lex_destroy(), so don't allocate here.
1823 (yy_buffer_stack) = 0;
1824 (yy_buffer_stack_top) = 0;
1825 (yy_buffer_stack_max) = 0;
1826 (yy_c_buf_p) = (char *) 0;
1830 /* Defined in main.c */
1833 _lc_opt_out = stdout;
1835 _lc_opt_in = (FILE *) 0;
1836 _lc_opt_out = (FILE *) 0;
1839 /* For future reference: Set errno on error, since we are called by
1840 * _lc_opt_lex_init()
1845 /* _lc_opt_lex_destroy is for both reentrant and non-reentrant scanners. */
1846 int _lc_opt_lex_destroy (void)
1849 /* Pop the buffer stack, destroying each element. */
1850 while(YY_CURRENT_BUFFER){
1851 _lc_opt__delete_buffer(YY_CURRENT_BUFFER );
1852 YY_CURRENT_BUFFER_LVALUE = NULL;
1853 _lc_opt_pop_buffer_state();
1856 /* Destroy the stack itself. */
1857 _lc_opt_free((yy_buffer_stack) );
1858 (yy_buffer_stack) = NULL;
1860 /* Reset the globals. This is important in a non-reentrant scanner so the next time
1861 * _lc_opt_lex() is called, initialization will occur. */
1868 * Internal utility routines.
1872 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
1875 for ( i = 0; i < n; ++i )
1880 #ifdef YY_NEED_STRLEN
1881 static int yy_flex_strlen (yyconst char * s )
1884 for ( n = 0; s[n]; ++n )
1891 void *_lc_opt_alloc (yy_size_t size )
1893 return (void *) malloc( size );
1896 void *_lc_opt_realloc (void * ptr, yy_size_t size )
1898 /* The cast to (char *) in the following accommodates both
1899 * implementations that use char* generic pointers, and those
1900 * that use void* generic pointers. It works with the latter
1901 * because both ANSI C and C++ allow castless assignment from
1902 * any pointer type to void*, and deal with argument conversions
1903 * as though doing an assignment.
1905 return (void *) realloc( (char *) ptr, size );
1908 void _lc_opt_free (void * ptr )
1910 free( (char *) ptr ); /* see _lc_opt_realloc() for (char *) cast */
1913 #define YYTABLES_NAME "yytables"
1915 #line 105 "lc_config_lexer.l"