Commit Graph

855 Commits

Author SHA1 Message Date
Akim Demaille
f0942df01a version 3.5.91
* NEWS: Record release date.
2020-04-29 08:47:35 +02:00
Akim Demaille
99efa35369 doc: document YYEOF, YYUNDEF and YYerror
* doc/bison.texi (Special Tokens): New.
* examples/c/bistromathic/parse.y: Formatting changes.
2020-04-29 08:23:55 +02:00
Akim Demaille
cd4e799da4 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-28 07:54:07 +02:00
Akim Demaille
7346163840 dogfooding: use YYERRCODE in our scanner
* src/scan-gram.l: Use it.
* tests/input.at: Adjust.
2020-04-27 08:21:50 +02:00
Akim Demaille
b74fc07d21 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 12:16:57 +02:00
Akim Demaille
5c9f50b545 examples: bistromathic: shorten token description
* examples/c/bistromathic/parse.y: "number" is enough.
* doc/bison.texi: Likewise.
2020-04-24 19:03:12 +02:00
Akim Demaille
2831bd376f news: fix typo
Reported by Frank Heckenbach.
2020-04-19 08:20:57 +02:00
Akim Demaille
0a64b76430 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-18 10:59:05 +02:00
Akim Demaille
0b948b7696 version 3.5.90
* NEWS: Record release date.
2020-04-18 10:41:20 +02:00
Akim Demaille
d6ae95fb50 c++: give public access to the symbol kind
symbol_type::token () was removed: it returned the token kind of a
symbol.  To do that, one needs to convert from the symbol kind to the
token kind, which requires a table.

This broke some users' unit tests for scanners, see
https://lists.gnu.org/r/bug-bison/2020-01/msg00001.html
https://lists.gnu.org/r/bug-bison/2020-03/msg00020.html
https://lists.gnu.org/r/help-bison/2020-04/msg00005.html

Instead of making this possible again, let's check the symbol's kind
instead.  So give proper access to a symbol's kind.

That feature existed, undocumented, as 'type_get()'.  Let's rename
this as 'kind()'.

* data/skeletons/c++.m4, data/skeletons/glr.cc,
* data/skeletons/lalr1.cc (type_get): Rename as...
(kind): This.
(type_get): Install a backward compatibility alias.
* doc/bison.texi (Complete Symbols): Document symbol_type and
symbol_type::kind.
2020-04-18 08:03:59 +02:00
Akim Demaille
5d983253f7 doc: updates for 3.6
* doc/bison.texi: More s/token type/token kind/.
* NEWS: Update.
2020-04-16 08:44:36 +02:00
Akim Demaille
758172a8b9 doc: spell check
* doc/bison.texi, NEWS, README-hacking.md: here.
And elsewhere.
2020-04-13 18:50:05 +02:00
Akim Demaille
dc1035bada doc: promote YYEOF
* NEWS (Deep overhaul of the symbol and token kinds): New.
* doc/bison.texi: Promote YYEOF over "0" in scanners.
(Token Decl): No longer show YYEOF here, it now works by default.
(Token I18n): More details about YYEOF here.
(Calc++): Just use YYEOF.
2020-04-13 16:54:14 +02:00
Akim Demaille
5839f4d289 c: rename yyexpected_tokens as yypcontext_expected_tokens
The user should think of yypcontext fields as accessible only via
yypcontext_* functions.  So let's rename yyexpected_tokens to reflect
that.

Let's _not_ rename yyreport_syntax_error, as the user may define this
function, and is not allowed to access directly the fields of
yypcontext_t: she *must* use the "accessors".  This is comparable to
the case of C++/Java where the user defines
parser::report_syntax_error, not parser::context::report_syntax_error.

* data/skeletons/glr.c, data/skeletons/yacc.c (yyexpected_tokens):
Rename as...
(yypcontext_expected_tokens): this.
Adjust dependencies.
2020-04-12 19:23:40 +02:00
Akim Demaille
04d62346f3 doc: refer to the token kind rather than the token type
* doc/bison.texi: Replace occurrences of "token type" with "token
kind".
Stop referring to the "macro definitions" of the token kinds, just
name them "definitions".
2020-04-05 19:14:39 +02:00
Akim Demaille
2c05fc750a c, c++: rename yysymbol_type_t as yysymbol_kind_t
See https://lists.gnu.org/r/bison-patches/2020-04/msg00031.html

* data/skeletons/c.m4, data/skeletons/glr.c, data/skeletons/yacc.c
(yysymbol_type_t): Rename as...
(yysymbol_kind_t): this.
Adjust dependencies.
* data/skeletons/c++.m4, data/skeletons/glr.cc, data/skeletons/lalr1.cc
(symbol_type_type): Rename as...
(symbol_kind_type): this.
Adjust dependencies.
2020-04-05 14:56:18 +02:00
Akim Demaille
7aee4586ca Merge branch 'maint'
* maint:
  maint: post-release administrivia
  version 3.5.4
  examples: reccalc: really compile cleanly in C99
  news: announce that Bison 3.6 drops YYERROR_VERBOSE
  news: update for 3.5.4
  style: fix spellos
  typo: succesful -> successful
  package: improve the readme
  java: check and fix support for api.token.raw
  java: style: prefer 'int[] foo' to 'int foo[]'
  build: fix syntax-check issues
  tests: recheck: work properly when the test suite was interrupted
  doc: c++: promote api.token.raw
  build: fix compatibility with old compilers
  examples: reccalc: compile cleanly in C99
