diff options
-rw-r--r-- | flex.skl | 32 | ||||
-rw-r--r-- | gen.c | 16 |
2 files changed, 24 insertions, 24 deletions
@@ -54,10 +54,10 @@ class istream; #define YY_USE_PROTOS #endif -#ifndef YY_USE_CONST -#ifndef const -#define const -#endif +#ifdef YY_USE_CONST +#define yyconst const +#else +#define yyconst #endif @@ -249,8 +249,8 @@ void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); -YY_BUFFER_STATE yy_scan_string YY_PROTO(( const char *str )); -YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( const char *bytes, int len )); +YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *str )); +YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); %* static void *yy_flex_alloc YY_PROTO(( yy_size_t )); @@ -290,7 +290,7 @@ static void yyunput YY_PROTO(( int c, char *buf_ptr )); #endif #ifndef yytext_ptr -static void yy_flex_strncpy YY_PROTO(( char *, const char *, int )); +static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); #endif #ifndef YY_NO_INPUT @@ -307,7 +307,7 @@ static int input YY_PROTO(( void )); static yy_state_type yy_get_previous_state YY_PROTO(( void )); static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); static int yy_get_next_buffer YY_PROTO(( void )); -static void yy_fatal_error YY_PROTO(( const char msg[] )); +static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); %* /* Done after the current pattern has been matched and before the @@ -1271,10 +1271,10 @@ yy_size_t size; #ifndef YY_NO_SCAN_STRING %- #ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_string( const char *str ) +YY_BUFFER_STATE yy_scan_string( yyconst char *str ) #else YY_BUFFER_STATE yy_scan_string( str ) -const char *str; +yyconst char *str; #endif { int len; @@ -1290,10 +1290,10 @@ const char *str; #ifndef YY_NO_SCAN_BYTES %- #ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_bytes( const char *bytes, int len ) +YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) #else YY_BUFFER_STATE yy_scan_bytes( bytes, len ) -const char *bytes; +yyconst char *bytes; int len; #endif { @@ -1398,7 +1398,7 @@ int yyFlexLexer::yy_top_state() %- #ifdef YY_USE_PROTOS -static void yy_fatal_error( const char msg[] ) +static void yy_fatal_error( yyconst char msg[] ) #else static void yy_fatal_error( msg ) char msg[]; @@ -1410,7 +1410,7 @@ char msg[]; %+ -void yyFlexLexer::LexerError( const char msg[] ) +void yyFlexLexer::LexerError( yyconst char msg[] ) { cerr << msg << '\n'; exit( YY_EXIT_FAILURE ); @@ -1438,11 +1438,11 @@ void yyFlexLexer::LexerError( const char msg[] ) #ifndef yytext_ptr #ifdef YY_USE_PROTOS -static void yy_flex_strncpy( char *s1, const char *s2, int n ) +static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) #else static void yy_flex_strncpy( s1, s2, n ) char *s1; -const char *s2; +yyconst char *s2; int n; #endif { @@ -50,11 +50,11 @@ static int indent_level = 0; /* each level is 8 spaces */ * to this is that the fast table representation generally uses the * 0 elements of its arrays, too.) */ -static char C_int_decl[] = "static const int %s[%d] =\n { 0,\n"; -static char C_short_decl[] = "static const short int %s[%d] =\n { 0,\n"; -static char C_long_decl[] = "static const long int %s[%d] =\n { 0,\n"; +static char C_int_decl[] = "static yyconst int %s[%d] =\n { 0,\n"; +static char C_short_decl[] = "static yyconst short int %s[%d] =\n { 0,\n"; +static char C_long_decl[] = "static yyconst long int %s[%d] =\n { 0,\n"; static char C_state_decl[] = - "static const yy_state_type %s[%d] =\n { 0,\n"; + "static yyconst yy_state_type %s[%d] =\n { 0,\n"; /* Indent to the current level. */ @@ -135,7 +135,7 @@ void genctbl() int end_of_buffer_action = num_rules + 1; /* Table of verify for transition and offset to next state. */ - out_dec( "static const struct yy_trans_info yy_transition[%d] =\n", + out_dec( "static yyconst struct yy_trans_info yy_transition[%d] =\n", tblend + numecs + 1 ); outn( " {" ); @@ -209,7 +209,7 @@ void genctbl() /* Table of pointers to start states. */ out_dec( - "static const struct yy_trans_info *yy_start_state_list[%d] =\n", + "static yyconst struct yy_trans_info *yy_start_state_list[%d] =\n", lastsc * 2 + 1 ); outn( " {" ); /* } so vi doesn't get confused */ @@ -530,7 +530,7 @@ void gen_next_match() { indent_puts( "{" ); /* } for vi */ indent_puts( - "register const struct yy_trans_info *yy_trans_info;\n" ); + "register yyconst struct yy_trans_info *yy_trans_info;\n" ); indent_puts( "register YY_CHAR yy_c;\n" ); indent_put2s( "for ( yy_c = %s;", char_map ); indent_puts( @@ -697,7 +697,7 @@ void gen_NUL_trans() out_dec( "register int yy_c = %d;\n", NUL_ec ); indent_puts( - "register const struct yy_trans_info *yy_trans_info;\n" ); + "register yyconst struct yy_trans_info *yy_trans_info;\n" ); indent_puts( "yy_trans_info = &yy_current_state[(unsigned int) yy_c];" ); indent_puts( "yy_current_state += yy_trans_info->yy_nxt;" ); |