* data/glr.c (yytnamerr): New function.

(yyreportSyntaxError): Use it to dequote most string literals.
* data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
with other skeletons.  All uses changed.
(yytnameerr_): New function.
(yyreport_syntax_error): Use it to dequote most string literals.
* data/yacc.c (yytnamerr): New function.
(yyerrlab): Use it to decode most string literals.
* doc/bison.texinfo (Decl Summary, Calling Convention):
Clarify quoting convention of yytname.
* src/output.c (prepare_symbols): Quote all names.  This undoes
the 2005-04-17 change, which is now accomplished (mostly) via
changes in the parsers as described above.
* tests/regression.at (Token definitions, Web2c Actions):
Undo most 2005-04-17 change here, too.
This commit is contained in:
Paul Eggert
2005-07-21 20:53:03 +00:00
parent 49b1cf794d
commit 9e0876fb0c
6 changed files with 182 additions and 43 deletions

View File

@@ -324,9 +324,9 @@ int yylex (void);
%token B_TOKEN "b"
%token C_TOKEN 'c'
%token 'd' D_TOKEN
%token SPECIAL "\\\'\?\"\n\t??!"
%token SPECIAL "\\\'\?\"\a\b\f\n\r\t\v\001\377\x001\x0000ff??!"
%%
exp: "a" "\\\'\?\"\n\t??!";
exp: "a" "\\\'\?\"\a\b\f\n\r\t\v\001\377\x001\x0000ff??!";
%%
void
yyerror (char const *s)
@@ -350,8 +350,7 @@ main (void)
AT_CHECK([bison -o input.c input.y])
AT_COMPILE([input])
AT_PARSER_CHECK([./input], 1, [],
[syntax error, unexpected \'?"
??!, expecting a
[syntax error, unexpected "\\'?\"\a\b\f\n\r\t\v\001\377\001\377?\?!", expecting a
])
AT_CLEANUP
@@ -635,8 +634,8 @@ static const unsigned char yyrline[] =
};
static const char *const yytname[] =
{
"$end", "error", "$undefined", "if", "const", "then", "else", "$accept",
"statement", "struct_stat", "if", "else", 0
"$end", "error", "$undefined", "\"if\"", "\"const\"", "\"then\"",
"\"else\"", "$accept", "statement", "struct_stat", "if", "else", 0
};
static const unsigned short int yytoknum[] =
{