2020-05-10  Akim Demaille  <akim.demaille@gmail.com>

	version 3.6.1
	* NEWS: Record release date.

2020-05-10  Akim Demaille  <akim.demaille@gmail.com>

	c++: style: reorder generated code
	The implementation of yy::parser::symbol_name is emitted even before
	the implementation of yy::parser::parser.  This makes little sense.

	* data/skeletons/lalr1.cc (symbol_name): Move its implementation in
	the same place as in the class definition: after "error" and before
	"context".

2020-05-10  Akim Demaille  <akim.demaille@gmail.com>

	c++: provide yy::parser::symbol_type::name
	* data/skeletons/c++.m4 (yy::parser::basic_symbol::name): New.
	* data/skeletons/lalr1.cc (yy_print_): Use it.
	* doc/bison.texi: Document.
	* tests/c++.at: Check.

2020-05-10  Akim Demaille  <akim.demaille@gmail.com>

	c++: make parser::symbol_name public
	Reported by Martin Blais <blais@furius.ca>.
	https://lists.gnu.org/r/help-bison/2020-05/msg00005.html

	* data/skeletons/lalr1.cc (symbol_name): Make it public.
	Add a private hidden hook to enable testing of private parts.
	* tests/local.at (AT_DATA_GRAMMAR_PROLOGUE): Help Emacs find the right
	language mode.
	* tests/c++.at (C++ Variant-based Symbols Unit Tests): Check that we
	can read symbol_name.

2020-05-10  Akim Demaille  <akim.demaille@gmail.com>

	examples: beware of ~/.inputrc
	* examples/c/bistromathic/bistromathic.test: here.

2020-05-10  Akim Demaille  <akim.demaille@gmail.com>

	build: also provide lzip compressed tarballs
	Suggested by Matias Fonzo <selk@dragora.org>.

	* cfg.mk: Post announcements to bison-announce.
	* configure.ac: Build lzip packages.
	* .travis.yml: Build only xz, we don't care about the other formats
	here.

2020-05-10  Akim Demaille  <akim.demaille@gmail.com>

	style: minor fixes
	* examples/c/README.md: here.

2020-05-09  Akim Demaille  <akim.demaille@gmail.com>

	yacc.c: restore ansi-c compatibility
	Reported by neok-m4700.
	https://github.com/akimd/bison/issues/37

	* data/skeletons/yacc.c: Don't use // comments.

2020-05-08  Akim Demaille  <akim.demaille@gmail.com>

	maint: post-release administrivia
	* NEWS: Add header line for next release.
	* .prev-version: Record previous version.
	* cfg.mk (old_NEWS_hash): Auto-update.

2020-05-08  Akim Demaille  <akim.demaille@gmail.com>

	version 3.6
	* NEWS: Record release date.

2020-05-08  Akim Demaille  <akim.demaille@gmail.com>

	examples: beware of portability issue on Windows
	Reported by Jannick.
	https://lists.gnu.org/r/bug-bison/2020-05/msg00040.html
	https://lists.gnu.org/r/bug-bison/2020-05/msg00066.html

	* examples/test (diff_opts): Use --strip-trailing-cr if supported, to
	avoid \n vs. \r\n issues.
	* examples/c/bistromathic/bistromathic.test: When on MSYS, don't try
	to check autocompletion.

2020-05-08  Akim Demaille  <akim.demaille@gmail.com>

	regen

2020-05-08  Akim Demaille  <akim.demaille@gmail.com>

	doc: fix the generation of the man page
	When there is no bison.1 at all, the procedure fails.

	* doc/local.mk (bison.1): Be robust to cold starts.

2020-05-08  Akim Demaille  <akim.demaille@gmail.com>

	news: prepare for 3.6

2020-05-08  Akim Demaille  <akim.demaille@gmail.com>

	doc: complete the table of symbols
	* doc/bison.texi: Add YYEMPTY, YYEOF and YYUNDEF.

2020-05-07  Akim Demaille  <akim.demaille@gmail.com>

	doc: clarify the glossary item about kinds
	* doc/bison.texi (Glossary): here.

2020-05-06  Akim Demaille  <akim.demaille@gmail.com>

	maint: post-release administrivia
	* NEWS: Add header line for next release.
	* .prev-version: Record previous version.
	* cfg.mk (old_NEWS_hash): Auto-update.

2020-05-06  Akim Demaille  <akim.demaille@gmail.com>

	version 3.5.94
	* NEWS: Record release date.

2020-05-06  Akim Demaille  <akim.demaille@gmail.com>

	doc: document yypstate_expected_tokens
	* doc/bison.texi (Push Parser Interface): Here.

