267 |
num = strtoul (yytext, 0, 10); |
num = strtoul (yytext, 0, 10); |
268 |
if (INT_MAX < num || errno) |
if (INT_MAX < num || errno) |
269 |
{ |
{ |
270 |
complain_at (*yylloc, _("%s is invalid"), yytext); |
complain_at (*yylloc, _("invalid value: %s"), quote (yytext)); |
271 |
num = INT_MAX; |
num = INT_MAX; |
272 |
} |
} |
273 |
yylval->integer = num; |
yylval->integer = num; |
306 |
} |
} |
307 |
|
|
308 |
. { |
. { |
309 |
LOCATION_PRINT (stderr, *yylloc); |
complain_at (*yylloc, _("invalid character: %s"), quote (yytext)); |
|
fprintf (stderr, _(": invalid character: `%c'\n"), *yytext); |
|
310 |
YY_STEP; |
YY_STEP; |
311 |
} |
} |
312 |
} |
} |
339 |
[^*]+|"*" ; |
[^*]+|"*" ; |
340 |
|
|
341 |
<<EOF>> { |
<<EOF>> { |
342 |
LOCATION_PRINT (stderr, *yylloc); |
complain_at (*yylloc, _("unexpected end of file in a comment")); |
|
fprintf (stderr, _(": unexpected end of file in a comment\n")); |
|
343 |
BEGIN INITIAL; |
BEGIN INITIAL; |
344 |
} |
} |
345 |
} |
} |
355 |
[^*\[\]]+|"*" YY_OBS_GROW; |
[^*\[\]]+|"*" YY_OBS_GROW; |
356 |
|
|
357 |
<<EOF>> { |
<<EOF>> { |
358 |
LOCATION_PRINT (stderr, *yylloc); |
complain_at (*yylloc, _("unexpected end of file in a comment")); |
|
fprintf (stderr, _(": unexpected end of file in a comment\n")); |
|
359 |
yy_pop_state (); |
yy_pop_state (); |
360 |
} |
} |
361 |
} |
} |
393 |
[^\"\\]+ YY_OBS_GROW; |
[^\"\\]+ YY_OBS_GROW; |
394 |
|
|
395 |
<<EOF>> { |
<<EOF>> { |
396 |
LOCATION_PRINT (stderr, *yylloc); |
complain_at (*yylloc, _("unexpected end of file in a string")); |
|
fprintf (stderr, _(": unexpected end of file in a string\n")); |
|
397 |
assert (yy_top_state () == INITIAL); |
assert (yy_top_state () == INITIAL); |
398 |
YY_OBS_FINISH; |
YY_OBS_FINISH; |
399 |
yylval->string = last_string; |
yylval->string = last_string; |
425 |
} |
} |
426 |
} |
} |
427 |
|
|
428 |
[^'\\]+ YY_OBS_GROW; |
[^\'\\]+ YY_OBS_GROW; |
429 |
|
|
430 |
<<EOF>> { |
<<EOF>> { |
431 |
LOCATION_PRINT (stderr, *yylloc); |
complain_at (*yylloc, _("unexpected end of file in a character")); |
|
fprintf (stderr, _(": unexpected end of file in a character\n")); |
|
432 |
assert (yy_top_state () == INITIAL); |
assert (yy_top_state () == INITIAL); |
433 |
YY_OBS_FINISH; |
YY_OBS_FINISH; |
434 |
yylval->string = last_string; |
yylval->string = last_string; |
448 |
unsigned long c = strtoul (yytext + 1, 0, 8); |
unsigned long c = strtoul (yytext + 1, 0, 8); |
449 |
if (UCHAR_MAX < c) |
if (UCHAR_MAX < c) |
450 |
{ |
{ |
451 |
LOCATION_PRINT (stderr, *yylloc); |
complain_at (*yylloc, _("invalid escape: %s"), quote (yytext)); |
|
fprintf (stderr, _(": invalid escape: %s\n"), quote (yytext)); |
|
452 |
YY_STEP; |
YY_STEP; |
453 |
} |
} |
454 |
else |
else |
461 |
c = strtoul (yytext + 2, 0, 16); |
c = strtoul (yytext + 2, 0, 16); |
462 |
if (UCHAR_MAX < c || errno) |
if (UCHAR_MAX < c || errno) |
463 |
{ |
{ |
464 |
LOCATION_PRINT (stderr, *yylloc); |
complain_at (*yylloc, _("invalid escape: %s"), quote (yytext)); |
|
fprintf (stderr, _(": invalid escape: %s\n"), quote (yytext)); |
|
465 |
YY_STEP; |
YY_STEP; |
466 |
} |
} |
467 |
else |
else |
475 |
\\r obstack_1grow (&string_obstack, '\r'); |
\\r obstack_1grow (&string_obstack, '\r'); |
476 |
\\t obstack_1grow (&string_obstack, '\t'); |
\\t obstack_1grow (&string_obstack, '\t'); |
477 |
\\v obstack_1grow (&string_obstack, '\v'); |
\\v obstack_1grow (&string_obstack, '\v'); |
478 |
\\[\"'?\\] obstack_1grow (&string_obstack, yytext[1]); |
\\[\"\'?\\] obstack_1grow (&string_obstack, yytext[1]); |
479 |
\\(u|U[0-9a-fA-F]{4})[0-9a-fA-F]{4} { |
\\(u|U[0-9a-fA-F]{4})[0-9a-fA-F]{4} { |
480 |
int c = convert_ucn_to_byte (yytext); |
int c = convert_ucn_to_byte (yytext); |
481 |
if (c < 0) |
if (c < 0) |
482 |
{ |
{ |
483 |
LOCATION_PRINT (stderr, *yylloc); |
complain_at (*yylloc, _("invalid escape: %s"), quote (yytext)); |
|
fprintf (stderr, _(": invalid escape: %s\n"), quote (yytext)); |
|
484 |
YY_STEP; |
YY_STEP; |
485 |
} |
} |
486 |
else |
else |
487 |
obstack_1grow (&string_obstack, c); |
obstack_1grow (&string_obstack, c); |
488 |
} |
} |
489 |
\\(.|\n) { |
\\(.|\n) { |
490 |
LOCATION_PRINT (stderr, *yylloc); |
complain_at (*yylloc, _("unrecognized escape: %s"), quote (yytext)); |
|
fprintf (stderr, _(": unrecognized escape: %s\n"), quote (yytext)); |
|
491 |
YY_OBS_GROW; |
YY_OBS_GROW; |
492 |
} |
} |
493 |
/* FLex wants this rule, in case of a `\<<EOF>>'. */ |
/* FLex wants this rule, in case of a `\<<EOF>>'. */ |
515 |
\\ YY_OBS_GROW; |
\\ YY_OBS_GROW; |
516 |
|
|
517 |
<<EOF>> { |
<<EOF>> { |
518 |
LOCATION_PRINT (stderr, *yylloc); |
complain_at (*yylloc, _("unexpected end of file in a character")); |
|
fprintf (stderr, _(": unexpected end of file in a character\n")); |
|
519 |
assert (yy_top_state () != INITIAL); |
assert (yy_top_state () != INITIAL); |
520 |
yy_pop_state (); |
yy_pop_state (); |
521 |
} |
} |
542 |
\\ YY_OBS_GROW; |
\\ YY_OBS_GROW; |
543 |
|
|
544 |
<<EOF>> { |
<<EOF>> { |
545 |
LOCATION_PRINT (stderr, *yylloc); |
complain_at (*yylloc, _("unexpected end of file in a string")); |
|
fprintf (stderr, _(": unexpected end of file in a string\n")); |
|
546 |
assert (yy_top_state () != INITIAL); |
assert (yy_top_state () != INITIAL); |
547 |
yy_pop_state (); |
yy_pop_state (); |
548 |
} |
} |
596 |
"@"(-?[0-9]+|"$") { handle_at (current_braced_code, |
"@"(-?[0-9]+|"$") { handle_at (current_braced_code, |
597 |
yytext, *yylloc); } |
yytext, *yylloc); } |
598 |
|
|
599 |
[^$@\[\]/'\"\{\}]+ YY_OBS_GROW; |
[^$@\[\]/\'\"\{\}]+ YY_OBS_GROW; |
600 |
|
|
601 |
/* A stray $, or /, or etc. */ |
/* A stray $, or /, or etc. */ |
602 |
. YY_OBS_GROW; |
. YY_OBS_GROW; |
603 |
|
|
604 |
<<EOF>> { |
<<EOF>> { |
605 |
LOCATION_PRINT (stderr, *yylloc); |
complain_at (*yylloc, _("unexpected end of file in a braced code")); |
|
fprintf (stderr, _(": unexpected end of file in a braced code\n")); |
|
606 |
yy_pop_state (); |
yy_pop_state (); |
607 |
YY_OBS_FINISH; |
YY_OBS_FINISH; |
608 |
yylval->string = last_string; |
yylval->string = last_string; |
625 |
return PROLOGUE; |
return PROLOGUE; |
626 |
} |
} |
627 |
|
|
628 |
[^%\[\]/'\"]+ YY_OBS_GROW; |
[^%\[\]/\'\"]+ YY_OBS_GROW; |
629 |
"%" YY_OBS_GROW; |
"%" YY_OBS_GROW; |
630 |
|
|
631 |
<<EOF>> { |
<<EOF>> { |
632 |
LOCATION_PRINT (stderr, *yylloc); |
complain_at (*yylloc, _("unexpected end of file in a prologue")); |
|
fprintf (stderr, _(": unexpected end of file in a prologue\n")); |
|
633 |
yy_pop_state (); |
yy_pop_state (); |
634 |
YY_OBS_FINISH; |
YY_OBS_FINISH; |
635 |
yylval->string = last_string; |
yylval->string = last_string; |
716 |
rule_length, n, type_name); |
rule_length, n, type_name); |
717 |
} |
} |
718 |
else |
else |
719 |
complain_at (location, _("invalid value: %s"), text); |
complain_at (location, _("invalid value: %s"), quote (text)); |
720 |
} |
} |
721 |
} |
} |
722 |
|
|
733 |
if (*cp == '$') |
if (*cp == '$') |
734 |
obstack_sgrow (&string_obstack, "]b4_dollar_dollar["); |
obstack_sgrow (&string_obstack, "]b4_dollar_dollar["); |
735 |
else |
else |
736 |
complain_at (location, _("%s is invalid"), quote_n (1, text)); |
complain_at (location, _("invalid value: %s"), quote (text)); |
737 |
} |
} |
738 |
|
|
739 |
|
|
788 |
rule_length, n); |
rule_length, n); |
789 |
} |
} |
790 |
else |
else |
791 |
complain_at (location, _("invalid value: %s"), text); |
complain_at (location, _("invalid value: %s"), quote (text)); |
792 |
} |
} |
793 |
} |
} |
794 |
|
|
805 |
if (*cp == '$') |
if (*cp == '$') |
806 |
obstack_sgrow (&string_obstack, "]b4_at_dollar["); |
obstack_sgrow (&string_obstack, "]b4_at_dollar["); |
807 |
else |
else |
808 |
complain_at (location, _("%s is invalid"), quote_n (1, text)); |
complain_at (location, _("invalid value: %s"), quote (text)); |
809 |
} |
} |
810 |
|
|
811 |
|
|
883 |
code = code < sizeof table ? table[code] : -1; |
code = code < sizeof table ? table[code] : -1; |
884 |
} |
} |
885 |
#endif |
#endif |
886 |
|
|
887 |
return code; |
return code; |
888 |
} |
} |
889 |
|
|