X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/838205d547498edd52c599e8755a233bb695e831..ff601366544d2cb2218c80e37083a88c6102061c:/ChangeLog diff --git a/ChangeLog b/ChangeLog index 6fb1ae22..02d15de9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,501 @@ +2009-09-09 Akim Demaille + + lalr1.cc: syntax_error as exceptions. + It is common to use sort of factories in the user actions. These + factories may check some "syntactic" constraints that are not + enforced by the grammar itself. This is possible using YYERROR + within the action itself. Provide the user with a means to throw + a syntax_error exception. + + * data/c++.m4 (b4_public_types_declare, b4_public_types_define): + Declare and define yy::parser::syntax_error. + * data/lalr1.cc: Include stdexcept. + (yy::parser::parse): Wrap the user action within a try/catch. + * data/glr.cc: Include stdexcept. + +2009-09-09 Akim Demaille + + lalr1.cc: add missing "inline". + * data/c++.m4 (b4_public_types_define): Add missing inline to + implementations provided in headers. + +2009-09-09 Akim Demaille + + %param: documentation. + * NEWS (2.6): Document %param, %lex-param, and %parse-param + changes. + * doc/bison.texinfo: Document that %lex-param and %parse-param + are n-ary. + Changes some examples to demonstrate it. + (Calc++ Parser): Use %param. + +2009-09-09 Akim Demaille + + Regen. + +2009-09-09 Akim Demaille + + style changes. + * src/parse-gram.y (add_param): Scope changes. + +2009-09-09 Akim Demaille + + %parse: support several arguments. + * src/parse-gram.y (current_param): New. + (param_type): Add param_none. + (params): New nonterminal. + Use it. + +2009-09-09 Akim Demaille + + Regen. + +2009-09-09 Akim Demaille + + %param. + Provide a means to factor lex-param and parse-param common + declarations. + + * src/parse-gram.y (param_type): New. + Define a %printer for it. + (add_param): Use it. + (%parse-param, %lex-param): Merge into... + (%parse): this new token. + Adjust the grammar to use it. + * src/scan-gram.l (RETURN_VALUE): New. + (RETURN_PERCENT_FLAG): Use it. + (RETURN_PERCENT_PARAM): New. + Use it to support %parse-param, %lex-param and %param. + +2009-09-03 Joel E. Denny + + Use aver not assert. + * src/output.c: Don't include assert.h. + (output_skeleton): Use aver not assert. + * src/system.h (aver): In documentation of why, add links to + Paul Eggert's explanations in the mailing lists. + +2009-09-05 Alex Rozenman + + Use "Unresolved reference" error message when no symbols were found + in a symbolic reference resolution. Remove .expr and -expr from + the shown reference when the reference is unresolved. + * src/scan-code.l: Change the error message, adjust location columns, + rename variable "exact_mode" to "explicit_bracketing". + * tests/named-ref.at: Adjust existing tests and add a new one. + +2009-09-04 Akim Demaille + + Adjust synclines in src/parse-gram.[ch]. + * tests/bison.in: Do some magic (including working around issues + with ylwrap) when this wrapper is used to compile + src/parse-gram.y. + +2009-09-03 Joel E. Denny + + Complain about unused %define variables and %code qualifiers. + * NEWS (2.5): Document. + * data/bison.m4 (b4_check_user_names): Complain instead of warn. + * doc/bison.texinfo (Decl Summary): Document complaint, and + improve %define documentation a little otherwise. + * tests/input.at (Reject unused %code qualifiers): Update. + (%define errors): Update. + (%define, --define, --force-define): Update. + (%define backward compatibility): Update. + (Unused %define api.pure): Update. + * tests/push.at (Push Parsing: Unsupported Skeletons): Update. + +2009-09-03 Joel E. Denny + + Don't suppress warnings about unused parse.error. + * data/bison.m4 (b4_error_verbose_flag): Don't examine value of + %define variable parse.error unless b4_error_verbose_flag is + actually expanded in a skeleton. + +2009-09-03 Akim Demaille + + * NEWS (2.4.2): Add "Internationalization" item. + +2009-09-03 Akim Demaille + + bootstrap: fix/improve find_tool. + * bootstrap (find_tool): Improve error messages. + Fix typo about find_tool_names. + +2009-08-29 Joel E. Denny + + Fix gcc 3.4.4 shadowing warning reported by Eric Blake. + See + . + * src/scan-code.h (code_props_rule_action_init): Rename + named_ref arg to name so it doesn't shadow named_ref type. This + makes it consistent with the function definition in scan-code.l + anyway. + +2009-08-28 Joel E. Denny + + %define: accept unquoted values. + * NEWS (2.5): Group all %define changes together, and document + this one. Remove quotes in IELR and canonical LR entry. + * doc/bison.texinfo: Remove quotes in most examples throughout. + (Decl Summary): Update %define documentation. + (Table of Symbols): Likewise. + * src/ielr.c (LrType): Update documentation. + * src/parse-gram.y (content.opt): Add production for ID. + * tests/actions.at: Remove quotes in most tests. + * tests/calc.at: Likewise. + * tests/existing.at: Likewise. + * tests/input.at: Likewise. + * tests/local.at: Likewise. + * tests/push.at: Likewise. + * tests/reduce.at: Likewise. + * tests/torture.at: Likewise. + +2009-08-28 Joel E. Denny + + %define lr.type: make values lowercase IDs. + That is, "LALR" => "lalr", "IELR" => "ielr", and + "canonical LR" => "canonical-lr". + * NEWS (2.5): Update documentation. + * doc/bison.texinfo (Decl Summary): Likewise. + * src/ielr.c (ielr): Use new values. + * src/ielr.h (ielr): Update documentation. + * src/reader.c (prepare_percent_define_front_end_variables): Use + and validate new values. + * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): Update test + grammars. + * tests/reduce.at (AT_TEST_LR_TYPE): Likewise. + +2009-08-27 Eric Blake + + scan-gram: avoid portability trap with ctype usage. + * src/scan-gram.l (): + Avoid compiler warning. + +2009-08-27 Joel E. Denny + + tests: use perl for printing special sequences to files. + And skip tests if perl is not available. This is better than + playing tricks with shell portability. Suggested by Akim + Demaille. + * tests/input.at (Bad character literals): Use it here for + omitting final newlines. + (Bad escapes in literals): Use it here for special characters. + +2009-08-26 Joel E. Denny + + tests: show a use of %define lr.default-reductions "consistent" + * tests/conflicts.at (%nonassoc and eof): Extend to test that it + prevents the omission of expected tokens for %error-verbose. + +2009-08-26 Akim Demaille + + tests: portability fix. + * tests/input.at (Bad escapes in literals): Don't expect "echo + '\0'" to output \ then 0. + +2009-08-26 Joel E. Denny + + Actually handle the yytable zero value correctly this time. + * data/bison.m4 (b4_integral_parser_tables_map): Don't mention + zero values in the YYTABLE comments. + * data/glr.c (yytable_value_is_error): Don't check for zero + value. + * data/lalr1.cc (yy_table_value_is_error_): Likewise. + * data/yacc.c (yytable_value_is_error): Likewise. + * data/lalr1.java (yy_table_value_is_error_): Likewise. + (yysyntax_error): Fix typo in code: use yytable_ not yycheck_. + * src/tables.h: In header comments, explain why it's useless to + check for a zero value in yytable. + +2009-08-25 Joel E. Denny + + More fixes related to last two patches. + * data/bison.m4 (b4_integral_parser_tables_map): Fix YYTABLE + comments: zero indicates syntax error not default action. + * data/c.m4 (b4_table_value_equals): Comment that YYID must be + defined. + * data/glr.c (yyis_pact_ninf): Rename to... + (yypact_value_is_default): ... this. + (yyisDefaultedState): Update for rename. + (yyis_table_ninf): Rename to... + (yytable_value_is_error): ... this, and check for value zero + besides just YYTABLE_NINF. + (yygetLRActions): Check for default value from yypact. It + appears that this check is always performed before this function + is invoked, and so adding the check here is probably redundant. + However, the code may evolve after this subtlety is forgotten. + Also, update for rename to yytable_value_is_error. Because that + macro now checks for zero, a different but equivalent branch of + the if-then-else here is evaluated. + (yyreportSyntaxError): Update for rename to + yytable_value_is_error. The zero condition was mishandled + before. + (yyrecoverSyntaxError): Update for renames. No behavioral + changes. + * data/lalr1.cc, data/lalr1.java (yy_pact_value_is_default_): + New function. + (yy_table_value_is_error_): New function. + (parse): Use new functions where possible. No behavioral + changes. + (yysyntax_error_, yysyntax_error): Use yy_table_value_is_error_. + The zero condition was mishandled before. + * data/yacc.c (yyis_pact_ninf): Rename to... + (yypact_value_is_default): ... this. + (yyis_table_ninf): Rename to... + (yytable_value_is_error): ... this, and check for value zero + besides just YYTABLE_NINF. + (yysyntax_error): Update for rename to yytable_value_is_error. + The zero condition was mishandled before. + (yyparse): Update for renames. No behavioral changes. + * src/tables.h: Improve comments about yypact, yytable, etc. + more. Most importantly, say yytable value of zero means syntax + error not default action. + +2009-08-25 Joel E. Denny + + Fix %error-verbose for conflicts resolved by %nonassoc. + * NEWS (2.5): Document. + * data/glr.c (yyreportSyntaxError): Fix this by checking + yyis_table_ninf. + * data/yacc.c (yysyntax_error): Likewise. + * data/lalr1.cc (yysyntax_error_): Fix this by checking + yytable_ninf_. + * data/lalr1.java (yysyntax_error): Likewise. + * tests/conflicts.at (%nonassoc and eof): Update expected output + and remove FIXME. + +2009-08-25 Joel E. Denny + + Some code and documentation improvements. + * data/c.m4 (b4_table_value_equals): New macro to capture + some repeated code. + * data/glr.c (yyis_pact_ninf): Use it here. + (yyis_table_ninf): Likewise. + (yyreportSyntaxError): Improve internal comments. + * data/yacc.c (yyis_pact_ninf): New macro copied from glr.c. + Use it everywhere possible. + (yyis_table_ninf): Likewise. + (yysyntax_error): Improve internal comments. + * data/lalr1.cc (yysyntax_error_): Likewise. + * data/lalr1.java (yysyntax_error): Likewise. + * src/tables.h: Improve comments about yypact, yytable, etc. + +2009-08-21 Joel E. Denny + + Use locale when quoting. + * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER): Use + quote rather than implementing quoting here. + +2009-08-20 Eric Blake + + Make previous patch more robust. + * src/output.c (ARRAY_CARDINALITY): New macro, copied from + argmatch.h. + (output_skeleton): Use it. + Suggested by Akim Demaille. + + Import latest m4/m4.m4. + * submodules/autoconf: Update to autoconf 2.64. + * configure.ac (M4_GNU_OPTION): New define. + * src/output.c (output_skeleton): Use it to resolve FIXME. + * NEWS: Mention this. + +2009-08-19 Joel E. Denny + + Fix complaints about escape sequences. + Discussed starting at + . + * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER): + For a \0 and similar escape sequences meaning the null + character, report an invalid escape sequence instead of an + invalid null character because the latter does not actually + appear in the user's input. + In all escape sequence complaints, don't escape the initial + backslash, and don't quote when the sequence appears at the end + of the complaint line unless there's whitespace that quotearg + won't escape. + Consistently say "invalid" not "unrecognized". + Consistently prefer "empty character literal" over "extra + characters in character literal" warning for invalid escape + sequences; that is, consistently discard those sequences. + * tests/input.at (Bad escapes in literals): New. + +2009-08-19 Akim Demaille + + doc: fixes. + * doc/bison.texinfo: Fix minor Texinfo errors. + +2009-08-19 Akim Demaille + + tests: distcc compliance. + * tests/synclines.at (AT_SYNCLINES_COMPILE): Discard distcc's + error messages from the output. + +2009-08-19 Akim Demaille + + variables: simplify the upgrade of namespace into api.namespace. + + This patch simplifies "variables: rename namespace as + api.namespace", commit 67501061076ba46355cfd9f9361c7eed861b389c. + Suggested by Joel E. Denny in + http://lists.gnu.org/archive/html/bison-patches/2009-07/msg00006.html + + * src/muscle-tab.c (muscle_percent_variable_update): New. + (muscle_percent_define_insert): Use it in replacement of the + previous tr invocation. + Remove variable_tr, no longer needed. + * data/bison.m4 (b4_percent_define_copy_, b4_percent_define_copy): + Remove. + * data/c++.m4: No longer handle namespace -> api.namespace. + * tests/input.at (%define backward compatibility): Check that + namespace is treated as api.namespace. + +2009-08-19 Akim Demaille + + doc: %initial-action to initialize yylloc. + Reported by Bill Allombert. + * doc/bison.texinfo: Set fill-column to 76. + (Location Type): Document the use of %initial-action to initialize + yylloc. + +2009-08-19 Akim Demaille + + lalr1.cc: use state_type. + * data/lalr1.cc (yysyntax_error_): Use state_type. + Move argument names into yy*. + +2009-08-19 Akim Demaille + + lalr1.cc: get rid of yyparse's yystate. + yystate and yystack_[0].state are equal, keep only the latter. + The former was also used as a temporary variable to compute the + post-reduction state. Move this computation into an auxiliary + function. + + * data/glr.c (yyLRgotoState): Fuse variable definition and first + assignment. + * data/lalr1.cc (yy_lr_goto_state_): New. + (yyparse): Use it. + Replace remaining uses of yystate by yystate_[0].state. + Remove the former. + +2009-08-19 Akim Demaille + + lalr1.cc: destroy $$ when YYERROR is called. + * data/lalr1.cc (yyreduce): Compute the resulting state before + running the user action so that yylhs is a valid symbol. + (yyerrorlab): Since yylhs is complete (it knows its type), we can + simply call yy_destroy_ to destroy $$ on YYERROR invocations. + * tests/c++.at (AT_CHECK_VARIANTS): Test YYERROR with variants. + +2009-08-18 Joel E. Denny + + maint: update for gnulib's recent update-copyright changes + * gnulib: Update. + * .x-update-copyright (COPYING): Add as it's no longer implied + when .x-update-copyright is present. + * cfg.mk (update-copyright-local): Remove, now ignored. + (update-copyright): Declare update-b4-copyright as a dependency. + +2009-08-17 Akim Demaille + + build: require gettext 0.17. + + Suggested by Bruno Haible. + http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00009.html + * configure.ac: require gettext 0.17 to ensure compatibility with + gnulib. + +2009-08-17 Akim Demaille + + build: lower gettext requirements. + + Bison was uselessly requiring the formatstring macros from + gettext, which resulted in mo files not being installed on systems + that perfectly supported Bison mo files. Lower the requirement. + http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00006.html + + * configure.ac: Require need-ngettext instead of + need-formatstring-macros. + Reported by Martin Jabocs. + Suggested by Bruno Haible. + * INSTALL: Restructure. + (Internationalization): New. + +2009-08-14 Joel E. Denny + + maint: fix use of copyright year intervals. + * gnulib: Update. + * bootstrap.conf (gnulib_modules): Update getopt to getopt-gnu + as now recommended in gnulib/NEWS. + * build-aux/update-b4-copyright: Fix. + * cfg.mk (update-copyright-env): Configure update-copyright. + +2009-08-13 Joel E. Denny + + Make it easier to write deterministic tests. + Continues Akim's work from his 2009-06-10 commits. + * src/reader.c (check_and_convert_grammar): Don't add any + symbols after the first symbols_do invocation. + * src/symtab.c (symbols_sorted): New static global. + (user_token_number_redeclaration): Update comments. + (symbol_from_uniqstr): If a new symbol is being created, assert + that symbols_sorted hasn't been allocated yet. + (symbols_free): Free symbols_sorted. + (symbols_cmp, symbols_cmp_qsort): New functions. + (symbols_do): Sort symbol_table into symbols_sorted on first + invocation. + * tests/input.at (Numbered tokens): Recombine tests now that the + output should be deterministic across multiple numbers. + +2009-08-12 Akim Demaille + + tests: GCC 4.5 compliance. + * tests/synclines.at (AT_SYNCLINES_COMPILE): Adjust to GCC 4.5's + messages about #error. + +2009-08-12 Akim Demaille + + build: fix the generation of the documentation. + Some of our targets use "bison --help", but they can't depend on + "bison" itself (to avoid additional requirements on the user), so + they used to call "make src/bison" in the commands. Then + concurrent builds may fail: one make might be aiming one of its + jobs at compiling src/bison, and another job at generating the man + page. If the latter is faster than the former, then we have two + makes that concurrently try to compile src/bison. + + This might also be a more convincing explanation for the failure + described in the patch "build: fix paths". + + * Makefile.am (SUFFIXES): Initialize. + * build-aux/move-if-change: New, symlink to gnulib's. + * build-aux/local.mk: Ship it. + * doc/common.x: Remove, merged into... + * doc/bison.x: here. + * doc/local.mk (doc/bison.help): New. + ($(CROSS_OPTIONS_TEXI)): Depend on it. + Use src/bison. + (.x.1): Replace with... + (doc/bison.1): this explicit, simpler, target. + (common_dep): Remove, inlined where appropriate. + (SUFFIXES, PREPATH): Remove, unused. + +2009-08-12 Akim Demaille + + gnulib: improve prefixing. + * configure.ac (gl_PREFIXED_LIBOBJS): Don't rename it, rather, + change the value of... + (gl_LIBOBJS): this. + Adjust more variables. + * etc/prefix-gnulib-mk (prefix_assignment): Don't rename + gl_LIBOBJS. + (prefix): Also transform rules whose targets have slashes. + Use $prefix liberally. + Map @MKDIR_P@ to $(MKDIR_P). + Prefix directories that are mkdir'd. + 2009-08-12 Akim Demaille build: fix paths. @@ -20,7 +518,7 @@ distcheck: fix. - * examples/calc++/Makefile.am: (EXTRA_DIST): Ship calc.stamp. + * examples/calc++/Makefile.am: (EXTRA_DIST): Ship calc.stamp. 2009-08-10 Joel E. Denny @@ -350,13 +848,13 @@ 2009-06-10 Akim Demaille gnulib: update. - * gnulib: Update to latest. - * lib/.cvsignore, lib/.gitignore, m4/.cvsignore, - * m4/.gitignore: Regen. - * src/symtab.c (symbol_from_uniqstr, semantic_type_from_uniqstr): - Call xalloc_die on hash_insert failures. - Requested by the new __warn_unused_result__ attribute of - hash_insert. + * gnulib: Update to latest. + * lib/.cvsignore, lib/.gitignore, m4/.cvsignore, + * m4/.gitignore: Regen. + * src/symtab.c (symbol_from_uniqstr, semantic_type_from_uniqstr): + Call xalloc_die on hash_insert failures. + Requested by the new __warn_unused_result__ attribute of + hash_insert. 2009-06-10 Akim Demaille