From: Vern Paxson Date: Wed, 25 Aug 1993 17:10:57 +0000 (+0000) Subject: yy_state_type declared earlier. X-Git-Tag: flex-2-5-5b~413 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2a7cdd6f5568d261ecc682e0a20b0f60501e85a9;p=flex yy_state_type declared earlier. Made a bunch of statics only output if not -+ --- diff --git a/gen.c b/gen.c index c51de78..424d321 100644 --- a/gen.c +++ b/gen.c @@ -1084,14 +1084,8 @@ void make_tables() indent_put2s( "%s yy_nxt;", trans_offset_type ); indent_puts( "};" ); indent_down(); - - indent_puts( - "typedef const struct yy_trans_info *yy_state_type;" ); } - else - indent_puts( "typedef int yy_state_type;" ); - if ( fullspd ) genctbl(); else if ( fulltbl ) @@ -1105,8 +1099,13 @@ void make_tables() */ if ( num_backing_up > 0 && ! reject ) { - indent_puts( "static yy_state_type yy_last_accepting_state;" ); - indent_puts( "static YY_CHAR *yy_last_accepting_cpos;\n" ); + if ( ! C_plus_plus ) + { + indent_puts( + "static yy_state_type yy_last_accepting_state;" ); + indent_puts( + "static YY_CHAR *yy_last_accepting_cpos;\n" ); + } } if ( nultrans ) @@ -1138,16 +1137,24 @@ void make_tables() if ( reject ) { /* Declare state buffer variables. */ - puts( + if ( ! C_plus_plus ) + { + puts( "static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr;" ); - puts( "static YY_CHAR *yy_full_match;" ); - puts( "static int yy_lp;" ); + puts( "static YY_CHAR *yy_full_match;" ); + puts( "static int yy_lp;" ); + } if ( variable_trailing_context_rules ) { - puts( "static int yy_looking_for_trail_begin = 0;" ); - puts( "static int yy_full_lp;" ); - puts( "static int *yy_full_state;" ); + if ( ! C_plus_plus ) + { + puts( + "static int yy_looking_for_trail_begin = 0;" ); + puts( "static int yy_full_lp;" ); + puts( "static int *yy_full_state;" ); + } + printf( "#define YY_TRAILING_MASK 0x%x\n", (unsigned int) YY_TRAILING_MASK ); printf( "#define YY_TRAILING_HEAD_MASK 0x%x\n", @@ -1188,8 +1195,12 @@ void make_tables() if ( yymore_used ) { - indent_puts( "static int yy_more_flag = 0;" ); - indent_puts( "static int yy_more_len = 0;" ); + if ( ! C_plus_plus ) + { + indent_puts( "static int yy_more_flag = 0;" ); + indent_puts( "static int yy_more_len = 0;" ); + } + indent_puts( "#define yymore() do { yy_more_flag = 1; } while ( 0 )" ); indent_puts(