Use strings rather than escapes when possible,
to minimize the number of warnings from xgettext.
(handle_action_dollar, handle_action_at): Don't use isdigit,
as it mishandles negative chars and it may not work as expected
outside the C locale.
{int} yylval->integer = strtol (yytext, 0, 10); return INT;
/* Characters. We don't check there is only one. */
{int} yylval->integer = strtol (yytext, 0, 10); return INT;
/* Characters. We don't check there is only one. */
- \' YY_OBS_GROW; yy_push_state (SC_ESCAPED_CHARACTER);
+ "'" YY_OBS_GROW; yy_push_state (SC_ESCAPED_CHARACTER);
- \" YY_OBS_GROW; yy_push_state (SC_ESCAPED_STRING);
+ "\"" YY_OBS_GROW; yy_push_state (SC_ESCAPED_STRING);
/* Comments. */
"/*" yy_push_state (SC_COMMENT);
/* Comments. */
"/*" yy_push_state (SC_COMMENT);
. {
LOCATION_PRINT (stderr, *yylloc);
. {
LOCATION_PRINT (stderr, *yylloc);
- fprintf (stderr, ": invalid character: `%c'\n", *yytext);
+ fprintf (stderr, _(": invalid character: `%c'\n"), *yytext);
<<EOF>> {
LOCATION_PRINT (stderr, *yylloc);
<<EOF>> {
LOCATION_PRINT (stderr, *yylloc);
- fprintf (stderr, ": unexpected end of file in a comment\n");
+ fprintf (stderr, _(": unexpected end of file in a comment\n"));
assert (yy_top_state () == INITIAL);
YY_OBS_GROW;
YY_OBS_FINISH;
assert (yy_top_state () == INITIAL);
YY_OBS_GROW;
YY_OBS_FINISH;
<<EOF>> {
LOCATION_PRINT (stderr, *yylloc);
<<EOF>> {
LOCATION_PRINT (stderr, *yylloc);
- fprintf (stderr, ": unexpected end of file in a string\n");
+ fprintf (stderr, _(": unexpected end of file in a string\n"));
assert (yy_top_state () == INITIAL);
YY_OBS_FINISH;
yylval->string = last_string;
assert (yy_top_state () == INITIAL);
YY_OBS_FINISH;
yylval->string = last_string;
YY_OBS_GROW;
assert (yy_top_state () == INITIAL);
{
YY_OBS_GROW;
assert (yy_top_state () == INITIAL);
{
- [^\'\n\r\\] YY_OBS_GROW;
{eols} obstack_1grow (&string_obstack, '\n'); YY_LINES;
<<EOF>> {
LOCATION_PRINT (stderr, *yylloc);
{eols} obstack_1grow (&string_obstack, '\n'); YY_LINES;
<<EOF>> {
LOCATION_PRINT (stderr, *yylloc);
- fprintf (stderr, ": unexpected end of file in a character\n");
+ fprintf (stderr, _(": unexpected end of file in a character\n"));
assert (yy_top_state () == INITIAL);
YY_OBS_FINISH;
yylval->string = last_string;
assert (yy_top_state () == INITIAL);
YY_OBS_FINISH;
yylval->string = last_string;
if (c > 255)
{
LOCATION_PRINT (stderr, *yylloc);
if (c > 255)
{
LOCATION_PRINT (stderr, *yylloc);
- fprintf (stderr, ": invalid escape: %s\n", quote (yytext));
+ fprintf (stderr, _(": invalid escape: %s\n"), quote (yytext));
\\[\\""] obstack_1grow (&string_obstack, yytext[1]);
\\(.|\n) {
LOCATION_PRINT (stderr, *yylloc);
\\[\\""] obstack_1grow (&string_obstack, yytext[1]);
\\(.|\n) {
LOCATION_PRINT (stderr, *yylloc);
- fprintf (stderr, ": unrecognized escape: %s\n", quote (yytext));
+ fprintf (stderr, _(": unrecognized escape: %s\n"), quote (yytext));
YY_OBS_GROW;
}
/* FLex wants this rule, in case of a `\<<EOF>>'. */
YY_OBS_GROW;
}
/* FLex wants this rule, in case of a `\<<EOF>>'. */
YY_OBS_GROW;
assert (yy_top_state () != INITIAL);
yy_pop_state ();
YY_OBS_GROW;
assert (yy_top_state () != INITIAL);
yy_pop_state ();
<<EOF>> {
LOCATION_PRINT (stderr, *yylloc);
<<EOF>> {
LOCATION_PRINT (stderr, *yylloc);
- fprintf (stderr, ": unexpected end of file in a character\n");
+ fprintf (stderr, _(": unexpected end of file in a character\n"));
assert (yy_top_state () != INITIAL);
yy_pop_state ();
}
assert (yy_top_state () != INITIAL);
yy_pop_state ();
}
assert (yy_top_state () != INITIAL);
YY_OBS_GROW;
yy_pop_state ();
assert (yy_top_state () != INITIAL);
YY_OBS_GROW;
yy_pop_state ();
<<EOF>> {
LOCATION_PRINT (stderr, *yylloc);
<<EOF>> {
LOCATION_PRINT (stderr, *yylloc);
- fprintf (stderr, ": unexpected end of file in a string\n");
+ fprintf (stderr, _(": unexpected end of file in a string\n"));
assert (yy_top_state () != INITIAL);
yy_pop_state ();
}
assert (yy_top_state () != INITIAL);
yy_pop_state ();
}
<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>
{
/* Characters. We don't check there is only one. */
<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>
{
/* Characters. We don't check there is only one. */
- \' YY_OBS_GROW; yy_push_state (SC_CHARACTER);
+ "'" YY_OBS_GROW; yy_push_state (SC_CHARACTER);
- \" YY_OBS_GROW; yy_push_state (SC_STRING);
+ "\"" YY_OBS_GROW; yy_push_state (SC_STRING);
/* Comments. */
"/*" YY_OBS_GROW; yy_push_state (SC_COMMENT);
/* Comments. */
"/*" YY_OBS_GROW; yy_push_state (SC_COMMENT);
<<EOF>> {
LOCATION_PRINT (stderr, *yylloc);
<<EOF>> {
LOCATION_PRINT (stderr, *yylloc);
- fprintf (stderr, ": unexpected end of file in a braced code\n");
+ fprintf (stderr, _(": unexpected end of file in a braced code\n"));
yy_pop_state ();
YY_OBS_FINISH;
yylval->string = last_string;
yy_pop_state ();
YY_OBS_FINISH;
yylval->string = last_string;
<<EOF>> {
LOCATION_PRINT (stderr, *yylloc);
<<EOF>> {
LOCATION_PRINT (stderr, *yylloc);
- fprintf (stderr, ": unexpected end of file in a prologue\n");
+ fprintf (stderr, _(": unexpected end of file in a prologue\n"));
yy_pop_state ();
YY_OBS_FINISH;
yylval->string = last_string;
yy_pop_state ();
YY_OBS_FINISH;
yylval->string = last_string;
obstack_fgrow1 (&string_obstack,
"]b4_lhs_value([%s])[", type_name);
}
obstack_fgrow1 (&string_obstack,
"]b4_lhs_value([%s])[", type_name);
}
- else if (isdigit (*cp) || *cp == '-')
+ else if (('0' <= *cp && *cp <= '9') || *cp == '-')
{
/* RULE_LENGTH is the number of values in the current rule so
far, which says where to find `$0' with respect to the top of
{
/* RULE_LENGTH is the number of values in the current rule so
far, which says where to find `$0' with respect to the top of
{
obstack_sgrow (&string_obstack, "]b4_lhs_location[");
}
{
obstack_sgrow (&string_obstack, "]b4_lhs_location[");
}
- else if (isdigit (*cp) || *cp == '-')
+ else if (('0' <= *cp && *cp <= '9') || *cp == '-')
{
/* RULE_LENGTH is the number of values in the current rule so
far, which says where to find `$0' with respect to the top of
{
/* RULE_LENGTH is the number of values in the current rule so
far, which says where to find `$0' with respect to the top of