2020-04-05 09:38:15 +02:00
Akim Demaille
6c44f2dce3 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-05 09:27:36 +02:00
Akim Demaille
5604903f7a version 3.5.4
* NEWS: Record release date.
2020-04-05 09:08:30 +02:00
Akim Demaille
225a67321b news: update the yyreport_syntax_error example
* examples/c/bistromathic/parse.y, tests/local.at
(yyreport_syntax_error): Fix use of YYSYMBOL_YYEMPTY.
* NEWS: Update.
2020-04-05 08:56:23 +02:00
Akim Demaille
4e26809ab9 style: rename yysyntax_error_arguments as yy_syntax_error_arguments
It's a private implementation detail.

* NEWS, data/skeletons/glr.c, data/skeletons/lalr1.cc,
* data/skeletons/yacc.c, doc/bison.texi: here.
2020-04-05 08:56:21 +02:00
Akim Demaille
76e11b5a3e c: rename yyparse_context_t as yypcontext_t
The first name is too long.  We already have `yypstate`, so
`yypcontext` is ok.  We are also migrating to using `*_t` for our
types.

* NEWS, data/skeletons/glr.c, data/skeletons/yacc.c, doc/bison.texi,
* examples/c/bistromathic/parse.y, src/parse-gram.y, tests/local.at:
(yyparse_context_t, yyparse_context_location, yyparse_context_token):
Rename as...
(yypcontext_t, yypcontext_location, yypcontext_token): these.
2020-04-04 19:20:29 +02:00
Akim Demaille
961ea2ac85 news: announce that Bison 3.6 drops YYERROR_VERBOSE
* NEWS: here.
2020-04-04 14:52:58 +02:00
Akim Demaille
cc6e5cf854 news: update for 3.5.4 2020-04-04 10:56:47 +02:00
Akim Demaille
44ac18d136 yacc.c: yypstate_expected_tokens
In push parsers, when asking for the list of expected tokens at some
point, it makes no sense to build a yyparse_context_t: the yypstate
alone suffices (the only difference being the lookahead).  Instead of
forcing the user to build a useless shell around yypstate, let's offer
yypstate_expected_tokens.

See https://lists.gnu.org/r/bison-patches/2020-03/msg00025.html.

* data/skeletons/yacc.c (yypstate): Declare earlier, so that we can
use it for...
(yypstate_expected_tokens): this new function, when in push parsers.
Adjust dependencies.
* examples/c/bistromathic/parse.y: Simplify: use
yypstate_expected_tokens.
Style fixes.
Reduce scopes (reported by Joel E. Denny).
2020-03-17 19:20:13 +01:00
Akim Demaille
951da960e6 merge branch 'maint'
* upstream/maint:
  maint: post-release administrivia
  version 3.5.3
  news: update for 3.5.3
  yacc.c: make sure we properly propagated the user's number for error
  diagnostics: don't crash because of repeated definitions of error
  style: initialize some struct members
  diagnostics: beware of zero-width characters
  diagnostics: be sure to close the styling when lines are too short
  muscles: fix incorrect decoding of $
  code: be robust to reference with invalid tags
  build: fix typo
  doc: update recommandation for libtextstyle
  style: comment changes
  examples: use consistently the GFDL header for readmes
  style: remove useless declarations
  typo: succesful -> successful
  README: point to tests/bison, and document --trace
  gnulib: update
  maint: post-release administrivia
2020-03-08 10:13:16 +01:00
Akim Demaille
15ea35019f maint: post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
2020-03-08 08:50:10 +01:00
Akim Demaille
f49684a577 version 3.5.3
* NEWS: Record release date.
2020-03-08 08:30:41 +01:00
Akim Demaille
044ad1288c news: update for 3.5.3 2020-03-08 08:17:13 +01:00
Akim Demaille
5789f9d91e examples: bistromathic: demonstrate the use of yyexpected_tokens
Let's use GNU readline and its TAB autocompletion to demonstrate the
use of yyexpected_tokens.

This shows a number of weaknesses in our current approach:

- some macros (yyssp, etc.) from push parsers "leak" in user code, we
  need to undefine them

- the context needed by yyexpected_tokens does not need the token,
  yypstate actually suffices

- yypstate is not properly setup when first allocated, which results
  in a crash of yyexpected_tokens if fired before a first token was
  read.  We should move initialization from yypush_parse into
  yypstate_new.

