num = strtoul (yytext, 0, 10);
if (INT_MAX < num || errno)
{
- complain_at (*yylloc, _("%s is invalid"), yytext);
+ complain_at (*yylloc, _("invalid value: %s"), quote (yytext));
num = INT_MAX;
}
yylval->integer = num;
}
. {
- LOCATION_PRINT (stderr, *yylloc);
- fprintf (stderr, _(": invalid character: `%c'\n"), *yytext);
+ complain_at (*yylloc, _("invalid character: %s"), quote (yytext));
YY_STEP;
}
}
[^*]+|"*" ;
<<EOF>> {
- LOCATION_PRINT (stderr, *yylloc);
- fprintf (stderr, _(": unexpected end of file in a comment\n"));
+ complain_at (*yylloc, _("unexpected end of file in a comment"));
BEGIN INITIAL;
}
}
[^*\[\]]+|"*" YY_OBS_GROW;
<<EOF>> {
- LOCATION_PRINT (stderr, *yylloc);
- fprintf (stderr, _(": unexpected end of file in a comment\n"));
+ complain_at (*yylloc, _("unexpected end of file in a comment"));
yy_pop_state ();
}
}
[^\"\\]+ YY_OBS_GROW;
<<EOF>> {
- LOCATION_PRINT (stderr, *yylloc);
- fprintf (stderr, _(": unexpected end of file in a string\n"));
+ complain_at (*yylloc, _("unexpected end of file in a string"));
assert (yy_top_state () == INITIAL);
YY_OBS_FINISH;
yylval->string = last_string;
}
}
- [^'\\]+ YY_OBS_GROW;
+ [^\'\\]+ YY_OBS_GROW;
<<EOF>> {
- LOCATION_PRINT (stderr, *yylloc);
- fprintf (stderr, _(": unexpected end of file in a character\n"));
+ complain_at (*yylloc, _("unexpected end of file in a character"));
assert (yy_top_state () == INITIAL);
YY_OBS_FINISH;
yylval->string = last_string;
unsigned long c = strtoul (yytext + 1, 0, 8);
if (UCHAR_MAX < c)
{
- LOCATION_PRINT (stderr, *yylloc);
- fprintf (stderr, _(": invalid escape: %s\n"), quote (yytext));
+ complain_at (*yylloc, _("invalid escape: %s"), quote (yytext));
YY_STEP;
}
else
c = strtoul (yytext + 2, 0, 16);
if (UCHAR_MAX < c || errno)
{
- LOCATION_PRINT (stderr, *yylloc);
- fprintf (stderr, _(": invalid escape: %s\n"), quote (yytext));
+ complain_at (*yylloc, _("invalid escape: %s"), quote (yytext));
YY_STEP;
}
else
\\r obstack_1grow (&string_obstack, '\r');
\\t obstack_1grow (&string_obstack, '\t');
\\v obstack_1grow (&string_obstack, '\v');
- \\[\"'?\\] obstack_1grow (&string_obstack, yytext[1]);
+ \\[\"\'?\\] obstack_1grow (&string_obstack, yytext[1]);
\\(u|U[0-9a-fA-F]{4})[0-9a-fA-F]{4} {
int c = convert_ucn_to_byte (yytext);
if (c < 0)
{
- LOCATION_PRINT (stderr, *yylloc);
- fprintf (stderr, _(": invalid escape: %s\n"), quote (yytext));
+ complain_at (*yylloc, _("invalid escape: %s"), quote (yytext));
YY_STEP;
}
else
obstack_1grow (&string_obstack, c);
}
\\(.|\n) {
- LOCATION_PRINT (stderr, *yylloc);
- fprintf (stderr, _(": unrecognized escape: %s\n"), quote (yytext));
+ complain_at (*yylloc, _("unrecognized escape: %s"), quote (yytext));
YY_OBS_GROW;
}
/* FLex wants this rule, in case of a `\<<EOF>>'. */
\\ YY_OBS_GROW;
<<EOF>> {
- LOCATION_PRINT (stderr, *yylloc);
- fprintf (stderr, _(": unexpected end of file in a character\n"));
+ complain_at (*yylloc, _("unexpected end of file in a character"));
assert (yy_top_state () != INITIAL);
yy_pop_state ();
}
\\ YY_OBS_GROW;
<<EOF>> {
- LOCATION_PRINT (stderr, *yylloc);
- fprintf (stderr, _(": unexpected end of file in a string\n"));
+ complain_at (*yylloc, _("unexpected end of file in a string"));
assert (yy_top_state () != INITIAL);
yy_pop_state ();
}
"@"(-?[0-9]+|"$") { handle_at (current_braced_code,
yytext, *yylloc); }
- [^$@\[\]/'\"\{\}]+ YY_OBS_GROW;
+ [^$@\[\]/\'\"\{\}]+ YY_OBS_GROW;
/* A stray $, or /, or etc. */
. YY_OBS_GROW;
<<EOF>> {
- LOCATION_PRINT (stderr, *yylloc);
- fprintf (stderr, _(": unexpected end of file in a braced code\n"));
+ complain_at (*yylloc, _("unexpected end of file in a braced code"));
yy_pop_state ();
YY_OBS_FINISH;
yylval->string = last_string;
return PROLOGUE;
}
- [^%\[\]/'\"]+ YY_OBS_GROW;
+ [^%\[\]/\'\"]+ YY_OBS_GROW;
"%" YY_OBS_GROW;
<<EOF>> {
- LOCATION_PRINT (stderr, *yylloc);
- fprintf (stderr, _(": unexpected end of file in a prologue\n"));
+ complain_at (*yylloc, _("unexpected end of file in a prologue"));
yy_pop_state ();
YY_OBS_FINISH;
yylval->string = last_string;
rule_length, n, type_name);
}
else
- complain_at (location, _("invalid value: %s"), text);
+ complain_at (location, _("invalid value: %s"), quote (text));
}
}
if (*cp == '$')
obstack_sgrow (&string_obstack, "]b4_dollar_dollar[");
else
- complain_at (location, _("%s is invalid"), quote_n (1, text));
+ complain_at (location, _("invalid value: %s"), quote (text));
}
rule_length, n);
}
else
- complain_at (location, _("invalid value: %s"), text);
+ complain_at (location, _("invalid value: %s"), quote (text));
}
}
if (*cp == '$')
obstack_sgrow (&string_obstack, "]b4_at_dollar[");
else
- complain_at (location, _("%s is invalid"), quote_n (1, text));
+ complain_at (location, _("invalid value: %s"), quote (text));
}
code = code < sizeof table ? table[code] : -1;
}
#endif
-
+
return code;
}