diff options
author | Vern Paxson <vern@ee.lbl.gov> | 1993-11-26 15:08:34 +0000 |
---|---|---|
committer | Vern Paxson <vern@ee.lbl.gov> | 1993-11-26 15:08:34 +0000 |
commit | e0636c8ad09f2152137cf77f2e64528218b566c1 (patch) | |
tree | 74c247960bf1ddd68aef99927c459aa73e425eec /gen.c | |
parent | 7438e63861cb1317977fc1f6fea29589a3276539 (diff) |
-l lex compatibility flag
Diffstat (limited to 'gen.c')
-rw-r--r-- | gen.c | 27 |
1 files changed, 27 insertions, 0 deletions
@@ -1255,6 +1255,24 @@ void make_tables() gen_find_action(); skelout(); + if ( lex_compat ) + { + indent_puts( "if ( yy_act != YY_END_OF_BUFFER )" ); + indent_up(); + indent_puts( "{" ); + indent_puts( "int yyl;" ); + indent_puts( "for ( yyl = 0; yyl < yyleng; ++yyl )" ); + indent_up(); + indent_puts( "if ( yytext[yyl] == '\\n' )" ); + indent_up(); + indent_puts( "++yylineno;" ); + indent_down(); + indent_down(); + indent_puts( "}" ); + indent_down(); + } + + skelout(); if ( ddebug ) { indent_puts( "if ( yy_flex_debug )" ); @@ -1367,6 +1385,15 @@ void make_tables() gen_NUL_trans(); skelout(); + if ( lex_compat ) + { /* update yylineno inside of unput() */ + indent_puts( "if ( c == '\\n' )" ); + indent_up(); + indent_puts( "--yylineno;" ); + indent_down(); + } + + skelout(); /* Copy remainder of input to output. */ |