summaryrefslogtreecommitdiff
path: root/ChangeLog
Commit message (Collapse)AuthorAgeFilesLines
* Keep sub-messages aligned. Fix strings for translation.Alex Rozenman2009-09-191-0/+15
| | | | | | | | | | | | | | * src/location.h: (location_print): Add return value. * src/location.c: (location_print): Return number of printed characters. * src/complain.h: Two new functions (complain_at_indent, warn_at_indent). * src/complain.cpp: Implement the alignment mechanism. Add new static variable (indent_ptr). Use and update it (error_message, complain_at_indent, warn_at_indent). * src/scan-code.l: Fix strings for translations. Use new *_indent functions (parse_ref, show_sub_messages). * NEWS (2.5): Add an announcement about named references.
* doc: fixes.Akim Demaille2009-09-171-0/+6
| | | | | * doc/bison.texinfo: here. Reported by Alex Rozenman.
* doc: lalr1.cc and variants.Akim Demaille2009-09-161-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | * doc/bison.texinfo (Decl Summary): Document the "lex_symbol" and "variant" %define variables. (C++ Semantic Values): Split into... (C++ Unions, C++ Variants): these. The latter is new. (C++ Parser Interface): Fix type names. Document parser::syntax_error. Document the fact that locations are not mandatory. (C++ Scanner Interface): Split into... (Split Symbols, Complete Symbols): these. The later is new. (Calc++ Parsing Driver): Use variants. Add more comments. Adjust style. (Calc++ Parser): Declare all the tokens, no longer accept raw characters. Remove %union. Adjust types and printers. Remove destructors. (Calc++ Scanner): Use make_<SYMBOL> functions. Use strerror in error message.
* doc: spell checking.Akim Demaille2009-09-161-0/+5
| | | | * doc/bison.texinfo: here.
* doc: comment changes.Akim Demaille2009-09-161-0/+5
| | | | * doc/bison.texinfo: Comment changes.
* lalr1.cc: factor the yytranslate_ invocation in make_SYMBOLS.Akim Demaille2009-09-161-0/+10
| | | | | | | | | * data/c++.m4, data/lalr1.cc (parser::symbol_type): Change the constructor to take a token_type instead of the (internal) symbol number. Call yytranslate_. * data/variant.hh (b4_symbol_constructor_define_): Therefore, don't call yytranslate_ here.
* TODO: statistics.Akim Demaille2009-09-161-0/+5
| | | | * TODO (Figures): New.
* tests: clean up push.at test group titles.Joel E. Denny2009-09-131-0/+6
| | | | | * tests/push.at: Remove "Push Parsing: " from test group titles because these are already under the banner "Push Parsing Tests".
* Provide an additional sub-message for clarity.Alex Rozenman2009-09-121-0/+9
| | | | | | | | | Add "symbol not found in production" error message when an "invalid reference" is detected in named references resolution. * src/scan-code.l: Update "invalid reference" case. * tests/named-ref.at: Adjust test-cases.
* Clean up yacc.c a little.Joel E. Denny2009-09-101-0/+8
| | | | | | | * data/yacc.c: Clean up M4 for readability, and make output whitespace more consistent. For the main parse function comment, instead of saying "yyparse or yypush_parse", say either "yyparse" or "yypush_parse" depending on which it actually is.
* Fix --enable-gcc-warnings.Joel E. Denny2009-09-101-0/+5
| | | | * src/parse-gram.y (%printer <param>): Handle param_none.
* lalr1.cc: syntax_error as exceptions.Akim Demaille2009-09-091-0/+15
| | | | | | | | | | | | | | 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.
* lalr1.cc: add missing "inline".Akim Demaille2009-09-091-0/+6
| | | | | * data/c++.m4 (b4_public_types_define): Add missing inline to implementations provided in headers.
* %param: documentation.Akim Demaille2009-09-091-0/+10
| | | | | | | | | * 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.
* Regen.Akim Demaille2009-09-091-0/+4
|
* style changes.Akim Demaille2009-09-091-0/+5
| | | | * src/parse-gram.y (add_param): Scope changes.
* %parse: support several arguments.Akim Demaille2009-09-091-0/+8
| | | | | | | * src/parse-gram.y (current_param): New. (param_type): Add param_none. (params): New nonterminal. Use it.
* Regen.Akim Demaille2009-09-091-0/+4
|
* %param.Akim Demaille2009-09-091-0/+17
| | | | | | | | | | | | | | | | 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.
* Complain about unused %define variables and %code qualifiers.Joel E. Denny2009-09-051-0/+14
| | | | | | | | | | | | | * 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.
* Use aver not assert.Joel E. Denny2009-09-051-0/+8
| | | | | | | * 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.
* Use "Unresolved reference" error message when no symbols were foundAlex Rozenman2009-09-051-0/+9
| | | | | | | | | 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.
* Adjust synclines in src/parse-gram.[ch].Akim Demaille2009-09-041-0/+7
| | | | | | * tests/bison.in: Do some magic (including working around issues with ylwrap) when this wrapper is used to compile src/parse-gram.y.
* Don't suppress warnings about unused parse.error.Joel E. Denny2009-09-031-0/+7
| | | | | | * 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.
* NEWS: Internationalization.Akim Demaille2009-09-031-0/+4
| | | | * NEWS (2.4.2): Add "Internationalization" item.
* bootstrap: fix/improve find_tool.Akim Demaille2009-09-031-0/+6
| | | | | * bootstrap (find_tool): Improve error messages. Fix typo about find_tool_names.
* Fix gcc 3.4.4 shadowing warning reported by Eric Blake.Joel E. Denny2009-08-291-0/+10
| | | | | | | | | See <http://lists.gnu.org/archive/html/bison-patches/2009-08/msg00093.html>. * 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.
* %define: accept unquoted values.Joel E. Denny2009-08-281-0/+19
| | | | | | | | | | | | | | | | | | * 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.
* %define lr.type: make values lowercase IDs.Joel E. Denny2009-08-281-0/+15
| | | | | | | | | | | | | | 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.
* scan-gram: avoid portability trap with ctype usage.Eric Blake2009-08-271-0/+6
| | | | | | | | * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Avoid compiler warning. Signed-off-by: Eric Blake <ebb9@byu.net> (cherry picked from commit bbbbe221d7c2ff2fff88f7a0c8dbfee73f2e8a58)
* tests: use perl for printing special sequences to files.Joel E. Denny2009-08-271-0/+10
| | | | | | | | | 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.
* tests: show a use of %define lr.default-reductions "consistent"Joel E. Denny2009-08-261-0/+6
| | | | | * tests/conflicts.at (%nonassoc and eof): Extend to test that it prevents the omission of expected tokens for %error-verbose.
* tests: portability fix.Akim Demaille2009-08-261-0/+6
| | | | | * tests/input.at (Bad escapes in literals): Don't expect "echo '\0'" to output \ then 0.
* Actually handle the yytable zero value correctly this time.Joel E. Denny2009-08-261-0/+14
| | | | | | | | | | | | | * 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.
* More fixes related to last two patches.Joel E. Denny2009-08-251-0/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* Fix %error-verbose for conflicts resolved by %nonassoc.Joel E. Denny2009-08-251-0/+13
| | | | | | | | | | | | * 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.
* Some code and documentation improvements.Joel E. Denny2009-08-251-0/+16
| | | | | | | | | | | | | | | * 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.
* Use locale when quoting.Joel E. Denny2009-08-211-0/+6
| | | | | * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER): Use quote rather than implementing quoting here.
* Make previous patch more robust.Eric Blake2009-08-201-14/+20
| | | | | | | | | | * src/output.c (ARRAY_CARDINALITY): New macro, copied from argmatch.h. (output_skeleton): Use it. Suggested by Akim Demaille. Signed-off-by: Eric Blake <ebb9@byu.net> (cherry picked from commit 1266b636740f0c6719d8cc11a5d569084fa37009)
* Import latest m4/m4.m4.Eric Blake2009-08-201-0/+8
| | | | | | | | | | * 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. Signed-off-by: Eric Blake <ebb9@byu.net> (cherry picked from commit b9ad39c1fb2482e1513cdf9800b31e71b7986b39)
* Fix complaints about escape sequences.Joel E. Denny2009-08-191-0/+20
| | | | | | | | | | | | | | | | | | | Discussed starting at <http://lists.gnu.org/archive/html/bison-patches/2009-08/msg00036.html>. * 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.
* doc: fixes.Akim Demaille2009-08-191-0/+5
| | | | * doc/bison.texinfo: Fix minor Texinfo errors.
* tests: distcc compliance.Akim Demaille2009-08-191-0/+6
| | | | | * tests/synclines.at (AT_SYNCLINES_COMPILE): Discard distcc's error messages from the output.
* variables: simplify the upgrade of namespace into api.namespace.Akim Demaille2009-08-191-0/+19
| | | | | | | | | | | | | | | | | 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 <demaille@gostai.com>Akim Demaille2009-08-191-0/+8
| | | | | | | | 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.
* lalr1.cc: use state_type.Akim Demaille2009-08-191-0/+6
| | | | | * data/lalr1.cc (yysyntax_error_): Use state_type. Move argument names into yy*.
* lalr1.cc: get rid of yyparse's yystate.Akim Demaille2009-08-191-0/+15
| | | | | | | | | | | | | | 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.
* lalr1.cc: destroy $$ when YYERROR is called.Akim Demaille2009-08-191-0/+9
| | | | | | | | * 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.
* maint: update for gnulib's recent update-copyright changesJoel E. Denny2009-08-181-0/+9
| | | | | | | | * 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.
* build: require gettext 0.17.Akim Demaille2009-08-171-0/+9
| | | | | | | | 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.