diff options
author | Vern Paxson <vern@ee.lbl.gov> | 1993-12-09 13:58:40 +0000 |
---|---|---|
committer | Vern Paxson <vern@ee.lbl.gov> | 1993-12-09 13:58:40 +0000 |
commit | efb1cf6aa4c2cfa507fd90df763092598a761f24 (patch) | |
tree | 4f021d0ba525a876a86129504490b9ef4100abe9 /main.c | |
parent | e89ab843296311d34122769645394f04feb7f36c (diff) |
Detect REJECT etc. before generating YY_USES_REJECT!
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 116 |
1 files changed, 58 insertions, 58 deletions
@@ -119,64 +119,6 @@ char **argv; readin(); - if ( syntaxerror ) - flexend( 1 ); - - if ( yymore_really_used == REALLY_USED ) - yymore_used = true; - else if ( yymore_really_used == REALLY_NOT_USED ) - yymore_used = false; - - if ( reject_really_used == REALLY_USED ) - reject = true; - else if ( reject_really_used == REALLY_NOT_USED ) - reject = false; - - if ( performance_report > 0 ) - { - if ( lex_compat ) - { - fprintf( stderr, -"-l AT&T lex compatibility option entails a large performance penalty\n" ); - fprintf( stderr, -" and may be the actual source of other reported performance penalties\n" ); - } - - if ( performance_report > 1 ) - { - if ( interactive ) - fprintf( stderr, - "-I (interactive) entails a minor performance penalty\n" ); - - if ( yymore_used ) - fprintf( stderr, - "yymore() entails a minor performance penalty\n" ); - } - - if ( reject ) - fprintf( stderr, - "REJECT entails a large performance penalty\n" ); - - if ( variable_trailing_context_rules ) - fprintf( stderr, -"Variable trailing context rules entail a large performance penalty\n" ); - } - - if ( reject ) - real_reject = true; - - if ( variable_trailing_context_rules ) - reject = true; - - if ( (fulltbl || fullspd) && reject ) - { - if ( real_reject ) - flexerror( "REJECT cannot be used with -f or -F" ); - else - flexerror( - "variable trailing context rules cannot be used with -f or -F" ); - } - ntod(); for ( i = 1; i <= num_rules; ++i ) @@ -817,6 +759,64 @@ void readin() flexend( 1 ); } + if ( syntaxerror ) + flexend( 1 ); + + if ( yymore_really_used == REALLY_USED ) + yymore_used = true; + else if ( yymore_really_used == REALLY_NOT_USED ) + yymore_used = false; + + if ( reject_really_used == REALLY_USED ) + reject = true; + else if ( reject_really_used == REALLY_NOT_USED ) + reject = false; + + if ( performance_report > 0 ) + { + if ( lex_compat ) + { + fprintf( stderr, +"-l AT&T lex compatibility option entails a large performance penalty\n" ); + fprintf( stderr, +" and may be the actual source of other reported performance penalties\n" ); + } + + if ( performance_report > 1 ) + { + if ( interactive ) + fprintf( stderr, + "-I (interactive) entails a minor performance penalty\n" ); + + if ( yymore_used ) + fprintf( stderr, + "yymore() entails a minor performance penalty\n" ); + } + + if ( reject ) + fprintf( stderr, + "REJECT entails a large performance penalty\n" ); + + if ( variable_trailing_context_rules ) + fprintf( stderr, +"Variable trailing context rules entail a large performance penalty\n" ); + } + + if ( reject ) + real_reject = true; + + if ( variable_trailing_context_rules ) + reject = true; + + if ( (fulltbl || fullspd) && reject ) + { + if ( real_reject ) + flexerror( "REJECT cannot be used with -f or -F" ); + else + flexerror( + "variable trailing context rules cannot be used with -f or -F" ); + } + if ( csize == 256 ) puts( "typedef unsigned char YY_CHAR;" ); else |