diff options
author | Vern Paxson <vern@ee.lbl.gov> | 1993-11-29 16:40:41 +0000 |
---|---|---|
committer | Vern Paxson <vern@ee.lbl.gov> | 1993-11-29 16:40:41 +0000 |
commit | cbe0e6b465562d465a7fbc15e62402a96d694db1 (patch) | |
tree | add9b10681e0cdcc0a0ff4568632ca68e2e1c07d /gen.c | |
parent | d0d675f51ac958bb757c4c22d8a5dd3df833fa96 (diff) |
Fixed to buffer section 1 definitions
Diffstat (limited to 'gen.c')
-rw-r--r-- | gen.c | 32 |
1 files changed, 30 insertions, 2 deletions
@@ -1221,10 +1221,38 @@ void make_tables() indent_puts( "#define YY_MORE_ADJ 0" ); } + fputs( &action_array[defs1_offset], stdout ); + + skelout(); + + if ( ! C_plus_plus ) + { + if ( use_read ) + { + printf( +"\tif ( (result = read( fileno(yyin), (char *) buf, max_size )) < 0 ) \\\n" ); + printf( + "\t\tYY_FATAL_ERROR( \"input in flex scanner failed\" );\n" ); + } + + else + { + printf( + "\tif ( yy_current_buffer->is_interactive ) \\\n" ); + printf( + "\t\tresult = (buf[0] = getc( yyin )) == EOF ? 0 : 1; \\\n" ); + printf( +"\telse if ( ((result = fread( (char *) buf, 1, max_size, yyin )) == 0)\\\n" ); + printf( "\t\t && ferror( yyin ) ) \\\n" ); + printf( + "\t\tYY_FATAL_ERROR( \"input in flex scanner failed\" );\n" ); + } + } + skelout(); /* Copy prolog to output file. */ - fputs( prolog, stdout ); + fputs( &action_array[prolog_offset], stdout ); skelout(); @@ -1323,7 +1351,7 @@ void make_tables() skelout(); indent_up(); gen_bu_action(); - fputs( action, stdout ); + fputs( &action_array[action_offset], stdout ); /* generate cases for any missing EOF rules */ for ( i = 1; i <= lastsc; ++i ) |