2020-05-06  Akim Demaille  <akim.demaille@gmail.com>

	doc: restructure the push parser documentation
	I don't think it's fair to have yypstate_new, yypstate_delete,
	yypush_parse and yypull_parse to have their own section, on par with
	yyparse and yylex.  Let them be in a single section about push
	parsers.  And show new/delete first.

	* doc/bison.texi (Push Parser Interface): New.
	Fuse the aforementioned sections into it.

2020-05-06  Akim Demaille  <akim@lrde.epita.fr>

	all: fix the interface of yyexpected_tokens
	The user gives yyexpected_tokens a limit: the max number of tokens she
	wants to hear about.  That's because an error message that reports a
	bazillion of possible tokens is useless.

	In that case yyexpected_tokens returned 0, so the user would not know
	if there are too many expected tokens or none (yes, that's possible).

	There are several ways to tell the user in which situation she's in:

	- return some E2MANY, a negative value.  Then it makes the pattern

	    int argsize = yypcontext_expected_tokens (ctx, arg, ARGS_MAX);
	    if (argsize < 0)
	      return argsize;

	  no longer valid, as for E2MANY (i) the user must generate the error
	  message anyway, and (ii) she should not return E2MANY

	- return ARGS_MAX + 1.  Then it makes it dangerous for the user, as
	  she has to iterate update `min (ARGS_MAX, argsize)`.

	Returning 0 is definitely simpler and safer for the user, as it tells
	her "this is not an error, just generate your message without a list
	of expecting tokens".  So let's still return 0, but set arg[0] to the
	empty token when the list is really empty.

	* data/skeletons/glr.c, data/skeletons/lalr1.cc, data/skeletons/lalr1.java
	* data/skeletons/yacc.c (yyexpected_tokens): Put the empty symbol
	first if there are no possible tokens at all.
	* examples/c/bistromathic/parse.y: Demonstrate how to use that.

2020-05-05  Akim Demaille  <akim.demaille@gmail.com>

	examples: fix handling of syntax errors
	The shell grammar does not allow empty statements in then/else part of
	an if, but examples/test failed to catch the syntax errors from the
	script it ran.  So exited with success anyway.

	You would expect 'set -e' to suffice, but with bash 3.2 actually it
	does not.  As a matter of fact, I could find a way to have this behave
	properly:

	    $ cat test.sh
	    set -e
	    cleanup ()
	    {
	      status=$?
	      echo "cleanup: $status"
	      exit $status
	    }
	    trap cleanup 0 1 2 13 15
	    . $1
	    s=$?
	    echo "test.sh: $s"
	    exit $s

	    $ cat bistro.test
	    if true; then
	    fi

	    $ /bin/sh ./test.sh ./bistro.test
	    ./bistro.test: line 2: syntax error near unexpected token `fi'
	    cleanup: 0
	    $ echo $?
	    0

	Remove the set -e (or the trap), and tada, it works...  So we have to
	deal with the error by hand.

	* examples/test ($exit): Replace with...
	($status): this.
	Preserve the exit status of the test case.
	* examples/c/bistromathic/bistromathic.test: Fix syntax error.

2020-05-04  Akim Demaille  <akim.demaille@gmail.com>

	doc: beware of timestamp issues on Haiku
	On Haiku, help2man is fired on a freshly extracted tarball.
	Reported by Bruno Haible.
	https://lists.gnu.org/r/bug-bison/2020-05/msg00055.html

	* doc/local.mk (bison.1): Be robust to a missing help2man.

2020-05-04  Akim Demaille  <akim.demaille@gmail.com>

	tests: beware of wchar_t portability issues on AIX
	https://lists.gnu.org/r/bug-bison/2020-05/msg00050.html
	Reported by Bruno Haible.

	* tests/diagnostics.at: here.

2020-05-04  Akim Demaille  <akim.demaille@gmail.com>

	glr.c: beware of portability issues with PTRDIFF_MAX
	For instance test 386, "glr.cc api.value.type={double}":

	    types.at:366: $CXX $CXXFLAGS $CPPFLAGS  $LDFLAGS -o test test.cc $LIBS
	    stderr:
	    test.cc: In function 'ptrdiff_t yysplitStack(yyGLRStack*, ptrdiff_t)':
	    test.cc:490:4: error: 'PTRDIFF_MAX' was not declared in this scope
	       (PTRDIFF_MAX < SIZE_MAX ? PTRDIFF_MAX : YY_CAST (ptrdiff_t, SIZE_MAX))
	        ^
	    test.cc:1805:37: note: in expansion of macro 'YYSIZEMAX'
	           ptrdiff_t half_max_capacity = YYSIZEMAX / 2 / state_size;
	                                         ^~~~~~~~~
	    test.cc:490:4: note: suggested alternative: '__PTRDIFF_MAX__'
	       (PTRDIFF_MAX < SIZE_MAX ? PTRDIFF_MAX : YY_CAST (ptrdiff_t, SIZE_MAX))
	        ^
	    test.cc:1805:37: note: in expansion of macro 'YYSIZEMAX'
	           ptrdiff_t half_max_capacity = YYSIZEMAX / 2 / state_size;
	                                         ^~~~~~~~~

	The failing tests are using glr.cc only, which I don't understand, the
	problem is rather in glr.c, so I would expect glr.c tests to also fail.

	Reported by Bruno Haible.
	https://lists.gnu.org/archive/html/bug-bison/2020-05/msg00053.html

	* data/skeletons/yacc.c: Move the block that defines
	YYPTRDIFF_T/YYPTRDIFF_MAXIMUM, YYSIZE_T/YYSIZE_MAXIMUM, and
	YYSIZEOF to...
	* data/skeletons/c.m4 (b4_sizes_types_define): Here.
	(b4_c99_int_type): Also take care of the #undefinition of short.
	* data/skeletons/yacc.c, data/skeletons/glr.c: Use
	b4_sizes_types_define.
	* data/skeletons/glr.c: Adjust to use YYPTRDIFF_T/YYPTRDIFF_MAXIMUM,
	YYSIZE_T/YYSIZE_MAXIMUM.

2020-05-04  Akim Demaille  <akim.demaille@gmail.com>

	todo: update

2020-05-04  Akim Demaille  <akim.demaille@gmail.com>

	examples: beware of strnlen portability issues
	One function missing on Solaris 10 Sparc:

	     CCLD     examples/c/bistromathic/bistromathic
	    Undefined                       first referenced
	    symbol                             in file
	    strnlen                             examples/c/bistromathic/bistromathic-parse.o
	    ld: fatal: symbol referencing errors. No output written to examples/c/bistromathic/bistromathic

	Reported by Dagobert Michelsen.
	https://lists.gnu.org/r/bug-bison/2020-05/msg00048.html

	* examples/c/bistromathic/parse.y (xstrndup): Don't use strnlen.
	xstrndup is assembled from gnulib's xstrndup, strndup and strnlen...

2020-05-04  Akim Demaille  <akim.demaille@gmail.com>

	examples: beware of portability issues with sh's trap
	On AIX 7.2, when invoking "exit 77", we actually exit with 127.  The
	"cleanup" function, called via trap, received an incorrect exit
	status, something described in Autoconf's doc.
	Reported by Bruno Haible.
	https://lists.gnu.org/archive/html/bug-bison/2020-05/msg00029.html
	https://lists.gnu.org/archive/html/bug-bison/2020-05/msg00047.html

	* examples/test (skip): New.
	* examples/c/bistromathic/bistromathic.test,
	* examples/c/reccalc/reccalc.test: Use it, to ensure $? is set to 77
	when the trap is called.

2020-05-04  Akim Demaille  <akim.demaille@gmail.com>

	tests: beware of portability issues with diff -u
	AIX 7.1 supports diff -u, but its output does not match the expected
	one.
	Reported by Bruno Haible.
	https://lists.gnu.org/r/bug-bison/2020-05/msg00049.html

	* tests/atlocal.in (DIFF_U_WORKS): New.
	* tests/local.at (AT_DIFF_U_CHECK): New.
	* tests/existing.at (_AT_TEST_EXISTING_GRAMMAR): Use AT_DIFF_U_CHECK.

2020-05-03  Akim Demaille  <akim.demaille@gmail.com>

	maint: post-release administrivia
	* NEWS: Add header line for next release.
	* .prev-version: Record previous version.
	* cfg.mk (old_NEWS_hash): Auto-update.

2020-05-03  Akim Demaille  <akim.demaille@gmail.com>

	version 3.5.93
	* NEWS: Record release date.

2020-05-03  Akim Demaille  <akim.demaille@gmail.com>

	news: update for 3.5.93

2020-05-03  Akim Demaille  <akim.demaille@gmail.com>

	gnulib: update

2020-05-03  Akim Demaille  <akim.demaille@gmail.com>

	tests: really skip tricky multichar test on Cygwin
	In Autotest, anything outside AT_SETUP/AT_CLEANUP is discarded.

	* tests/diagnostics.at (AT_TEST): Accept a skip-if test.
	Use it to skip on cygwin.

2020-05-03  Akim Demaille  <akim.demaille@gmail.com>

	bistromathic: beware of portability issues of readline on AIX
	Readline may emit escape sequences before the prompt.
	Reported by Bruno Haible.
	https://lists.gnu.org/r/platform-testers/2020-05/msg00001.html.

	* examples/c/bistromathic/bistromathic.test: Trust readline _only_ if
	we get what we expect on some reference computation.

2020-05-03  Akim Demaille  <akim.demaille@gmail.com>

	examples: beware of portability issues with cmp
	As someone wrote nearly 20 years ago in Autoconf's documentation,
	don't use cmp to compare text files, but diff.
	https://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=abad4f0576a7dc361e5385e19c7681449103cdb1
	Reported by Jannick.

	* examples/test: Use diff, not cmp.

2020-05-03  Akim Demaille  <akim.demaille@gmail.com>

	build: fix warnings (shown on IRIX)
	Appearing on IRIX with gcc -mabi=n32.
	Reported by Bruno Haible.
	https://lists.gnu.org/r/bug-bison/2020-05/msg00039.html

	* examples/c++/variant-11.yy, examples/c/bistromathic/parse.y: Don't
	give chars to isdigit, cast them to unsigned char before.
	* src/complain.c: Use c_isdigit.
	* src/fixits.c (fixits_run): Avoid casts.
	* src/lalr.c (goto_print): Use %zu for a size_t.

2020-05-03  Akim Demaille  <akim.demaille@gmail.com>

	c++: be compatible with the pre-3.6 way to get a symbol's kind
	Reported by Pramod Kumbhar.
	https://lists.gnu.org/r/bug-bison/2020-05/msg00025.html

	* data/skeletons/c++.m4: here.

2020-05-03  Akim Demaille  <akim.demaille@gmail.com>

	bistromathic: beware of portability issues with strndup
	Reported by Dagobert Michelsen.
	https://lists.gnu.org/r/bug-bison/2020-05/msg00026.html

	* examples/c/bistromathic/parse.y (xstrndup): New.
	Use it.

2020-05-03  Akim Demaille  <akim.demaille@gmail.com>

	flex: fix incorrect use of Automake conditional
	AM_CONDITIONAL does _not_ define a shell variable...
	Reported privately by Denis Excoffier.

	* configure.ac (LEX_CXX_WORKS): Fix its definition.

2020-05-03  Bruno Haible  <bruno@clisp.org>

	package: fix a link error on IRIX
	https://lists.gnu.org/r/bug-bison/2020-05/msg00035.html

	* src/local.mk (src_bison_LDADD): Mention libbison.a before, not after, the
	system libraries.

2020-05-03  Akim Demaille  <akim.demaille@gmail.com>

	bistromathic: beware of portability of readline
	Don't try to build bistromathic if we don't have readline.
	Reported by Bruno Haible.
	https://lists.gnu.org/r/bug-bison/2020-05/msg00028.html

	* configure.ac (ENABLE_BISTROMATHIC): New.
	* examples/c/bistromathic/local.mk: Use it.
	* examples/c/bistromathic/bistromathic.test: Exit 77 for skip.

2020-05-03  Akim Demaille  <akim.demaille@gmail.com>

	tests: beware of portability issues of sh
	"foo || bar" does not invoke bar on AIX 7.2 when foo does not exist.
	It just dies.
	Reported by Bruno Haible.
	https://lists.gnu.org/r/bug-bison/2020-05/msg00029.html

	* examples/c/reccalc/reccalc.test: Check for seq in a subshell.

2020-05-03  Akim Demaille  <akim.demaille@gmail.com>

	maint: post-release administrivia
	* NEWS: Add header line for next release.
	* .prev-version: Record previous version.
	* cfg.mk (old_NEWS_hash): Auto-update.

2020-05-03  Akim Demaille  <akim.demaille@gmail.com>

	version 3.5.92
	* NEWS: Record release date.

2020-05-03  Akim Demaille  <akim.demaille@gmail.com>

	news: update for 3.5.92

2020-05-03  Akim Demaille  <akim.demaille@gmail.com>

	gnulib: update

2020-05-03  Akim Demaille  <akim.demaille@gmail.com>

	java: demonstrate push parsers
	* data/skeletons/lalr1.java (Location): Make it a static class.
	(Lexer.yylex, Lexer.getLVal, Lexer.getStartPos, Lexer.getEndPos):
	These are not needed in push parsers.
	* examples/java/calc/Calc.y: Demonstrate push parsers in the Java.
	* doc/bison.texi: Push parsers have been supported for a long time,
	remove incorrect statements stating the opposite.

2020-05-03  Akim Demaille  <akim.demaille@gmail.com>

	doc: clarify what a location is
	Reported by Arthur Schwarz <aschwarz1309@att.net>
	https://lists.gnu.org/r/help-bison/2013-12/msg00009.html

	* doc/bison.texi (Location Type): here.

2020-05-03  Akim Demaille  <akim.demaille@gmail.com>

	tests: beware of mbswidth portability issues
	Shy away from these issues on Cygwin.
	Reported Denis Excoffier.
	https://lists.gnu.org/r/bug-bison/2020-05/msg00003.html

	* tests/diagnostics.at (Tabulations and multibyte characters): Split
	in two.

2020-05-03  Akim Demaille  <akim.demaille@gmail.com>

	examples: beware of intl portability issues
	Reported by Horst von Brand.
	https://lists.gnu.org/r/bug-bison/2020-04/msg00033.html

	* examples/c/bistromathic/Makefile: libintl might not be needed, but
	libm probably is.
	* examples/c/bistromathic/parse.y: Include locale.h.

2020-05-03  Akim Demaille  <akim.demaille@gmail.com>

	examples: beware of portability issues with readline
	On OpenBSD 6.5, the prompt is repeated, but not the actual command
	line...  Don't try to cope with that.
	Reported by Bruno Haible.
	https://lists.gnu.org/r/bug-bison/2020-05/msg00015.html

	* examples/c/bistromathic/bistromathic.test: Skip when readline behave
	this way.

2020-05-03  Akim Demaille  <akim.demaille@gmail.com>

	examples: beware of the portability of flex --header-file
	The option --header was introduced in version 2.5.6.
	The option --header-file was introduced in version 2.6.4.
	Reported by Bruno Haible.
	https://lists.gnu.org/r/bug-bison/2020-05/msg00013.html

	So use --header, and do bother with versions that don't support it.

	* m4/flex.m4: Check whether flex supports --header.
	* configure.ac (FLEX_WORKS, FLEX_CXX_WORKS): Set to false if it doesn't.
	* * examples/c/reccalc/local.mk, examples/c/reccalc/Makefile:
	Use --header rather than --header-file.

2020-05-03  Akim Demaille  <akim.demaille@gmail.com>

	c++: provide backward compatibility on by_type
	To write unit tests for their scanners, some users depended on
	symbol_type::token():

	    Lexer lex("12345");
	    symbol_type t = lex.nextToken();
	    assert(t.token() == token::INTLIT);
	    assert(t.value.as<int>() == 12345);

	But symbol_type::token() was removed in Bison 3.5 because it relied on
	a conversion table.  So users had to find other patterns, such as

	    assert(t.type_get() == by_type(token::INTLIT).type_get());

	which relies on several private implementation details.

	As part of transitioning from "token type" to "token kind", and making
	this a public and documented interface, "by_type" was renamed
	"by_kind" and "type_get()" was renamed as "kind()".  The latter had
	backward compatibility mechanisms, not the former.

	In Bison 3.6 none of this should be used, but rather

	    assert(t.kind() == symbol_kind::S_INTLIT);

	Reported by Pramod Kumbhar.
	https://lists.gnu.org/r/bug-bison/2020-05/msg00012.html

	* data/skeletons/c++.m4 (by_type): Make it an alias to by_kind.

2020-05-02  Akim Demaille  <akim.demaille@gmail.com>

	yacc.c: improve formatting of the generated code
	* data/skeletons/yacc.c (yy_reduce_print): here.

2020-05-02  Akim Demaille  <akim.demaille@gmail.com>

	doc: java supports push parsers since 3.0 (2013-07-25)
	* doc/bison.texi: Clarify this.

2020-05-02  Akim Demaille  <akim.demaille@gmail.com>

	java: fix coding style
	I don't plan to fix everything in one go.  But this was in the way of
	the next commit.

	* data/skeletons/lalr1.java: Avoid space before parens.
	* tests/java.at: Adjust.

2020-05-02  Akim Demaille  <akim.demaille@gmail.com>

	style: comment changes
	* tests/java.at: here.

2020-05-02  Akim Demaille  <akim.demaille@gmail.com>

	todo: more

2020-05-02  Akim Demaille  <akim.demaille@gmail.com>

	style: more documentation about errs
	Suggested by Angelo Borsotti.
	https://lists.gnu.org/r/bug-bison/2014-02/msg00003.html

	* src/state.h: here.

2020-05-01  Akim Demaille  <akim.demaille@gmail.com>

	doc: document the exit status
	Suggested by Alexandre Duret-Lutz.
	https://lists.gnu.org/r/bug-bison/2013-09/msg00015.html

	* doc/bison.texi (Invocation): Here.

2020-05-01  Akim Demaille  <akim.demaille@gmail.com>

	java: add missing i18n requests
	* data/skeletons/lalr1.java (reportSyntaxError): Here.

2020-05-01  Akim Demaille  <akim.demaille@gmail.com>

	java: style: fix coding style of yyerror/reportSyntaxError
	* data/skeletons/lalr1.java: here.

2020-05-01  Akim Demaille  <akim.demaille@gmail.com>

	java: avoid useless work
	* data/skeletons/lalr1.java (yySymbolPrint): Avoid the computation of
	the argument if useless.
	While at it, fix Java coding style.

2020-05-01  Akim Demaille  <akim.demaille@gmail.com>

	java: comment changes
	* data/skeletons/lalr1.java, examples/java/calc/Calc.y: here.

2020-05-01  Akim Demaille  <akim.demaille@gmail.com>

	news: make it more consistent
	* NEWS: Use the same pattern for titles.

2020-05-01  Akim Demaille  <akim.demaille@gmail.com>

	c++: use modern idioms to make classes non-copyable
	Reported by Don Macpherson.
	https://lists.gnu.org/r/bug-bison/2019-05/msg00015.html
	https://github.com/akimd/bison/issues/36

	* data/skeletons/lalr1.cc, data/skeletons/stack.hh,
	* data/skeletons/variant.hh: Delete the copy-ctor and the copy operator.

2020-04-30  Akim Demaille  <akim.demaille@gmail.com>

	yacc.c: avoid the use of a temporary
	* data/skeletons/yacc.c: Use YYLLOC_DEFAULT directly with the final
	destination.

2020-04-29  Akim Demaille  <akim.demaille@gmail.com>

	maint: post-release administrivia
	* NEWS: Add header line for next release.
	* .prev-version: Record previous version.
	* cfg.mk (old_NEWS_hash): Auto-update.

2020-04-29  Akim Demaille  <akim.demaille@gmail.com>

	version 3.5.91
	* NEWS: Record release date.

2020-04-29  Akim Demaille  <akim.demaille@gmail.com>

	build: fix syntax-check issues
	* cfg.mk: We do want to gettextize the examples.
	* po/POTFILES.in: Adjust.

2020-04-29  Akim Demaille  <akim.demaille@gmail.com>

	gnulib: update

2020-04-29  Akim Demaille  <akim.demaille@gmail.com>

	doc: document YYEOF, YYUNDEF and YYerror
	* doc/bison.texi (Special Tokens): New.
	* examples/c/bistromathic/parse.y: Formatting changes.

2020-04-29  Akim Demaille  <akim.demaille@gmail.com>

	package: fix distcheck
	Bison emits strings to translate in the generated code, for builtin
	tokens.  So they appear only in generated parsers, which are not
	shipped, so they are not in the src tree, so we cannot use them in our
	POTFILE.

	Except src/parse-gram.c, which is in the source tree.  And even in the
	git repo.  But to avoid useless diffs in the repo, we do not keep the
	src/parse-gram.c _with_ the #lines.  This is done in a dist-hook which
	regenerates src/parse-gram.c when we run "make dist".

	Unfortunately, then, update-po traverses the whole tree and sees that
	the location of the strings to translate in src/parse-gram.c have
	changed, so the bison.pot is to be updated.  And that is not possible
	in the "make dist" which is run within "make distcheck"
	(not the one preparing the dist for distcheck, the one run by
	distcheck to check that a distributed tarball can build a tarball)
	because then the src tree is read-only.

	So let's not put src/parse-gram.c in the POTFILE, and expose these
	strings to gettextize by hand.

	* src/i18n-strings.c: New.
	* po/POTFILES.in: Add it, and remove src/parse-gram.c.

2020-04-29  Akim Demaille  <akim.demaille@gmail.com>

	style: avoid gettextize warnings
	* src/scan-gram.l, src/scan-skel.l: Help it see the start and end of
	"character literals".

2020-04-29  Akim Demaille  <akim.demaille@gmail.com>

	tests: beware of portability of readline
	* examples/test: here.

2020-04-28  Akim Demaille  <akim.demaille@gmail.com>

	yacc.c: install backward compatibility for YYERRCODE
	Some people have been using that symbol.  Some even have #defined it
	themselves.
	https://lists.gnu.org/r/bison-patches/2020-04/msg00138.html

	Let's provide backward compatibility, having it point to YYUNDEF, so
	that an error message is generated.

	* data/skeletons/yacc.c (YYERRCODE): New, at the exact same location
	it was defined before.

2020-04-28  Akim Demaille  <akim.demaille@gmail.com>

	style: c++: s/type/kind/ where appropriate
	These are internal details.  `type_get ()` is still there to ensure
	backward compatibility, `kind ()` being the modern way.

	* data/skeletons/c++.m4 (by_type, by_type::type): Rename as...
	(by_kind, by_kind::kind_): this.
	Adjust dependencies.

2020-04-28  Akim Demaille  <akim.demaille@gmail.com>

	java: clean up the definition of token kinds
	From

	    public interface Lexer {
	      /* Token kinds.  */
	      /** Token number, to be returned by the scanner.  */
	      static final int YYEOF = 0;
	      /** Token number, to be returned by the scanner.  */
	      static final int YYERRCODE = 256;
	      /** Token number, to be returned by the scanner.  */
	      static final int YYUNDEF = 257;
	      /** Token number, to be returned by the scanner.  */
	      static final int BANG = 258;
	    ...
	      /** Deprecated, use b4_symbol(0, id) instead.  */
	      public static final int EOF = YYEOF;

	to

	    public interface Lexer {
	      /* Token kinds.  */
	      /** Token "end of file", to be returned by the scanner.  */
	      static final int YYEOF = 0;
	      /** Token error, to be returned by the scanner.  */
	      static final int YYerror = 256;
	      /** Token "invalid token", to be returned by the scanner.  */
	      static final int YYUNDEF = 257;
	      /** Token "!", to be returned by the scanner.  */
	      static final int BANG = 258;
	    ...
	      /** Deprecated, use YYEOF instead.  */
	      public static final int EOF = YYEOF;

	* data/skeletons/java.m4 (b4_token_enum): Display the symbol's tag in
	comment.
	* data/skeletons/lalr1.java: Address overquotation issue.
	* examples/java/calc/Calc.y, examples/java/simple/Calc.y: Use YYEOF,
	not EOF.

2020-04-28  Akim Demaille  <akim.demaille@gmail.com>

	error: rename the error token from YYERRCODE to YYerror
	See https://lists.gnu.org/r/bison-patches/2020-04/msg00162.html.

	* data/skeletons/bison.m4, data/skeletons/c.m4, data/skeletons/glr.cc,
	* data/skeletons/lalr1.java, doc/bison.texi,
	* examples/c/bistromathic/parse.y, src/scan-gram.l, src/symtab.c
	(YYERRCODE): Rename as...
	(YYerror): this.
	Adjust dependencies.

2020-04-27  Akim Demaille  <akim.demaille@gmail.com>

	dogfooding: use YYERRCODE in our scanner
	* src/scan-gram.l: Use it.
	* tests/input.at: Adjust.

2020-04-27  Akim Demaille  <akim.demaille@gmail.com>

	scanner: avoid spurious errors about empty character literals
	On an invalid character literal such as "'\777'" we used to produce
	two errors:

	    input.y:2.9-12: error: invalid number after \-escape: 777
	    input.y:2.8-13: error: empty character literal

	Get rid of the second one.

	* src/scan-gram.l (STRING_GROW_ESCAPE): New.
	* tests/input.at: Adjust.

2020-04-27  Akim Demaille  <akim.demaille@gmail.com>

	scanner: bad character literals are errors
	* src/scan-gram.l: These are errors, not warnings.
	* tests/input.at: Adjust.

2020-04-27  Akim Demaille  <akim.demaille@gmail.com>

	regen

2020-04-26  Akim Demaille  <akim.demaille@gmail.com>

	todo: update

2020-04-26  Akim Demaille  <akim.demaille@gmail.com>

	all: don't emit an error message when the scanner returns YYERRCODE
	I'm quite pleased to see that the tricky case of glr.c was already
	prepared by the changes to support syntax_error exceptions.  Better
	yet, it is actually syntax_error that becomes a special case of the
	general pattern: make yytoken be YYERRCODE.

	* data/skeletons/glr.c (YYFAULTYTOK): Remove the now useless (Basil)
	Faulty token.
	Instead, use the error token.
	* data/skeletons/lalr1.d, data/skeletons/lalr1.java: When computing
	the action, first check the case of the error token.

	* tests/calc.at: Check cases for the error token symbols before and
	after it.

2020-04-26  Akim Demaille  <akim.demaille@gmail.com>

	c: don't emit an error message when the scanner returns YYERRCODE
	* data/skeletons/yacc.c (yyparse): When the scanner returns YYERRCODE,
	go directly to error recovery (yyerrlab1).
	However, don't keep the error token as lookahead, that token is too
	special.
	* data/skeletons/lalr1.cc: Likewise.

	* examples/c/bistromathic/parse.y (yylex): Use that feature to report
	nicely invalid characters.
	* examples/c/bistromathic/bistromathic.test: Check that.
	* examples/test: Neutralize gratuitous differences such as rule
	position.

	* tests/calc.at: Check that case in C only.
	The other case seem to be working, but that's an illusion that the
	next commit will address (in fact, they can enter endless loops, and
	report the error several times anyway).

2020-04-26  Akim Demaille  <akim.demaille@gmail.com>

	examples: bistromathic: demonstrate error recovery
	* examples/c/bistromathic/parse.y: here.
	* examples/c/bistromathic/bistromathic.test: Check it.
	Included a stupid case where the error is actually ignored.

2020-04-26  Akim Demaille  <akim.demaille@gmail.com>

	examples: bistromathic: when quitting, close the current line
	When the user ctrl-d the line, we left the cursor not at col 0.
	Let's fix that.
	This revealed a few short-comings in the testing framework.

	* examples/test (run): Also display the diffs.
	And support -n.
	* examples/c/bistromathic/bistromathic.test
	* examples/c/bistromathic/parse.y

2020-04-26  Akim Demaille  <akim.demaille@gmail.com>

	examples: bistromathic: comment changes
	* examples/c/bistromathic/parse.y: here.

2020-04-26  Akim Demaille  <akim.demaille@gmail.com>

	doc: hacking tricks
	* README-hacking.md: Here.

2020-04-26  Akim Demaille  <akim.demaille@gmail.com>

	c++: make valid to print the empty symbol
	* data/skeletons/lalr1.cc (yy_print_): here.

2020-04-26  Akim Demaille  <akim.demaille@gmail.com>

	c++: always define symbol_name
	* data/skeletons/lalr1.cc (symbol_name): Always define it, even when
	it's actually yytname which is used.

2020-04-26  Akim Demaille  <akim.demaille@gmail.com>

	c++: fix a few style issues
	* data/skeletons/lalr1.cc (yystack_print_, yy_reduce_print_): Add
	missing const.
	(yystack_print_): Rename as...
	(yy_stack_print_): this.
	* data/skeletons/glr.cc (yy_symbol_value_print_, yy_symbol_print_):
	Add missing const.

2020-04-26  Akim Demaille  <akim.demaille@gmail.com>

	all: prefer YYERRCODE to YYERROR
	We will not keep YYERRCODE anyway, it causes backward compatibility
	issues.  So as a first step, let all the skeletons use that name,
	until we have a better one.

	* data/skeletons/bison.m4, data/skeletons/glr.c,
	* data/skeletons/glr.cc, data/skeletons/lalr1.cc,
	* data/skeletons/lalr1.d, data/skeletons/lalr1.java,
	* data/skeletons/yacc.c, doc/bison.texi, tests/headers.at,
	* tests/input.at:
	here.

2020-04-26  Akim Demaille  <akim.demaille@gmail.com>

	style: glr.c: clarify
	* data/skeletons/glr.c: Make the code a bit clearer.

2020-04-26  Akim Demaille  <akim.demaille@gmail.com>

	style: prefer b4_has_translations_if
	* data/skeletons/glr.c, data/skeletons/yacc.c: here.

2020-04-26  Akim Demaille  <akim.demaille@gmail.com>

	style: glr.c: fix indentation issue
	* data/skeletons/glr.c (yyparse): here.

2020-04-26  Akim Demaille  <akim.demaille@gmail.com>

	style: fix a few remaining 'type' instead of 'kind'
	* data/skeletons/glr.c, data/skeletons/yacc.c (YY_SYMBOL_PRINT):
	Here.

2020-04-26  Akim Demaille  <akim.demaille@gmail.com>

	skeletons: make the warning about implementation details clearer
	* data/skeletons/bison.m4 (b4_disclaimer): Here.
	* data/skeletons/lalr1.d, data/skeletons/lalr1.java: Use it.

2020-04-25  Akim Demaille  <akim.demaille@gmail.com>

	style: c: fix a few minor issues about indentation of cpp directives
	* README-hacking.md: More about cpp.
	* data/skeletons/c.m4, data/skeletons/yacc.c: Style changes.

2020-04-25  Akim Demaille  <akim.demaille@gmail.com>

	bench: store in benches/012 rather than in benches/12
	* etc/bench.pl.in ($basedir): New.
	Format $count with a least three digits.

2020-04-25  Akim Demaille  <akim.demaille@gmail.com>

	bench: minor improvements
	* etc/bench.pl.in: Don't force parse.error=detailed
	Use a simpler way to display the pseudo %bison directive.
	(&bench_with_gbenchmark): Give details about the compiler.

2020-04-25  Akim Demaille  <akim.demaille@gmail.com>

	style: clarify #endif
	We could try to avoid the weird "#if 1", but then the indentation of
	the inner #if would be wrong.  Let' keep it this way.

	* data/skeletons/yacc.c: here.
	Also, avoid sticking the comment to the directive.

2020-04-25  Akim Demaille  <akim.demaille@gmail.com>

	style: minor fixes
	* data/skeletons/bison.m4, doc/bison.texi: Spell check.
	* examples/c/bistromathic/parse.y (N_): Remove, now useless.

2020-04-24  Akim Demaille  <akim.demaille@gmail.com>

	examples: bistromathic: shorten token description
	* examples/c/bistromathic/parse.y: "number" is enough.
	* doc/bison.texi: Likewise.

2020-04-24  Akim Demaille  <akim.demaille@gmail.com>

	examples: bistromathic: demonstrate internationalization
	Currently it was only using stubs.  Let's actually translate the
	strings using gettext.

	* examples/c/bistromathic/local.mk: Define LOCALEDIR, BISON_LOCALEDIR
	and link with libintl.
	* examples/c/bistromathic/parse.y: Use them.
	Remove useless includes.
	Take ENABLE_NLS into account.
	(error_format_string): New.
	(yyreport_syntax_error): Rewrite to rely on a format string, which is
	more appropriate for internationalization.
	* examples/c/bistromathic/Makefile: We no longer use Flex.
	We need readline and intl.

	* doc/bison.texi: Point to bistromathic for a better option for