* examples/c/bistromathic/parse.y (yylex): Take input as a string, not
a file.
(EXIT): New token.
(input): Adjust to work only on a line.
(line): Remove.
(symbol_count, process_line, expected_tokens, completion)
(init_readline): New.
* examples/c/bistromathic/bistromathic.test: Adjust expectations.
2020-03-01 12:31:39 +01:00
Akim Demaille
388e12ac0f examples: lexcalc: demonstrate location tracking
The bistromathic example should not use Flex, it makes it too complex.
But it was the only example to show location tracking with Flex.

* examples/c/lexcalc/lexcalc.test, examples/c/lexcalc/parse.y,
* examples/c/lexcalc/scan.l: Demonstrate location tracking as is done
in bistromathic.
2020-02-29 12:15:19 +01:00
Victor Morales Cayuela
e09a72eeb0 diagnostics: modernize the display of submessages
Since Bison 2.7, output was indented four spaces for explanatory
statements.  For example:

    input.y:2.7-13: error: %type redeclaration for exp
    input.y:1.7-11:     previous declaration

Since the introduction of caret-diagnostics, it became less clear.
Remove the indentation and display submessages as in GCC:

    input.y:2.7-13: error: %type redeclaration for exp
        2 | %type <float> exp
          |       ^~~~~~~
    input.y:1.7-11: note: previous declaration
        1 | %type <int> exp
          |       ^~~~~

* src/complain.h (SUB_INDENT): Remove.
(warnings): Add "note" to the enum.
* src/complain.h, src/complain.c (complain_indent): Replace by...
(subcomplain): this.
Adjust all dependencies.
* tests/actions.at, tests/diagnostics.at, tests/glr-regression.at,
* tests/input.at, tests/named-refs.at, tests/regression.at:
Adjust expectations.
2020-02-15 08:28:40 +01:00
Akim Demaille
3ed42d2487 Merge tag 'v3.5.2'
bison 3.5.2

* tag 'v3.5.2':
  version 3.5.2
  news: 3.5.2
  gnulib: update
  doc: update Doxygen template
  java: avoid trailing white spaces
  m4: fix b4_token_format
  doc: clearly state that %yacc only makes sense with yacc.c
  doc: spell check
  examples: be more robust to spaces in paths
  larlr1.cc: Reject unsupported values for parse.lac
2020-02-13 19:19:11 +01:00
Akim Demaille
26c5f48c1c maint: post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
2020-02-13 19:11:16 +01:00
Akim Demaille
7f921d18dd version 3.5.2
* NEWS: Record release date.
2020-02-13 18:25:21 +01:00
Akim Demaille
cc3760ef51 news: 3.5.2
* NEWS: Update.
2020-02-13 18:25:11 +01:00
Akim Demaille
48be689a73 java: examples: split in two
* examples/java: Split in...
* examples/java/simple, examples/java/calc: these.
2020-02-05 13:17:00 +01:00
Akim Demaille
23ba9e5dfa doc: document new features of parse.error
* doc/bison.texi (Error Reporting): Rename as...
(Error Reporting Function): this.
Adjust dependencies.
Make it a subsection of this...
(Error Reporting): new section.
(Syntax Error Reporting Function): New.
(parse.error): Update description.
2020-02-02 09:19:58 +01:00
Akim Demaille
ebe427bbf3 Merge branch 'maint'
* maint:
  maint: post-release administrivia
  version 3.5.1
  news: update
  CI: use ICC again
  warnings: pacify ICC in lalr1.cc
  test: report.at: avoid tiny new failure
  git: update ignores
2020-01-19 14:50:09 +01:00
Akim Demaille
7e3a513d88 maint: post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
2020-01-19 14:35:50 +01:00
Akim Demaille
57f64ebbf8 version 3.5.1
* NEWS: Record release date.
2020-01-19 14:17:48 +01:00
Akim Demaille
c8d997cb5f news: update 2020-01-19 14:10:46 +01:00
Akim Demaille
c67daa9a97 package: bump copyrights to 2020
Run 'make update-copyright'.
2020-01-10 19:16:23 +01:00
Akim Demaille
8036635251 package: bump copyrights to 2020
Run 'make update-copyright'.
2020-01-05 10:26:35 +01:00
Akim Demaille
da4587fcd7 doc: YYERROR_VERBOSE is no longer supported
* doc/bison.texi (Table of Symbols): Remove last reference to it.
* NEWS: Be clear about that.
2020-01-04 09:14:19 +01:00
Akim Demaille
3bad20352c maint: post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
2019-12-11 07:57:45 +01:00
Akim Demaille
cb3bf6493d version 3.5
* NEWS: Record release date.
2019-12-11 07:41:51 +01:00
Akim Demaille
57503e2165 news: prepare for 3.5 2019-12-10 07:06:04 +01:00
Akim Demaille
9141f0b79f maint: post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
2019-12-08 09:29:24 +01:00
Akim Demaille
d57eab87e8 version 3.4.92
* NEWS: Record release date.
2019-12-08 09:12:30 +01:00