Here is my proposal for the first batch of changes to improve the generation of error messages. There remains of course much to do:
- the case of push parsers - parse.error rich and dequoted yytname - support for translated string aliases - documentation - other skeletons (those that don't have LAC support will get poor quality results. GLR might be a challenge.) Please, comment the design and implementation here. However, you might find it easier to read here: https://github.com/akimd/bison/pull/16. I would have liked to extract more commits that deal with the test suite from this thread, but it was too entangled, and I already spent too much time in git rebase and fixing conflicts. Sorry about that. Akim Demaille (12): yacc.c: extract yyerror_message_arguments yacc.c: store token numbers, not token strings yacc.c: style: avoid macros yacc.c: add custom error message generation yacc.c: check custom error messages tests: compute verbose error messages from the custom ones yacc.c: isolate yyexpected_tokens yacc.c: let custom error messages see the location yacc.c: check custom error messages with parse-params tests: a clearer test for parse-params yacc.c: pass the parse-params to yyreport_syntax_error yacc.c: portability to G++ 4.8 data/skeletons/bison.m4 | 5 +- data/skeletons/yacc.c | 248 ++++++++++++++++++++++++++-------------- examples/c/calc/calc.y | 55 ++++++++- tests/calc.at | 192 +++++++++++++++++++------------ tests/local.at | 82 ++++++++++--- tests/testsuite.at | 2 +- 6 files changed, 401 insertions(+), 183 deletions(-) -- 2.24.1
