/[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.37 by eggert, Fri Nov 8 05:20:20 2002 UTC revision 1.38 by eggert, Sun Nov 10 05:17:56 2002 UTC
# Line 168  static void handle_at (braced_code_t cod Line 168  static void handle_at (braced_code_t cod
168                         char *cp, location_t location);                         char *cp, location_t location);
169  static void handle_syncline (char *args, location_t *location);  static void handle_syncline (char *args, location_t *location);
170  static int convert_ucn_to_byte (char const *hex_text);  static int convert_ucn_to_byte (char const *hex_text);
171  static void unexpected_end_of_file (location_t, char const *);  static void unexpected_end_of_file (location_t *, char const *);
172    
173  %}  %}
174  %x SC_COMMENT SC_LINE_COMMENT SC_YACC_COMMENT  %x SC_COMMENT SC_LINE_COMMENT SC_YACC_COMMENT
# Line 331  splice  (\\[ \f\t\v]*\n)* Line 331  splice  (\\[ \f\t\v]*\n)*
331    }    }
332    
333    .|\n     ;    .|\n     ;
334    <<EOF>>  unexpected_end_of_file (*yylloc, "*/");    <<EOF>>  unexpected_end_of_file (yylloc, "*/");
335  }  }
336    
337    
# Line 342  splice  (\\[ \f\t\v]*\n)* Line 342  splice  (\\[ \f\t\v]*\n)*
342  <SC_COMMENT>  <SC_COMMENT>
343  {  {
344    "*"{splice}"/"  YY_OBS_GROW; BEGIN c_context;    "*"{splice}"/"  YY_OBS_GROW; BEGIN c_context;
345    <<EOF>>         unexpected_end_of_file (*yylloc, "*/");    <<EOF>>         unexpected_end_of_file (yylloc, "*/");
346  }  }
347    
348    
# Line 375  splice  (\\[ \f\t\v]*\n)* Line 375  splice  (\\[ \f\t\v]*\n)*
375    }    }
376    
377    .|\n      YY_OBS_GROW;    .|\n      YY_OBS_GROW;
378    <<EOF>>   unexpected_end_of_file (*yylloc, "\"");    <<EOF>>   unexpected_end_of_file (yylloc, "\"");
379  }  }
380    
381    /*---------------------------------------------------------------.    /*---------------------------------------------------------------.
# Line 399  splice  (\\[ \f\t\v]*\n)* Line 399  splice  (\\[ \f\t\v]*\n)*
399    }    }
400    
401    .|\n      YY_OBS_GROW;    .|\n      YY_OBS_GROW;
402    <<EOF>>   unexpected_end_of_file (*yylloc, "'");    <<EOF>>   unexpected_end_of_file (yylloc, "'");
403  }  }
404    
405    
# Line 472  splice  (\\[ \f\t\v]*\n)* Line 472  splice  (\\[ \f\t\v]*\n)*
472    "'"                  YY_OBS_GROW; BEGIN c_context;    "'"                  YY_OBS_GROW; BEGIN c_context;
473    \\{splice}[^\[\]]    YY_OBS_GROW;    \\{splice}[^\[\]]    YY_OBS_GROW;
474    {splice}             YY_OBS_GROW;    {splice}             YY_OBS_GROW;
475    <<EOF>>              unexpected_end_of_file (*yylloc, "'");    <<EOF>>              unexpected_end_of_file (yylloc, "'");
476  }  }
477    
478    
# Line 486  splice  (\\[ \f\t\v]*\n)* Line 486  splice  (\\[ \f\t\v]*\n)*
486    "\""                 YY_OBS_GROW; BEGIN c_context;    "\""                 YY_OBS_GROW; BEGIN c_context;
487    \\{splice}[^\[\]]    YY_OBS_GROW;    \\{splice}[^\[\]]    YY_OBS_GROW;
488    {splice}             YY_OBS_GROW;    {splice}             YY_OBS_GROW;
489    <<EOF>>              unexpected_end_of_file (*yylloc, "\"");    <<EOF>>              unexpected_end_of_file (yylloc, "\"");
490  }  }
491    
492    
# Line 534  splice  (\\[ \f\t\v]*\n)* Line 534  splice  (\\[ \f\t\v]*\n)*
534    "@"(-?[0-9]+|"$")               { handle_at (current_braced_code,    "@"(-?[0-9]+|"$")               { handle_at (current_braced_code,
535                                                 yytext, *yylloc); }                                                 yytext, *yylloc); }
536    
537    <<EOF>>  unexpected_end_of_file (*yylloc, "}");    <<EOF>>  unexpected_end_of_file (yylloc, "}");
538  }  }
539    
540    
# Line 551  splice  (\\[ \f\t\v]*\n)* Line 551  splice  (\\[ \f\t\v]*\n)*
551      return PROLOGUE;      return PROLOGUE;
552    }    }
553    
554    <<EOF>>  unexpected_end_of_file (*yylloc, "%}");    <<EOF>>  unexpected_end_of_file (yylloc, "%}");
555  }  }
556    
557    
# Line 842  handle_syncline (char *args, location_t Line 842  handle_syncline (char *args, location_t
842  `-------------------------------------------------------------*/  `-------------------------------------------------------------*/
843    
844  static void  static void
845  unexpected_end_of_file (location_t loc, char const *token_end)  unexpected_end_of_file (location_t *loc, char const *token_end)
846  {  {
847    size_t i;    size_t i = strlen (token_end);
848    
849    complain_at (loc, _("missing `%s' at end of file"), token_end);    complain_at (*loc, _("missing `%s' at end of file"), token_end);
850    for (i = strlen (token_end); i != 0; i--)  
851      unput (token_end[i - 1]);    /* Adjust location's last column so that any later message does not
852         mention the characters just inserted.  */
853      loc->last_column -= i;
854    
855      while (i != 0)
856        unput (token_end[--i]);
857  }  }
858    
859    

Legend:
Removed from v.1.37  
changed lines
  Added in v.1.38

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