Compare commits

..
8 Commits
Author SHA1 Message Date
Akim Demaille 307fcdee00 version 3.6
* NEWS: Record release date.
2020-05-08 09:57:14 +02:00
Akim Demaille d26d10ad6c 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 09:45:29 +02:00
Akim Demaille 1b4108da3e regen 2020-05-08 09:45:29 +02:00
Akim Demaille 53bfc7df94 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 09:02:45 +02:00
Akim Demaille a5fb4a88ef news: prepare for 3.6 2020-05-08 07:34:30 +02:00
Akim Demaille 54df196d49 doc: complete the table of symbols
* doc/bison.texi: Add YYEMPTY, YYEOF and YYUNDEF.
2020-05-08 07:34:30 +02:00
Akim Demaille 52bb6f0525 doc: clarify the glossary item about kinds
* doc/bison.texi (Glossary): here.
2020-05-07 08:38:58 +02:00
Akim Demaille 76dab18af3 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 08:48:05 +02:00
8 changed files with 76 additions and 62 deletions
+1 -1
View File
@@ -1 +1 @@
3.5.93
3.5.94
+13 -38
View File
@@ -1,43 +1,6 @@
GNU Bison NEWS
* Noteworthy changes in release 3.5.94 (2020-05-06) [beta]
Portability issues.
* Noteworthy changes in release 3.5.93 (2020-05-03) [beta]
Portability issues.
* Noteworthy changes in release 3.5.92 (2020-05-03) [beta]
Portability issues.
More documentation.
Backward compatibility issues with C++.
* Noteworthy changes in release 3.5.91 (2020-04-29) [stable]
** New features
*** Returning the error token
When the scanner returns an invalid token or the undefined token
(YYUNDEF), the parser generates an error message and enters error
recovery. Because of that error message, most scanners that find lexical
errors generate an error message, and then ignore the invalid input
without entering the error-recovery.
The scanners may now return YYerror, the error token, to enter the
error-recovery mode without triggering an additional error message. See
the bistromathic for an example.
*** The bistromathic features internationalization
Its way to build the error message is more general and is easy to use in
other projects.
* Noteworthy changes in release 3.5.90 (2020-04-18) [beta]
* Noteworthy changes in release 3.6 (2020-05-08) [stable]
** Backward incompatible changes
@@ -142,6 +105,18 @@ GNU Bison NEWS
It makes little sense to use this feature without enabling LAC (lookahead
correction).
*** Returning the error token
When the scanner returns an invalid token or the undefined token
(YYUNDEF), the parser generates an error message and enters error
recovery. Because of that error message, most scanners that find lexical
errors generate an error message, and then ignore the invalid input
without entering the error-recovery.
The scanners may now return YYerror, the error token, to enter the
error-recovery mode without triggering an additional error message. See
the bistromathic for an example.
*** Deep overhaul of the symbol and token kinds
To avoid the confusion with types in programming languages, we now refer
+27 -6
View File
@@ -7666,11 +7666,11 @@ recovery.
In either case, the rest of the action is not executed.
@end deffn
@deffn {Macro} YYEMPTY
@deffn {Value} YYEMPTY
Value stored in @code{yychar} when there is no lookahead token.
@end deffn
@deffn {Macro} YYEOF
@deffn {Value} YYEOF
Value stored in @code{yychar} when the lookahead is the end of the input
stream.
@end deffn
@@ -14700,6 +14700,14 @@ is given a nonzero value, the parser will output information on input
symbols and parser action. @xref{Tracing}.
@end deffn
@deffn {Value} YYEMPTY
The pseudo token kind when there is no lookahead token.
@end deffn
@deffn {Value} YYEOF
The token kind denoting is the end of the input stream.
@end deffn
@deffn {Macro} yyerrok
Macro to cause parser to recover immediately to its normal mode
after a syntax error. @xref{Error Recovery}.
@@ -14856,6 +14864,10 @@ should not be confused with the @emph{symbol kinds}, used internally by the
parser.
@end deffn
@deffn {Value} YYUNDEF
The token kind denoting an unknown token.
@end deffn
@node Glossary
@appendix Glossary
@@ -14942,12 +14954,21 @@ A continuous flow of data between devices or programs.
@item Kind
``Token'' and ``symbol'' are each overloaded to mean either a grammar symbol
(kind) or all parse info (kind, value, location) associated with occurrences
of that grammar symbol from the input. To disambiguate, we use ``token
kind'' and ``symbol kind'' to mean both grammar symbols and the types that
represent them in a base programming language (C, C++, etc.). However, we
use ``token'' and ``symbol'' without the word ``kind'' to mean parsed
of that grammar symbol from the input. To disambiguate,
@itemize
@item
we use ``token kind'' and ``symbol kind'' to mean both grammar symbols and
the values that represent them in a base programming language (C, C++,
etc.). The names of the types of these values are typically
@code{token_kind_t}, or @code{token_kind_type}, or @code{TokenKind},
depending on the programming language.
@item
we use ``token'' and ``symbol'' without the word ``kind'' to mean parsed
occurrences, and we append the word ``type'' to refer to the types that
represent them in a base programming language.
@end itemize
In summary: When you see ``kind'', interpret ``symbol'' or ``token'' to mean
a @emph{grammar symbol}. When you don't see ``kind'' (including when you
+4 -4
View File
@@ -131,7 +131,7 @@ dist_man_MANS = $(top_srcdir)/%D%/bison.1
EXTRA_DIST += $(dist_man_MANS:.1=.x)
MAINTAINERCLEANFILES += $(dist_man_MANS)
# Differences to ignore when comparing the man page (the date).
# Differences to ignore when comparing man pages (the date).
remove_time_stamp = \
sed 's/^\(\.TH[^"]*"[^"]*"[^"]*\)"[^"]*"/\1/'
@@ -144,15 +144,15 @@ endif
# have the real thing, so if there's a .git directory, fail hard.
#
# We shouldn't need this, but on some OS the timestamps in the tarball
# leaves us no choice. See
# leave us no choice. See
# https://lists.gnu.org/r/bug-bison/2020-05/msg00055.html.
$(top_srcdir)/%D%/bison.1: $(MAN_DEPS)
$(AM_V_GEN)if $(HELP2MAN) --version >/dev/null 2>&1; then \
$(HELP2MAN) \
--include=$(top_srcdir)/%D%/bison.x \
--output=$@.tmp tests/bison && \
$(remove_time_stamp) $@ >$@a.tmp 2>/dev/null && \
$(remove_time_stamp) $@.tmp >$@b.tmp 2>/dev/null && \
{ $(remove_time_stamp) $@ >$@a.tmp || true; } && \
$(remove_time_stamp) $@.tmp >$@b.tmp && \
if diff $@a.tmp $@b.tmp >/dev/null 2>&1; then \
touch $@; \
else \
+17 -8
View File
@@ -41,10 +41,11 @@ echo >perfect '> 0
echo >ok '0'
echo '0' | prog >effective
if diff perfect effective >/dev/null 2>&1; then
echo "checking for readline output"
if diff perfect effective; then
# Alles ist gut.
strip_prompt=false
elif diff ok effective >/dev/null 2>&1; then
elif diff ok effective; then
strip_prompt=true
else
skip "this is not the GNU Readline we expect"
@@ -257,14 +258,22 @@ err: Cleanup: popping nterm input (1.1-4: )' -p
# From now on, the differences between versions of GNU Readline are
# too painful to try to cope with.
if $strip_prompt; then
echo "SKIP: this is not the GNU Readline we expect"
if $exit; then
exit 0
else
exit 1
fi
echo "SKIP: this is not the GNU Readline we expect"
exit $status
fi
# On Windows10/MSYS2 the ^G coming from <tab> completion is not
# emitted the same way
# (https://lists.gnu.org/r/bug-bison/2020-05/msg00076.html).
echo "checking for kernel name"
case `uname -s` in
(MSYS*)
echo "SKIP: this is Windows/MSYS"
exit $status
;;
esac
# Check completion after an operator.
sed -e 's/\\t/ /g' >input <<EOF
(1+\t\t
+9 -2
View File
@@ -34,6 +34,13 @@ cwd=$(pwd)
# See bistromathic.test.
strip_prompt=false
# If diff supports --strip-trailing-cr, use it, to avoid EOL issues
# when testing Java programs on Windows.
echo "checking for diff --strip-trailing-cr"
if diff --strip-trailing-cr "$1" "$1"; then
diff_opts=--strip-trailing-cr
fi
# The exercised program.
abs_medir=$cwd/examples/$medir
if test -x "$abs_medir/$me"; then
@@ -129,7 +136,7 @@ run ()
} >eff
if test $sta_eff -eq $sta_exp; then
if diff eff exp >/dev/null 2>&1; then
if diff $diff_opts eff exp >/dev/null 2>&1; then
echo "$me: PASS: $number"
else
echo "$me: FAIL: $number"
@@ -140,7 +147,7 @@ run ()
echo "$me: effective output:"
sed -e 's/^/ /' eff
echo "$me: diff:"
diff -u exp eff | sed -e 's/^/ /'
diff $diff_opts -u exp eff | sed -e 's/^/ /'
status=1
fi
else
+4 -2
View File
@@ -1,4 +1,4 @@
/* A Bison parser, made by GNU Bison 3.5.93. */
/* A Bison parser, made by GNU Bison 3.6. */
/* Bison implementation for Yacc-like parsers in C
@@ -49,7 +49,7 @@
#define YYBISON 1
/* Bison version. */
#define YYBISON_VERSION "3.5.93"
#define YYBISON_VERSION "3.6"
/* Skeleton name. */
#define YYSKELETON_NAME "yacc.c"
@@ -1632,6 +1632,8 @@ yypcontext_expected_tokens (const yypcontext_t *yyctx,
yyarg[yycount++] = yysym;
}
}
if (yyarg && yycount == 0 && 0 < yyargn)
yyarg[0] = YYSYMBOL_YYEMPTY;
return yycount;
}
+1 -1
View File
@@ -1,4 +1,4 @@
/* A Bison parser, made by GNU Bison 3.5.93. */
/* A Bison parser, made by GNU Bison 3.6. */
/* Bison interface for Yacc-like parsers in C