/[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.23 by akim, Fri Jul 19 08:31:32 2002 UTC revision 1.24 by eggert, Mon Aug 12 14:52:47 2002 UTC
# Line 167  blanks   [ \t\f]+ Line 167  blanks   [ \t\f]+
167    {int}       yylval->integer = strtol (yytext, 0, 10); return INT;    {int}       yylval->integer = strtol (yytext, 0, 10); return INT;
168    
169    /* Characters.  We don't check there is only one.  */    /* Characters.  We don't check there is only one.  */
170    \'          YY_OBS_GROW; yy_push_state (SC_ESCAPED_CHARACTER);    "'"         YY_OBS_GROW; yy_push_state (SC_ESCAPED_CHARACTER);
171    
172    /* Strings. */    /* Strings. */
173    \"          YY_OBS_GROW; yy_push_state (SC_ESCAPED_STRING);    "\""        YY_OBS_GROW; yy_push_state (SC_ESCAPED_STRING);
174    
175    /* Comments. */    /* Comments. */
176    "/*"        yy_push_state (SC_COMMENT);    "/*"        yy_push_state (SC_COMMENT);
# Line 199  blanks   [ \t\f]+ Line 199  blanks   [ \t\f]+
199    
200    .           {    .           {
201      LOCATION_PRINT (stderr, *yylloc);      LOCATION_PRINT (stderr, *yylloc);
202      fprintf (stderr, ": invalid character: `%c'\n", *yytext);      fprintf (stderr, _(": invalid character: `%c'\n"), *yytext);
203      YY_STEP;      YY_STEP;
204    }    }
205  }  }
# Line 243  blanks   [ \t\f]+ Line 243  blanks   [ \t\f]+
243    
244    <<EOF>> {    <<EOF>> {
245      LOCATION_PRINT (stderr, *yylloc);      LOCATION_PRINT (stderr, *yylloc);
246      fprintf (stderr, ": unexpected end of file in a comment\n");      fprintf (stderr, _(": unexpected end of file in a comment\n"));
247      yy_pop_state ();      yy_pop_state ();
248    }    }
249  }  }
# Line 256  blanks   [ \t\f]+ Line 256  blanks   [ \t\f]+
256    
257  <SC_ESCAPED_STRING>  <SC_ESCAPED_STRING>
258  {  {
259    \" {    "\"" {
260      assert (yy_top_state () == INITIAL);      assert (yy_top_state () == INITIAL);
261      YY_OBS_GROW;      YY_OBS_GROW;
262      YY_OBS_FINISH;      YY_OBS_FINISH;
# Line 271  blanks   [ \t\f]+ Line 271  blanks   [ \t\f]+
271    
272    <<EOF>> {    <<EOF>> {
273      LOCATION_PRINT (stderr, *yylloc);      LOCATION_PRINT (stderr, *yylloc);
274      fprintf (stderr, ": unexpected end of file in a string\n");      fprintf (stderr, _(": unexpected end of file in a string\n"));
275      assert (yy_top_state () == INITIAL);      assert (yy_top_state () == INITIAL);
276      YY_OBS_FINISH;      YY_OBS_FINISH;
277      yylval->string = last_string;      yylval->string = last_string;
# Line 287  blanks   [ \t\f]+ Line 287  blanks   [ \t\f]+
287    
288  <SC_ESCAPED_CHARACTER>  <SC_ESCAPED_CHARACTER>
289  {  {
290    \' {    "'" {
291      YY_OBS_GROW;      YY_OBS_GROW;
292      assert (yy_top_state () == INITIAL);      assert (yy_top_state () == INITIAL);
293      {      {
# Line 302  blanks   [ \t\f]+ Line 302  blanks   [ \t\f]+
302      }      }
303    }    }
304    
305    [^\'\n\r\\]      YY_OBS_GROW;    [^\n\r\\] YY_OBS_GROW;
306    
307    {eols}    obstack_1grow (&string_obstack, '\n'); YY_LINES;    {eols}    obstack_1grow (&string_obstack, '\n'); YY_LINES;
308    
309    <<EOF>> {    <<EOF>> {
310      LOCATION_PRINT (stderr, *yylloc);      LOCATION_PRINT (stderr, *yylloc);
311      fprintf (stderr, ": unexpected end of file in a character\n");      fprintf (stderr, _(": unexpected end of file in a character\n"));
312      assert (yy_top_state () == INITIAL);      assert (yy_top_state () == INITIAL);
313      YY_OBS_FINISH;      YY_OBS_FINISH;
314      yylval->string = last_string;      yylval->string = last_string;
# Line 329  blanks   [ \t\f]+ Line 329  blanks   [ \t\f]+
329      if (c > 255)      if (c > 255)
330        {        {
331          LOCATION_PRINT (stderr, *yylloc);          LOCATION_PRINT (stderr, *yylloc);
332          fprintf (stderr, ": invalid escape: %s\n", quote (yytext));          fprintf (stderr, _(": invalid escape: %s\n"), quote (yytext));
333          YY_STEP;          YY_STEP;
334        }        }
335      else      else
# Line 350  blanks   [ \t\f]+ Line 350  blanks   [ \t\f]+
350    \\[\\""]   obstack_1grow (&string_obstack, yytext[1]);    \\[\\""]   obstack_1grow (&string_obstack, yytext[1]);
351    \\(.|\n)      {    \\(.|\n)      {
352      LOCATION_PRINT (stderr, *yylloc);      LOCATION_PRINT (stderr, *yylloc);
353      fprintf (stderr, ": unrecognized escape: %s\n", quote (yytext));      fprintf (stderr, _(": unrecognized escape: %s\n"), quote (yytext));
354      YY_OBS_GROW;      YY_OBS_GROW;
355    }    }
356    /* FLex wants this rule, in case of a `\<<EOF>>'. */    /* FLex wants this rule, in case of a `\<<EOF>>'. */
# Line 365  blanks   [ \t\f]+ Line 365  blanks   [ \t\f]+
365    
366  <SC_CHARACTER>  <SC_CHARACTER>
367  {  {
368    \' {    "'" {
369      YY_OBS_GROW;      YY_OBS_GROW;
370      assert (yy_top_state () != INITIAL);      assert (yy_top_state () != INITIAL);
371      yy_pop_state ();      yy_pop_state ();
# Line 380  blanks   [ \t\f]+ Line 380  blanks   [ \t\f]+
380    
381    <<EOF>> {    <<EOF>> {
382      LOCATION_PRINT (stderr, *yylloc);      LOCATION_PRINT (stderr, *yylloc);
383      fprintf (stderr, ": unexpected end of file in a character\n");      fprintf (stderr, _(": unexpected end of file in a character\n"));
384      assert (yy_top_state () != INITIAL);      assert (yy_top_state () != INITIAL);
385      yy_pop_state ();      yy_pop_state ();
386    }    }
# Line 394  blanks   [ \t\f]+ Line 394  blanks   [ \t\f]+
394    
395  <SC_STRING>  <SC_STRING>
396  {  {
397    \" {    "\"" {
398      assert (yy_top_state () != INITIAL);      assert (yy_top_state () != INITIAL);
399      YY_OBS_GROW;      YY_OBS_GROW;
400      yy_pop_state ();      yy_pop_state ();
# Line 409  blanks   [ \t\f]+ Line 409  blanks   [ \t\f]+
409    
410    <<EOF>> {    <<EOF>> {
411      LOCATION_PRINT (stderr, *yylloc);      LOCATION_PRINT (stderr, *yylloc);
412      fprintf (stderr, ": unexpected end of file in a string\n");      fprintf (stderr, _(": unexpected end of file in a string\n"));
413      assert (yy_top_state () != INITIAL);      assert (yy_top_state () != INITIAL);
414      yy_pop_state ();      yy_pop_state ();
415    }    }
# Line 423  blanks   [ \t\f]+ Line 423  blanks   [ \t\f]+
423  <SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>  <SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>
424  {  {
425    /* Characters.  We don't check there is only one.  */    /* Characters.  We don't check there is only one.  */
426    \'          YY_OBS_GROW; yy_push_state (SC_CHARACTER);    "'"         YY_OBS_GROW; yy_push_state (SC_CHARACTER);
427    
428    /* Strings. */    /* Strings. */
429    \"          YY_OBS_GROW; yy_push_state (SC_STRING);    "\""        YY_OBS_GROW; yy_push_state (SC_STRING);
430    
431    /* Comments. */    /* Comments. */
432    "/*"        YY_OBS_GROW; yy_push_state (SC_COMMENT);    "/*"        YY_OBS_GROW; yy_push_state (SC_COMMENT);
# Line 470  blanks   [ \t\f]+ Line 470  blanks   [ \t\f]+
470    
471    <<EOF>> {    <<EOF>> {
472      LOCATION_PRINT (stderr, *yylloc);      LOCATION_PRINT (stderr, *yylloc);
473      fprintf (stderr, ": unexpected end of file in a braced code\n");      fprintf (stderr, _(": unexpected end of file in a braced code\n"));
474      yy_pop_state ();      yy_pop_state ();
475      YY_OBS_FINISH;      YY_OBS_FINISH;
476      yylval->string = last_string;      yylval->string = last_string;
# Line 499  blanks   [ \t\f]+ Line 499  blanks   [ \t\f]+
499    
500    <<EOF>> {    <<EOF>> {
501      LOCATION_PRINT (stderr, *yylloc);      LOCATION_PRINT (stderr, *yylloc);
502      fprintf (stderr, ": unexpected end of file in a prologue\n");      fprintf (stderr, _(": unexpected end of file in a prologue\n"));
503      yy_pop_state ();      yy_pop_state ();
504      YY_OBS_FINISH;      YY_OBS_FINISH;
505      yylval->string = last_string;      yylval->string = last_string;
# Line 564  handle_action_dollar (char *text, locati Line 564  handle_action_dollar (char *text, locati
564        obstack_fgrow1 (&string_obstack,        obstack_fgrow1 (&string_obstack,
565                        "]b4_lhs_value([%s])[", type_name);                        "]b4_lhs_value([%s])[", type_name);
566      }      }
567    else if (isdigit (*cp) || *cp == '-')    else if (('0' <= *cp && *cp <= '9') || *cp == '-')
568      {      {
569        /* RULE_LENGTH is the number of values in the current rule so        /* RULE_LENGTH is the number of values in the current rule so
570           far, which says where to find `$0' with respect to the top of           far, which says where to find `$0' with respect to the top of
# Line 651  handle_action_at (char *text, location_t Line 651  handle_action_at (char *text, location_t
651      {      {
652        obstack_sgrow (&string_obstack, "]b4_lhs_location[");        obstack_sgrow (&string_obstack, "]b4_lhs_location[");
653      }      }
654    else if (isdigit (*cp) || *cp == '-')    else if (('0' <= *cp && *cp <= '9') || *cp == '-')
655      {      {
656        /* RULE_LENGTH is the number of values in the current rule so        /* RULE_LENGTH is the number of values in the current rule so
657           far, which says where to find `$0' with respect to the top of           far, which says where to find `$0' with respect to the top of

Legend:
Removed from v.1.23  
changed lines
  Added in v.1.24

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