summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* maint: automate annual package-wide copyright-year update.Joel E. Denny2009-08-0423-898/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * .x-update-copyright: New. * Makefile.am (EXTRA_DIST): Remove maint.mk. * bootstrap.conf (gnulib_modules): Add maintainer-makefile and update-copyright. Remove gnumakefile, which is implied by maintainer-makefile. * cfg.mk (bootstrap-tools): Copy from old maint.mk. * gnulib: Update. * maint.mk: Remove, now copied from gnulib. * examples/extexi: Add missing "(C)" in copyright statement so update-copyright can recognize it. * src/LR0.h: Likewise. * src/print.h: Likewise. * src/print_graph.h: Likewise. * src/named-ref.c: Likewise. * src/named-ref.h: Likewise. * src/gram.c: Add missing comma in copyright statement. * src/gram.h: Likewise. (cherry picked from commit dbbb64f09180b8749e3a91d3559e13b933cd15c8) Conflicts: Makefile.am gnulib maint.mk src/gram.h
* Fix "make distcheck".Joel E. Denny2009-08-042-2/+8
| | | | | | * examples/calc++/Makefile.am: Say $(srcdir)/calc.stamp instead of just calc.stamp. (cherry picked from commit cfc9e431c31f7f7291dd16a4a505d6a41e662d0c)
* Pacify "gcc -Wunused" for the input function from Flex.Joel E. Denny2009-08-014-3/+17
| | | | | | | | | | | | | | Reported by Alex Rozenman. This warning shows up with gcc-4.3.0 and later. * src/scan-code.l: Add "%option noinput", which I cannot find in the Flex manual, but which Flex has supported since at least as far back as 2.5.4. However, if any of our developers still use Flex 2.5.4, they'll need to stop configuring with --enable-gcc-warnings because "%option noinput" didn't work correctly until Flex 2.5.6. * src/scan-gram.l: Likewise. * src/scan-skel.l: Likewise. (cherry picked from commit 42f8609bbd033edf6cca102ca080eade94ed08ef)
* Fix mail address in ChangeLog.Alex Rozenman2009-07-311-3/+3
|
* Fix --enable-gcc-warnings problems.Alex Rozenman2009-07-314-73/+80
| | | | | | * src/reader.c: Adjust variable names. * src/scan-code.l: Fix prototypes and adjust names. * src/named-ref.c: Remove redundant "if".
* Fix a --enable-gcc-warnings problem.Joel E. Denny2009-07-292-2/+8
| | | | | | * src/scan-gram.l (SC_ESCAPED_CHARACTER): Actually use length variable. (cherry picked from commit a1ed2b71faac0de1db1c0e279ee3203115ec70d8)
* Warn about character literals not of length one.Joel E. Denny2009-07-244-8/+108
| | | | | | | | | * NEWS (2.5): Document. * src/scan-gram.l (INITIAL): Remove comment that we don't check the length. (SC_ESCAPED_CHARACTER): Warn if length is wrong. * tests/input.at (Bad character literals): New test group. (cherry picked from commit ac9b0e954b1d3aed514a3bbd363da1514202af0f)
* Fix some memory leaks.Alex Rozenman2009-07-244-2/+29
| | | | | | | * src/named-ref.c: Add a pointer check (named_ref_free). * src/scan-code.l: New function (variant_table_free). Called in code_scanner_free. * src/symlist.c: Call to named_ref_free (symbol_list_free).
* * src/lalr.c (state_lookahead_tokens_count): Correct comment.Joel E. Denny2009-07-242-4/+9
| | | | (cherry picked from commit 2de160e12ea0b0313a3a4f2120b30a3eeaad0c76)
* Some M4 cleanup in the testsuite.Joel E. Denny2009-07-223-40/+43
| | | | | | | | | | | | | | | | | | | | Suggested by Eric Blake at <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00083.html>. * tests/existing.at (_AT_TEST_EXISTING_GRAMMAR): Do not complicate the code by distinguishing between a missing value and an empty string value for an optional argument. This fix is allowed by the similar fix in AT_TEST_TABLES_AND_PARSE below. * tests/local.at (_AT_TEST_TABLES_AND_PARSE): Merge into... (AT_TEST_TABLES_AND_PARSE): ... this now that the special arguments are not needed because of the following changes. Fix stale comments. Bison developers should use GNU M4 and should not use POSIXLY_CORRECT when building the test suite, so do not complicate the code by avoiding $10 and above. Do not quote an empty string value for an optional argument, and do not distinguish between a missing value and an empty string value. (cherry picked from commit cba975069a746bccdd2f2a954954ac7e43a47ac2)
* Revert unnecessary column realignment in --help output.Joel E. Denny2009-07-152-16/+23
| | | | | | | Reported by Akim Demaille at <http://lists.gnu.org/archive/html/bison-patches/2009-06/msg00010.html>. * src/getargs.c (usage): Here. (cherry picked from commit 620b2e3691598e057e24a7965fd268d0495cf9f5)
* Alphabetical order in src/local.mk.Alex Rozenman2009-07-042-3/+8
| | | | * src/local.mk: Adjust.
* Regen.Alex Rozenman2009-07-042-133/+134
|
* Style changes and factoring.Alex Rozenman2009-07-049-194/+221
| | | | | | | | | | | | | * src/named-ref.h: Add comments. * src/parse-gram.y: Readability and style changes. * src/reader.c: Factoring: assign_named_ref function. * src/scan-code.l: Factoring and style changes. Rename parse_named_ref to parse_ref. Use "c-ctype.h" from gnulib. Use "unsigned" type for variant index. Improve readablity. * src/scan-gram.l: Change error messages and add comments. * src/symlist.h: symbol_list_null: New function decl. * src/symlist.c: symbol_list_null: Implement here. * tests/named-refs.at: Adjust for new error messages.
* scan-code: avoid compiler warningsEric Blake2009-06-292-2/+7
| | | | | | | * src/scan-code.l (parse_named_ref): Use correct specifiers. Signed-off-by: Eric Blake <ebb9@byu.net> (cherry picked from commit ae09ec8577cbf72188164ab42ba2ea022722b78c)
* build: avoid concurrent extraction of calc++.Akim Demaille2009-06-292-2/+15
| | | | | | | | * examples/calc++/Makefile.am (calc.stamp): New. Depend on it to create the sources of calc++ so that concurrent builds don't launch several "extexi" in parallel. Not only this is inefficient, this also builds incorrect sources with several extractions mixed together.
* parse.error: fix.Akim Demaille2009-06-292-25/+35
| | | | | | * data/bison.m4: Move code related to specific variables after the definition of the variable-maintaining macros so that we don't "invoke" b4_percent_define_check_values before it is defined.
* Regen.Akim Demaille2009-06-292-572/+587
|
* variables: parse.errorAkim Demaille2009-06-298-62/+119
| | | | | | | | | | | | | | | | | | | | | Implement, document, and test the replacement of %error-verbose by %define parse.error "verbose". * data/bison.m4 (b4_error_verbose_if): Reimplement to track the values of the parse.error variable. Make "simple" its default value. Check the valid values. * src/parse-gram.y: Use %define parse.error. (PERCENT_ERROR_VERBOSE): New token. Support it. * src/scan-gram.l: Support %error-verbose. * doc/bison.texinfo (Decl Summary): Replace the documentation of %define error-verbose by that of %define parse.error. * NEWS: Document it. * tests/actions.at, tests/calc.at: Use parse.error instead of %error-verbose.
* Regen.Alex Rozenman2009-06-272-364/+387
|
* Named symbol references.Alex Rozenman2009-06-2714-87/+1162
| | | | | | | | | | | | | | | | | | | | | | | | | Discussed in: http://lists.gnu.org/archive/html/bison-patches/2009-01/msg00000.html http://lists.gnu.org/archive/html/bison-patches/2009-02/msg00002.html http://lists.gnu.org/archive/html/bison-patches/2009-03/msg00009.html * src/parse-gram.y: Add new syntax (named_ref.opt). * src/reader.c: Store named refs in symbol lists. * src/reader.h: New argument for symbol_append and action_append functions. * src/scan-code.h: Add new field (named_ref) into code_props data structure. Keeps named ref of midrule actions. * src/scan-code.l: Support for named refs in semantic action code. New function 'parse_named_ref'. * src/scan-gram.l: Support bracketed id. * src/symlist.c: Store named refs in symbol lists. * src/symlist.h: New field in symbol list: named_ref. * src/named-ref.h: New file, a struct for named_ref. * src/named-ref.cp: New file, named_ref_new function. * src/local.mk: Add two new files. * tests/testsuite.at: Include new test group: * tests/named-refs.at: this new file.
* hash: check insertion for memory exhaustion.Akim Demaille2009-06-252-2/+8
| | | | * src/uniqstr.c (uniqstr_new): New.
* variables: rename namespace as api.namespace.Akim Demaille2009-06-247-110/+196
| | | | | | | | | | | | | | | | | | | | Discussed in http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00033.html * data/bison.m4 (b4_percent_define_copy_, b4_percent_define_copy): New. (b4_percent_define_use): New. Use it where applicable. * data/c++.m4: Replace uses of the variable "namespace" by "api.namespace". Default the latter to the former. * doc/bison.texinfo (Decl Summary): Document "namespace" as obsolete. Document api.namespace. Use @samp to document %define uses, keep @code for identifiers. * NEWS: Likewise. * tests/c++.at, tests/input.at: Test api.namespace instead of namespace. (The tests passed with namespace.)
* style changes.Akim Demaille2009-06-115-21/+29
| | | | | | * data/xslt/xml2dot.xsl, data/xslt/xml2xhtml.xsl: Space changes. * src/print-xml.c: Style changes. * tests/conflicts.at: Comment changes.
* xml: beware of user strings used to give a %prec to rules.Akim Demaille2009-06-113-5/+30
| | | | | | * tests/conflicts.at (%prec with user strings): New. * src/gram.c (grammar_rules_print_xml): Escape the precedence for XML output.
* hash: check insertion for memory exhaustion.Akim Demaille2009-06-113-3/+13
| | | | | | * src/muscle-tab.c (muscle_insert, muscle_grow) * src/state.c (state_hash_insert): Check the return value of hash_insert.
* tests: honor TESTSUITEFLAGS in every check target.Akim Demaille2009-06-112-7/+15
| | | | | | * tests/local.mk (RUN_TESTSUITE): New. (check-local, installcheck-local, maintainer-check-g++) (maintainer-check-posix, maintainer-check-valgrind): Use it.
* gnulib: update.Akim Demaille2009-06-111-0/+0
| | | | | | | The previous patch accidently sent back gnulib in the past. Reported by Eric Blake. * gnulib: update to latest.
* deterministic test suite.Akim Demaille2009-06-103-15/+40
| | | | | | | | | | | | | | | | | Some consistency checks on symbols are performed after all the symbols were read, by an iteration over the symbol table. This traversal is nondeterministic, which can be a problem for test cases. Avoid this. Addresses another form of nondeterminism reported by Joel E. Denny. http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html * tests/input.at (Numbered tokens): Split the hexadecimal/decimal test in two. Use different file names for the three tests to make the maintenance easier.
* gnulib: update.Akim Demaille2009-06-107-2/+19
| | | | | | | | | | * 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.
* deterministic user-token-number redeclaration errors.Akim Demaille2009-06-105-9/+67
| | | | | | | | | | | Address nondeterminism reported by Joel E. Denny. http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html * src/uniqstr.h: Comment changes. * src/location.h (boundary_cmp, location_cmp): New. * src/symtab.c (user_token_number_redeclaration): New. (symbol_translation): Use it. * tests/input.at (Numbered tokens): Adjust the expected output.
* build: avoid ignored errors.Akim Demaille2009-05-252-6/+15
| | | | | * doc/local.mk ($(CROSS_OPTIONS_TEXI)): Don't generate ignored errors, they pollute the output.
* Convert multiple variable definition warnings to complaints.Joel E. Denny2009-05-236-35/+62
| | | | | | | | | | | | * NEWS (2.5): Add a new entry for that change. * doc/bison.texinfo (Decl Summary): Update %define entry. (Bison Options): Update -D/--define/-F/--force-define entry. * src/muscle-tab.c (muscle_percent_define_insert): Implement. * src/muscle-tab.h (muscle_percent_define_insert): Update comments. * tests/input.at (`%define errors'): Update. (`%define, --define, --force-define'): Update. (cherry picked from commit e3a33f7c23fc9febd1bbff33045c8b455a1972a8)
* -F/--force-define and relative %define/-D/--define priorities.Joel E. Denny2009-05-2311-241/+356
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * NEWS (2.5): Add documentation to -D/--define entry. * build-aux/cross-options.pl: Hard-code association of --force-define with %define. * doc/bison.texinfo (Decl Summary): In %define entry, cross-reference command-line options. (Bison Options): Add documentation to -D/--define entry. (Option Cross Key): Widen column for --force-define row. * src/getargs.c (usage): Document -F/--force-define. Realign options in output. (short_options, long_options, getargs): Parse -F/--force-define, and update muscle_percent_define_insert invocations. * src/muscle-tab.h (muscle_percent_define_how): New enum type. (muscle_percent_define_insert): Add argument with that type. * src/muscle-tab.c (muscle_percent_define_insert): Implement -F/--force-define behavior and priorities. (muscle_percent_define_ensure): Update muscle_percent_define_insert invocation. * src/parse-gram.y (prologue_declaration): Update muscle_percent_define_insert invocations. * tests/input.at (`%define, --define'): Rename to... (`%define, --define, --force-define'): ... this and extend. (cherry picked from commit 34d419381579dd30642e5646aaeaece36207be94) Conflicts: src/getargs.c src/parse-gram.c src/parse-gram.h src/parse-gram.y
* Update some comments to make sense for -D.Joel E. Denny2009-05-233-8/+17
| | | | | | | | | | | | * data/bison.m4 (b4_check_user_names): In header comments, say "user occurrence" instead of "grammar occurrence". * src/muscle-tab.h (muscle_percent_define_insert): Likewise. (muscle_percent_code_grow): Likewise just for consistency. (cherry picked from commit 246c4efafed178058a22b96d7a046340f6119057) Conflicts: src/muscle-tab.h
* * data/c++.m4 (b4_namespace_close): Simplify slightly.Joel E. Denny2009-05-202-2/+6
| | | | (cherry picked from commit e7bfa8b7211e2a02f4cec6f122b3141ad2ca97fb)
* Handle a trailing `:' in a user-supplied C++ namespace better.Joel E. Denny2009-05-192-1/+9
| | | | | | | | * data/c++.m4 (b4_namespace_close): Don't let it be printed among the closing braces here. This fix might make the generated code easier to debug, but otherwise it should be insignificant because a trailing `:' is a C++ error already. (cherry picked from commit 8c221795affd367ac106161610d42fc94633e3fd)
* remove useless variable.Akim Demaille2009-05-192-5/+7
| | | | | * src/getargs.c (skeleton_arg): Remove now useless variable. Should help the compiler see that this printf-like call is sane.
* Rename token.prefix as api.tokens.prefix.Akim Demaille2009-05-1510-55/+67
| | | | | | | | | | Discussed here. http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00024.html. * NEWS, data/bison.m4, data/c.m4, data/java.m4, doc/bison.texinfo, * tests/c++.at, tests/calc.at, tests/java.at, tests/local.at (token.prefix): Rename as... (api.tokens.prefix): this.
* doc: use C++ headers.Akim Demaille2009-05-112-2/+8
| | | | | * doc/bison.texinfo (Calc++ Scanner): Prefer C++ headers to C headers.
* doc: token.prefixAkim Demaille2009-05-113-27/+99
| | | | | | | | | | | * doc/bison.simple (Decl Summary): Document token.prefix. (Calc++ Parser): Various fixes. Formatting changes. Use token.prefix. Introduce a macro TOKEN to shorten the code and make it more readable. (Calc++ Scanner): Adjust. * NEWS (Variable token.prefix): New.
* tests: check token numbers.Akim Demaille2009-05-051-0/+37
| | | | * tests/input.at (Numbered tokens): New.
* bison: catch bad symbol names.Akim Demaille2009-05-043-4/+16
| | | | | * src/scan-gram.l({int}{id}): Report as an invalid identifier. * tests/input.at: Adjust.
* identifiers: dashes are letters.Akim Demaille2009-05-046-18/+33
| | | | | | | | | | | Dashes can now start identifiers (symbols and directives). * src/scan-gram.l ({letter}): Add dash. ({id}): Remove it. * tests/input.at (Symbols): Adjust. Remove stray comment. * tests/regression.at (Invalid inputs): Adjust error message. * doc/bison.texinfo (Symbols): Update.
* Declare %code to be a permanent feature.Joel E. Denny2009-05-013-11/+31
| | | | | | | | * NEWS (2.4.2): Here. * doc/bison.texinfo (Prologue Alternatives): Don't say it's experimental. (Decl Summary): Likewise. (cherry picked from commit cefb18280b83ea19b742a22f7be8661b518874b5)
* Convert underscores to dashes in some %define variable names.Joel E. Denny2009-04-3020-65/+164
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For now, just api.push-pull and lr.keep-unreachable-states. Maintain old names for backward compatibility. * NEWS (2.5): Document. * data/c.m4 (b4_identification): Update comment. * data/yacc.c: Update access. * doc/bison.texinfo: Update. * etc/bench.pl.in (bench_push_parser): Update use. * src/files.c (tr): Move to... * src/getargs.c, src/getargs.h (tr): ... here because I can't think of a better place to expose it. My logic is that, for all uses of tr so far, command-line arguments can be involved, and getargs.h is already included. * src/main.c (main): Update access. * src/muscle_tab.c (muscle_percent_define_insert): Convert old variable names to new variable names before assigning value. * src/reader.c (reader): Update setting default. * tests/calc.at: Update uses. * tests/conflicts.at (Unreachable States After Conflict Resolution): Update use. * tests/input.at (%define enum variables): Update use. (%define backward compatibility): New test group. * tests/push.at: Update uses. * tests/reduce.at: Update uses. * tests/torture.at: Update uses. (cherry picked from commit 812775a0391e122eff1983afea2da96c600c7307) Conflicts: data/c.m4 etc/bench.pl.in src/parse-gram.c src/parse-gram.h tests/conflicts.at
* Set all front-end %define defaults in one place.Joel E. Denny2009-04-303-3/+11
| | | | | | * src/main.c (main): Move lr.keep_unreachable_states default... * src/reader.c (reader): ... to here. (cherry picked from commit 1c4aa81df1fd11e2be5b2af78b4375f85bb2e59e)
* Rename lr.default_reductions to lr.default-reductions.Joel E. Denny2009-04-309-23/+35
| | | | | | | | | | | | * NEWS (2.5): Here. * doc/bison.texinfo: Here. * src/lalr.c (initialize_LA): Here. * src/print.c (print_reductions): Here. * src/reader.c (reader): Here. * src/tables.c (action_row): Here. * tests/input.at (%define enum variables): Here. * tests/reduce.at (AT_TEST_LR_DEFAULT_REDUCTIONS): Here. (cherry picked from commit 1d0f55cc843d6dfca01e2c13fd49ee2c119c6631)
* Pacify ./configure --enable-gcc-warnings.Joel E. Denny2009-04-292-3/+12
| | | | | | | | | * tests/input.at (Symbols): Prototype yyerror and yylex. (cherry picked from commit 0b59345789e88b34ec7e3a68b99d6fbd368cb798) Conflicts: ChangeLog
* Document how `%define "var" "value"' is not M4-friendly.Joel E. Denny2009-04-294-14/+21
| | | | | | | | | * src/parse-gram.y (variable): In comments here. (cherry picked from commit 904ea1bca411d4d5f4f729e7f2982841a858f5ea) Conflicts: src/parse-gram.c