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); |
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 |
} |
} |
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 |
} |
} |
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; |
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; |
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 |
{ |
{ |
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; |
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 |
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>>'. */ |
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 (); |
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 |
} |
} |
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 (); |
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 |
} |
} |
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); |
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; |
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; |
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 |
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 |