X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Flibcore%2Flc_config_lexer.c;h=ec995741981f295d137f8855e41164f9d678711c;hb=69c991e03a0eb1b284e6d0c41623d340a8e26d16;hp=a87a8e36d2a76cbe08a96dca07795020401f1543;hpb=de1b0c8d4f653f534a38740ad7f6803d82f2762e;p=libfirm diff --git a/ir/libcore/lc_config_lexer.c b/ir/libcore/lc_config_lexer.c index a87a8e36d..ec9957419 100644 --- a/ir/libcore/lc_config_lexer.c +++ b/ir/libcore/lc_config_lexer.c @@ -6,10 +6,29 @@ /* A lexical scanner generated by flex */ +#define yy_create_buffer _lc_opt__create_buffer +#define yy_delete_buffer _lc_opt__delete_buffer +#define yy_flex_debug _lc_opt__flex_debug +#define yy_init_buffer _lc_opt__init_buffer +#define yy_flush_buffer _lc_opt__flush_buffer +#define yy_load_buffer_state _lc_opt__load_buffer_state +#define yy_switch_to_buffer _lc_opt__switch_to_buffer +#define yyin _lc_opt_in +#define yyleng _lc_opt_leng +#define yylex _lc_opt_lex +#define yylineno _lc_opt_lineno +#define yyout _lc_opt_out +#define yyrestart _lc_opt_restart +#define yytext _lc_opt_text +#define yywrap _lc_opt_wrap +#define yyalloc _lc_opt_alloc +#define yyrealloc _lc_opt_realloc +#define yyfree _lc_opt_free + #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 33 +#define YY_FLEX_SUBMINOR_VERSION 35 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif @@ -31,7 +50,7 @@ /* C99 systems have . Non-C99 systems may or may not. */ -#if __STDC_VERSION__ >= 199901L +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, * if you want the limit (max/min) macros for int types. @@ -54,7 +73,6 @@ typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; -#endif /* ! C99 */ /* Limits of integral types. */ #ifndef INT8_MIN @@ -85,6 +103,8 @@ typedef unsigned int flex_uint32_t; #define UINT32_MAX (4294967295U) #endif +#endif /* ! C99 */ + #endif /* ! FLEXINT_H */ #ifdef __cplusplus @@ -94,11 +114,12 @@ typedef unsigned int flex_uint32_t; #else /* ! __cplusplus */ -#if __STDC__ +/* C99 requires __STDC__ to be defined as 1. */ +#if defined (__STDC__) #define YY_USE_CONST -#endif /* __STDC__ */ +#endif /* defined (__STDC__) */ #endif /* ! __cplusplus */ #ifdef YY_USE_CONST @@ -178,14 +199,9 @@ extern FILE *_lc_opt_in, *_lc_opt_out; #define unput(c) yyunput( c, (yytext_ptr) ) -/* The following is because we cannot portably get our hands on size_t - * (without autoconf's help, which isn't available because we want - * flex-generated scanners to compile on their own). - */ - #ifndef YY_TYPEDEF_YY_SIZE_T #define YY_TYPEDEF_YY_SIZE_T -typedef unsigned int yy_size_t; +typedef size_t yy_size_t; #endif #ifndef YY_STRUCT_YY_BUFFER_STATE @@ -501,7 +517,7 @@ char *_lc_opt_text; License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ - +#include "config.h" #include @@ -518,7 +534,7 @@ static int _lc_opt_wrap(void) -#line 522 "lc_config_lexer.c" +#line 540 "lc_config_lexer.c" #define INITIAL 0 #define LINE_COMMENT 1 @@ -541,6 +557,35 @@ static int _lc_opt_wrap(void) static int yy_init_globals (void ); +/* Accessor methods to globals. + These are made visible to non-reentrant scanners for convenience. */ + +int _lc_opt_lex_destroy (void ); + +int _lc_opt_get_debug (void ); + +void _lc_opt_set_debug (int debug_flag ); + +YY_EXTRA_TYPE _lc_opt_get_extra (void ); + +void _lc_opt_set_extra (YY_EXTRA_TYPE user_defined ); + +FILE *_lc_opt_get_in (void ); + +void _lc_opt_set_in (FILE * in_str ); + +FILE *_lc_opt_get_out (void ); + +void _lc_opt_set_out (FILE * out_str ); + +int _lc_opt_get_leng (void ); + +char *_lc_opt_get_text (void ); + +int _lc_opt_get_lineno (void ); + +void _lc_opt_set_lineno (int line_number ); + /* Macros after this point can all be overridden by user definitions in * section 1. */ @@ -583,7 +628,7 @@ static int input (void ); /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO (void) fwrite( _lc_opt_text, _lc_opt_leng, 1, _lc_opt_out ) +#define ECHO fwrite( _lc_opt_text, _lc_opt_leng, 1, _lc_opt_out ) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -676,10 +721,10 @@ YY_DECL register char *yy_cp, *yy_bp; register int yy_act; -#line 53 "lc_config_lexer.l" +#line 55 "lc_config_lexer.l" -#line 683 "lc_config_lexer.c" +#line 730 "lc_config_lexer.c" if ( !(yy_init) ) { @@ -764,65 +809,65 @@ do_action: /* This label is used only to access EOF actions. */ case 1: YY_RULE_SETUP -#line 55 "lc_config_lexer.l" +#line 57 "lc_config_lexer.l" { BEGIN(BIG_COMMENT); } YY_BREAK case 2: YY_RULE_SETUP -#line 56 "lc_config_lexer.l" +#line 58 "lc_config_lexer.l" { BEGIN(INITIAL); } YY_BREAK case 3: /* rule 3 can match eol */ YY_RULE_SETUP -#line 57 "lc_config_lexer.l" +#line 59 "lc_config_lexer.l" PMANGLE(linenr)++; YY_BREAK case 4: YY_RULE_SETUP -#line 58 "lc_config_lexer.l" +#line 60 "lc_config_lexer.l" ; YY_BREAK case 5: YY_RULE_SETUP -#line 60 "lc_config_lexer.l" +#line 62 "lc_config_lexer.l" { BEGIN(LINE_COMMENT); } YY_BREAK case 6: /* rule 6 can match eol */ YY_RULE_SETUP -#line 61 "lc_config_lexer.l" +#line 63 "lc_config_lexer.l" { BEGIN(INITIAL); PMANGLE(linenr)++; } YY_BREAK case 7: YY_RULE_SETUP -#line 62 "lc_config_lexer.l" +#line 64 "lc_config_lexer.l" ; YY_BREAK case 8: YY_RULE_SETUP -#line 65 "lc_config_lexer.l" +#line 67 "lc_config_lexer.l" { BEGIN(DAT); } YY_BREAK case 9: YY_RULE_SETUP -#line 66 "lc_config_lexer.l" +#line 68 "lc_config_lexer.l" { BEGIN(STR); } YY_BREAK case 10: YY_RULE_SETUP -#line 67 "lc_config_lexer.l" +#line 69 "lc_config_lexer.l" { BEGIN(DAT_CONT); } YY_BREAK case 11: YY_RULE_SETUP -#line 68 "lc_config_lexer.l" +#line 70 "lc_config_lexer.l" { _lc_opt_add_to_data_char(PMANGLE(text)[0]); } YY_BREAK case 12: /* rule 12 can match eol */ YY_RULE_SETUP -#line 69 "lc_config_lexer.l" +#line 71 "lc_config_lexer.l" { BEGIN(INITIAL); PMANGLE(linenr)++; @@ -833,17 +878,17 @@ YY_RULE_SETUP case 13: /* rule 13 can match eol */ YY_RULE_SETUP -#line 75 "lc_config_lexer.l" +#line 77 "lc_config_lexer.l" { BEGIN(DAT); PMANGLE(linenr)++; } YY_BREAK case 14: YY_RULE_SETUP -#line 76 "lc_config_lexer.l" +#line 78 "lc_config_lexer.l" ; YY_BREAK case 15: YY_RULE_SETUP -#line 79 "lc_config_lexer.l" +#line 81 "lc_config_lexer.l" { BEGIN(INITIAL); _lc_opt_add_to_data_char('\0'); @@ -852,43 +897,43 @@ YY_RULE_SETUP YY_BREAK case 16: YY_RULE_SETUP -#line 85 "lc_config_lexer.l" +#line 87 "lc_config_lexer.l" _lc_opt_add_to_data_char('\n'); YY_BREAK case 17: YY_RULE_SETUP -#line 86 "lc_config_lexer.l" +#line 88 "lc_config_lexer.l" _lc_opt_add_to_data_char('\r'); YY_BREAK case 18: YY_RULE_SETUP -#line 87 "lc_config_lexer.l" +#line 89 "lc_config_lexer.l" _lc_opt_add_to_data_char('\t'); YY_BREAK case 19: YY_RULE_SETUP -#line 88 "lc_config_lexer.l" +#line 90 "lc_config_lexer.l" _lc_opt_add_to_data_char('\b'); YY_BREAK case 20: YY_RULE_SETUP -#line 89 "lc_config_lexer.l" +#line 91 "lc_config_lexer.l" _lc_opt_add_to_data_char('\f'); YY_BREAK case 21: YY_RULE_SETUP -#line 90 "lc_config_lexer.l" +#line 92 "lc_config_lexer.l" _lc_opt_add_to_data_char(_lc_opt_text[1]); YY_BREAK case 22: /* rule 22 can match eol */ YY_RULE_SETUP -#line 91 "lc_config_lexer.l" +#line 93 "lc_config_lexer.l" _lc_opt_add_to_data_char(_lc_opt_text[0]); YY_BREAK case 23: YY_RULE_SETUP -#line 93 "lc_config_lexer.l" +#line 95 "lc_config_lexer.l" { PMANGLE(lval).text.str = PMANGLE(text); PMANGLE(lval).text.len = PMANGLE(leng); @@ -897,31 +942,31 @@ YY_RULE_SETUP YY_BREAK case 24: YY_RULE_SETUP -#line 98 "lc_config_lexer.l" +#line 100 "lc_config_lexer.l" { return SEP; } YY_BREAK case 25: YY_RULE_SETUP -#line 100 "lc_config_lexer.l" +#line 102 "lc_config_lexer.l" ; YY_BREAK case 26: /* rule 26 can match eol */ YY_RULE_SETUP -#line 101 "lc_config_lexer.l" +#line 103 "lc_config_lexer.l" PMANGLE(linenr)++; YY_BREAK case 27: YY_RULE_SETUP -#line 103 "lc_config_lexer.l" +#line 105 "lc_config_lexer.l" return _lc_opt_text[0]; YY_BREAK case 28: YY_RULE_SETUP -#line 105 "lc_config_lexer.l" +#line 107 "lc_config_lexer.l" ECHO; YY_BREAK -#line 925 "lc_config_lexer.c" +#line 972 "lc_config_lexer.c" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(LINE_COMMENT): case YY_STATE_EOF(BIG_COMMENT): @@ -1181,6 +1226,14 @@ static int yy_get_next_buffer (void) else ret_val = EOB_ACT_CONTINUE_SCAN; + if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + /* Extend the array by 50%, plus the number we really need. */ + yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) _lc_opt_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); + if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + } + (yy_n_chars) += number_to_move; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; @@ -1596,6 +1649,8 @@ static void _lc_opt_ensure_buffer_stack (void) (yy_buffer_stack) = (struct yy_buffer_state**)_lc_opt_alloc (num_to_alloc * sizeof(struct yy_buffer_state*) ); + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in _lc_opt_ensure_buffer_stack()" ); memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); @@ -1614,6 +1669,8 @@ static void _lc_opt_ensure_buffer_stack (void) ((yy_buffer_stack), num_to_alloc * sizeof(struct yy_buffer_state*) ); + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in _lc_opt_ensure_buffer_stack()" ); /* zero only the new slots.*/ memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); @@ -1912,4 +1969,4 @@ void _lc_opt_free (void * ptr ) #define YYTABLES_NAME "yytables" -#line 105 "lc_config_lexer.l" +#line 107 "lc_config_lexer.l"