summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* calc++: don't rely on Automake to compile a C++ parser.nextAkim Demaille2012-02-243-29/+54
| | | | | | | | | | Basically, revert commit 609b3d8096fb0cc1fa4d908b6e1a860ced260bda, it is currently too hard to use Automake to leave the extracted and generated files in the src tree. * examples/calc++/calc++-parser.hh: Remove. * examples/calc++/local.mk (examples/calc++/calc++-parser.stamp): New.
* avoid direct strncmp calls.Akim Demaille2012-02-233-4/+12
| | | | | | | | | | | | | | Before this change, bison would accept either .tab and _tab equivalently, whatever the current platform. Besides, it was not obeying everywhere to the possible definition of TAB_EXT to something else than .tab. For consistency, handle only TAB_EXT (".tab" on non DJGPP platforms). Support for "_tab" is neither documented, nor tested. * src/system.h (STRNCMP_LIT): New. From Jim Meyering. (STRPREFIX_LIT): New. * src/files.c, src/getargs.c: Use it.
* maint: use STREQ/STRNEQ.Akim Demaille2012-02-2315-34/+34
| | | | | | | | | | | | * doc/bison.texinfo: Space change. * src/system.h (STREQ, STRNEQ): New. * src/files.c, src/ielr.c, src/lalr.c, src/muscle-tab.c, * src/output.c, src/print.c, src/print_graph.c, * src/reader.c, src/scan-skel.l, src/tables.c, * src/uniqstr.c: Use them. * src/scan-gram.l: Do not use streq.h, use system.h's STREQ. * cfg.mk: The documentation is an exception.
* doc: fix environment issues.Akim Demaille2012-02-231-34/+34
| | | | | | | * doc/bison.texinfo: Do not use @verbatim, in particular when we use @group inside. Use @quotation instead of @display for frequently asked questions, it looks much nicer.
* maint: gitignore.Akim Demaille2012-02-222-0/+4
| | | | * examples/mfcalc/.gitignore, examples/rpcalc/.gitignore: Fix.
* regen.Akim Demaille2012-02-212-4/+4
| | | | * src/parse-gram.c, src/parse-gram.h: regen.
* tests: fix regressions.Akim Demaille2012-02-216-4/+6
| | | | | | | | | | Exit status 63 is documented for version-mismatch. * bootstrap.conf (gnulib_modules): Remove sysexits. * src/system.h (EX_MISMATCH): Define. * src/parse-gram.y (version_check): Use it instead of EX_CONFIG. Missing includes. * tests/calc.at, tests/named-refs.at: Include assert.h.
* tests: post-process stderr to normalize quotes.Akim Demaille2012-02-211-5/+17
| | | | | * tests/bison.in: Save bison's stderr, and convert gettextized quotes to plain ASCII.
* glr: fix ambiguity reports.Akim Demaille2012-02-212-2/+119
| | | | | | | | Fix a regression introduced in commit 783aa653f4ca70a75919c8516b950494c612cbfe. * tests/glr-regression.at (Ambiguity reports): New. * data/glr.c (yyreportTree): Fix an offset error.
* doc: stylistic improvements.Akim Demaille2012-02-191-18/+107
| | | | | * doc/bison.texinfo: Prefer "continue" to empty loop bodies. Add some @group/@end group to avoid poor page breaks.
* doc: check the rpcalc.Akim Demaille2012-02-197-15/+127
| | | | | | | | | | | | | * doc/bison.texinfo: Tag rpcalc.y snippets. Add missing includes. (Rpcalc Rules): Don't issue leading tabs. Complete an Info menu. Use @result. * examples/rpcalc/local.mk: New. * examples/rpcalc/rpcalc.test: New. * examples/local.mk: Use them. * examples/mfcalc/mfcalc.test: Remove dup test. * examples/test: Disable debug traces.
* regen.Akim Demaille2012-02-192-237/+237
| | | | * src/parse-gram.c, src/parse-gram.h: Regen.
* maint: address sc_prohibit_doubled_word.Akim Demaille2012-02-193-7/+6
| | | | | | * data/yacc.c, doc/bison.texinfo: Reword to avoid having to disable that check. * cfg.mk: No longer skip this test.
* maint: address sc_prohibit_always-defined_macros.Akim Demaille2012-02-192-8/+11
| | | | | | | * cfg.mk: No longer skip it, except where EXIT_SUCCESS is used as a witness for stdlib.h. Skip this test when appropriate. * data/yacc.c: Drop a note about why EXIT_SUCCESS is defined here.
* maint: address sc_bindtextdomain, sc_program_name and sc_prohibit_HAVE_MBRTOWC.Akim Demaille2012-02-197-13/+18
| | | | | | | | * bootstrap.conf (gnulib_modules): Require progname. * src/complain.c, src/getargs.c, src/getargs.h, src/main.c: Use it. * cfg.mk (exclude): New. Use it. Skip lib/main.c for bindtextdomain and set_program_name.
* maint: remove stray file.Akim Demaille2012-02-191-292/+0
| | | | * config.hin: Remove.
* bitset: fix an incorrect error message.Akim Demaille2012-02-192-1/+2
| | | | | * lib/bitset_stats.c: here. Reported by Stefano Lattarini.
* maint: remove trailing empty lines.Akim Demaille2012-02-184-7/+2
| | | | | | | | * cfg.mk: No longer skip sc_prohibit_empty_lines_at_EOF, except for parse-gram.h (generated). * examples/mfcalc/.gitignore, lib/.gitignore, m4/.gitignore, * po/.gitignore, runtime-po/.gitignore: Remove trailing/leading empty lines.
* maint: regen.Akim Demaille2012-02-182-355/+355
| | | | * src/parse-gram.c, src/parse-gram.h: regen.
* maint: avoid "magic number exit".Akim Demaille2012-02-1810-11/+18
| | | | | | | | | * cfg.mk (local-checks-to-skip): No longer skip it. * bootstrap.conf (gnulib_modules): Add sysexits. * doc/bison.texinfo, etc/bench.pl.in, src/parse-gram.y, * src/system.h, tests/calc.at, tests/named-refs.at: Use assert where appropriate instead of "if (...) exit". Use symbolic exit status elsewhere.
* maint: fix some syntax-check issues.Akim Demaille2012-02-1813-20/+6
| | | | | | | | | | | | | * cfg.mk (local-checks-to-skip): Remove sc_prohibit_quotearg_without_use, sc_prohibit_strcmp, sc_unmarked_diagnostics, sc_useless_cpp_parens. (sc_unmarked_diagnostics): Skip DJGPP. * data/yacc.c, src/LR0.c, src/closure.c, * src/flex-scanner.h, src/gram.c, src/lalr.c, * src/print-xml.c, src/print.c, src/print_graph.c, * src/reader.c, src/reduce.c, src/tables.c: Don't use parens with cpp's defined. Remove useless includes.
* maint: address a couple of syntax-check errors.Akim Demaille2012-02-186-13/+10
| | | | | | | | | | * cfg.mk (local-checks-to-skip): Remove sc_error_message_period and sc_error_message_uppercase. Address the uncovered issues. * po/POTFILES.in: Add missing files. * src/symtab.c: Remove useless includes. * lib/bitset_stats.c, src/files.c, tests/glr-regression.at: Use conformant error messages.
* maint: gnulib: upgrade.Akim Demaille2012-02-181-0/+0
|
* doc: mfcalc: fix includes.Akim Demaille2012-02-171-1/+1
| | | | * doc/bison.texinfo: math.h is needed early.
* examples: factor the test suite.Akim Demaille2012-02-177-130/+92
| | | | | | | | | | | | | * examples/mfcalc/test, examples/calc++/test: Extract the common bits into... * examples/test: here. (cwd): New. Use it to avoid a race on the temporary directory. Reported by Jim Meyering. * examples/mfcalc/test, examples/calc++/test: Rename into... * examples/mfcalc/mfcalc.test, examples/calc++/calc++.test: these. * examples/calc++/local.mk, examples/mfcalc/local.mk, * examples/local.mk: Adjust.
* examples: fix the test suites.Akim Demaille2012-02-172-20/+52
| | | | | | | | | | | | | * examples/calc++/test, examples/mfcalc/test (me): Be more meaningfull: include the example name. (prog): Factor. (run): Avoid printf, use echo. Add missing parens. (cleanup): New. Call it on trap. Remove the previous "rm" that did the cleanup. Move into a private directory to avoid concurrency issues. Reported by Jim Meyering.
* examples: link mfcalc with -lm for uses of pow, cos, atan, etc.Jim Meyering2012-02-171-0/+1
| | | | * examples/mfcalc/local.mk (examples_mfcalc_mfcalc_LDADD): Define.
* mfcalc: extract and exercise.Akim Demaille2012-02-164-0/+139
| | | | | | * examples/mfcalc/local.mk, examples/mfcalc/test: New, based on calc++'s ones. * examples/local.mk: Include mfcalc/local.mk.
* calc++: factor for other extracted tests.Akim Demaille2012-02-165-23/+26
| | | | | | | | | | | | * Makefile.am (TESTS, check_PROGRAMS): Initialize here. * examples/local.mk (doc, extexi): Define here. * examples/calc++/local.mk: Adjust accordingly. * configure.ac: Ask for parallel-tests (for the way the logs are handled). * examples/calc++/test: As a consequence, always be verbose. ($prog): New. (run): Use it. Sort the tests in a more natural order (simplest first).
* doc: mfcalc: send errors to stderr.Akim Demaille2012-02-161-23/+37
| | | | | | | * doc/bison.texinfo (Mfcalc Lexer): New. (Mfcalc Main): Move the definition of main and yyerror here, for clarity. Let yyerror report on stderr.
* doc: fix mfcalc code.Akim Demaille2012-02-162-21/+35
| | | | | | | | | * doc/bison.texinfo (Multi-function Calc): Add missing includes. Fix the rendering of the result: use @result and remove the initial tabulation in the actual code. Fix stylistic issues: avoid the , operator. Add extexi mark-up. * examples/extexi: Also support @smallexample.
* tests: c++: stylistic changes.Akim Demaille2012-02-161-5/+5
| | | | | * tests/c++.at: Don't use void for incoming arguments. Prefer cstdlib to stdlib.h.
* tests: avoid c++ failure due to lack of getenv declJim Meyering2012-02-161-1/+2
| | | | | | * tests/c++.at (Syntax error as exception): Avoid spurious failure at least when compiling with g++-4.7.x due to lack of declaration of getenv. Include <stdlib.h>.
* maint: trust Automake for parser headers.Akim Demaille2012-02-152-2/+0
| | | | | | * examples/calc++/local.mk, src/local.mk: Now that automake can see `-d' in AM_YFLAGS, we can rely on it to compile and ship the parser header files.
* maint: help Automake reading Yacc flags.Akim Demaille2012-02-151-1/+1
| | | | * Makefile.am (AM_YFLAGS): Automake looks for "-d" alone.
* calc++: rely on Automake.Akim Demaille2012-02-154-46/+41
| | | | | | | | | | | | | | | | | | | | | | | Rely on $(YACC) being the bison being built, and let Automake do the rest. It turned out to be much more difficult than anticipated, for various reasons, including some bad behavior from Automake 1.11.2 which (i) generates calc++-parser.h instead of calc++-parser.hh, and (ii) leaves an #include "y.tab.h" in the generated parser instead of #include "calc++-parser.h". The authors of Automake appear to be aware of the problem, http://lists.gnu.org/archive/html/automake/2011-05/msg00008.html so a simple work around will suffice for the time being. * examples/calc++/y.tab.h, examples/calc++/calc++-parser.hh: New. To work around Automake 1.11.2 issues. * examples/calc++/local.mk: Remove all the rules for compilation with bison, leave them to Automake. So provide it with "calc++-parse.yy" as a source file. (calc_sources_generated, calc_sources_extracted): Rename as. (calc_generated, calc_extracted): these. (calc_sources): New. Fix them.
* maint: tidy the Makefile a bit.Akim Demaille2012-02-142-11/+13
| | | | | | | | | * src/local.mk: Put yacc related variables together. (AUTOMAKE_OPTIONS): Move to... * Makefile.am: here. Remove an old Emacs mode request which disables Automake support. * src/local.mk (YACC, AM_YFLAGS): Move to... * Makefile.am: here, as they will be used by other local.mks.
* maint: de-recurse the handling of examplesAkim Demaille2012-02-148-55/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The directory was still using a local Makefile.am because it provides "scoped" Make variables: these examples are not meant to use the same CPPFLAGS etc. If we were to use the same -I set, we'd pick up gnulib's stdio.h for instance, which we do not want for these simple examples. Yet, as a result, the dependencies are less accurate, there is code duplication, etc. This is especially perceptible when trying to extract more examples from the documentation, as will be done in forthcoming changes. In order to make the tuning of CPPFLAGS easier, discard the predefined -I from Automake. * examples/calc++/Makefile.am: Rename as... * examples/calc++/local.mk: this. Adjust the paths which are now rooted in top_srcdir/top_builddir. Handle BISON_CXX_WORKS here, instead of the too crude previous approach that completely discarded the whole directory. ($(BISON)): Remove now useless bouncing recipe. (calc___CPPFLAGS): New. Stay away from -Ilib. * Makefile.am, configure.ac, examples/local.mk, * examples/calc++/test: Adjust. * configure.ac: Pass nostdinc to Automake. * src/local.mk, lib/local.mk (AM_CPPFLAGS): Move to... * Makefile.am: here. * src/local.mk, examples/calc++/Makefile.am (BISON, BISON_IN): Factor to... * Makefile.am: here. * tests/local.mk: Use it.
* variant: fix the example.Akim Demaille2012-02-141-1/+1
| | | | | * examples/variant.yy: Adjust to "assert" being now "parse.assert".
* maint: more authors.Akim Demaille2012-02-141-1/+16
| | | | | * AUTHORS: here. Suggested by Tys Lefering.
* maint: add license headers.Akim Demaille2012-02-146-0/+98
| | | | | | * examples/calc++/test, examples/variant.yy, AUTHORS, THANKS, * tests/atlocal.in, tests/bison.in: Add license headers. Reported by Tys Lefering.
* maint: remove obsolete file.Akim Demaille2012-02-141-16/+0
| | | | | * etc/make-ChangeLogs: Remove (used for rcs to cvs migration!). Reported by Tys Lefering.
* lalr1.cc: also handle syntax_error when calling yylex.Akim Demaille2012-02-104-7/+39
| | | | | | | | * data/lalr1.cc (parse): Catch syntax_error around yylex and forward them to errlab1. * tests/c++.at (Syntax error as exception): Check support for syntax exceptions raised by the scanner. * NEWS, doc/bison.texinfo: Document it.
* tests: lalr1.cc: check syntax_error.Akim Demaille2012-02-101-0/+75
| | | | * tests/c++.at (Syntax error as exception): New.
* tests: don't require locations uselessly.Akim Demaille2012-02-101-4/+3
| | | | | * tests/c++.at (Syntax error discarding no lookahead): Contrary to 2.5, C++ parsers can work without locations.
* maint: more silent rules.Akim Demaille2012-02-102-9/+12
| | | | | | | | | * tests/local.mk (TESTSUITE_AT): Include plackage.m4. Adjust dependencies. Make testsuite.at its first argument. (package.m4): Be silent. (testsuite): Be silent. Use $<.
* skeletons: simplify the protections against "unused" warnings.Akim Demaille2012-02-103-21/+15
| | | | | | | | | | | | | | * data/c.m4 (b4_parse_param_use): Also accept optional arguments to "use". Simplify callers. * data/glr.c (yyuserAction): Simplify use of b4_parse_param_use. (yy_reduce_print): Don't use b4_parse_param_use, as all the arguments _are_ used. * data/lalr1.cc (YY_SYMBOL_PRINT): Even when disabled, "use" the symbol argument. This neutralizes a warning in yypush_ when there are no symbols with a semantic values. (yy_destroy_): Remove useless "use" of yymsg.
* glr: formatting changes.Akim Demaille2012-02-101-4/+10
| | | | * data/glr.c: Split long strings.
* use a more consistent quoting style.Akim Demaille2012-02-0814-68/+73
| | | | | | | | | | | | | | | | See <http://lists.gnu.org/archive/html/bug-bison/2012-01/msg00120.html>. Use quotearg as often as possible instead of leaving the choice of the quotes to the translators. Use shorter messages. Factor similar messages to a single format, to make localization easier. * src/files.c, src/getargs.c, src/muscle-tab.c, src/reader.c * src/scan-code.l, src/scan-gram.l, src/symtab.c: Use quote() or quotearg_colon() on printf arguments instead of quotes in the format string. * data/bison.m4: Keep sync with the changes in muscle-tab.c. * tests/skeletons.at, tests/input.at, tests/regression.at: Adjust expected messages.
* maint: reenable sc_m4_quote_checkJim Meyering2012-01-312-2/+1
| | | | | * cfg.mk (local-checks-to-skip): Reenable sc_m4_quote_check. * m4/dmalloc.m4: Add quotes.