/[bison]/bison/src/scan-gram.l
ViewVC logotype

Diff of /bison/src/scan-gram.l

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.35 by akim, Wed Nov 6 08:08:46 2002 UTC revision 1.36 by eggert, Thu Nov 7 08:15:11 2002 UTC
# Line 129  extend_location (location_t *loc, char c Line 129  extend_location (location_t *loc, char c
129  }  }
130    
131    
132    /* Report an unexpected end of file at LOC.  A token or comment began
133       with TOKEN_START, but an end of file was encountered and the
134       expected TOKEN_END was missing.  */
135    
136    static void
137    unexpected_end_of_file (location_t loc,
138                            char const *token_start, char const *token_end)
139    {
140      complain_at (loc, _("unexpected end of file in `%s ... %s'"),
141                   token_start, token_end);
142    }
143    
144    
145    
146  /* STRING_OBSTACK -- Used to store all the characters that we need to  /* STRING_OBSTACK -- Used to store all the characters that we need to
147     keep (to construct ID, STRINGS etc.).  Use the following macros to     keep (to construct ID, STRINGS etc.).  Use the following macros to
# Line 349  splice  (\\[ \f\t\v]*\n)* Line 362  splice  (\\[ \f\t\v]*\n)*
362    [^*]+|"*"  ;    [^*]+|"*"  ;
363    
364    <<EOF>> {    <<EOF>> {
365      complain_at (*yylloc, _("unexpected end of file in a comment"));      unexpected_end_of_file (*yylloc, "/*", "*/");
366      BEGIN INITIAL;      BEGIN INITIAL;
367    }    }
368  }  }
# Line 365  splice  (\\[ \f\t\v]*\n)* Line 378  splice  (\\[ \f\t\v]*\n)*
378    [^*\[\]]+|"*"   YY_OBS_GROW;    [^*\[\]]+|"*"   YY_OBS_GROW;
379    
380    <<EOF>> {    <<EOF>> {
381      complain_at (*yylloc, _("unexpected end of file in a comment"));      unexpected_end_of_file (*yylloc, "/*", "*/");
382      yy_pop_state ();      yy_pop_state ();
383    }    }
384  }  }
# Line 403  splice  (\\[ \f\t\v]*\n)* Line 416  splice  (\\[ \f\t\v]*\n)*
416    [^\"\\]+  YY_OBS_GROW;    [^\"\\]+  YY_OBS_GROW;
417    
418    <<EOF>> {    <<EOF>> {
419      complain_at (*yylloc, _("unexpected end of file in a string"));      unexpected_end_of_file (*yylloc, "\"", "\"");
420      assert (yy_top_state () == INITIAL);      assert (yy_top_state () == INITIAL);
421      YY_OBS_FINISH;      YY_OBS_FINISH;
422      yylval->string = last_string;      yylval->string = last_string;
# Line 438  splice  (\\[ \f\t\v]*\n)* Line 451  splice  (\\[ \f\t\v]*\n)*
451    [^\'\\]+  YY_OBS_GROW;    [^\'\\]+  YY_OBS_GROW;
452    
453    <<EOF>> {    <<EOF>> {
454      complain_at (*yylloc, _("unexpected end of file in a character literal"));      unexpected_end_of_file (*yylloc, "'", "'");
455      assert (yy_top_state () == INITIAL);      assert (yy_top_state () == INITIAL);
456      YY_OBS_FINISH;      YY_OBS_FINISH;
457      yylval->string = last_string;      yylval->string = last_string;
# Line 529  splice  (\\[ \f\t\v]*\n)* Line 542  splice  (\\[ \f\t\v]*\n)*
542    \\                   YY_OBS_GROW;    \\                   YY_OBS_GROW;
543    
544    <<EOF>> {    <<EOF>> {
545      complain_at (*yylloc, _("unexpected end of file in a character literal"));      unexpected_end_of_file (*yylloc, "'", "'");
546      assert (yy_top_state () != INITIAL);      assert (yy_top_state () != INITIAL);
547      yy_pop_state ();      yy_pop_state ();
548    }    }
# Line 556  splice  (\\[ \f\t\v]*\n)* Line 569  splice  (\\[ \f\t\v]*\n)*
569    \\                   YY_OBS_GROW;    \\                   YY_OBS_GROW;
570    
571    <<EOF>> {    <<EOF>> {
572      complain_at (*yylloc, _("unexpected end of file in a string"));      unexpected_end_of_file (*yylloc, "\"", "\"");
573      assert (yy_top_state () != INITIAL);      assert (yy_top_state () != INITIAL);
574      yy_pop_state ();      yy_pop_state ();
575    }    }
# Line 616  splice  (\\[ \f\t\v]*\n)* Line 629  splice  (\\[ \f\t\v]*\n)*
629    [^\"$%\'/<@\[\]\{\}]+|[$%/<@]|"<"{splice}"<"  YY_OBS_GROW;    [^\"$%\'/<@\[\]\{\}]+|[$%/<@]|"<"{splice}"<"  YY_OBS_GROW;
630    
631    <<EOF>> {    <<EOF>> {
632      complain_at (*yylloc, _("unexpected end of file in `{ ... }'"));      unexpected_end_of_file (*yylloc, "{", "}");
633      yy_pop_state ();      yy_pop_state ();
634      YY_OBS_FINISH;      YY_OBS_FINISH;
635      yylval->string = last_string;      yylval->string = last_string;
# Line 643  splice  (\\[ \f\t\v]*\n)* Line 656  splice  (\\[ \f\t\v]*\n)*
656    "%"                YY_OBS_GROW;    "%"                YY_OBS_GROW;
657    
658    <<EOF>> {    <<EOF>> {
659      complain_at (*yylloc, _("unexpected end of file in `%%{ ... %%}'"));      unexpected_end_of_file (*yylloc, "%{", "%}");
660      yy_pop_state ();      yy_pop_state ();
661      YY_OBS_FINISH;      YY_OBS_FINISH;
662      yylval->string = last_string;      yylval->string = last_string;
# Line 871  convert_ucn_to_byte (char const *ucn) Line 884  convert_ucn_to_byte (char const *ucn)
884      /* A non-ASCII host.  Use CODE to index into a table of the C      /* A non-ASCII host.  Use CODE to index into a table of the C
885         basic execution character set, which is guaranteed to exist on         basic execution character set, which is guaranteed to exist on
886         all Standard C platforms.  This table also includes '$', '@',         all Standard C platforms.  This table also includes '$', '@',
887         and '`', which not in the basic execution character set but         and '`', which are not in the basic execution character set but
888         which are unibyte characters on all the platforms that we know         which are unibyte characters on all the platforms that we know
889         about.  */         about.  */
890      static signed char const table[] =      static signed char const table[] =

Legend:
Removed from v.1.35  
changed lines
  Added in v.1.36

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26