Compare commits

..
99 Commits
Author SHA1 Message Date
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 2f23ca6f65 gnulib: update 2020-02-13 08:18:12 +01:00
Akim Demaille 468b68c5cd doc: update Doxygen template
* Doxyfile.in: Run doxygen -u on it.
2020-02-13 08:18:12 +01:00
Akim Demaille 9ed802a026 java: avoid trailing white spaces
* data/skeletons/java.m4 (b4_maybe_throws): Issue a space before when needed.
* data/skeletons/lalr1.java: Avoid trailing spaces.
2020-02-13 08:18:12 +01:00
Akim Demaille fb554c2804 m4: fix b4_token_format
We used to emit:

    /** Token number,to be returned by the scanner.  */
    static final int NUM = 258;
    /** Token number,to be returned by the scanner.  */
    static final int NEG = 259;

with no space after the comma.  Fix that.

* data/skeletons/bison.m4 (b4_token_format): Quote where appropriate.
2020-02-13 08:18:11 +01:00
Akim Demaille 47850d4f58 doc: clearly state that %yacc only makes sense with yacc.c
* doc/bison.texi: here.
2020-02-13 08:18:11 +01:00
Akim Demaille 57b035a242 doc: spell check
* doc/bison.texi: here.
2020-02-13 08:18:11 +01:00
Akim Demaille 1587a5ea9b examples: be more robust to spaces in paths
Reported by Nikki Valen.
https://lists.gnu.org/r/bug-bison/2020-01/msg00032.html

* examples/test ($prog): Remove, replaced by...
(prog): This new function, which pays attention to quoting shell
variables.
2020-01-21 07:01:34 +01:00
Adrian VogelsgesangandAkim Demaille 4ab2cf7450 larlr1.cc: Reject unsupported values for parse.lac
Just as the yacc.c skeleton, the lalr1.cc skeleton should reject
invalid values for parse.lac.

* data/skeletons/lalr1.cc: check validity of parse.lac
* tests/input.at: new test cases
2020-01-21 06:57:21 +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 61b8a8def5 CI: use ICC again
See https://github.com/nemequ/icc-travis/issues/15.
Thanks to Jeff Hammond and Evan Nemerson for their help.

* configure.ac (warn_common): Disable dubious warnings.
* .travis.yml: Use ICC again.
2020-01-19 11:36:47 +01:00
Akim Demaille 6990c5bde9 warnings: pacify ICC in lalr1.cc
See 139d065594.

* data/skeletons/yacc.c: If I might be a char, write a[+I] instead of
a[I], so that ICC does not complain.
2020-01-19 11:35:26 +01:00
Jim MeyeringandAkim Demaille 27e822abfd test: report.at: avoid tiny new failure
Be robust to newer versions of Autoconf where the package URL defaults
to https instead of http.

* configure.ac (AC_INIT): Use https.
* tests/report.at: Adjust expected output s/http/https/
to match updated URL.
2020-01-19 10:03:01 +01:00
Akim Demaille 21ba496083 git: update ignores 2020-01-19 10:02:55 +01:00
Akim Demaille 9cf0a97aa9 gnulib: update 2020-01-11 06:03:51 +01:00
Akim Demaille 3dec8a4caf lalr1.cc: avoid static_cast
Reported by donmac703.
Fixes https://github.com/akimd/bison/issues/20.

* data/skeletons/lalr1.cc: here.
2020-01-10 19:31:00 +01:00
Akim Demaille 2cb52c5a91 glr.c: add missing cast
Reported by psjo.
Fixes https://github.com/akimd/bison/issues/19.

* data/skeletons/glr.c (yyprocessOneStack): Here.
2020-01-10 19:30:54 +01:00
Akim Demaille 04f3bfc596 regen 2020-01-10 19:21:35 +01:00
Akim Demaille c67daa9a97 package: bump copyrights to 2020
Run 'make update-copyright'.
2020-01-10 19:16:23 +01:00
Akim Demaille 2ca8e86f83 gitignore: update 2020-01-10 19:16:16 +01:00
Akim Demaille 78bb152a63 tests: also check -Wchar-subscripts
GCC's -Wchar-subscripts may report issues on platforms where char is
unsigned.  Unfortunately the current CI does not reproduce the
problem.  But that would allow contributors to report issues if the
warning appears somewhere.

See 139d065594.
Problem reported by Andy Fiddaman in:
https://lists.gnu.org/r/bug-bison/2019-12/msg00021.html

* configure.ac (warn_common): Add -Wchar-subscripts.
2019-12-31 12:00:02 +01:00
Akim Demaille 4d6ff4c5e5 CI: do not specify the language
When we give travis the langugage, it overrides our envvars.  Instead
of the MATRIX_EVAL trick, just stop specifying the language.
2019-12-30 15:28:15 +01:00
Akim Demaille 9bb5087ad1 CI: remove ICC support, we can no longer use it
https://github.com/nemequ/icc-travis/issues/15
2019-12-30 08:56:46 +01:00
Akim Demaille d29e40a047 doc: clean up the description of YYDEBUG
* doc/bison.texi: Make it clearer that %define parse.trace is the
preferred options.
Fix a typo about api.prefix.
2019-12-29 11:13:00 +01:00
Akim Demaille b10366f296 glr.cc: avoid compiler warnings
381. types.at:366: testing glr.cc api.value.type={double} ...
    test.cc:207:57: error: "__clang_major__" is not defined, evaluates to 0 [-Werror=undef]
      207 | #if defined __APPLE__ && YY_CPLUSPLUS < 201103L && 4 <= __clang_major__
          |                                                         ^~~~~~~~~~~~~~~

* data/skeletons/glr.cc: Check __clang_major__ before using it.
2019-12-29 11:13:00 +01:00
Paul Eggert 139d065594 warnings: pacify ‘gcc -Wchar-subscripts’ in yacc.c
Problem reported by Andy Fiddaman in:
https://lists.gnu.org/r/bug-bison/2019-12/msg00021.html
* data/skeletons/yacc.c (yy_reduce_print, yy_lac, yysyntax_error)
(yyreturn): If I might be a char, write a[+I] instead of a[I],
so that ‘gcc -Wchar-subscripts’ does not complain.
2019-12-18 13:35:28 -08:00
Akim Demaille 0d73c39bb7 doc: formatting changes
* doc/bison.texi: No output changes.
2019-12-14 17:19:53 +01:00
Akim Demaille 7f01adced9 tests: don't fail if seq is no available
As is the case on Solaris.
Reported by Dennis Clarke.
https://lists.gnu.org/archive/html/bug-bison/2019-12/msg00011.html

* examples/c/reccalc/reccalc.test: Skip if there is no seq.
2019-12-14 17:19:53 +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 b3abe014f2 glr.cc: disable warnings from Clang on macOS
$ cat test.cc
    #include <stddef.h>
    #include <stdint.h>

    ptrdiff_t half_max_capacity = PTRDIFF_MAX;
    $ clang++-mp-9.0 -pedantic -std=c++98 /tmp/test.cc -c
    /tmp/test.cc:4:31: warning: 'long long' is a C++11 extension [-Wc++11-long-long]
    ptrdiff_t half_max_capacity = PTRDIFF_MAX;
                                  ^
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdint.h:149:23:
            note: expanded from macro 'PTRDIFF_MAX'
    #define PTRDIFF_MAX       INT64_MAX
                              ^
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdint.h:75:26:
            note: expanded from macro 'INT64_MAX'
    #define INT64_MAX        9223372036854775807LL
                             ^
    1 warning generated.

* data/skeletons/glr.cc: here.
2019-12-08 16:34:53 +01:00
Akim Demaille 80f3220fea api.token.raw: fix it in C++
Another breakage revealed by vcsn.

* data/skeletons/c++.m4 (yytranslate_): Do not hard code "yy" and
"parser", both can be changed by the user.
Actually, since we are in the parser itself, there's really no need to
qualify the type.
2019-12-08 16:07:50 +01:00
Akim Demaille fc2040a750 c++: fix comments for %code blocks
In a project of mine, vcsn, this commit fixes the following comments.

    --- /tmp/parse.hh	2019-12-08 15:51:24.792934703 +0100
    +++ lib/vcsn/rat/parse.hh	2019-12-08 16:00:59.137107503 +0100
    @@ -43,7 +43,7 @@

     #ifndef YY_YY_USERS_AKIM_SRC_LRDE_2_LIB_VCSN_RAT_PARSE_HH_INCLUDED
     # define YY_YY_USERS_AKIM_SRC_LRDE_2_LIB_VCSN_RAT_PARSE_HH_INCLUDED
    -// //                    "%code requires" blocks.
    +// "%code requires" blocks.
     #line 20 "/Users/akim/src/lrde/2/lib/vcsn/rat/parse.yy"

       #include <iostream>
    @@ -1851,7 +1851,7 @@

    -// //                    "%code provides" blocks.
    +// "%code provides" blocks.
     #line 60 "/Users/akim/src/lrde/2/lib/vcsn/rat/parse.yy"

       #define YY_DECL_(Class) \

* data/skeletons/bison.m4 (b4_percent_code_get): Pass an expanded
string to b4_comment.
2019-12-08 16:03:36 +01:00
Akim Demaille d55f240991 parser: pretend we are Bison 3.5
* src/parse-gram.y: Accept we're Bison 3.5.
2019-12-08 16:03:36 +01:00
Akim Demaille 4f961a706d c++: fix spello
* data/skeletons/lalr1.cc: here.
2019-12-08 15:42:41 +01:00
Akim Demaille ac203e6c3c todo: update
* TODO: Schedule some features for 3.6.
Remove obsolete stuff.
2019-12-08 10:12:02 +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
Akim Demaille bb901beb68 news: fixes
Reported by Paul Eggert.
https://lists.gnu.org/archive/html/bison-patches/2019-12/msg00014.html

* NEWS: here.
2019-12-08 09:12:07 +01:00
Akim Demaille fa00c56c17 doc: minor changes
* README-hacking.md: here.
2019-12-07 18:23:08 +01:00
Akim Demaille 5359c479bc gnulib: update 2019-12-07 15:29:43 +01:00
Akim Demaille 20107b77c0 doc: clearly deprecate YYPRINT
* doc/bison.texi (Prologue): Stop using YYPRINT as an example.
(The YYPRINT Macro): Clearly show this macro is deprecated.
2019-12-07 15:29:43 +01:00
Akim Demaille 5e71eef267 doc: formatting changes
* doc/bison.texi: here.
No change in content.
2019-12-07 15:29:43 +01:00
Akim Demaille 472531dc72 news: update 2019-12-07 15:29:43 +01:00
Akim Demaille 046f238826 d: obey parse.error
* data/skeletons/lalr1.d (yysyntax_error): Let the dispatch be
bison-time, not runtime.
2019-12-07 13:23:45 +01:00
Akim Demaille 9bf06f6963 c++: also prefer YY_ASSERT to YYASSERT
Like the other skeletons.

* data/skeletons/variant.hh: here.
2019-12-07 13:23:45 +01:00
Akim Demaille 357336d254 glr.c: obey the parse.assert %define variable
* data/skeletons/glr.c (YYASSERT): Rename as...
(YY_ASSERT): this, for consistency with yacc.c, and also to emphasize
the fact that this is not for the end user (YY_ prefix).
* tests/glr-regression.at: Define parse.assert.
2019-12-07 13:23:45 +01:00
Akim Demaille d4a6c3c58a c++: beware of short ranges for state numbers
Now that we use small integral types, possibly unsigned (e.g.,
unsigned char), to store state numbers, using -1 to denote an empty
state (i.e., a state that stores no semantical value) is very
dangerous: it will be confused with state 255, which might be
non-empty.

Rather than allocating a larger range of state numbers to keep the
empty-state apart, let's use the number of a state known to store no
value.  The initial state, numbered 0, seems to fit perfectly the job.

Reported by Frank Heckenbach.
https://lists.gnu.org/archive/html/bug-bison/2019-11/msg00016.html

* data/skeletons/lalr1.cc (empty_state): Be 0.
2019-12-07 09:22:55 +01:00
Akim Demaille 8976e0f567 api.token.raw: check it against api.token.constructor
* tests/scanner.at: here.
2019-12-07 08:57:14 +01:00
Akim Demaille 6dca1eb950 regen 2019-12-06 08:27:55 +01:00
Akim Demaille f8d82ff039 warnings: enable -Wuseless-cast, and eliminate warnings
Prompted by Frank Heckenbach.
https://lists.gnu.org/archive/html/bug-bison/2019-11/msg00016.html.

* configure.ac (warn_cxx): Add -Wuseless-cast.
* data/skeletons/c.m4 (b4_attribute_define): Define
YY_IGNORE_USELESS_CAST_BEGIN and YY_IGNORE_USELESS_CAST_END.
* data/skeletons/glr.c (YY_FPRINTF): New, replaces YYFPRINTF, wrapped
with YY_IGNORE_USELESS_CAST_BEGIN and YY_IGNORE_USELESS_CAST_END.
(YY_DPRINTF): Likewise.
* tests/actions.at: Remove useless cast.
* tests/headers.at: Adjust.
2019-12-06 08:27:55 +01:00
Akim Demaille 9e9e49224f diagnostics: style changes
* src/complain.h, src/complain.c: Comment changes.
* src/scan-skel.l: Reduce scopes.
* data/skeletons/bison.m4: Factor diagnostic functions.
2019-12-02 19:35:01 +01:00
Akim Demaille 8b53f4e022 glr.c: style changes
* data/skeletons/glr.c (yysplitStack): Reduce scopes.
* tests/atlocal.in: Formatting changes.
2019-12-02 19:34:48 +01:00
Akim Demaille 8c87a62308 c++: get rid of symbol_type::token ()
It is not used.  And its implementation was wrong when api.token.raw
was defined, as it was still mapping to the external token numbers,
instead of the internal ones.  Besides it was provided only when
api.token.constructor is defined, yet always declared.

* data/skeletons/c++.m4 (by_type::token): Remove, useless.
2019-12-01 10:05:48 +01:00
Akim Demaille 478cb5cf12 c++: remove useless cast about user_token_number_max_
Reported by Frank Heckenbach.
https://lists.gnu.org/archive/html/bug-bison/2019-11/msg00016.html

The cast is needed when yytranslate_'s argument type is token_type,
i.e., when api.token.constructor is defined.

    373. types.at:138: testing lalr1.cc api.value.type=variant api.token.constructor ...
    ======== Testing with C++ standard flags: ''
    ../../tests/types.at:138: bison --color=no -fno-caret  -o test.cc test.y
    ../../tests/types.at:138: $CXX $CXXFLAGS $CPPFLAGS  $LDFLAGS -o test test.cc $LIBS
    stderr:
    test.cc:966:16: error: result of comparison of constant 257 with
                    expression of type 'yy::parser::token_type'
                   (aka 'yy::parser::token::yytokentype') is always true
                   [-Werror,-Wtautological-constant-out-of-range-compare]
        else if (t <= user_token_number_max_)
                 ~ ^  ~~~~~~~~~~~~~~~~~~~~~~
    1 error generated.

It is because it is expected that when api.token.constructor is
defined, only symbol constructors will be used, that yytranslate_ then
takes a token_type.  But it is wrong: we still allow literal
characters in this case, as demonstrated by test 373 for instance.

    %define api.value.type variant
    %define api.token.constructor
    %token <std::pair<int, int>> '1' '2';
    [...]
    static yy::parser::symbol_type yylex ()
    {
      static char const input[] = "12";
      int res = input[toknum++];
      typedef yy::parser::symbol_type symbol;
      if (res)
        return symbol (res, std::make_pair (res - '0', res - '0' + 1));
      else
        return symbol (res);
    }

So let yytranslate_ always take an int, which makes the cast truly
useless.

* data/skeletons/c++.m4, data/skeletons/lalr1.cc (yytranslate_): here.
2019-12-01 08:53:58 +01:00
Akim Demaille 94f70bd861 c++: clean a few issues wrt special tokens
The C++ implementation of LAC did not skip the $undefined token,
probably because it was not exposed.  Expose it, and use clearer
names.

* data/skeletons/c++.m4: Don't define undef_token_ in yytranslate_,
but...
* data/skeletons/lalr1.cc (yy_undef_token_): here.
Use a more precise type to define yy_undef_token_ and yy_error_token_.
Unfortunately we move from a compile-time value defined via an enum to
a static const member.  Eventually we should make it constexpr.
Make LAC implementation more alike yacc.c's one.
2019-12-01 08:08:19 +01:00
Akim Demaille 9b4f0970fe d, java: improve yytranslate and neighbors
* data/skeletons/lalr1.d, data/skeletons/lalr1.java: Don't expose
yyuser_token_number_max_ and yyundef_token_.  Do as in C++: scope them
into yytranslate_, and only when api.token.raw is not defined.
(yyterror_): Rename as...
(yy_error_token_): this.
* data/skeletons/lalr1.d (token_number_type): New.
Use it.
Can't be done in the Java backend, as Java does not have type aliases.
2019-12-01 07:59:23 +01:00
Akim Demaille 869028a66d d, java: get rid of a useless table
* data/skeletons/lalr1.d, data/skeletons/lalr1.java (yytoken_number_):
Remove, useless.
Was used in ancient C skeletons to support YYPRINT, long obsoleted by
%printer.
2019-12-01 07:38:31 +01:00
Akim Demaille 6f92a7f664 c++, d, java: remove yyerrcode
It is not used at all.  We will remove it also from yacc.c, but
later (see TODO).

* data/skeletons/lalr1.cc, data/skeletons/lalr1.d,
* data/skeletons/lalr1.java (yyerrcode_):
Remove.
2019-11-30 17:30:48 +01:00
Akim Demaille 6a61b6b17e c++: improve typing
* data/skeletons/lalr1.cc (yysyntax_error_): symbol_type::type_get
returns a symbol_number_type (which is indeed an int).
2019-11-30 17:30:48 +01:00
Akim Demaille a4bf7cdf9e c++: remove useless cast about yyeof_
Reported by Frank Heckenbach.
https://lists.gnu.org/archive/html/bug-bison/2019-11/msg00016.html

* data/skeletons/c++.m4 (b4_yytranslate_define): Don't use yyeof_ as
if it had two different types.
It is used once against the input argument, which is the value
returned by yylex, which is an "external token number", typically an
int.  It is also used as output type, an "internal symbol number".
It turns out that in both cases we mean "0", but let's keep yyeof_
only for the case "internal symbol number", i.e., _after_ conversion
by yytranslate.
This frees us from one cast.
2019-11-30 17:30:48 +01:00
Akim Demaille 9471a5ffe9 glr: style change
* data/skeletons/glr.c (YYDPRINTF): Expand into an empty statement,
instead of nothing.
Simplify callers.
2019-11-30 14:41:16 +01:00
Akim Demaille 24c5214ae8 glr: remove useless casts
Reported by GCC's -Wuseless-cast.

* data/skeletons/glr.c: Don't cast to yybool, it's useless.
2019-11-30 14:41:16 +01:00
Akim Demaille 2f7097d1b1 yacc.c, glr.c: fix crash when reporting errors in consistent states
The current code for yysyntax_error for %define parse.error verbose is
fishy (given that YYEMPTY is -2, invalid argument for yytname[]):

    static int
    yysyntax_error ([...])
    {
      YYPTRDIFF_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
    [...]
      if (yytoken != YYEMPTY)

A nearby comment reports

    The only way there can be no lookahead present (in yychar) is if
    this state is a consistent state with a default action.  Thus,
    detecting the absence of a lookahead is sufficient to determine
    that there is no unexpected or expected token to report.  In that
    case, just report a simple "syntax error".

So it _is_ possible to call yysyntax_error with yytoken == YYEMPTY,
albeit quite difficult when meaning to, so virtually impossible by
accident (after all, there was never a bug report about this).

I failed to produce a test case, but Joel E. Denny provided me with
one (added to the test suite below).  The yacc.c skeleton fails on
this, and once fixed dies on a second problem.  The glr.c skeleton was
also dying, but immediately of this second problem.

Indeed we were not allocating space for the error message's final \0.
This was hidden by the fact that we only had error messages with at
least an unexpected token displayed, so with at least one "%s" in the
format string, whose size (2) was included (incorrectly) in the final
size of the message (where the %s have been replaced by the actual
content).

* data/skeletons/glr.c, data/skeletons/yacc.c (yysyntax_error):
Do not invoke yytnamerr on YYEMPTY.
Clarify the computation of the length of the _final_ error message,
with the NUL terminator but without the '%s's.
* tests/conflicts.at (Syntax error in consistent error state):
New, contributed by Joel E. Denny.
2019-11-29 18:21:43 +01:00
Akim Demaille 28369ecb5d tests: avoid creating files whose name collide with standard headers
Having a file named "exception" is risky: the compiler might use that
file in #include.
Reported by 马俊 <[email protected]>.

* tests/local.at (AT_SKIP_IF_EXCEPTION_SUPPORT_IS_POOR): Generate
'exceptions', not 'exception'.
2019-11-26 08:05:32 +01:00
Akim Demaille b92f064e9b doc: more details about the test suite
* README-hacking.md: here.
2019-11-22 09:02:06 +01:00
Akim Demaille 98f19578aa maint: post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
2019-11-20 07:49:44 +01:00
Akim Demaille 7d9839c4a8 version 3.4.91
* NEWS: Record release date.
2019-11-20 07:13:38 +01:00
Akim Demaille ad32ec64c8 style: pacify syntax-check
* cfg.mk: No need to translate *.md files.
* data/skeletons/glr.c, data/skeletons/yacc.c: Fix space issues.
2019-11-20 07:10:27 +01:00
Akim Demaille 44cdc0f001 gnulib: update 2019-11-19 21:15:00 +01:00
Akim Demaille ca796220ec doc: don't promote dangling aliases
String literals as tokens serve two distinct purposes: freeing from
having to implement the keyword matching in the scanner, and improving
error messages.  Most of the time both can be achieved at the same
time, but on occasions, it does not work so well.

We promote their use for error messages.  We will also still support
the former case, but it is _not_ the recommended approach.

* doc/bison.texi (Tokens from Literals): Clearly state that we don't
recommend looking up the token types in the list of token names.
2019-11-18 09:15:35 +01:00
Akim Demaille 8a910107b3 diagnostics: complain about undeclared string tokens
String literals, which allow for better error messages, are (too)
liberally accepted by Bison, which might result in silent errors.  For
instance

    %type <exVal> cond "condition"

does not define “condition” as a string alias to 'cond' (nonterminal
symbols do not have string aliases).  It is rather equivalent to

    %nterm <exVal> cond
    %token <exVal> "condition"

i.e., it gives the type 'exVal' to the "condition" token, which was
clearly not the intention.

Introduce -Wdangling-alias to catch this.

* src/complain.h, src/complain.c: Add support for -Wdangling-alias.
(argmatch_warning_args): Sort.
* src/symtab.c (symbol_check_defined): Complain about dangling
aliases.
* doc/bison.texi: Document it.
* tests/input.at (Dangling aliases): New test.
2019-11-17 18:27:42 +01:00
Akim Demaille 28d1ca8f48 diagnostics: yacc reserves %type to nonterminals
On

    %token TOKEN1
    %type  <ival> TOKEN1 TOKEN2 't'
    %token TOKEN2
    %%
    expr:

bison -Wyacc gives

    input.y:2.15-20: warning: POSIX yacc reserves %type to nonterminals [-Wyacc]
        2 | %type  <ival> TOKEN1 TOKEN2 't'
          |               ^~~~~~
    input.y:2.29-31: warning: POSIX yacc reserves %type to nonterminals [-Wyacc]
        2 | %type  <ival> TOKEN1 TOKEN2 't'
          |                             ^~~
    input.y:2.22-27: warning: POSIX yacc reserves %type to nonterminals [-Wyacc]
        2 | %type  <ival> TOKEN1 TOKEN2 't'
          |                      ^~~~~~

The messages appear to be out of order, but they are emitted when the
error is found.

* src/symtab.h (symbol_class): Add pct_type_sym, used to denote
symbols appearing in %type.
* src/symtab.c (complain_pct_type_on_token): New.
(symbol_class_set): Check that %type is not applied to tokens.
(symbol_check_defined): pct_type_sym also means undefined.
* src/parse-gram.y (symbol_decl.1): Set the class to pct_type_sym.
* src/reader.c (grammar_current_rule_begin): pct_type_sym also means
undefined.
* tests/input.at (Yacc's %type): New.
2019-11-17 09:45:25 +01:00
Akim Demaille 1817b475a6 doc: promote %nterm over %type
As an extension to POSIX Yacc, Bison's %type accepts tokens.
Unfortunately with string literals as implicit tokens, this is
misleading, and led some users to write

    %type <exVal> cond "condition"

believing that "condition" would be associated to the 'cond'
nonterminal (see https://github.com/apache/httpd/pull/72).

* doc/bison.texi: Promote %nterm rather than %type to declare the type
of nonterminals.
2019-11-16 12:54:44 +01:00
Akim Demaille 22ca07defa doc: formatting changes
* doc/bison.texi: No visible changes.
2019-11-16 12:54:44 +01:00
Akim Demaille dbd6975b5c doc: work around warnings when Flex C output is compiled in C++
* doc/bison.texi (calc++/scanner.ll): here.
While at it, clarify clang vs. warnings.
2019-11-16 12:54:44 +01:00
Akim Demaille cd726fdc4d tests: be robust to old Perl versions on Cygwin
Reported by Denis Excoffier.
https://lists.gnu.org/archive/html/bug-bison/2019-11/msg00008.html.

* tests/output.at: Be sure to remove back up files.
2019-11-16 12:54:44 +01:00
Akim Demaille 60ebd8e210 regen 2019-11-16 12:54:44 +01:00
kaneko yandAkim Demaille 3765e3e790 gram.c: Fix condition of aver
* src/gram.c (grammar_dump): Fix condition of aver.
What we want to check is that rhs is followed by its rule.
2019-11-12 08:39:28 +01:00
Akim Demaille c313360deb doc: clarify build instructions
* README: A few fixes.
Explain how to install color support.
* README-hacking: Rename as...
* README-hacking.md: this, and convert to Markdown.
Improve typography.
Improve explanations about update-test.
2019-11-11 15:59:53 +01:00
Akim Demaille 25698b58c0 gnulib: update 2019-11-11 15:41:29 +01:00
Yuichiro KanekoandAkim Demaille 17d34c231b gram.c: also print terminals in grammar_dump
* src/gram.c (grammar_dump): Print terminals likewise non terminals.
* tests/sets.at (Reduced Grammar): Update test case to catch up the
change and add a test case where prec and assoc are used.
2019-11-11 10:37:30 +01:00
Akim Demaille af000bab11 doc: work around Texinfo 6.7 bug
When @code is used in a @deftype... definition, it issues quotes.
Remove them.
See https://lists.gnu.org/archive/html/help-texinfo/2019-11/msg00004.html.

* doc/local.mk: here.
2019-11-10 14:59:11 +01:00
Akim Demaille b2347a3c3e doc: formatting changes
* doc/bison.texi: Wrap lines.
No semantical difference.
2019-11-09 07:57:05 +01:00
Akim Demaille 008d927f71 doc: use upper case for tokens
* doc/bison.texi: here.
2019-11-09 07:54:32 +01:00
Akim Demaille 1650c729d9 doc: type-face fixes
* doc/bison.texi: Use @code for types in function definitions.
2019-11-07 07:13:40 +01:00
Akim Demaille 7bdf7246fb c++: expose the type used to store line and column numbers
* data/skeletons/location.cc (position::counter_type)
(location::counter_type): New.
Use them.
* doc/bison.texi (C++ position, C++ location): Adjust.
2019-11-06 18:20:15 +01:00
Akim Demaille 583c193ffa tests: fix comment and adjust to locale names on GNU/Linux
Reported by Denis Excoffier.

* tests/diagnostics.at: here.
2019-11-03 10:32:22 +01:00
Akim Demaille 47b9ada6fa tests: really check complaints from m4
* tests/diagnostics.at (Locations from M4, Tabulations and multibyte
characters from M4): These tests are actually checking a message
coming from C, not from M4.  Replace with...
(Complaints from M4): This.
2019-11-03 10:32:22 +01:00
Akim Demaille dcd5bb26e3 tests: simplify prologue
* tests/testsuite.h: We no longer load gnulib in the tests.
2019-11-03 10:32:22 +01:00
Akim Demaille cce6c998b6 diagnostics: add missing translation
* src/muscle-tab.c (muscle_percent_define_check_kind): Here.
2019-11-03 09:24:12 +01:00
Akim Demaille 3398b0fa90 c++: fix old cast warnings
We still have a few old C casts in lalr1.cc, let's get rid of them.
Reported by Frank Heckenbach.

Actually, let's monitor all our casts using easy to grep macros.
Let's use these macros to use the C++ standard casts when we are in
C++.

* data/skeletons/c.m4 (b4_cast_define): New.
* data/skeletons/glr.c, data/skeletons/glr.cc,
* data/skeletons/lalr1.cc, data/skeletons/stack.hh,
* data/skeletons/yacc.c:
Use it and/or its casts.

* tests/actions.at, tests/cxx-type.at,
* tests/glr-regression.at, tests/headers.at, tests/torture.at,
* tests/types.at:
Use YY_CAST instead of C casts.

* configure.ac (warn_cxx): Add -Wold-style-cast.
* doc/bison.texi: Disable it.
2019-11-02 16:40:50 +01:00
Akim Demaille 2bd1d9e20f tests: be robust to tput errors
Reported by Denis Excoffier.

* tests/bison.in: here.
2019-11-01 12:04:13 +01:00
Akim Demaille 1f2546396e git: update ignores
I don't understand what happened in
10acc148bb.
2019-11-01 12:04:13 +01:00
Akim Demaille 809268c1a4 maint: post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
2019-10-29 21:58:53 +01:00
216 changed files with 2886 additions and 1844 deletions
+1 -1
View File
@@ -1 +1 @@
3.4.2 3.5.1
+69 -58
View File
@@ -1,14 +1,8 @@
# Travis defines and exports CC and CXX *after* we have defined our version: ~> 1.0
# environment variables via 'env'. So, do not use 'env' to define them.
# Instead, put their definitions in MATRIX_EVAL, which we eval after the
# definitions from Travis.
language: cpp
env: # If the language is set to C or C++, Travis defines and exports CC
global: # and CXX *after* we have defined our environment variables via 'env'.
# ICC serial number. language: minimal
# See https://github.com/nemequ/icc-travis.
secure: B3manbbi0anCAGDJTdAa9TlodzRHeiYD87FKmFzS877dPm8Cm0BDvtUhKBUpBvP8+nbHOWFGrgDmLugSZjTGU+mAxtuQpamUFHvinu0BIk3qtjlqouwvbtIqUu8iiZ3Uqu+xKeAANKRy0YVZGLlEb9F3N119tJ/Fxp1p9bXL1qph+CZ25OFbUgZ2s4F+/AyHMUxJlNXKFe3Qean65hC6edhU3zoaKzr/g/wtbhRmcyWbkOa1dJqzr2yKotcPvrnApGhDzgMKFtohg/t7xfMADDVv6sGS5XNpt25Z+MUCmLg4Z9eD7u109jvRV1eu/jgVafqsthWEhXbuMiFgFhKBKGCNZ0dACIfKZSkFZI6FdM7ovJ6aNhSlxZ2169Ybd22rN1UTHeCQWySPcVVOg5taLVpqe+E8Xhnv4hBO5NrzElWwCMLxIdPUSwVStYvtDr8ZytHWzfot50vSnFKIFpTOr9hP4+AJMVmmqJfaJo2MLBft/q2xkztrMv3lQSj3m4+ma9kPDwXIu9uCutjlnhc00jNx9qegi5VfpAjxcG1R+pX4T20az6ByHk/7LPQsANkT31RJq/jAeD9LEuMOy8miha83q4QuvbFaqPK3PY0el/O1LZaXqLsV2aQ0uqH8YX0l4r5NzHdhb+3lYgvpMBO5ytr/EWJiEyNYV518050IUDE=
# Run in two steps: # Run in two steps:
# 1. Build the tarball # 1. Build the tarball
@@ -87,7 +81,9 @@ jobs:
- sourceline: 'ppa:ubuntu-toolchain-r/test' - sourceline: 'ppa:ubuntu-toolchain-r/test'
packages: g++-9 packages: g++-9
env: env:
- MATRIX_EVAL="CC=gcc-9 && CXX=g++-9 && CONFIGUREFLAGS='CPPFLAGS=-DNDEBUG CFLAGS=-O3 CXXFLAGS=-O3'" - CC=gcc-9
- CXX=g++-9
- CONFIGUREFLAGS='CPPFLAGS=-DNDEBUG CFLAGS=-O3 CXXFLAGS=-O3'
# ASAN is time consuming, and we timeout the 50min granted by # ASAN is time consuming, and we timeout the 50min granted by
# Travis if we run all the tests in one go. Run in two parts. # Travis if we run all the tests in one go. Run in two parts.
@@ -108,7 +104,8 @@ jobs:
- libc++abi-9-dev - libc++abi-9-dev
env: env:
# Do not use ASAN with ubuntu's libc++: https://bugs.llvm.org/show_bug.cgi?id=17379 # Do not use ASAN with ubuntu's libc++: https://bugs.llvm.org/show_bug.cgi?id=17379
- MATRIX_EVAL="CC='clang-9 -fsanitize=address' CXX='clang++-9 -fsanitize=address -stdlib=libc++'" - CC='clang-9 -fsanitize=address'
- CXX='clang++-9 -fsanitize=address -stdlib=libc++'
- PART=1 - PART=1
- name: "Clang 9 libc++ and ASAN part 2" - name: "Clang 9 libc++ and ASAN part 2"
@@ -118,26 +115,26 @@ jobs:
addons: *clang9 addons: *clang9
env: env:
# Do not use ASAN with ubuntu's libc++: https://bugs.llvm.org/show_bug.cgi?id=17379 # Do not use ASAN with ubuntu's libc++: https://bugs.llvm.org/show_bug.cgi?id=17379
- MATRIX_EVAL="CC='clang-9 -fsanitize=address' CXX='clang++-9 -fsanitize=address -stdlib=libc++'" - CC='clang-9 -fsanitize=address'
- CXX='clang++-9 -fsanitize=address -stdlib=libc++'
- PART=2 - PART=2
# Currently no longer works (https://github.com/nemequ/icc-travis/issues/15). - name: "ICC"
# - name: "ICC" stage: check
# stage: check os: linux
# # We need the build-aux/install-icc.sh script. compiler: icc
# git: env:
# clone: true - CC=icc
# submodules: false - CXX=icpc
# depth: 1 install:
# os: linux - source /opt/intel/inteloneapi/compiler/latest/env/vars.sh
# dist: xenial addons:
# env: apt:
# # ICC's warnings are often very wrong (e.g., it thinks foo ? sources:
# # "bar" : "baz" is char* instead of const char*), so don't try - sourceline: 'deb https://apt.repos.intel.com/oneapi all main'
# # to work around the, and obviously, don't die on them. key_url: 'https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB'
# - MATRIX_EVAL="CC=icc && CXX=icpc" packages:
# - MAKE_ARGS='WERROR_CFLAGS= WERROR_CXXFLAGS=' - intel-oneapi-icc
## ----- ## ## ----- ##
## GCC. ## ## GCC. ##
@@ -150,7 +147,8 @@ jobs:
apt: apt:
packages: g++-8 packages: g++-8
env: env:
- MATRIX_EVAL="CC='gcc-8 -fsanitize=undefined,address -fno-omit-frame-pointer' CXX='g++-8 -fsanitize=undefined,address -fno-omit-frame-pointer'" - CC='gcc-8 -fsanitize=undefined,address -fno-omit-frame-pointer'
- CXX='g++-8 -fsanitize=undefined,address -fno-omit-frame-pointer'
- CONFIGUREFLAGS='CFLAGS=-O1 CXXFLAGS=-O1' - CONFIGUREFLAGS='CFLAGS=-O1 CXXFLAGS=-O1'
- PART=1 - PART=1
@@ -162,7 +160,8 @@ jobs:
apt: apt:
packages: g++-8 packages: g++-8
env: env:
- MATRIX_EVAL="CC=gcc-8 && CXX=g++-8" - CC=gcc-8
- CXX=g++-8
- name: "GCC 7" - name: "GCC 7"
stage: check stage: check
@@ -172,7 +171,8 @@ jobs:
apt: apt:
packages: g++-7 packages: g++-7
env: env:
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7" - CC=gcc-7
- CXX=g++-7
- name: "GCC 6" - name: "GCC 6"
stage: check stage: check
@@ -183,7 +183,8 @@ jobs:
sources: ubuntu-toolchain-r-test sources: ubuntu-toolchain-r-test
packages: g++-6 packages: g++-6
env: env:
- MATRIX_EVAL="CC=gcc-6 && CXX=g++-6" - CC=gcc-6
- CXX=g++-6
- name: "GCC 5" - name: "GCC 5"
stage: check stage: check
@@ -194,7 +195,8 @@ jobs:
sources: ubuntu-toolchain-r-test sources: ubuntu-toolchain-r-test
packages: g++-5 packages: g++-5
env: env:
- MATRIX_EVAL="CC=gcc-5 && CXX=g++-5" - CC=gcc-5
- CXX=g++-5
- name: "GCC 4.9" - name: "GCC 4.9"
stage: check stage: check
@@ -205,7 +207,8 @@ jobs:
sources: ubuntu-toolchain-r-test sources: ubuntu-toolchain-r-test
packages: g++-4.9 packages: g++-4.9
env: env:
- MATRIX_EVAL="CC=gcc-4.9 && CXX=g++-4.9" - CC=gcc-4.9
- CXX=g++-4.9
- name: "GCC 4.8" - name: "GCC 4.8"
stage: check stage: check
@@ -216,7 +219,8 @@ jobs:
sources: ubuntu-toolchain-r-test sources: ubuntu-toolchain-r-test
packages: g++-4.8 packages: g++-4.8
env: env:
- MATRIX_EVAL="CC=gcc-4.8 && CXX=g++-4.8" - CC=gcc-4.8
- CXX=g++-4.8
- name: "GCC 4.7" - name: "GCC 4.7"
stage: check stage: check
@@ -227,7 +231,8 @@ jobs:
sources: ubuntu-toolchain-r-test sources: ubuntu-toolchain-r-test
packages: g++-4.7 packages: g++-4.7
env: env:
- MATRIX_EVAL="CC=gcc-4.7 && CXX=g++-4.7" - CC=gcc-4.7
- CXX=g++-4.7
- name: "GCC 4.6" - name: "GCC 4.6"
stage: check stage: check
@@ -238,7 +243,8 @@ jobs:
sources: ubuntu-toolchain-r-test sources: ubuntu-toolchain-r-test
packages: g++-4.6 packages: g++-4.6
env: env:
- MATRIX_EVAL="CC=gcc-4.6 && CXX=g++-4.6" - CC=gcc-4.6
- CXX=g++-4.6
## ------- ## ## ------- ##
## Clang. ## ## Clang. ##
@@ -255,7 +261,8 @@ jobs:
- libc++-8-dev - libc++-8-dev
- libc++abi-8-dev - libc++abi-8-dev
env: env:
- MATRIX_EVAL="CC=clang-8 && CXX='clang++-8 -stdlib=libc++'" - CC=clang-8
- CXX='clang++-8 -stdlib=libc++'
- CONFIGUREFLAGS='CPPFLAGS=-DNDEBUG CFLAGS=-O3 CXXFLAGS=-O3' - CONFIGUREFLAGS='CPPFLAGS=-DNDEBUG CFLAGS=-O3 CXXFLAGS=-O3'
- name: "Clang 7" - name: "Clang 7"
@@ -269,7 +276,8 @@ jobs:
- libc++-7-dev - libc++-7-dev
- libc++abi-7-dev - libc++abi-7-dev
env: env:
- MATRIX_EVAL="CC=clang-7 && CXX='clang++-7 -stdlib=libc++'" - CC=clang-7
- CXX='clang++-7 -stdlib=libc++'
- name: "Clang 6 and libc++" - name: "Clang 6 and libc++"
stage: check stage: check
@@ -284,7 +292,8 @@ jobs:
- clang-6.0 - clang-6.0
- libc++-dev - libc++-dev
env: env:
- MATRIX_EVAL="CC=clang-6.0 && CXX='clang++-6.0 -stdlib=libc++'" - CC=clang-6.0
- CXX='clang++-6.0 -stdlib=libc++'
- name: "Clang 5" - name: "Clang 5"
stage: check stage: check
@@ -297,7 +306,8 @@ jobs:
- clang-5.0 - clang-5.0
- libc++-dev - libc++-dev
env: env:
- MATRIX_EVAL="CC='clang-5.0' CXX='clang++-5.0'" - CC='clang-5.0'
- CXX='clang++-5.0'
- name: "Clang 4" - name: "Clang 4"
stage: check stage: check
@@ -308,7 +318,8 @@ jobs:
sources: llvm-toolchain-xenial-4.0 sources: llvm-toolchain-xenial-4.0
packages: clang-4.0 packages: clang-4.0
env: env:
- MATRIX_EVAL="CC=clang-4.0 && CXX=clang++-4.0" - CC=clang-4.0
- CXX=clang++-4.0
- name: "Clang 3.9" - name: "Clang 3.9"
stage: check stage: check
@@ -319,7 +330,8 @@ jobs:
sources: llvm-toolchain-xenial-3.9 sources: llvm-toolchain-xenial-3.9
packages: clang-3.9 packages: clang-3.9
env: env:
- MATRIX_EVAL="CC=clang-3.9 && CXX=clang++-3.9" - CC=clang-3.9
- CXX=clang++-3.9
- name: "Clang 3.8" - name: "Clang 3.8"
stage: check stage: check
@@ -332,7 +344,8 @@ jobs:
- llvm-toolchain-precise-3.8 - llvm-toolchain-precise-3.8
packages: clang-3.8 packages: clang-3.8
env: env:
- MATRIX_EVAL="CC=clang-3.8 && CXX=clang++-3.8" - CC=clang-3.8
- CXX=clang++-3.8
- name: "CLang 3.7" - name: "CLang 3.7"
stage: check stage: check
@@ -345,7 +358,8 @@ jobs:
- llvm-toolchain-precise-3.7 - llvm-toolchain-precise-3.7
packages: clang-3.7 packages: clang-3.7
env: env:
- MATRIX_EVAL="CC=clang-3.7 && CXX=clang++-3.7" - CC=clang-3.7
- CXX=clang++-3.7
- name: "Clang 3.6" - name: "Clang 3.6"
stage: check stage: check
@@ -358,7 +372,8 @@ jobs:
- llvm-toolchain-precise-3.6 - llvm-toolchain-precise-3.6
packages: clang-3.6 packages: clang-3.6
env: env:
- MATRIX_EVAL="CC=clang-3.6 && CXX=clang++-3.6" - CC=clang-3.6
- CXX=clang++-3.6
- name: "Clang 3.5" - name: "Clang 3.5"
stage: check stage: check
@@ -371,7 +386,8 @@ jobs:
- llvm-toolchain-precise-3.5 - llvm-toolchain-precise-3.5
packages: clang-3.5 packages: clang-3.5
env: env:
- MATRIX_EVAL="CC=clang-3.5 && CXX=clang++-3.5" - CC=clang-3.5
- CXX=clang++-3.5
- name: "Clang 3.4" - name: "Clang 3.4"
stage: check stage: check
@@ -384,7 +400,8 @@ jobs:
env: env:
# No versioned name installed, but beware that Travis installs # No versioned name installed, but beware that Travis installs
# a more modern clang earlier in the default PATH. # a more modern clang earlier in the default PATH.
- MATRIX_EVAL='CC=/usr/bin/clang && CXX=/usr/bin/clang++' - CC=/usr/bin/clang
- CXX=/usr/bin/clang++
- name: "Clang 3.3" - name: "Clang 3.3"
stage: check stage: check
@@ -396,7 +413,8 @@ jobs:
packages: clang-3.3 packages: clang-3.3
env: env:
# See comment for 3.4. # See comment for 3.4.
- MATRIX_EVAL='CC=/usr/bin/clang && CXX=/usr/bin/clang++' - CC=/usr/bin/clang
- CXX=/usr/bin/clang++
## From https://docs.gitlab.com/ce/ci/ssh_keys/#ssh-keys-when-using-the-docker-executor. ## From https://docs.gitlab.com/ce/ci/ssh_keys/#ssh-keys-when-using-the-docker-executor.
## Applies to Travis too. Applied to all the 'script's (of all the jobs). ## Applies to Travis too. Applied to all the 'script's (of all the jobs).
@@ -414,13 +432,9 @@ before_script:
# Applies only to the jobs that don't have a 'script', i.e., applies to all the 'check' jobs, but not the 'dist' one. # Applies only to the jobs that don't have a 'script', i.e., applies to all the 'check' jobs, but not the 'dist' one.
script: script:
- eval "$MATRIX_EVAL"
# Beware not too leak $SSH_PRIVATE_KEY. # Beware not too leak $SSH_PRIVATE_KEY.
# - env # - env
- sudo apt-get install -qq doxygen flex m4 - sudo apt-get install -qq doxygen flex m4
# Install and activate ICC.
- if [[ $CC == "icc" ]]; then build-aux/install-icc.sh; fi
- if [[ -f ~/.bashrc ]]; then source ~/.bashrc; fi
# Install and activate dmd. # Install and activate dmd.
- mkdir -p ~/dlang && wget https://dlang.org/install.sh -O ~/dlang/install.sh - mkdir -p ~/dlang && wget https://dlang.org/install.sh -O ~/dlang/install.sh
- source $(source ~/dlang/install.sh dmd -a) - source $(source ~/dlang/install.sh dmd -a)
@@ -452,6 +466,3 @@ script:
- if test ${PART-1} = 1; then make check VERBOSE=1 TESTSUITEFLAGS=-j2 || { cat test-suite.log && cat tests/testsuite.log && false; }; fi - if test ${PART-1} = 1; then make check VERBOSE=1 TESTSUITEFLAGS=-j2 || { cat test-suite.log && cat tests/testsuite.log && false; }; fi
- if test ${PART-2} = 2; then make maintainer-check-posix VERBOSE=1 TESTSUITEFLAGS=-j2 || { cat tests/testsuite.log && false; }; fi - if test ${PART-2} = 2; then make maintainer-check-posix VERBOSE=1 TESTSUITEFLAGS=-j2 || { cat tests/testsuite.log && false; }; fi
- if test ${PART-2} = 2; then make maintainer-check-g++ VERBOSE=1 TESTSUITEFLAGS=-j2 || { cat tests/testsuite.log && false; }; fi - if test ${PART-2} = 2; then make maintainer-check-g++ VERBOSE=1 TESTSUITEFLAGS=-j2 || { cat tests/testsuite.log && false; }; fi
after_script:
- uninstall_intel_software || true
+1 -1
View File
@@ -24,7 +24,7 @@ and nasty bugs.
----- -----
Copyright (C) 1998-2015, 2018-2019 Free Software Foundation, Inc. Copyright (C) 1998-2015, 2018-2020 Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler. This file is part of Bison, the GNU Compiler Compiler.
+1 -1
View File
@@ -26733,7 +26733,7 @@
----- -----
Copyright (C) 1987-1988, 1991-2015, 2018-2019 Free Software Copyright (C) 1987-1988, 1991-2015, 2018-2020 Free Software
Foundation, Inc. Foundation, Inc.
Copying and distribution of this file, with or without Copying and distribution of this file, with or without
+1 -1
View File
@@ -1,6 +1,6 @@
## Process this file with automake to produce Makefile.in. ## Process this file with automake to produce Makefile.in.
# Copyright (C) 2001-2015, 2018-2019 Free Software Foundation, Inc. # Copyright (C) 2001-2015, 2018-2020 Free Software Foundation, Inc.
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
+144 -22
View File
@@ -1,6 +1,23 @@
GNU Bison NEWS GNU Bison NEWS
* Noteworthy changes in release 3.4.90 (2019-10-29) [beta] * Noteworthy changes in release 3.5.2 (2020-02-13) [stable]
** Bug fixes
Portability issues and minor cosmetic issues.
The lalr1.cc skeleton properly rejects unsupported values for parse.lac
(as yacc.c does).
* Noteworthy changes in release 3.5.1 (2020-01-19) [stable]
** Bug fixes
Portability fixes.
Fix compiler warnings.
* Noteworthy changes in release 3.5 (2019-12-11) [stable]
** Backward incompatible changes ** Backward incompatible changes
@@ -11,11 +28,14 @@ GNU Bison NEWS
In C++, line numbers and columns are now represented as 'int' not In C++, line numbers and columns are now represented as 'int' not
'unsigned', so that integer overflow on positions is easily checkable via 'unsigned', so that integer overflow on positions is easily checkable via
'gcc -fsanitize=undefined' and the like. This affects the API for 'gcc -fsanitize=undefined' and the like. This affects the API for
positions. positions. The default position and location classes now expose
'counter_type' (int), used to define line and column numbers.
** Bug fixes ** Deprecated features
In Java, %define api.prefix was ignored. It now behaves as expected. The YYPRINT macro, which works only with yacc.c and only for tokens, was
obsoleted long ago by %printer, introduced in Bison 1.50 (November 2002).
It is deprecated and its support will be removed eventually.
** New features ** New features
@@ -40,9 +60,107 @@ GNU Bison NEWS
The gain is typically moderate, but in extreme cases (very simple user The gain is typically moderate, but in extreme cases (very simple user
actions), a 10% improvement can be observed. actions), a 10% improvement can be observed.
*** Generated parsers use better types for states
Stacks now use the best integral type for state numbers, instead of always
using 15 bits. As a result "small" parsers now have a smaller memory
footprint (they use 8 bits), and there is support for large automata (16
bits), and extra large (using int, i.e., typically 31 bits).
*** Generated parsers prefer signed integer types
Bison skeletons now prefer signed to unsigned integer types when either
will do, as the signed types are less error-prone and allow for better
checking with 'gcc -fsanitize=undefined'. Also, the types chosen are now
portable to unusual machines where char, short and int are all the same
width. On non-GNU platforms this may entail including <limits.h> and (if
available) <stdint.h> to define integer types and constants.
*** A skeleton for the D programming language
For the last few releases, Bison has shipped a stealth experimental
skeleton: lalr1.d. It was first contributed by Oliver Mangold, based on
Paolo Bonzini's lalr1.java, and was cleaned and improved thanks to
H. S. Teoh.
However, because nobody has committed to improving, testing, and
documenting this skeleton, it is not clear that it will be supported in
the future.
The lalr1.d skeleton *is functional*, and works well, as demonstrated in
examples/d/calc.d. Please try it, enjoy it, and... commit to support it.
*** Debug traces in Java
The Java backend no longer emits code and data for parser tracing if the
%define variable parse.trace is not defined.
** Diagnostics
*** New diagnostic: -Wdangling-alias
String literals, which allow for better error messages, are (too)
liberally accepted by Bison, which might result in silent errors. For
instance
%type <exVal> cond "condition"
does not define "condition" as a string alias to 'cond' (nonterminal
symbols do not have string aliases). It is rather equivalent to
%nterm <exVal> cond
%token <exVal> "condition"
i.e., it gives the type 'exVal' to the "condition" token, which was
clearly not the intention.
Also, because string aliases need not be defined, typos such as "baz"
instead of "bar" will be not reported.
The option -Wdangling-alias catches these situations. On
%token BAR "bar"
%type <ival> foo "foo"
%%
foo: "baz" {}
bison -Wdangling-alias reports
warning: string literal not attached to a symbol
| %type <ival> foo "foo"
| ^~~~~
warning: string literal not attached to a symbol
| foo: "baz" {}
| ^~~~~
The -Wall option does not (yet?) include -Wdangling-alias.
*** Better POSIX Yacc compatibility diagnostics
POSIX Yacc restricts %type to nonterminals. This is now diagnosed by
-Wyacc.
%token TOKEN1
%type <ival> TOKEN1 TOKEN2 't'
%token TOKEN2
%%
expr:
gives with -Wyacc
input.y:2.15-20: warning: POSIX yacc reserves %type to nonterminals [-Wyacc]
2 | %type <ival> TOKEN1 TOKEN2 't'
| ^~~~~~
input.y:2.29-31: warning: POSIX yacc reserves %type to nonterminals [-Wyacc]
2 | %type <ival> TOKEN1 TOKEN2 't'
| ^~~
input.y:2.22-27: warning: POSIX yacc reserves %type to nonterminals [-Wyacc]
2 | %type <ival> TOKEN1 TOKEN2 't'
| ^~~~~~
*** Diagnostics with insertion *** Diagnostics with insertion
The diagnostics now display suggestion below the underlined source. The diagnostics now display the suggestion below the underlined source.
Replacement for undeclared symbols are now also suggested. Replacement for undeclared symbols are now also suggested.
$ cat /tmp/foo.y $ cat /tmp/foo.y
@@ -83,26 +201,28 @@ GNU Bison NEWS
1 | %token FOO … 1 | %token FOO …
| ^~~ | ^~~
*** Debug traces in Java ** Changes
The Java backend no longer emits code and data for parser tracing if the *** Debugging glr.c and glr.cc
%define variable parse.trace is not defined.
*** Generated parsers prefer signed integer types The glr.c skeleton always had asserts to check its own behavior (not the
user's). These assertions are now under the control of the parse.assert
%define variable (disabled by default).
Bison skeletons now prefer signed to unsigned integer types when either *** Clean up
will do, as the signed types are less error-prone and allow for better
checking with 'gcc -fsanitize=undefined'. Also, the types chosen are now
portable to unusual machines where char, short and int are all the same
width. On non-GNU platforms this may entail including <limits.h> and (if
available) <stdint.h> to define integer types and constants.
*** Generated parsers use better types for states Several new compiler warnings in the generated output have been avoided.
Some unused features are no longer emitted. Cleaner generated code in
general.
Stacks now use the best integral type for state numbers, instead of always ** Bug Fixes
using 15 bits. As a result "small" parsers now have a smaller memory
footprint (they use 8 bits), and there is support for large automata (16 Portability issues in the test suite.
bits), and extra large (using int, i.e., typically 31 bits).
In theory, parsers using %nonassoc could crash when reporting verbose
error messages. This unlikely bug has been fixed.
In Java, %define api.prefix was ignored. It now behaves as expected.
* Noteworthy changes in release 3.4.2 (2019-09-12) [stable] * Noteworthy changes in release 3.4.2 (2019-09-12) [stable]
@@ -3708,7 +3828,7 @@ Output file does not redefine const for C++.
----- -----
Copyright (C) 1995-2015, 2018-2019 Free Software Foundation, Inc. Copyright (C) 1995-2015, 2018-2020 Free Software Foundation, Inc.
This file is part of Bison, the GNU Parser Generator. This file is part of Bison, the GNU Parser Generator.
@@ -3754,7 +3874,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
LocalWords: Heimbigner AST src ast Makefile srcdir MinGW xxlex XXSTYPE LocalWords: Heimbigner AST src ast Makefile srcdir MinGW xxlex XXSTYPE
LocalWords: XXLTYPE strictfp IDEs ffixit fdiagnostics parseable fixits LocalWords: XXLTYPE strictfp IDEs ffixit fdiagnostics parseable fixits
LocalWords: Wdeprecated yytext Variadic variadic yyrhs yyphrs RCS README LocalWords: Wdeprecated yytext Variadic variadic yyrhs yyphrs RCS README
LocalWords: noexcept constexpr ispell american deprecations backend LocalWords: noexcept constexpr ispell american deprecations backend Teoh
LocalWords: YYPRINT Mangold Bonzini's Wdangling exVal baz checkable gcc
LocalWords: fsanitize Vogelsgesang lis redeclared stdint automata
Local Variables: Local Variables:
ispell-dictionary: "american" ispell-dictionary: "american"
+1 -1
View File
@@ -36,7 +36,7 @@ to the bison package.
----- -----
Copyright (C) 2002, 2005, 2009-2015, 2018-2019 Free Software Foundation, Copyright (C) 2002, 2005, 2009-2015, 2018-2020 Free Software Foundation,
Inc. Inc.
This file is part of Bison, the GNU Compiler Compiler. This file is part of Bison, the GNU Compiler Compiler.
+37 -16
View File
@@ -7,20 +7,41 @@ Here are basic installation instructions for a repository checkout:
$ git submodule update --init $ git submodule update --init
$ ./bootstrap $ ./bootstrap
then proceed with the usual 'configure && make' steps. then proceed with the usual `configure && make` steps.
Be sure to read README-hacking, which contains all the needed information The file README-hacking.md is about building, modifying and checking Bison.
about building, modifying and checking Bison.
## Build from tarball ## Build from tarball
See the file INSTALL for generic compilation and installation instructions. See the file INSTALL for generic compilation and installation instructions.
Bison requires GNU m4 1.4.6 or later. See: Bison requires GNU m4 1.4.6 or later. See
https://ftp.gnu.org/gnu/m4/m4-1.4.6.tar.gz.
https://ftp.gnu.org/gnu/m4/m4-1.4.6.tar.gz ## Colored diagnostics
As an experimental feature, diagnostics are now colored, controlled by the
`--color` and `--style` options.
To use them, install the libtextstyle library before configuring Bison. It
is available from https://alpha.gnu.org/gnu/gettext/, for instance
https://alpha.gnu.org/gnu/gettext/libtextstyle-0.8.tar.gz.
The option --color supports the following arguments:
- always, yes: Enable colors.
- never, no: Disable colors.
- auto, tty (default): Enable colors if the output device is a tty.
To customize the styles, create a CSS file, say `bison-bw.css`, similar to
/* bison-bw.css */
.warning { }
.error { font-weight: 800; text-decoration: underline; }
.note { }
then invoke bison with `--style=bison-bw.css`, or set the `BISON_STYLE`
environment variable to `bison-bw.css`.
## Relocatability ## Relocatability
If you pass '--enable-relocatable' to 'configure', Bison is relocatable. If you pass `--enable-relocatable` to `configure`, Bison is relocatable.
A relocatable program can be moved or copied to a different location on the A relocatable program can be moved or copied to a different location on the
file system. It can also be used through mount points for network sharing. file system. It can also be used through mount points for network sharing.
@@ -42,15 +63,15 @@ details.
# Questions # Questions
See the section FAQ in the documentation (doc/bison.info) for frequently See the section FAQ in the documentation (doc/bison.info) for frequently
asked questions. The documentation is also available in PDF and HTML, asked questions. The documentation is also available in PDF and HTML,
provided you have a recent version of Texinfo installed: run "make pdf" or provided you have a recent version of Texinfo installed: run `make pdf` or
"make html". `make html`.
If you have questions about using Bison and the documentation does not If you have questions about using Bison and the documentation does not
answer them, please send mail to <[email protected]>. answer them, please send mail to <[email protected]>.
# Bug reports # Bug reports
Please send bug reports to <[email protected]>. Be sure to include the Please send bug reports to <[email protected]>. Be sure to include the
version number from 'bison --version', and a complete, self-contained test version number from `bison --version`, and a complete, self-contained test
case in each bug report. case in each bug report.
# Copyright statements # Copyright statements
@@ -59,13 +80,7 @@ that the range specifies every single year in that closed interval.
<!-- <!--
Local Variables: Copyright (C) 1992, 1998-1999, 2003-2005, 2008-2015, 2018-2020 Free
mode: markdown
fill-column: 76
ispell-dictionary: "american"
End:
Copyright (C) 1992, 1998-1999, 2003-2005, 2008-2015, 2018-2019 Free
Software Foundation, Inc. Software Foundation, Inc.
This file is part of GNU bison, the GNU Compiler Compiler. This file is part of GNU bison, the GNU Compiler Compiler.
@@ -83,6 +98,12 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
Local Variables:
mode: markdown
fill-column: 76
ispell-dictionary: "american"
End:
LocalWords: parsers ngettext Texinfo pdf html YYYY ZZZZ ispell american LocalWords: parsers ngettext Texinfo pdf html YYYY ZZZZ ispell american
LocalWords: MERCHANTABILITY LocalWords: MERCHANTABILITY
+1 -1
View File
@@ -12,7 +12,7 @@ the problems you encounter.
----- -----
Copyright (C) 2002, 2004, 2009-2015, 2018-2019 Free Software Foundation, Copyright (C) 2002, 2004, 2009-2015, 2018-2020 Free Software Foundation,
Inc. Inc.
This file is part of GNU Bison. This file is part of GNU Bison.
+189 -163
View File
@@ -2,20 +2,19 @@ This file attempts to describe the rules to use when hacking Bison.
Don't put this file into the distribution. Don't put this file into the distribution.
Everything related to the development of Bison is on Savannah: Everything related to the development of Bison is on Savannah:
http://savannah.gnu.org/projects/bison/.
http://savannah.gnu.org/projects/bison/
* Administrivia # Administrivia
** If you incorporate a change from somebody on the net: ## If you incorporate a change from somebody on the net:
First, if it is a large change, you must make sure they have signed the First, if it is a large change, you must make sure they have signed the
appropriate paperwork. Second, be sure to add their name and email address appropriate paperwork. Second, be sure to add their name and email address
to THANKS. to THANKS.
** If a change fixes a test, mention the test in the commit message. ## If a change fixes a test, mention the test in the commit message.
** Bug reports ## Bug reports
If somebody reports a new bug, mention his name in the commit message and in If somebody reports a new bug, mention his name in the commit message and in
the test case you write. Put him into THANKS. the test case you write. Put him into THANKS.
@@ -24,18 +23,18 @@ demonstrates the bug. Then fix the bug, re-run the test suite, and check
everything in. everything in.
* Hacking # Hacking
** Visible changes ## Visible changes
Which include serious bug fixes, must be mentioned in NEWS. Which include serious bug fixes, must be mentioned in NEWS.
** Translations ## Translations
Only user visible strings are to be translated: error messages, bits of the Only user visible strings are to be translated: error messages, bits of the
.output file etc. This excludes impossible error messages (comparable to .output file etc. This excludes impossible error messages (comparable to
assert/abort), and all the --trace output which is meant for the maintainers assert/abort), and all the --trace output which is meant for the maintainers
only. only.
** Horizontal tabs ## Horizontal tabs
Do not add horizontal tab characters to any file in Bison's repository Do not add horizontal tab characters to any file in Bison's repository
except where required. For example, do not use tabs to format C code. except where required. For example, do not use tabs to format C code.
However, make files, ChangeLog, and some regular expressions require tabs. However, make files, ChangeLog, and some regular expressions require tabs.
@@ -43,12 +42,12 @@ Also, test cases might need to contain tabs to check that Bison properly
processes tabs in its input. processes tabs in its input.
* Working from the repository # Working from the repository
These notes intend to help people working on the checked-out sources. These These notes intend to help people working on the checked-out sources. These
requirements do not apply when building from a distribution tarball. requirements do not apply when building from a distribution tarball.
** Requirements ## Requirements
We've opted to keep only the highest-level sources in the repository. This We've opted to keep only the highest-level sources in the repository. This
eases our maintenance burden, (fewer merges etc.), but imposes more eases our maintenance burden, (fewer merges etc.), but imposes more
@@ -75,8 +74,8 @@ If you're using a GNU/Linux distribution, the easiest way to install the
above packages depends on your system. The following shell command should above packages depends on your system. The following shell command should
work for Debian-based systems such as Ubuntu: work for Debian-based systems such as Ubuntu:
sudo apt-get install \ sudo apt-get install \
autoconf automake autopoint flex graphviz help2man texinfo valgrind autoconf automake autopoint flex graphviz help2man texinfo valgrind
Bison is written using Bison grammars, so there are bootstrapping issues. Bison is written using Bison grammars, so there are bootstrapping issues.
The bootstrap script attempts to discover when the C code generated from the The bootstrap script attempts to discover when the C code generated from the
@@ -89,53 +88,51 @@ after synchronizing from the repository a plain 'make' should be sufficient.
Note, however, that when gnulib is updated, running './bootstrap' again Note, however, that when gnulib is updated, running './bootstrap' again
might be needed. might be needed.
** First checkout ## First checkout
Obviously, if you are reading these notes, you did manage to check out this Obviously, if you are reading these notes, you did manage to check out this
package from the repository. For the record, you will find all the relevant package from the repository. For the record, you will find all the relevant
information on: information on http://savannah.gnu.org/git/?group=bison.
http://savannah.gnu.org/git/?group=bison
Bison uses Git submodules: subscriptions to other Git repositories. In Bison uses Git submodules: subscriptions to other Git repositories. In
particular it uses gnulib, the GNU portability library. To ask Git to particular it uses gnulib, the GNU portability library. To ask Git to
perform the first checkout of the submodules, run perform the first checkout of the submodules, run
$ git submodule update --init $ git submodule update --init
The next step is to get other files needed to build, which are extracted The next step is to get other files needed to build, which are extracted
from other source packages: from other source packages:
$ ./bootstrap $ ./bootstrap
Bootstrapping updates the submodules to the versions registered in the Bootstrapping updates the submodules to the versions registered in the
top-level directory. To change gnulib, first check out the version you want top-level directory. To change gnulib, first check out the version you want
in `gnulib`, then commit this change in Bison's repository, and finally run in `gnulib`, then commit this change in Bison's repository, and finally run
bootstrap. bootstrap.
If it fails with missing symbols (e.g., "error: possibly undefined macro: If it fails with missing symbols (e.g., `error: possibly undefined macro:
AC_PROG_GNU_M4"), you are likely to have forgotten the submodule AC_PROG_GNU_M4`), you are likely to have forgotten the submodule
initialization part. To recover from it, run `git reset --hard HEAD`, and initialization part. To recover from it, run `git reset --hard HEAD`, and
restart with the submodule initialization. Otherwise, there you are! Just restart with the submodule initialization. Otherwise, there you are! Just
$ ./configure $ ./configure
$ make $ make
$ make check $ make check
At this point, there should be no difference between your local copy, and At this point, there should be no difference between your local copy, and
the master copy: the master copy:
$ git diff $ git diff
should output no difference. should output no difference.
Enjoy! Enjoy!
** Updating ## Updating
If you have git at version 1.8.2 or later, the command If you have git at version 1.8.2 or later, the command
$ git submodule update --recursive --remote $ git submodule update --recursive --remote
will be useful for updating to the latest version of all submodules. will be useful for updating to the latest version of all submodules.
@@ -143,109 +140,132 @@ Under earlier versions, use of submodules make things somewhat different
because git does not yet support recursive operations: submodules must be because git does not yet support recursive operations: submodules must be
taken care of explicitly. taken care of explicitly.
*** Updating Bison ### Updating Bison
If you pull a newer version of a branch, say via "git pull", you might If you pull a newer version of a branch, say via `git pull`, you might
import requests for updated submodules. A simple "git diff" will reveal if import requests for updated submodules. A simple `git diff` will reveal if
the current version of the submodule (i.e., the actual contents of the the current version of the submodule (i.e., the actual contents of the
gnulib directory) and the current request from the subscriber (i.e., the gnulib directory) and the current request from the subscriber (i.e., the
reference of the version of gnulib that the Bison repository requests) reference of the version of gnulib that the Bison repository requests)
differ. To upgrade the submodules (i.e., to check out the version that is differ. To upgrade the submodules (i.e., to check out the version that is
actually requested by the subscriber, run "git submodule update". actually requested by the subscriber, run `git submodule update`.
$ git pull $ git pull
$ git submodule update $ git submodule update
*** Updating a submodule ### Updating a submodule
To update a submodule, say gnulib, do as follows: To update a submodule, say gnulib, do as follows:
Get the most recent version of the master branch from git. Get the most recent version of the master branch from git.
$ cd gnulib $ cd gnulib
$ git fetch $ git fetch
$ git checkout -b master --track origin/master $ git checkout -b master --track origin/master
Make sure Bison can live with that version of gnulib. Make sure Bison can live with that version of gnulib.
$ cd .. $ cd ..
$ ./bootstrap $ ./bootstrap
$ make distcheck $ make distcheck
Register your changes. Register your changes.
$ git checkin ... $ git commit ...
For a suggestion of what gnulib commit might be stable enough for a formal For a suggestion of what gnulib commit might be stable enough for a formal
release, see the ChangeLog in the latest gnulib snapshot at: release, see the ChangeLog in the latest gnulib snapshot at
http://erislabs.net/ianb/projects/gnulib/.
http://erislabs.net/ianb/projects/gnulib/
The Autoconf files we use are currently: The Autoconf files we use are currently:
- m4/m4.m4
m4/m4.m4 - lib/m4sugar/m4sugar.m4
lib/m4sugar/m4sugar.m4 - lib/m4sugar/foreach.m4
lib/m4sugar/foreach.m4
These files don't change very often in Autoconf, so it should be relatively These files don't change very often in Autoconf, so it should be relatively
straight-forward to examine the differences in order to decide whether to straight-forward to examine the differences in order to decide whether to
update. update.
* Test suite # Test Suite
** make check ## make check
Use liberally. Consume without moderation. It is composed of two kinds of tests: the
examples, and the main test suite.
** Updating the expectations ### The Examples
Sometimes some changes have a large impact on the test suite (e.g., when we In examples/, there is a number of ready-to-use examples (see
added the "[-Wother]" part to all the warnings). Part of the update can be examples/README.md). These examples have small test suites run by `make
done with a crude tool: tests/update-test. Read it for more information. check`. The test results are in local `*.log` files (e.g.,
`$build/examples/c/calc/calc.log`).
** TESTSUITEFLAGS ### The Main Test Suite
To run just the testsuite (not the tests related to the examples), run `make The main test suite, in tests/, is written on top of GNU Autotest, which is
check-local`. part of Autoconf. Run `info autoconf 'Using Autotest'` to read the
documentation, not only about how to write tests, but also where are the
logs, how to read them etc.
The main test suite generates a log for each test (e.g.,
`$build/tests/testsuite.dir/004/testsuite.log` for test #4), and a main log
file in `$build/tests/testsuite.log`. The latter is meant for end users: it
contains lots of details that should help diagnosing issues, including build
issues. The per-test logs are more convenient when working locally.
#### TESTSUITEFLAGS
To run just the main test suite, run `make check-local`.
The default is for make check-local to run all tests sequentially. This can The default is for make check-local to run all tests sequentially. This can
be very time consuming when checking repeatedly or on slower setups. This be very time consuming when checking repeatedly or on slower setups. This
can be sped up in two ways: can be sped up in two ways:
Using -j, in a make-like fashion, for example: Using -j, in a make-like fashion, for example:
$ make check-local TESTSUITEFLAGS='-j8'
$ make check-local TESTSUITEFLAGS='-j8'
Actually, when using GNU Make, TESTSUITEFLAGS defaults to the -jN passed to Actually, when using GNU Make, TESTSUITEFLAGS defaults to the -jN passed to
it, so you may simply run it, so you may simply run
$ make check-local -j8
$ make check-local -j8
Running only the tests of a certain category, as specified in the AT files Running only the tests of a certain category, as specified in the AT files
with AT_KEYWORDS([[category]]). Categories include: with AT_KEYWORDS([[category]]). Categories include:
- c++, for c++ parsers - c++, for c++ parsers
- deprec, for tests concerning deprecated constructs. - deprec, for tests concerning deprecated constructs.
- glr, for glr parsers - glr, for glr parsers
- java, for java parsers - java, for java parsers
- report, for automaton dumps - report, for automaton dumps
To get a list of all the tests (and their keywords for -k), run
$ ./tests/testsuite -l
To run a specific set of tests, use -k (for "keyword"). For example: To run a specific set of tests, use -k (for "keyword"). For example:
$ make check-local TESTSUITEFLAGS='-k c++'
$ make check-local TESTSUITEFLAGS='-k c++'
Both can be combined. Both can be combined.
$ make check-local TESTSUITEFLAGS='-j8 -k c++'
$ make check-local TESTSUITEFLAGS='-j8 -k c++'
To rerun the tests that failed: To rerun the tests that failed:
$ make recheck -j5
** Typical errors $ make recheck -j5
If the test suite shows failures such as the following one
.../bison/lib/getopt.h:196:8: error: redefinition of 'struct option' #### Updating the Expectations
/usr/include/getopt.h:54:8: error: previous definition of 'struct option' Sometimes some changes have a large impact on the test suite (e.g., when we
added the `[-Wother]` part to all the warnings). Part of the update can be
done with a crude tool: `build-aux/update-test`.
it probably means that some file was compiled without Once you ran the test suite, and therefore have many `testsuite.log` files,
AT_DATA_SOURCE_PROLOGUE. This error is due to the fact that our -I options run, from the source tree:
pick up gnulib's replacement headers, such as getopt.h, and this will go
wrong if config.h was not included first.
See tests/local.at for details. $ ./build-aux/update-test $build/tests/testsuite.dir/*/testsuite.log
** make maintainer-check-valgrind where `$build` would be your build tree. This will hopefully update most
tests. Re-run the test suite. It might be interesting to run `update-test`
again, since some early failures may stop latter tests from being run. Yet
at some point, you'll have to fix remaining issues by hand...
## make maintainer-check-valgrind
This target uses valgrind both to check bison, and the generated parsers. This target uses valgrind both to check bison, and the generated parsers.
This is not mature on Mac OS X. First, Valgrind does support the way bison This is not mature on Mac OS X. First, Valgrind does support the way bison
@@ -256,13 +276,13 @@ bison. build-aux/darwin11.4.0.valgrind addresses some of them.
Third, valgrind issues warnings such as: Third, valgrind issues warnings such as:
--99312:0:syswrap- WARNING: Ignoring sigreturn( ..., UC_RESET_ALT_STACK ); --99312:0:syswrap- WARNING: Ignoring sigreturn( ..., UC_RESET_ALT_STACK );
which cause the test to fail uselessly. It is hard to ignore these errors which cause the test to fail uselessly. It is hard to ignore these errors
with a major overhaul of the way instrumentation is performed in the test with a major overhaul of the way instrumentation is performed in the test
suite. So currently, do not try to run valgrind on Mac OS X. suite. So currently, do not try to run valgrind on Mac OS X.
** Release checks ## Release checks
Try to run the test suite with more severe conditions before a Try to run the test suite with more severe conditions before a
release: release:
@@ -274,25 +294,25 @@ release:
its warnings; there's no need to obey blindly to it its warnings; there's no need to obey blindly to it
(<http://lists.gnu.org/archive/html/bison-patches/2012-05/msg00057.html>). (<http://lists.gnu.org/archive/html/bison-patches/2012-05/msg00057.html>).
- Check with "make syntax-check" if there are issues diagnosed by gnulib. - Check with `make syntax-check` if there are issues diagnosed by gnulib.
- run "make maintainer-check" which: - run `make maintainer-check` which:
- runs "valgrind -q bison" to run Bison under Valgrind. - runs `valgrind -q bison` to run Bison under Valgrind.
- runs the parsers under Valgrind. - runs the parsers under Valgrind.
- runs the test suite with G++ as C compiler... - runs the test suite with G++ as C compiler...
- run "make maintainer-check-push", which runs "make maintainer-check" while - run `make maintainer-check-push`, which runs `make maintainer-check` while
activating the push implementation and its pull interface wrappers in many activating the push implementation and its pull interface wrappers in many
test cases that were originally written to exercise only the pull test cases that were originally written to exercise only the pull
implementation. This makes certain the push implementation can perform implementation. This makes certain the push implementation can perform
every task the pull implementation can. every task the pull implementation can.
- run "make maintainer-check-xml", which runs "make maintainer-check" while - run `make maintainer-check-xml`, which runs `make maintainer-check` while
checking Bison's XML automaton report for every working grammar passed to checking Bison's XML automaton report for every working grammar passed to
Bison in the test suite. The check just diffs the output of Bison's Bison in the test suite. The check just diffs the output of Bison's
included XSLT style sheets with the output of --report=all and --graph. included XSLT style sheets with the output of --report=all and --graph.
- running "make maintainer-check-release" takes care of running - running `make maintainer-check-release` takes care of running
maintainer-check, maintainer-check-push and maintainer-check-xml. maintainer-check, maintainer-check-push and maintainer-check-xml.
- Change tests/atlocal/CFLAGS to add your preferred options. - Change tests/atlocal/CFLAGS to add your preferred options.
@@ -300,7 +320,7 @@ release:
- Test with a very recent version of GCC for both C and C++. Testing with - Test with a very recent version of GCC for both C and C++. Testing with
older versions that are still in use is nice too. older versions that are still in use is nice too.
** gnulib ## gnulib
To run tests on gnulib components (e.g., on bitset): To run tests on gnulib components (e.g., on bitset):
cd gnulib cd gnulib
@@ -319,58 +339,58 @@ re-run the tests, run:
./configure -C CC='gcc-mp-8 -fsanitize=undefined' CFLAGS='-ggdb' ./configure -C CC='gcc-mp-8 -fsanitize=undefined' CFLAGS='-ggdb'
make check make check
* Release Procedure # Release Procedure
This section needs to be updated to take into account features from gnulib. This section needs to be updated to take into account features from gnulib.
In particular, be sure to read README-release. In particular, be sure to read README-release.
** Update the submodules. See above. ## Update the submodules. See above.
** Update maintainer tools, such as Autoconf. See above. ## Update maintainer tools, such as Autoconf. See above.
** Try to get the *.pot files to the Translation Project at least one ## Try to get the *.pot files to the Translation Project at least one
week before a stable release, to give them time to translate them. Before week before a stable release, to give them time to translate them. Before
generating the *.pot files, make sure that po/POTFILES.in and generating the *.pot files, make sure that po/POTFILES.in and
runtime-po/POTFILES.in list all files with translatable strings. This runtime-po/POTFILES.in list all files with translatable strings. This
helps: grep -l '\<_(' *. helps: `grep -l '\<_(' *`.
** Tests ## Tests
See above. See above.
** Update the foreign files ## Update the foreign files
Running "./bootstrap" in the top level should update them all for you. This Running `./bootstrap` in the top level should update them all for you. This
covers PO files too. Sometimes a PO file contains problems that causes it covers PO files too. Sometimes a PO file contains problems that causes it
to be rejected by recent Gettext releases; please report these to the to be rejected by recent Gettext releases; please report these to the
Translation Project. Translation Project.
** Update README ## Update README
Make sure the information in README is current. Most notably, make sure it Make sure the information in README is current. Most notably, make sure it
recommends a version of GNU M4 that is compatible with the latest Bison recommends a version of GNU M4 that is compatible with the latest Bison
sources. sources.
** Check copyright years. ## Check copyright years.
We update years in copyright statements throughout Bison once at the start We update years in copyright statements throughout Bison once at the start
of every year by running "make update-copyright". However, before a of every year by running `make update-copyright`. However, before a
release, it's good to verify that it's actually been run. Besides the release, it's good to verify that it's actually been run. Besides the
copyright statement for each Bison file, check the copyright statements that copyright statement for each Bison file, check the copyright statements that
the skeletons insert into generated parsers, and check all occurrences of the skeletons insert into generated parsers, and check all occurrences of
PACKAGE_COPYRIGHT_YEAR in configure.ac. `PACKAGE_COPYRIGHT_YEAR` in configure.ac.
** Update NEWS, commit and tag. ## Update NEWS, commit and tag.
See do-release-commit-and-tag in README-release. For a while, we used beta See do-release-commit-and-tag in README-release. For a while, we used beta
names such as "2.6_rc1". Now that we use gnulib in the release procedure, names such as `2.6_rc1`. Now that we use gnulib in the release procedure,
we must use "2.5.90", which has the additional benefit of being properly we must use `2.5.90`, which has the additional benefit of being properly
sorted in "git tag -l". sorted in `git tag -l`.
** make alpha, beta, or stable ## make alpha, beta, or stable
See README-release. See README-release.
** Upload ## Upload
There are two ways to upload the tarballs to the GNU servers: using gnupload There are two ways to upload the tarballs to the GNU servers: using gnupload
(from gnulib), or by hand. Obviously prefer the former. But in either (from gnulib), or by hand. Obviously prefer the former. But in either
case, be sure to read the following paragraph. case, be sure to read the following paragraph.
*** Setup ### Setup
You need "gnupg". You need `gnupg`.
Make sure your public key has been uploaded at least to keys.gnupg.net. You Make sure your public key has been uploaded at least to keys.gnupg.net. You
can upload it with: can upload it with:
@@ -379,106 +399,105 @@ can upload it with:
where F125BDF3 should be replaced with your key ID. where F125BDF3 should be replaced with your key ID.
*** Using gnupload ### Using gnupload
You need "ncftp". You need `ncftp`.
At the end "make stable" (or alpha/beta) will display the procedure to run. At the end `make stable` (or alpha/beta) will display the procedure to run.
Just copy and paste it in your shell. Just copy and paste it in your shell.
*** By hand ### By hand
The generic GNU upload procedure is at: The generic GNU upload procedure is at
http://www.gnu.org/prep/maintain/maintain.html#Automated-FTP-Uploads.
http://www.gnu.org/prep/maintain/maintain.html#Automated-FTP-Uploads
Follow the instructions there to register your information so you're permitted Follow the instructions there to register your information so you're permitted
to upload. to upload.
Here's a brief reminder of how to roll the tarballs and upload them: Here's a brief reminder of how to roll the tarballs and upload them:
*** make distcheck ### make distcheck
*** gpg -b bison-2.3b.tar.gz ### gpg -b bison-2.3b.tar.gz
*** In a file named "bison-2.3b.tar.gz.directive", type: ### In a file named `bison-2.3b.tar.gz.directive`, type:
version: 1.1 version: 1.1
directory: bison directory: bison
filename: bison-2.3b.tar.gz filename: bison-2.3b.tar.gz
*** gpg --clearsign bison-2.3b.tar.gz.directive ### gpg --clearsign bison-2.3b.tar.gz.directive
*** ftp ftp-upload.gnu.org # Log in as anonymous. ### ftp ftp-upload.gnu.org # Log in as anonymous.
*** cd /incoming/alpha # cd /incoming/ftp for full release. ### cd /incoming/alpha # cd /incoming/ftp for full release.
*** put bison-2.3b.tar.gz # This can take a while. ### put bison-2.3b.tar.gz # This can take a while.
*** put bison-2.3b.tar.gz.sig ### put bison-2.3b.tar.gz.sig
*** put bison-2.3b.tar.gz.directive.asc ### put bison-2.3b.tar.gz.directive.asc
*** Repeat all these steps for bison-2.3b.tar.xz. ### Repeat all these steps for bison-2.3b.tar.xz.
** Update Bison manual on www.gnu.org. ## Update Bison manual on www.gnu.org.
The instructions below are obsolete, and left in case one would like to run The instructions below are obsolete, and left in case one would like to run
the commands by hand. Today, one just needs to run the commands by hand. Today, one just needs to run
$ make web-manual-update $ make web-manual-update
See README-release. See README-release.
*** You need a non-anonymous checkout of the web pages directory. ### You need a non-anonymous checkout of the web pages directory.
$ cvs -d YOUR_USERID@cvs.savannah.gnu.org:/web/bison checkout bison $ cvs -d YOUR_USERID@cvs.savannah.gnu.org:/web/bison checkout bison
*** Get familiar with the instructions for web page maintainers. ### Get familiar with the instructions for web page maintainers.
http://www.gnu.org/server/standards/readme_index.html http://www.gnu.org/server/standards/readme_index.html
http://www.gnu.org/server/standards/README.software.html http://www.gnu.org/server/standards/README.software.html
especially the note about symlinks. especially the note about symlinks.
*** Build the web pages. ### Build the web pages.
Assuming BISON_CHECKOUT refers to a checkout of the Bison dir, and Assuming BISON_CHECKOUT refers to a checkout of the Bison dir, and
BISON_WWW_CHECKOUT refers to the web directory created above, do: BISON_WWW_CHECKOUT refers to the web directory created above, do:
$ cd $BISON_CHECKOUT/doc $ cd $BISON_CHECKOUT/doc
$ make stamp-vti $ make stamp-vti
$ ../build-aux/gendocs.sh -o "$BISON_WWW_CHECKOUT/manual" \ $ ../build-aux/gendocs.sh -o "$BISON_WWW_CHECKOUT/manual" \
bison "Bison - GNU parser generator" bison "Bison - GNU parser generator"
$ cd $BISON_WWW_CHECKOUT $ cd $BISON_WWW_CHECKOUT
Verify that the result looks sane. Verify that the result looks sane.
*** Commit the modified and the new files. ### Commit the modified and the new files.
*** Remove old files. ### Remove old files.
Find the files which have not been overwritten (because they belonged to Find the files which have not been overwritten (because they belonged to
sections that have been removed or renamed): sections that have been removed or renamed):
$ cd manual/html_node $ cd manual/html_node
$ ls -lt $ ls -lt
Remove these files and commit their removal to CVS. For each of these Remove these files and commit their removal to CVS. For each of these
files, add a line to the file .symlinks. This will ensure that hyperlinks files, add a line to the file .symlinks. This will ensure that hyperlinks
to the removed files will redirect to the entire manual; this is better than to the removed files will redirect to the entire manual; this is better than
a 404 error. a 404 error.
** Announce ## Announce
The "make release" command just created a template, The "make release" command just created a template,
$HOME/announce-bison-X.Y. Otherwise, to generate it, run: `$HOME/announce-bison-X.Y`. Otherwise, to generate it, run:
make RELEASE_TYPE=alpha gpg_key_ID=F125BDF3 announcement make RELEASE_TYPE=alpha gpg_key_ID=F125BDF3 announcement
where alpha can be replaced by beta or stable and F125BDF3 should be where alpha can be replaced by `beta` or `table` and F125BDF3 should be
replaced with your key ID. replaced with your key ID.
Complete/fix the announcement file. The generated list of recipients Complete/fix the announcement file. The generated list of recipients
(info-gnu@gnu.org, bug-bison@gnu.org, help-bison@gnu.org, (info-gnu@gnu.org, bison-announce@gnu.org, bug-bison@gnu.org,
bison-patches@gnu.org, and coordinator@translationproject.org) is help-bison@gnu.org, bison-patches@gnu.org, and
appropriate for a stable release or a "serious beta". For any other coordinator@translationproject.org) is appropriate for a stable release or a
release, drop at least info-gnu@gnu.org. For an example of how to fill out "serious beta". For any other release, drop at least info-gnu@gnu.org. For
the rest of the template, search the mailing list archives for the most an example of how to fill out the rest of the template, search the mailing
recent release announcement. list archives for the most recent release announcement.
For a stable release, send the same announcement on the comp.compilers For a stable release, send the same announcement on the comp.compilers
newsgroup by sending email to compilers@iecc.com. Do not make any Cc as the newsgroup by sending email to compilers@iecc.com. Do not make any Cc as the
moderator will throw away anything cross-posted or Cc'ed. It really needs moderator will throw away anything cross-posted or Cc'ed. It really needs
to be a separate message. to be a separate message.
** Prepare NEWS ## Prepare NEWS
So that developers don't accidentally add new items to the old NEWS entry, So that developers don't accidentally add new items to the old NEWS entry,
create a new empty entry in line 3 (without the two leading spaces): create a new empty entry in line 3 (without the two leading spaces):
@@ -486,9 +505,9 @@ create a new empty entry in line 3 (without the two leading spaces):
Push these changes. Push these changes.
----- <!--
Copyright (C) 2002-2005, 2007-2015, 2018-2019 Free Software Foundation, Copyright (C) 2002-2005, 2007-2015, 2018-2020 Free Software Foundation,
Inc. Inc.
This file is part of GNU Bison. This file is part of GNU Bison.
@@ -506,13 +525,20 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
LocalWords: Automake Autoconf Gettext Gzip Rsync Valgrind gnulib submodules
LocalWords: submodule init cd distcheck checkin ChangeLog valgrind sigreturn
LocalWords: UC gcc DGNULIB POSIXCHECK xml XSLT glr lalr README po runtime rc
LocalWords: gnupload gnupg gpg keyserver BDF ncftp filename clearsign cvs dir
LocalWords: symlinks vti html lt POSIX Cc'ed
Local Variables: Local Variables:
mode: outline mode: markdown
fill-column: 76 fill-column: 76
ispell-dictionary: "american"
End: End:
LocalWords: Automake Autoconf Gettext Gzip Rsync Valgrind gnulib submodules
LocalWords: submodule init cd distcheck ChangeLog valgrind sigreturn sudo
LocalWords: UC gcc DGNULIB POSIXCHECK xml XSLT glr lalr README po runtime rc
LocalWords: gnupload gnupg gpg keyserver BDF ncftp filename clearsign cvs dir
LocalWords: symlinks vti html lt POSIX Cc'ed Graphviz Texinfo autoconf jN
LocalWords: automake autopoint graphviz texinfo PROG Wother parsers
LocalWords: TESTSUITEFLAGS deprec struct gnulib's getopt config ggdb
LocalWords: bitset fsanitize symlink CFLAGS MERCHANTABILITY ispell
LocalWords: american
-->
+6 -2
View File
@@ -60,6 +60,7 @@ Enrico Scholz [email protected]
Eric Blake [email protected] Eric Blake [email protected]
Eric S. Raymond [email protected] Eric S. Raymond [email protected]
Étienne Renault [email protected] Étienne Renault [email protected]
Evan Nemerson [email protected]
Evgeny Stambulchik [email protected] Evgeny Stambulchik [email protected]
Fabrice Bauzac [email protected] Fabrice Bauzac [email protected]
Ferdinand Thiessen [email protected] Ferdinand Thiessen [email protected]
@@ -79,6 +80,7 @@ Hans Åberg [email protected]
Horst Von Brand [email protected] Horst Von Brand [email protected]
Jan Nieuwenhuizen [email protected] Jan Nieuwenhuizen [email protected]
Jannick [email protected] Jannick [email protected]
Jeff Hammond [email protected]
Jerry Quinn [email protected] Jerry Quinn [email protected]
Jesse Thilo [email protected] Jesse Thilo [email protected]
Jim Kent [email protected] Jim Kent [email protected]
@@ -128,6 +130,7 @@ Nick Bowler [email protected]
Nicolas Bedon [email protected] Nicolas Bedon [email protected]
Nicolas Burrus [email protected] Nicolas Burrus [email protected]
Nicolas Tisserand [email protected] Nicolas Tisserand [email protected]
Nikki Valen [email protected]
Noah Friedman [email protected] Noah Friedman [email protected]
Odd Arild Olsen [email protected] Odd Arild Olsen [email protected]
Oleg Smolsky [email protected] Oleg Smolsky [email protected]
@@ -205,8 +208,9 @@ Wwp [email protected]
xolodho [email protected] xolodho [email protected]
Yuichiro Kaneko [email protected] Yuichiro Kaneko [email protected]
Zack Weinberg [email protected] Zack Weinberg [email protected]
長田偉伸 [email protected]
江 祖铭 [email protected] 江 祖铭 [email protected]
長田偉伸 [email protected]
马俊 [email protected]
Many people are not named here because we lost track of them. We Many people are not named here because we lost track of them. We
thank them! Please, help us keeping this list up to date. thank them! Please, help us keeping this list up to date.
@@ -218,7 +222,7 @@ End:
----- -----
Copyright (C) 2000-2015, 2018-2019 Free Software Foundation, Inc. Copyright (C) 2000-2015, 2018-2020 Free Software Foundation, Inc.
This file is part of Bison, the GNU Parser Generator. This file is part of Bison, the GNU Parser Generator.
+65 -79
View File
@@ -1,4 +1,4 @@
* Bison 3.5 * Bison 3.6
** doc ** doc
I feel its ugly to use the GNU style to declare functions in the doc. It I feel its ugly to use the GNU style to declare functions in the doc. It
generates tons of white space in the page, and may contribute to bad page generates tons of white space in the page, and may contribute to bad page
@@ -50,12 +50,72 @@ syntax error, unexpected $end, expecting ↦ or 🎅🐃 or '\n'
While at it, we should stop using "$end" by default, in favor of "end of While at it, we should stop using "$end" by default, in favor of "end of
file", or "end of input", whatever. See how lalr1.java does that. file", or "end of input", whatever. See how lalr1.java does that.
** consistency
token vs terminal, variable vs non terminal.
** Stop indentation in diagnostics
Before Bison 2.7, we printed "flatly" the dependencies in long diagnostics:
input.y:2.7-12: %type redeclaration for exp
input.y:1.7-12: previous declaration
In Bison 2.7, we indented them
input.y:2.7-12: error: %type redeclaration for exp
input.y:1.7-12: previous declaration
Later we quoted the source in the diagnostics, and today we have:
/tmp/foo.y:1.12-14: warning: symbol FOO redeclared [-Wother]
1 | %token FOO FOO
| ^~~
/tmp/foo.y:1.8-10: previous declaration
1 | %token FOO FOO
| ^~~
The indentation is no longer helping. We should probably get rid of it, or
maybe keep it only when -fno-caret. GCC displays this as a "note":
$ g++-mp-9 -Wall /tmp/foo.c -c
/tmp/foo.c:1:10: error: redefinition of 'int foo'
1 | int foo, foo;
| ^~~
/tmp/foo.c:1:5: note: 'int foo' previously declared here
1 | int foo, foo;
| ^~~
Likewise for Clang, contrary to what I believed (because "note:" is written
in black, so it doesn't show in my terminal :-)
$ clang++-mp-8.0 -Wall /tmp/foo.c -c
clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
/tmp/foo.c:1:10: error: redefinition of 'foo'
int foo, foo;
^
/tmp/foo.c:1:5: note: previous definition is here
int foo, foo;
^
1 error generated.
See also the item "Complaint submessage indentation" below.
** api.token.raw ** api.token.raw
Maybe we should exhibit the YYUNDEFTOK token. It could also be assigned a Maybe we should exhibit the YYUNDEFTOK token. It could also be assigned a
semantic value so that yyerror could be used to report invalid lexemes. semantic value so that yyerror could be used to report invalid lexemes.
See also the item "$undefined" below. See also the item "$undefined" below.
* Bison 3.6 ** C++
Move to int everywhere instead of unsigned? stack_size, etc. The parser
itself uses int (for yylen for instance), yet stack is based on size_t.
Maybe locations should also move to ints.
Paul Eggert already covered most of this. But before publishing these
changes, we need to ask our C++ users if they agree with that change, or if
we need some migration path. Could be a %define variable, or simply
%require "3.5".
* Bison 3.7
** Unit rules / Injection rules (Akim Demaille) ** Unit rules / Injection rules (Akim Demaille)
Maybe we could expand unit rules (or "injections", see Maybe we could expand unit rules (or "injections", see
https://homepages.cwi.nl/~daybuild/daily-books/syntax/2-sdf/sdf.html), i.e., https://homepages.cwi.nl/~daybuild/daily-books/syntax/2-sdf/sdf.html), i.e.,
@@ -134,51 +194,8 @@ $ ./tests/testsuite -l | grep errors | sed q
38: input.at:1730 errors 38: input.at:1730 errors
* Short term * Short term
** Stop indentation in diagnostics ** Get rid of YYPRINT and b4_toknum
Before Bison 2.7, we printed "flatly" the dependencies in long diagnostics: Besides yytoknum is wrong when api.token.raw is defined.
input.y:2.7-12: %type redeclaration for exp
input.y:1.7-12: previous declaration
In Bison 2.7, we indented them
input.y:2.7-12: error: %type redeclaration for exp
input.y:1.7-12: previous declaration
Later we quoted the source in the diagnostics, and today we have:
/tmp/foo.y:1.12-14: warning: symbol FOO redeclared [-Wother]
1 | %token FOO FOO
| ^~~
/tmp/foo.y:1.8-10: previous declaration
1 | %token FOO FOO
| ^~~
The indentation is no longer helping. We should probably get rid of it, or
maybe keep it only when -fno-caret. GCC displays this as a "note":
$ g++-mp-9 -Wall /tmp/foo.c -c
/tmp/foo.c:1:10: error: redefinition of 'int foo'
1 | int foo, foo;
| ^~~
/tmp/foo.c:1:5: note: 'int foo' previously declared here
1 | int foo, foo;
| ^~~
Likewise for Clang, contrary to what I believed (because "note:" is written
in black, so it doesn't show in my terminal :-)
$ clang++-mp-8.0 -Wall /tmp/foo.c -c
clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
/tmp/foo.c:1:10: error: redefinition of 'foo'
int foo, foo;
^
/tmp/foo.c:1:5: note: previous definition is here
int foo, foo;
^
1 error generated.
See also the item "Complaint submessage indentation" below.
** Better design for diagnostics ** Better design for diagnostics
The current implementation of diagnostics is adhoc, it grew organically. It The current implementation of diagnostics is adhoc, it grew organically. It
@@ -214,20 +231,6 @@ page:
https://gcc.gnu.org/onlinedocs/gcc/Diagnostic-Message-Formatting-Options.html https://gcc.gnu.org/onlinedocs/gcc/Diagnostic-Message-Formatting-Options.html
** consistency
token vs terminal, variable vs non terminal.
** C++
Move to int everywhere instead of unsigned? stack_size, etc. The parser
itself uses int (for yylen for instance), yet stack is based on size_t.
Maybe locations should also move to ints.
Paul Eggert already covered most of this. But before publishing these
changes, we need to ask our C++ users if they agree with that change, or if
we need some migration path. Could be a %define variable, or simply
%require "3.5".
** Graphviz display code thoughts ** Graphviz display code thoughts
The code for the --graph option is over two files: print_graph, and The code for the --graph option is over two files: print_graph, and
graphviz. This is because Bison used to also produce VCG graphs, but since graphviz. This is because Bison used to also produce VCG graphs, but since
@@ -600,23 +603,6 @@ to bison. If you're interested, I'll work on a patch.
* Better graphics * Better graphics
Equip the parser with a means to create the (visual) parse tree. Equip the parser with a means to create the (visual) parse tree.
* Complaint submessage indentation.
We already have an implementation that works fairly well for named
reference messages, but it would be nice to use it consistently for all
submessages from Bison. For example, the "previous definition"
submessage or the list of correct values for a %define variable might
look better with indentation.
However, the current implementation makes the assumption that the
location printed on the first line is not usually much shorter than the
locations printed on the submessage lines that follow. That assumption
may not hold true as often for some kinds of submessages especially if
we ever support multiple grammar files.
Here's a proposal for how a new implementation might look:
http://lists.gnu.org/archive/html/bison-patches/2009-09/msg00086.html
Local Variables: Local Variables:
mode: outline mode: outline
@@ -626,7 +612,7 @@ End:
----- -----
Copyright (C) 2001-2004, 2006, 2008-2015, 2018-2019 Free Software Copyright (C) 2001-2004, 2006, 2008-2015, 2018-2020 Free Software
Foundation, Inc. Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler. This file is part of Bison, the GNU Compiler Compiler.
+1 -1
View File
@@ -4,7 +4,7 @@ scriptversion=2019-01-04.17; # UTC
# Bootstrap this package from checked-out sources. # Bootstrap this package from checked-out sources.
# Copyright (C) 2003-2019 Free Software Foundation, Inc. # Copyright (C) 2003-2020 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
+3 -1
View File
@@ -1,6 +1,6 @@
# Bootstrap configuration. # Bootstrap configuration.
# Copyright (C) 2006-2015, 2018-2019 Free Software Foundation, Inc. # Copyright (C) 2006-2015, 2018-2020 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@@ -60,6 +60,8 @@ gnulib_modules='
vsnprintf-posix vsprintf-posix vsnprintf-posix vsprintf-posix
' '
checkout_only_file=README-hacking.md
# Additional xgettext options to use. Use "\\\newline" to break lines. # Additional xgettext options to use. Use "\\\newline" to break lines.
XGETTEXT_OPTIONS=$XGETTEXT_OPTIONS'\\\ XGETTEXT_OPTIONS=$XGETTEXT_OPTIONS'\\\
--from-code=UTF-8\\\ --from-code=UTF-8\\\
+1 -1
View File
@@ -1,4 +1,4 @@
# Copyright (C) 2012-2015, 2018-2019 Free Software Foundation, Inc. # Copyright (C) 2012-2015, 2018-2020 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
+1 -1
View File
@@ -1,4 +1,4 @@
# Copyright (C) 2012-2015, 2018-2019 Free Software Foundation, Inc. # Copyright (C) 2012-2015, 2018-2020 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
+19
View File
@@ -1,5 +1,24 @@
#! /usr/bin/env perl #! /usr/bin/env perl
# Generate a release announcement message.
# Copyright (C) 2007-2020 Free Software Foundation, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
# Written by Akimn Demaille.
use warnings; use warnings;
use 5.005; use 5.005;
use strict; use strict;
+1 -1
View File
@@ -1,4 +1,4 @@
## Copyright (C) 2000-2015, 2018-2019 Free Software Foundation, Inc. ## Copyright (C) 2000-2015, 2018-2020 Free Software Foundation, Inc.
## ##
## This program is free software: you can redistribute it and/or modify ## This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by ## it under the terms of the GNU General Public License as published by
+1 -1
View File
@@ -3,7 +3,7 @@
# Update b4_copyright invocations or b4_copyright_years definitions to # Update b4_copyright invocations or b4_copyright_years definitions to
# include the current year. # include the current year.
# Copyright (C) 2009-2015, 2018-2019 Free Software Foundation, Inc. # Copyright (C) 2009-2015, 2018-2020 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
+1 -1
View File
@@ -2,7 +2,7 @@
# In configure.ac, update PACKAGE_COPYRIGHT_YEAR to the current year. # In configure.ac, update PACKAGE_COPYRIGHT_YEAR to the current year.
# Copyright (C) 2010-2015, 2018-2019 Free Software Foundation, Inc. # Copyright (C) 2010-2015, 2018-2020 Free Software Foundation, Inc.
# #
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
+23 -2
View File
@@ -1,8 +1,29 @@
#! /usr/bin/env python #! /usr/bin/env python
# usage: # Update expectations in an Autotest test suite.
# update-test _build/8d/tests/testsuite.dir/*/testsuite.log
# Copyright (C) 2019-2020 Free Software Foundation, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
# Written by Akim Demaille.
# usage:
#
# update-test _build/8d/tests/testsuite.dir/*/testsuite.log
#
# from your source tree.
import argparse import argparse
import os import os
import re import re
+2 -2
View File
@@ -1,5 +1,5 @@
## Customize maint.mk -*- makefile -*- ## Customize maint.mk -*- makefile -*-
## Copyright (C) 2008-2015, 2018-2019 Free Software Foundation, Inc. ## Copyright (C) 2008-2015, 2018-2020 Free Software Foundation, Inc.
## This program is free software: you can redistribute it and/or modify ## This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by ## it under the terms of the GNU General Public License as published by
@@ -156,7 +156,7 @@ exclude = \
$(call exclude, \ $(call exclude, \
bindtextdomain=^lib/main.c$$ \ bindtextdomain=^lib/main.c$$ \
cast_of_argument_to_free=^src/muscle-tab.c$$ \ cast_of_argument_to_free=^src/muscle-tab.c$$ \
po_check=^po/POTFILES.in$$ \ po_check=(^po/POTFILES.in|.md)$$ \
preprocessor_indentation=^data/|^lib/|^src/parse-gram.[ch]$$ \ preprocessor_indentation=^data/|^lib/|^src/parse-gram.[ch]$$ \
program_name=^lib/main.c$$ \ program_name=^lib/main.c$$ \
prohibit_always-defined_macros=^data/skeletons/yacc.c$$ \ prohibit_always-defined_macros=^data/skeletons/yacc.c$$ \
+47 -9
View File
@@ -1,6 +1,6 @@
# Configure template for GNU Bison. -*-Autoconf-*- # Configure template for GNU Bison. -*-Autoconf-*-
# #
# Copyright (C) 2001-2015, 2018-2019 Free Software Foundation, Inc. # Copyright (C) 2001-2015, 2018-2020 Free Software Foundation, Inc.
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@@ -26,8 +26,10 @@ m4_pattern_allow([^BISON_USE_NLS$])
AC_INIT([GNU Bison], AC_INIT([GNU Bison],
m4_esyscmd([build-aux/git-version-gen .tarball-version]), m4_esyscmd([build-aux/git-version-gen .tarball-version]),
[[email protected]]) [[email protected]],
AC_SUBST([PACKAGE_COPYRIGHT_YEAR], [2019]) [],
[https://www.gnu.org/software/bison/])
AC_SUBST([PACKAGE_COPYRIGHT_YEAR], [2020])
AC_DEFINE_UNQUOTED([PACKAGE_COPYRIGHT_YEAR], [$PACKAGE_COPYRIGHT_YEAR], AC_DEFINE_UNQUOTED([PACKAGE_COPYRIGHT_YEAR], [$PACKAGE_COPYRIGHT_YEAR],
[The copyright year for this package]) [The copyright year for this package])
@@ -100,14 +102,44 @@ if test "$enable_gcc_warnings" = yes; then
# -Wno-tautological-constant-out-of-range-compare for Clang 3.3 and # -Wno-tautological-constant-out-of-range-compare for Clang 3.3 and
# 3.4 on GNU/Linux that choke on intprops.h's INT_MULTIPLY_WRAPV, # 3.4 on GNU/Linux that choke on intprops.h's INT_MULTIPLY_WRAPV,
# etc. # etc.
warn_common='-Wall -Wextra -Wcast-align #
# ICC: -wr188
#
# 1669 warnings warnings_default =
# ../src/complain.c(318): error #188: enumerated type mixed with another type
# 1670 Wconflicts_sr | Wconflicts_rr | Wdeprecated | Wother;
# 1671 ^
# 1672
# 1673../src/complain.c(393): error #188: enumerated type mixed with another type
# 1674 warnings w = 1 << wbit;
# 1675 ^
#
# ICC: -wr3179
#
# char const *usefulness
# = rule_useless_in_grammar_p (&rules[r]) ? "useless-in-grammar"
# : rule_useless_in_parser_p (&rules[r]) ? "useless-in-parser"
# : "useful";
#
# gives
#
# error #3179: deprecated conversion of string literal to char* (should be const char*)
#
# ICC: -wr2259 (that's in C, in spite of what the error messages which seems to be about C++).
# error #2259: non-pointer conversion from "int" to "yybool={signed char}" may lose significant bits
# yybool yynormal YY_ATTRIBUTE_UNUSED = yystackp->yysplitPoint == YY_NULLPTR;
# ^
warn_common='-Wall -Wextra
-Wcast-align -Wchar-subscripts
-fparse-all-comments -Wdocumentation -fparse-all-comments -Wdocumentation
-Wformat -Wimplicit-fallthrough -Wnull-dereference -Wformat -Wimplicit-fallthrough -Wnull-dereference
-Wno-sign-compare -Wno-tautological-constant-out-of-range-compare -Wno-sign-compare -Wno-tautological-constant-out-of-range-compare
-Wpointer-arith -Wshadow -Wpointer-arith -Wshadow
-Wwrite-strings' -Wwrite-strings
-wr188 -wr2259 -wr3179'
warn_c='-Wbad-function-cast -Wstrict-prototypes' warn_c='-Wbad-function-cast -Wstrict-prototypes'
warn_cxx='-Wextra-semi -Wnoexcept -Wundefined-func-template -Wweak-vtables' warn_cxx='-Wextra-semi -Wnoexcept -Wold-style-cast -Wundefined-func-template
-Wweak-vtables'
# Warnings for the test suite only. # Warnings for the test suite only.
# #
# -fno-color-diagnostics: Clang's use of colors in the error # -fno-color-diagnostics: Clang's use of colors in the error
@@ -150,8 +182,6 @@ if test "$enable_gcc_warnings" = yes; then
# Warnings for the test suite, and maybe for bison if GCC is modern # Warnings for the test suite, and maybe for bison if GCC is modern
# enough. # enough.
gl_WARN_ADD([-Wmissing-declarations], [WARN_CFLAGS_TEST])
gl_WARN_ADD([-Wmissing-prototypes], [WARN_CFLAGS_TEST])
test $lv_cv_gcc_pragma_push_works = yes && test $lv_cv_gcc_pragma_push_works = yes &&
AS_VAR_APPEND([WARN_CFLAGS], [" $WARN_CFLAGS_TEST"]) AS_VAR_APPEND([WARN_CFLAGS], [" $WARN_CFLAGS_TEST"])
@@ -178,6 +208,14 @@ if test "$enable_gcc_warnings" = yes; then
[[if (sizeof (long) < sizeof (int)) return 1;]])]) [[if (sizeof (long) < sizeof (int)) return 1;]])])
gl_WARN_ADD([-Wzero-as-null-pointer-constant], [WARN_CXXFLAGS], gl_WARN_ADD([-Wzero-as-null-pointer-constant], [WARN_CXXFLAGS],
[AC_LANG_PROGRAM([], [nullptr])]) [AC_LANG_PROGRAM([], [nullptr])])
# Before GCC6, the pragmas don't work well enough to neutralize
# this warning.
gl_WARN_ADD([-Wuseless-cast], [WARN_CXXFLAGS],
[AC_LANG_PROGRAM([], [
#if defined __GNUC__ && ! defined __ICC && ! defined __clang__ && __GNUC__ < 6
syntax error
#endif
])])
gl_WARN_ADD([-Werror], [WERROR_CXXFLAGS]) gl_WARN_ADD([-Werror], [WERROR_CXXFLAGS])
# Warnings for the test suite only. # Warnings for the test suite only.
for i in $warn_tests; for i in $warn_tests;
@@ -278,7 +316,7 @@ uname=`uname`
case $VALGRIND:$uname in case $VALGRIND:$uname in
'':*) ;; '':*) ;;
*:Darwin) *:Darwin)
# See README-hacking. # See README-hacking.md.
VALGRIND=;; VALGRIND=;;
*:*) *:*)
suppfile=build-aux/$uname.valgrind suppfile=build-aux/$uname.valgrind
+1 -1
View File
@@ -174,7 +174,7 @@ fill-column: 76
ispell-dictionary: "american" ispell-dictionary: "american"
End: End:
Copyright (C) 2002, 2008-2015, 2018-2019 Free Software Foundation, Inc. Copyright (C) 2002, 2008-2015, 2018-2020 Free Software Foundation, Inc.
This file is part of GNU Bison. This file is part of GNU Bison.
+1 -1
View File
@@ -1,5 +1,5 @@
/* Default styling rules for Bison when doing terminal output. /* Default styling rules for Bison when doing terminal output.
Copyright (C) 2019 Free Software Foundation, Inc. Copyright (C) 2019-2020 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
+1 -1
View File
@@ -1,4 +1,4 @@
## Copyright (C) 2002, 2005-2015, 2018-2019 Free Software Foundation, ## Copyright (C) 2002, 2005-2015, 2018-2020 Free Software Foundation,
## Inc. ## Inc.
## This program is free software: you can redistribute it and/or modify ## This program is free software: you can redistribute it and/or modify
+9 -10
View File
@@ -2,7 +2,7 @@
# Language-independent M4 Macros for Bison. # Language-independent M4 Macros for Bison.
# Copyright (C) 2002, 2004-2015, 2018-2019 Free Software Foundation, # Copyright (C) 2002, 2004-2015, 2018-2020 Free Software Foundation,
# Inc. # Inc.
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
@@ -192,7 +192,7 @@ m4_define([b4_error],
# @warn(1@) # @warn(1@)
# @warn(1@,2@) # @warn(1@,2@)
m4_define([b4_warn], m4_define([b4_warn],
[b4_error([[warn]], [], [], $@)]) [b4_warn_at([], [], $@)])
# b4_warn_at(START, END, FORMAT, [ARG1], [ARG2], ...) # b4_warn_at(START, END, FORMAT, [ARG1], [ARG2], ...)
# --------------------------------------------------- # ---------------------------------------------------
@@ -210,7 +210,7 @@ m4_define([b4_warn_at],
# #
# See b4_warn example. # See b4_warn example.
m4_define([b4_complain], m4_define([b4_complain],
[b4_error([[complain]], [], [], $@)]) [b4_complain_at([], [], $@)])
# b4_complain_at(START, END, FORMAT, [ARG1], [ARG2], ...) # b4_complain_at(START, END, FORMAT, [ARG1], [ARG2], ...)
# ------------------------------------------------------- # -------------------------------------------------------
@@ -226,8 +226,7 @@ m4_define([b4_complain_at],
# #
# See b4_warn example. # See b4_warn example.
m4_define([b4_fatal], m4_define([b4_fatal],
[b4_error([[fatal]], [], [], $@)dnl [b4_fatal_at([], [], $@)])
m4_exit(1)])
# b4_fatal_at(START, END, FORMAT, [ARG1], [ARG2], ...) # b4_fatal_at(START, END, FORMAT, [ARG1], [ARG2], ...)
# ---------------------------------------------------- # ----------------------------------------------------
@@ -533,9 +532,9 @@ m4_define([b4_any_token_visible_if],
# ---------------------------- # ----------------------------
m4_define([b4_token_format], m4_define([b4_token_format],
[b4_token_visible_if([$2], [b4_token_visible_if([$2],
[m4_quote(m4_format([$1], [m4_format([[$1]],
[b4_symbol([$2], [id])], m4_quote(b4_symbol([$2], [id])),
[b4_symbol([$2], b4_api_token_raw_if([[number]], [[user_number]]))]))])]) m4_quote(b4_symbol([$2], b4_api_token_raw_if([[number]], [[user_number]]))))])])
## ------- ## ## ------- ##
@@ -976,8 +975,8 @@ m4_define([b4_percent_code_get],
[m4_pushdef([b4_macro_name], [[b4_percent_code(]$1[)]])dnl [m4_pushdef([b4_macro_name], [[b4_percent_code(]$1[)]])dnl
m4_ifval([$1], [m4_define([b4_percent_code_bison_qualifiers(]$1[)])])dnl m4_ifval([$1], [m4_define([b4_percent_code_bison_qualifiers(]$1[)])])dnl
m4_ifdef(b4_macro_name, m4_ifdef(b4_macro_name,
[b4_comment([m4_if([$#], [0], [[Unqualified %code]], [b4_comment(m4_if([$#], [0], [[[Unqualified %code blocks.]]],
[["%code ]$1["]])[ blocks.]]) [[["%code ]$1[" blocks.]]]))
b4_user_code([m4_indir(b4_macro_name)])])dnl b4_user_code([m4_indir(b4_macro_name)])])dnl
m4_popdef([b4_macro_name])]) m4_popdef([b4_macro_name])])
+1 -1
View File
@@ -2,7 +2,7 @@
# C++ skeleton dispatching for Bison. # C++ skeleton dispatching for Bison.
# Copyright (C) 2006-2007, 2009-2015, 2018-2019 Free Software # Copyright (C) 2006-2007, 2009-2015, 2018-2020 Free Software
# Foundation, Inc. # Foundation, Inc.
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
+7 -27
View File
@@ -2,7 +2,7 @@
# C++ skeleton for Bison # C++ skeleton for Bison
# Copyright (C) 2002-2019 Free Software Foundation, Inc. # Copyright (C) 2002-2020 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@@ -367,9 +367,6 @@ m4_define([b4_symbol_type_define],
/// \a empty when empty. /// \a empty when empty.
symbol_number_type type_get () const YY_NOEXCEPT; symbol_number_type type_get () const YY_NOEXCEPT;
/// The token.
token_type token () const YY_NOEXCEPT;
/// The symbol type. /// The symbol type.
/// \a empty_symbol when empty. /// \a empty_symbol when empty.
/// An int, not token_number_type, to be able to store empty_symbol. /// An int, not token_number_type, to be able to store empty_symbol.
@@ -498,22 +495,7 @@ m4_define([b4_public_types_define],
{ {
return type; return type;
} }
]b4_token_ctor_if([[ ]])
]b4_inline([$1])b4_parser_class[::token_type
]b4_parser_class[::by_type::token () const YY_NOEXCEPT
{
// YYTOKNUM[NUM] -- (External) token number corresponding to the
// (internal) symbol number NUM (which must be that of a token). */
static
const ]b4_int_type_for([b4_toknum])[
yytoken_number_[] =
{
]b4_toknum[
};
return token_type (yytoken_number_[type]);
}
]])[]dnl
])
# b4_token_constructor_define # b4_token_constructor_define
@@ -529,11 +511,10 @@ m4_define([b4_token_constructor_define], [])
# sometimes in the cc file. # sometimes in the cc file.
m4_define([b4_yytranslate_define], m4_define([b4_yytranslate_define],
[ b4_inline([$1])b4_parser_class[::token_number_type [ b4_inline([$1])b4_parser_class[::token_number_type
]b4_parser_class[::yytranslate_ (]b4_token_ctor_if([token_type], ]b4_parser_class[::yytranslate_ (int t)
[int])[ t)
{ {
]b4_api_token_raw_if( ]b4_api_token_raw_if(
[[ return static_cast<yy::parser::token_number_type> (t);]], [[ return static_cast<token_number_type> (t);]],
[[ // YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to [[ // YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to
// TOKEN-NUM as returned by yylex. // TOKEN-NUM as returned by yylex.
static static
@@ -543,14 +524,13 @@ m4_define([b4_yytranslate_define],
]b4_translate[ ]b4_translate[
}; };
const int user_token_number_max_ = ]b4_user_token_number_max[; const int user_token_number_max_ = ]b4_user_token_number_max[;
const token_number_type undef_token_ = ]b4_undef_token_number[;
if (static_cast<int> (t) <= yyeof_) if (t <= 0)
return yyeof_; return yyeof_;
else if (static_cast<int> (t) <= user_token_number_max_) else if (t <= user_token_number_max_)
return translate_table[t]; return translate_table[t];
else else
return undef_token_;]])[ return yy_undef_token_;]])[
} }
]]) ]])
+1 -1
View File
@@ -2,7 +2,7 @@
# Common code for C-like languages (C, C++, Java, etc.) # Common code for C-like languages (C, C++, Java, etc.)
# Copyright (C) 2012-2015, 2018-2019 Free Software Foundation, Inc. # Copyright (C) 2012-2015, 2018-2020 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
+1 -1
View File
@@ -2,7 +2,7 @@
# C skeleton dispatching for Bison. # C skeleton dispatching for Bison.
# Copyright (C) 2006-2007, 2009-2015, 2018-2019 Free Software # Copyright (C) 2006-2007, 2009-2015, 2018-2020 Free Software
# Foundation, Inc. # Foundation, Inc.
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
+32 -5
View File
@@ -2,7 +2,7 @@
# C M4 Macros for Bison. # C M4 Macros for Bison.
# Copyright (C) 2002, 2004-2015, 2018-2019 Free Software Foundation, # Copyright (C) 2002, 2004-2015, 2018-2020 Free Software Foundation,
# Inc. # Inc.
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
@@ -327,11 +327,11 @@ m4_define([b4_attribute_define],
#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ #if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
/* Suppress an incorrect diagnostic about yylval being uninitialized. */ /* Suppress an incorrect diagnostic about yylval being uninitialized. */
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
_Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic push") \
_Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
_Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
_Pragma ("GCC diagnostic pop") _Pragma ("GCC diagnostic pop")
#else #else
# define YY_INITIAL_VALUE(Value) Value # define YY_INITIAL_VALUE(Value) Value
@@ -343,9 +343,36 @@ m4_define([b4_attribute_define],
#ifndef YY_INITIAL_VALUE #ifndef YY_INITIAL_VALUE
# define YY_INITIAL_VALUE(Value) /* Nothing. */ # define YY_INITIAL_VALUE(Value) /* Nothing. */
#endif #endif
#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
# define YY_IGNORE_USELESS_CAST_BEGIN \
_Pragma ("GCC diagnostic push") \
_Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
# define YY_IGNORE_USELESS_CAST_END \
_Pragma ("GCC diagnostic pop")
#endif
#ifndef YY_IGNORE_USELESS_CAST_BEGIN
# define YY_IGNORE_USELESS_CAST_BEGIN
# define YY_IGNORE_USELESS_CAST_END
#endif
]]) ]])
# b4_cast_define
# --------------
m4_define([b4_cast_define],
[# ifndef YY_CAST
# ifdef __cplusplus
# define YY_CAST(Type, Val) static_cast<Type> (Val)
# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
# else
# define YY_CAST(Type, Val) ((Type) (Val))
# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
# endif
# endif[]dnl
])
# b4_null_define # b4_null_define
# -------------- # --------------
# Portability issues: define a YY_NULLPTR appropriate for the current # Portability issues: define a YY_NULLPTR appropriate for the current
+1 -1
View File
@@ -2,7 +2,7 @@
# D skeleton dispatching for Bison. # D skeleton dispatching for Bison.
# Copyright (C) 2018-2019 Free Software Foundation, Inc. # Copyright (C) 2018-2020 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
+1 -1
View File
@@ -2,7 +2,7 @@
# D language support for Bison # D language support for Bison
# Copyright (C) 2018-2019 Free Software Foundation, Inc. # Copyright (C) 2018-2020 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
+214 -182
View File
@@ -2,7 +2,7 @@
# GLR skeleton for Bison # GLR skeleton for Bison
# Copyright (C) 2002-2015, 2018-2019 Free Software Foundation, Inc. # Copyright (C) 2002-2015, 2018-2020 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@@ -125,7 +125,7 @@ m4_define([b4_lhs_value],
# ----------------------------- # -----------------------------
# See README. # See README.
m4_define([b4_rhs_data], m4_define([b4_rhs_data],
[((yyGLRStackItem const *)yyvsp)@{YYFILL (b4_subtract([$2], [$1]))@}.yystate]) [YY_CAST (yyGLRStackItem const *, yyvsp)@{YYFILL (b4_subtract([$2], [$1]))@}.yystate])
# b4_rhs_value(RULE-LENGTH, POS, SYMBOL-NUM, [TYPE]) # b4_rhs_value(RULE-LENGTH, POS, SYMBOL-NUM, [TYPE])
@@ -198,7 +198,7 @@ b4_glr_cc_if([],
[b4_defines_if( [b4_defines_if(
[b4_output_begin([b4_spec_header_file]) [b4_output_begin([b4_spec_header_file])
b4_copyright([Skeleton interface for Bison GLR parsers in C], b4_copyright([Skeleton interface for Bison GLR parsers in C],
[2002-2015, 2018-2019])[ [2002-2015, 2018-2020])[
]b4_cpp_guard_open([b4_spec_header_file])[ ]b4_cpp_guard_open([b4_spec_header_file])[
]b4_shared_declarations[ ]b4_shared_declarations[
]b4_cpp_guard_close([b4_spec_header_file])[ ]b4_cpp_guard_close([b4_spec_header_file])[
@@ -212,7 +212,7 @@ b4_copyright([Skeleton interface for Bison GLR parsers in C],
b4_output_begin([b4_parser_file_name]) b4_output_begin([b4_parser_file_name])
b4_copyright([Skeleton implementation for Bison GLR parsers in C], b4_copyright([Skeleton implementation for Bison GLR parsers in C],
[2002-2015, 2018-2019])[ [2002-2015, 2018-2020])[
/* C GLR parser skeleton written by Paul Hilfinger. */ /* C GLR parser skeleton written by Paul Hilfinger. */
]b4_disclaimer[ ]b4_disclaimer[
@@ -235,7 +235,7 @@ b4_copyright([Skeleton implementation for Bison GLR parsers in C],
#define yylloc ]b4_prefix[lloc]])]))[ #define yylloc ]b4_prefix[lloc]])]))[
]b4_user_pre_prologue[ ]b4_user_pre_prologue[
]b4_cast_define[
]b4_null_define[ ]b4_null_define[
]b4_defines_if([[#include "@basename(]b4_spec_header_file[@)"]], ]b4_defines_if([[#include "@basename(]b4_spec_header_file[@)"]],
@@ -289,7 +289,8 @@ static YYLTYPE yyloc_default][]b4_yyloc_default;])[
# define YYREALLOC realloc # define YYREALLOC realloc
#endif #endif
#define YYSIZEMAX (PTRDIFF_MAX < SIZE_MAX ? PTRDIFF_MAX : (ptrdiff_t) SIZE_MAX) #define YYSIZEMAX \
(PTRDIFF_MAX < SIZE_MAX ? PTRDIFF_MAX : YY_CAST (ptrdiff_t, SIZE_MAX))
#ifdef __cplusplus #ifdef __cplusplus
typedef bool yybool; typedef bool yybool;
@@ -310,15 +311,20 @@ static YYLTYPE yyloc_default][]b4_yyloc_default;])[
# define YYLONGJMP(Env, Val) \ # define YYLONGJMP(Env, Val) \
do { \ do { \
longjmp (Env, Val); \ longjmp (Env, Val); \
YYASSERT (0); \ YY_ASSERT (0); \
} while (yyfalse) } while (yyfalse)
#endif #endif
]b4_attribute_define([noreturn])[ ]b4_attribute_define([noreturn])[
#ifndef YYASSERT ]b4_parse_assert_if([[#ifdef NDEBUG
# define YYASSERT(Condition) ((void) ((Condition) || (abort (), 0))) # define YY_ASSERT(E) ((void) (0 && (E)))
#else
# include <assert.h> /* INFRINGES ON USER NAME SPACE */
# define YY_ASSERT(E) assert (E)
#endif #endif
]],
[[#define YY_ASSERT(E) ((void) (0 && (E)))]])[
/* YYFINAL -- State number of the termination state. */ /* YYFINAL -- State number of the termination state. */
#define YYFINAL ]b4_final_state_number[ #define YYFINAL ]b4_final_state_number[
@@ -469,23 +475,36 @@ typedef enum { yyok, yyaccept, yyabort, yyerr } YYRESULTTAG;
# define YYFPRINTF fprintf # define YYFPRINTF fprintf
# endif # endif
]b4_yy_location_print_define[ # define YY_FPRINTF \
YY_IGNORE_USELESS_CAST_BEGIN YY_FPRINTF_
# define YYDPRINTF(Args) \ # define YY_FPRINTF_(Args) \
do { \
YYFPRINTF Args; \
YY_IGNORE_USELESS_CAST_END \
} while (0)
# define YY_DPRINTF \
YY_IGNORE_USELESS_CAST_BEGIN YY_DPRINTF_
# define YY_DPRINTF_(Args) \
do { \ do { \
if (yydebug) \ if (yydebug) \
YYFPRINTF Args; \ YYFPRINTF Args; \
YY_IGNORE_USELESS_CAST_END \
} while (0) } while (0)
]b4_yy_location_print_define[
]b4_yy_symbol_print_define[ ]b4_yy_symbol_print_define[
# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
do { \ do { \
if (yydebug) \ if (yydebug) \
{ \ { \
YYFPRINTF (stderr, "%s ", Title); \ YY_FPRINTF ((stderr, "%s ", Title)); \
yy_symbol_print (stderr, Type, Value]b4_locuser_args([Location])[); \ yy_symbol_print (stderr, Type, Value]b4_locuser_args([Location])[); \
YYFPRINTF (stderr, "\n"); \ YY_FPRINTF ((stderr, "\n")); \
} \ } \
} while (0) } while (0)
@@ -501,7 +520,7 @@ static void yypdumpstack (struct yyGLRStack* yystackp)
#else /* !]b4_api_PREFIX[DEBUG */ #else /* !]b4_api_PREFIX[DEBUG */
# define YYDPRINTF(Args) # define YY_DPRINTF(Args) do {} while (yyfalse)
# define YY_SYMBOL_PRINT(Title, Type, Value, Location) # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
#endif /* !]b4_api_PREFIX[DEBUG */ #endif /* !]b4_api_PREFIX[DEBUG */
@@ -617,7 +636,7 @@ yytnamerr (char *yyres, const char *yystr)
if (yyres) if (yyres)
return yystpcpy (yyres, yystr) - yyres; return yystpcpy (yyres, yystr) - yyres;
else else
return (ptrdiff_t) strlen (yystr); return YY_CAST (ptrdiff_t, strlen (yystr));
} }
# endif # endif
@@ -742,10 +761,7 @@ yyMemoryExhausted (yyGLRStack* yystackp)
static inline const char* static inline const char*
yytokenName (yySymbol yytoken) yytokenName (yySymbol yytoken)
{ {
if (yytoken == YYEMPTY) return yytoken == YYEMPTY ? "" : yytname[yytoken];
return "";
return yytname[yytoken];
} }
#endif #endif
@@ -785,7 +801,7 @@ yygetToken (int *yycharp][]b4_pure_if([, yyGLRStack* yystackp])[]b4_user_formals
]b4_parse_param_use()dnl ]b4_parse_param_use()dnl
[ if (*yycharp == YYEMPTY) [ if (*yycharp == YYEMPTY)
{ {
YYDPRINTF ((stderr, "Reading a token: "));]b4_glr_cc_if([[ YY_DPRINTF ((stderr, "Reading a token: "));]b4_glr_cc_if([[
#if YY_EXCEPTIONS #if YY_EXCEPTIONS
try try
{ {
@@ -795,7 +811,7 @@ yygetToken (int *yycharp][]b4_pure_if([, yyGLRStack* yystackp])[]b4_user_formals
} }
catch (const ]b4_namespace_ref[::]b4_parser_class[::syntax_error& yyexc) catch (const ]b4_namespace_ref[::]b4_parser_class[::syntax_error& yyexc)
{ {
YYDPRINTF ((stderr, "Caught exception: %s\n", yyexc.what()));]b4_locations_if([ YY_DPRINTF ((stderr, "Caught exception: %s\n", yyexc.what()));]b4_locations_if([
yylloc = yyexc.location;])[ yylloc = yyexc.location;])[
yyerror (]b4_lyyerror_args[yyexc.what ()); yyerror (]b4_lyyerror_args[yyexc.what ());
// Map errors caught in the scanner to the undefined token // Map errors caught in the scanner to the undefined token
@@ -809,7 +825,7 @@ yygetToken (int *yycharp][]b4_pure_if([, yyGLRStack* yystackp])[]b4_user_formals
if (*yycharp <= YYEOF) if (*yycharp <= YYEOF)
{ {
*yycharp = yytoken = YYEOF; *yycharp = yytoken = YYEOF;
YYDPRINTF ((stderr, "Now at end of input.\n")); YY_DPRINTF ((stderr, "Now at end of input.\n"));
} }
else else
{ {
@@ -845,7 +861,7 @@ yyuserAction (yyRuleNum yyn, int yyrhslen, yyGLRStackItem* yyvsp,
yyGLRStack* yystackp, yyGLRStack* yystackp,
YYSTYPE* yyvalp]b4_locuser_formals[) YYSTYPE* yyvalp]b4_locuser_formals[)
{ {
yybool yynormal YY_ATTRIBUTE_UNUSED = (yybool) (yystackp->yysplitPoint == YY_NULLPTR); yybool yynormal YY_ATTRIBUTE_UNUSED = yystackp->yysplitPoint == YY_NULLPTR;
int yylow; int yylow;
]b4_parse_param_use([yyvalp], [yylocp])dnl ]b4_parse_param_use([yyvalp], [yylocp])dnl
[ YYUSE (yyrhslen); [ YYUSE (yyrhslen);
@@ -891,7 +907,7 @@ yyuserAction (yyRuleNum yyn, int yyrhslen, yyGLRStackItem* yyvsp,
} }
catch (const syntax_error& yyexc) catch (const syntax_error& yyexc)
{ {
YYDPRINTF ((stderr, "Caught exception: %s\n", yyexc.what()));]b4_locations_if([ YY_DPRINTF ((stderr, "Caught exception: %s\n", yyexc.what()));]b4_locations_if([
*yylocp = yyexc.location;])[ *yylocp = yyexc.location;])[
yyerror (]b4_yyerror_args[yyexc.what ()); yyerror (]b4_yyerror_args[yyexc.what ());
YYERROR; YYERROR;
@@ -945,9 +961,9 @@ yydestroyGLRState (char const *yymsg, yyGLRState *yys]b4_user_formals[)
if (yydebug) if (yydebug)
{ {
if (yys->yysemantics.yyfirstVal) if (yys->yysemantics.yyfirstVal)
YYFPRINTF (stderr, "%s unresolved", yymsg); YY_FPRINTF ((stderr, "%s unresolved", yymsg));
else else
YYFPRINTF (stderr, "%s incomplete", yymsg); YY_FPRINTF ((stderr, "%s incomplete", yymsg));
YY_SYMBOL_PRINT ("", yystos[yys->yylrState], YY_NULLPTR, &yys->yyloc); YY_SYMBOL_PRINT ("", yystos[yys->yylrState], YY_NULLPTR, &yys->yyloc);
} }
#endif #endif
@@ -980,7 +996,7 @@ yylhsNonterm (yyRuleNum yyrule)
static inline yybool static inline yybool
yyisDefaultedState (yyStateNum yystate) yyisDefaultedState (yyStateNum yystate)
{ {
return (yybool) yypact_value_is_default (yypact[yystate]); return yypact_value_is_default (yypact[yystate]);
} }
/** The default reduction for YYSTATE, assuming it has one. */ /** The default reduction for YYSTATE, assuming it has one. */
@@ -1040,13 +1056,13 @@ yyLRgotoState (yyStateNum yystate, yySymbol yysym)
static inline yybool static inline yybool
yyisShiftAction (int yyaction) yyisShiftAction (int yyaction)
{ {
return (yybool) (0 < yyaction); return 0 < yyaction;
} }
static inline yybool static inline yybool
yyisErrorAction (int yyaction) yyisErrorAction (int yyaction)
{ {
return (yybool) (yyaction == 0); return yyaction == 0;
} }
/* GLRStates */ /* GLRStates */
@@ -1076,7 +1092,7 @@ yyaddDeferredAction (yyGLRStack* yystackp, ptrdiff_t yyk, yyGLRState* yystate,
{ {
yySemanticOption* yynewOption = yySemanticOption* yynewOption =
&yynewGLRStackItem (yystackp, yyfalse)->yyoption; &yynewGLRStackItem (yystackp, yyfalse)->yyoption;
YYASSERT (!yynewOption->yyisState); YY_ASSERT (!yynewOption->yyisState);
yynewOption->yystate = yyrhs; yynewOption->yystate = yyrhs;
yynewOption->yyrule = yyrule; yynewOption->yyrule = yyrule;
if (yystackp->yytops.yylookaheadNeeds[yyk]) if (yystackp->yytops.yylookaheadNeeds[yyk])
@@ -1102,21 +1118,24 @@ yyinitStateSet (yyGLRStateSet* yyset)
yyset->yysize = 1; yyset->yysize = 1;
yyset->yycapacity = 16; yyset->yycapacity = 16;
yyset->yystates yyset->yystates
= (yyGLRState**) YYMALLOC ((size_t) yyset->yycapacity = YY_CAST (yyGLRState**,
* sizeof yyset->yystates[0]); YYMALLOC (YY_CAST (size_t, yyset->yycapacity)
* sizeof yyset->yystates[0]));
if (! yyset->yystates) if (! yyset->yystates)
return yyfalse; return yyfalse;
yyset->yystates[0] = YY_NULLPTR; yyset->yystates[0] = YY_NULLPTR;
yyset->yylookaheadNeeds yyset->yylookaheadNeeds
= (yybool*) YYMALLOC ((size_t) yyset->yycapacity = YY_CAST (yybool*,
* sizeof yyset->yylookaheadNeeds[0]); YYMALLOC (YY_CAST (size_t, yyset->yycapacity)
* sizeof yyset->yylookaheadNeeds[0]));
if (! yyset->yylookaheadNeeds) if (! yyset->yylookaheadNeeds)
{ {
YYFREE (yyset->yystates); YYFREE (yyset->yystates);
return yyfalse; return yyfalse;
} }
memset (yyset->yylookaheadNeeds, memset (yyset->yylookaheadNeeds,
0, (size_t) yyset->yycapacity * sizeof yyset->yylookaheadNeeds[0]); 0,
YY_CAST (size_t, yyset->yycapacity) * sizeof yyset->yylookaheadNeeds[0]);
return yytrue; return yytrue;
} }
@@ -1134,9 +1153,10 @@ yyinitGLRStack (yyGLRStack* yystackp, ptrdiff_t yysize)
yystackp->yyerrState = 0; yystackp->yyerrState = 0;
yynerrs = 0; yynerrs = 0;
yystackp->yyspaceLeft = yysize; yystackp->yyspaceLeft = yysize;
yystackp->yyitems = yystackp->yyitems
(yyGLRStackItem*) YYMALLOC ((size_t) yysize = YY_CAST (yyGLRStackItem*,
* sizeof yystackp->yynextFree[0]); YYMALLOC (YY_CAST (size_t, yysize)
* sizeof yystackp->yynextFree[0]));
if (!yystackp->yyitems) if (!yystackp->yyitems)
return yyfalse; return yyfalse;
yystackp->yynextFree = yystackp->yyitems; yystackp->yynextFree = yystackp->yyitems;
@@ -1147,8 +1167,9 @@ yyinitGLRStack (yyGLRStack* yystackp, ptrdiff_t yysize)
#if YYSTACKEXPANDABLE #if YYSTACKEXPANDABLE
# define YYRELOC(YYFROMITEMS,YYTOITEMS,YYX,YYTYPE) \ # define YYRELOC(YYFROMITEMS, YYTOITEMS, YYX, YYTYPE) \
&((YYTOITEMS) - ((YYFROMITEMS) - (yyGLRStackItem*) (YYX)))->YYTYPE &((YYTOITEMS) \
- ((YYFROMITEMS) - YY_REINTERPRET_CAST (yyGLRStackItem*, (YYX))))->YYTYPE
/** If *YYSTACKP is expandable, extend it. WARNING: Pointers into the /** If *YYSTACKP is expandable, extend it. WARNING: Pointers into the
stack from outside should be considered invalid after this call. stack from outside should be considered invalid after this call.
@@ -1168,8 +1189,10 @@ yyexpandGLRStack (yyGLRStack* yystackp)
yynewSize = 2*yysize; yynewSize = 2*yysize;
if (YYMAXDEPTH < yynewSize) if (YYMAXDEPTH < yynewSize)
yynewSize = YYMAXDEPTH; yynewSize = YYMAXDEPTH;
yynewItems = (yyGLRStackItem*) YYMALLOC ((size_t) yynewSize yynewItems
* sizeof yynewItems[0]); = YY_CAST (yyGLRStackItem*,
YYMALLOC (YY_CAST (size_t, yynewSize)
* sizeof yynewItems[0]));
if (! yynewItems) if (! yynewItems)
yyMemoryExhausted (yystackp); yyMemoryExhausted (yystackp);
for (yyp0 = yystackp->yyitems, yyp1 = yynewItems, yyn = yysize; for (yyp0 = yystackp->yyitems, yyp1 = yynewItems, yyn = yysize;
@@ -1177,7 +1200,7 @@ yyexpandGLRStack (yyGLRStack* yystackp)
yyn -= 1, yyp0 += 1, yyp1 += 1) yyn -= 1, yyp0 += 1, yyp1 += 1)
{ {
*yyp1 = *yyp0; *yyp1 = *yyp0;
if (*(yybool *) yyp0) if (*YY_REINTERPRET_CAST (yybool *, yyp0))
{ {
yyGLRState* yys0 = &yyp0->yystate; yyGLRState* yys0 = &yyp0->yystate;
yyGLRState* yys1 = &yyp1->yystate; yyGLRState* yys1 = &yyp1->yystate;
@@ -1250,7 +1273,7 @@ yyundeleteLastStack (yyGLRStack* yystackp)
return; return;
yystackp->yytops.yystates[0] = yystackp->yylastDeleted; yystackp->yytops.yystates[0] = yystackp->yylastDeleted;
yystackp->yytops.yysize = 1; yystackp->yytops.yysize = 1;
YYDPRINTF ((stderr, "Restoring last deleted stack as stack #0.\n")); YY_DPRINTF ((stderr, "Restoring last deleted stack as stack #0.\n"));
yystackp->yylastDeleted = YY_NULLPTR; yystackp->yylastDeleted = YY_NULLPTR;
} }
@@ -1264,9 +1287,7 @@ yyremoveDeletes (yyGLRStack* yystackp)
if (yystackp->yytops.yystates[yyi] == YY_NULLPTR) if (yystackp->yytops.yystates[yyi] == YY_NULLPTR)
{ {
if (yyi == yyj) if (yyi == yyj)
{ YY_DPRINTF ((stderr, "Removing dead stacks.\n"));
YYDPRINTF ((stderr, "Removing dead stacks.\n"));
}
yystackp->yytops.yysize -= 1; yystackp->yytops.yysize -= 1;
} }
else else
@@ -1280,10 +1301,8 @@ yyremoveDeletes (yyGLRStack* yystackp)
yystackp->yytops.yylookaheadNeeds[yyj] = yystackp->yytops.yylookaheadNeeds[yyj] =
yystackp->yytops.yylookaheadNeeds[yyi]; yystackp->yytops.yylookaheadNeeds[yyi];
if (yyj != yyi) if (yyj != yyi)
{ YY_DPRINTF ((stderr, "Rename stack %ld -> %ld.\n",
YYDPRINTF ((stderr, "Rename stack %ld -> %ld.\n", YY_CAST (long, yyi), YY_CAST (long, yyj)));
(long) yyi, (long) yyj));
}
yyj += 1; yyj += 1;
} }
yyi += 1; yyi += 1;
@@ -1319,7 +1338,7 @@ yyglrShiftDefer (yyGLRStack* yystackp, ptrdiff_t yyk, yyStateNum yylrState,
ptrdiff_t yyposn, yyGLRState* yyrhs, yyRuleNum yyrule) ptrdiff_t yyposn, yyGLRState* yyrhs, yyRuleNum yyrule)
{ {
yyGLRState* yynewState = &yynewGLRStackItem (yystackp, yytrue)->yystate; yyGLRState* yynewState = &yynewGLRStackItem (yystackp, yytrue)->yystate;
YYASSERT (yynewState->yyisState); YY_ASSERT (yynewState->yyisState);
yynewState->yylrState = yylrState; yynewState->yylrState = yylrState;
yynewState->yyposn = yyposn; yynewState->yyposn = yyposn;
@@ -1352,22 +1371,22 @@ yy_reduce_print (yybool yynormal, yyGLRStackItem* yyvsp, ptrdiff_t yyk,
int yynrhs = yyrhsLength (yyrule);]b4_locations_if([ int yynrhs = yyrhsLength (yyrule);]b4_locations_if([
int yylow = 1;])[ int yylow = 1;])[
int yyi; int yyi;
YYFPRINTF (stderr, "Reducing stack %ld by rule %d (line %d):\n", YY_FPRINTF ((stderr, "Reducing stack %ld by rule %d (line %d):\n",
(long) yyk, yyrule - 1, yyrline[yyrule]); YY_CAST (long, yyk), yyrule - 1, yyrline[yyrule]));
if (! yynormal) if (! yynormal)
yyfillin (yyvsp, 1, -yynrhs); yyfillin (yyvsp, 1, -yynrhs);
/* The symbols being reduced. */ /* The symbols being reduced. */
for (yyi = 0; yyi < yynrhs; yyi++) for (yyi = 0; yyi < yynrhs; yyi++)
{ {
YYFPRINTF (stderr, " $%d = ", yyi + 1); YY_FPRINTF ((stderr, " $%d = ", yyi + 1));
yy_symbol_print (stderr, yy_symbol_print (stderr,
yystos[yyvsp[yyi - yynrhs + 1].yystate.yylrState], yystos[yyvsp[yyi - yynrhs + 1].yystate.yylrState],
&yyvsp[yyi - yynrhs + 1].yystate.yysemantics.yysval]b4_locations_if([, &yyvsp[yyi - yynrhs + 1].yystate.yysemantics.yysval]b4_locations_if([,
&]b4_rhs_location(yynrhs, yyi + 1))[]dnl &]b4_rhs_location(yynrhs, yyi + 1))[]dnl
b4_user_args[); b4_user_args[);
if (!yyvsp[yyi - yynrhs + 1].yystate.yyresolved) if (!yyvsp[yyi - yynrhs + 1].yystate.yyresolved)
YYFPRINTF (stderr, " (unresolved)"); YY_FPRINTF ((stderr, " (unresolved)"));
YYFPRINTF (stderr, "\n"); YY_FPRINTF ((stderr, "\n"));
} }
} }
#endif #endif
@@ -1387,8 +1406,9 @@ yydoAction (yyGLRStack* yystackp, ptrdiff_t yyk, yyRuleNum yyrule,
if (yystackp->yysplitPoint == YY_NULLPTR) if (yystackp->yysplitPoint == YY_NULLPTR)
{ {
/* Standard special case: single stack. */ /* Standard special case: single stack. */
yyGLRStackItem* yyrhs = (yyGLRStackItem*) yystackp->yytops.yystates[yyk]; yyGLRStackItem* yyrhs
YYASSERT (yyk == 0); = YY_REINTERPRET_CAST (yyGLRStackItem*, yystackp->yytops.yystates[yyk]);
YY_ASSERT (yyk == 0);
yystackp->yynextFree -= yynrhs; yystackp->yynextFree -= yynrhs;
yystackp->yyspaceLeft += yynrhs; yystackp->yyspaceLeft += yynrhs;
yystackp->yytops.yystates[0] = & yystackp->yynextFree[-1].yystate; yystackp->yytops.yystates[0] = & yystackp->yynextFree[-1].yystate;
@@ -1408,7 +1428,7 @@ yydoAction (yyGLRStack* yystackp, ptrdiff_t yyk, yyRuleNum yyrule,
for (yyi = 0; yyi < yynrhs; yyi += 1) for (yyi = 0; yyi < yynrhs; yyi += 1)
{ {
yys = yys->yypred; yys = yys->yypred;
YYASSERT (yys); YY_ASSERT (yys);
} }
yyupdateSplit (yystackp, yys); yyupdateSplit (yystackp, yys);
yystackp->yytops.yystates[yyk] = yys; yystackp->yytops.yystates[yyk] = yys;
@@ -1442,11 +1462,9 @@ yyglrReduce (yyGLRStack* yystackp, ptrdiff_t yyk, yyRuleNum yyrule,
YYRESULTTAG yyflag = yydoAction (yystackp, yyk, yyrule, &yysval]b4_locuser_args([&yyloc])[); YYRESULTTAG yyflag = yydoAction (yystackp, yyk, yyrule, &yysval]b4_locuser_args([&yyloc])[);
if (yyflag == yyerr && yystackp->yysplitPoint != YY_NULLPTR) if (yyflag == yyerr && yystackp->yysplitPoint != YY_NULLPTR)
{ YY_DPRINTF ((stderr,
YYDPRINTF ((stderr, "Parse on stack %ld rejected by rule %d (line %d).\n",
"Parse on stack %ld rejected by rule %d (line %d).\n", YY_CAST (long, yyk), yyrule - 1, yyrline[yyrule - 1]));
(long) yyk, yyrule - 1, yyrline[yyrule - 1]));
}
if (yyflag != yyok) if (yyflag != yyok)
return yyflag; return yyflag;
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyrule], &yysval, &yyloc); YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyrule], &yysval, &yyloc);
@@ -1466,14 +1484,15 @@ yyglrReduce (yyGLRStack* yystackp, ptrdiff_t yyk, yyRuleNum yyrule,
0 < yyn; yyn -= 1) 0 < yyn; yyn -= 1)
{ {
yys = yys->yypred; yys = yys->yypred;
YYASSERT (yys); YY_ASSERT (yys);
} }
yyupdateSplit (yystackp, yys); yyupdateSplit (yystackp, yys);
yynewLRState = yyLRgotoState (yys->yylrState, yylhsNonterm (yyrule)); yynewLRState = yyLRgotoState (yys->yylrState, yylhsNonterm (yyrule));
YYDPRINTF ((stderr, YY_DPRINTF ((stderr,
"Reduced stack %ld by rule %d (line %d); action deferred. " "Reduced stack %ld by rule %d (line %d); action deferred. "
"Now in state %d.\n", "Now in state %d.\n",
(long) yyk, yyrule - 1, yyrline[yyrule - 1], yynewLRState)); YY_CAST (long, yyk), yyrule - 1, yyrline[yyrule - 1],
yynewLRState));
for (yyi = 0; yyi < yystackp->yytops.yysize; yyi += 1) for (yyi = 0; yyi < yystackp->yytops.yysize; yyi += 1)
if (yyi != yyk && yystackp->yytops.yystates[yyi] != YY_NULLPTR) if (yyi != yyk && yystackp->yytops.yystates[yyi] != YY_NULLPTR)
{ {
@@ -1485,8 +1504,8 @@ yyglrReduce (yyGLRStack* yystackp, ptrdiff_t yyk, yyRuleNum yyrule,
{ {
yyaddDeferredAction (yystackp, yyk, yyp, yys0, yyrule); yyaddDeferredAction (yystackp, yyk, yyp, yys0, yyrule);
yymarkStackDeleted (yystackp, yyk); yymarkStackDeleted (yystackp, yyk);
YYDPRINTF ((stderr, "Merging stack %ld into stack %ld.\n", YY_DPRINTF ((stderr, "Merging stack %ld into stack %ld.\n",
(long) yyk, (long) yyi)); YY_CAST (long, yyk), YY_CAST (long, yyi)));
return yyok; return yyok;
} }
yyp = yyp->yypred; yyp = yyp->yypred;
@@ -1503,42 +1522,45 @@ yysplitStack (yyGLRStack* yystackp, ptrdiff_t yyk)
{ {
if (yystackp->yysplitPoint == YY_NULLPTR) if (yystackp->yysplitPoint == YY_NULLPTR)
{ {
YYASSERT (yyk == 0); YY_ASSERT (yyk == 0);
yystackp->yysplitPoint = yystackp->yytops.yystates[yyk]; yystackp->yysplitPoint = yystackp->yytops.yystates[yyk];
} }
if (yystackp->yytops.yysize >= yystackp->yytops.yycapacity) if (yystackp->yytops.yycapacity <= yystackp->yytops.yysize)
{ {
yyGLRState** yynewStates = YY_NULLPTR; ptrdiff_t state_size = sizeof yystackp->yytops.yystates[0];
yybool* yynewLookaheadNeeds;
ptrdiff_t state_size = sizeof yynewStates[0];
ptrdiff_t half_max_capacity = YYSIZEMAX / 2 / state_size; ptrdiff_t half_max_capacity = YYSIZEMAX / 2 / state_size;
if (half_max_capacity < yystackp->yytops.yycapacity) if (half_max_capacity < yystackp->yytops.yycapacity)
yyMemoryExhausted (yystackp); yyMemoryExhausted (yystackp);
yystackp->yytops.yycapacity *= 2; yystackp->yytops.yycapacity *= 2;
yynewStates = {
(yyGLRState**) YYREALLOC (yystackp->yytops.yystates, yyGLRState** yynewStates
((size_t) yystackp->yytops.yycapacity = YY_CAST (yyGLRState**,
* sizeof yynewStates[0])); YYREALLOC (yystackp->yytops.yystates,
if (yynewStates == YY_NULLPTR) (YY_CAST (size_t, yystackp->yytops.yycapacity)
yyMemoryExhausted (yystackp); * sizeof yynewStates[0])));
yystackp->yytops.yystates = yynewStates; if (yynewStates == YY_NULLPTR)
yyMemoryExhausted (yystackp);
yystackp->yytops.yystates = yynewStates;
}
yynewLookaheadNeeds = {
(yybool*) YYREALLOC (yystackp->yytops.yylookaheadNeeds, yybool* yynewLookaheadNeeds
((size_t) yystackp->yytops.yycapacity = YY_CAST (yybool*,
* sizeof yynewLookaheadNeeds[0])); YYREALLOC (yystackp->yytops.yylookaheadNeeds,
if (yynewLookaheadNeeds == YY_NULLPTR) (YY_CAST (size_t, yystackp->yytops.yycapacity)
yyMemoryExhausted (yystackp); * sizeof yynewLookaheadNeeds[0])));
yystackp->yytops.yylookaheadNeeds = yynewLookaheadNeeds; if (yynewLookaheadNeeds == YY_NULLPTR)
yyMemoryExhausted (yystackp);
yystackp->yytops.yylookaheadNeeds = yynewLookaheadNeeds;
}
} }
yystackp->yytops.yystates[yystackp->yytops.yysize] yystackp->yytops.yystates[yystackp->yytops.yysize]
= yystackp->yytops.yystates[yyk]; = yystackp->yytops.yystates[yyk];
yystackp->yytops.yylookaheadNeeds[yystackp->yytops.yysize] yystackp->yytops.yylookaheadNeeds[yystackp->yytops.yysize]
= yystackp->yytops.yylookaheadNeeds[yyk]; = yystackp->yytops.yylookaheadNeeds[yyk];
yystackp->yytops.yysize += 1; yystackp->yytops.yysize += 1;
return yystackp->yytops.yysize-1; return yystackp->yytops.yysize - 1;
} }
/** True iff YYY0 and YYY1 represent identical options at the top level. /** True iff YYY0 and YYY1 represent identical options at the top level.
@@ -1572,7 +1594,7 @@ yymergeOptionSets (yySemanticOption* yyy0, yySemanticOption* yyy1)
int yyn; int yyn;
for (yys0 = yyy0->yystate, yys1 = yyy1->yystate, for (yys0 = yyy0->yystate, yys1 = yyy1->yystate,
yyn = yyrhsLength (yyy0->yyrule); yyn = yyrhsLength (yyy0->yyrule);
yyn > 0; 0 < yyn;
yys0 = yys0->yypred, yys1 = yys1->yypred, yyn -= 1) yys0 = yys0->yypred, yys1 = yys1->yypred, yyn -= 1)
{ {
if (yys0 == yys1) if (yys0 == yys1)
@@ -1654,7 +1676,7 @@ yyresolveStates (yyGLRState* yys, int yyn,
{ {
if (0 < yyn) if (0 < yyn)
{ {
YYASSERT (yys->yypred); YY_ASSERT (yys->yypred);
YYCHK (yyresolveStates (yys->yypred, yyn-1, yystackp]b4_user_args[)); YYCHK (yyresolveStates (yys->yypred, yyn-1, yystackp]b4_user_args[));
if (! yys->yyresolved) if (! yys->yyresolved)
YYCHK (yyresolveValue (yys, yystackp]b4_user_args[)); YYCHK (yyresolveValue (yys, yystackp]b4_user_args[));
@@ -1725,26 +1747,26 @@ yyreportTree (yySemanticOption* yyx, int yyindent)
yystates[0] = yys; yystates[0] = yys;
if (yyx->yystate->yyposn < yys->yyposn + 1) if (yyx->yystate->yyposn < yys->yyposn + 1)
YYFPRINTF (stderr, "%*s%s -> <Rule %d, empty>\n", YY_FPRINTF ((stderr, "%*s%s -> <Rule %d, empty>\n",
yyindent, "", yytokenName (yylhsNonterm (yyx->yyrule)), yyindent, "", yytokenName (yylhsNonterm (yyx->yyrule)),
yyx->yyrule - 1); yyx->yyrule - 1));
else else
YYFPRINTF (stderr, "%*s%s -> <Rule %d, tokens %ld .. %ld>\n", YY_FPRINTF ((stderr, "%*s%s -> <Rule %d, tokens %ld .. %ld>\n",
yyindent, "", yytokenName (yylhsNonterm (yyx->yyrule)), yyindent, "", yytokenName (yylhsNonterm (yyx->yyrule)),
yyx->yyrule - 1, (long) (yys->yyposn + 1), yyx->yyrule - 1, YY_CAST (long, yys->yyposn + 1),
(long) yyx->yystate->yyposn); YY_CAST (long, yyx->yystate->yyposn)));
for (yyi = 1; yyi <= yynrhs; yyi += 1) for (yyi = 1; yyi <= yynrhs; yyi += 1)
{ {
if (yystates[yyi]->yyresolved) if (yystates[yyi]->yyresolved)
{ {
if (yystates[yyi-1]->yyposn+1 > yystates[yyi]->yyposn) if (yystates[yyi-1]->yyposn+1 > yystates[yyi]->yyposn)
YYFPRINTF (stderr, "%*s%s <empty>\n", yyindent+2, "", YY_FPRINTF ((stderr, "%*s%s <empty>\n", yyindent+2, "",
yytokenName (yystos[yystates[yyi]->yylrState])); yytokenName (yystos[yystates[yyi]->yylrState])));
else else
YYFPRINTF (stderr, "%*s%s <tokens %ld .. %ld>\n", yyindent+2, "", YY_FPRINTF ((stderr, "%*s%s <tokens %ld .. %ld>\n", yyindent+2, "",
yytokenName (yystos[yystates[yyi]->yylrState]), yytokenName (yystos[yystates[yyi]->yylrState]),
(long) (yystates[yyi-1]->yyposn + 1), YY_CAST (long, yystates[yyi-1]->yyposn + 1),
(long) yystates[yyi]->yyposn); YY_CAST (long, yystates[yyi]->yyposn)));
} }
else else
yyreportTree (yystates[yyi]->yysemantics.yyfirstVal, yyindent+2); yyreportTree (yystates[yyi]->yysemantics.yyfirstVal, yyindent+2);
@@ -1760,12 +1782,12 @@ yyreportAmbiguity (yySemanticOption* yyx0,
YYUSE (yyx1); YYUSE (yyx1);
#if ]b4_api_PREFIX[DEBUG #if ]b4_api_PREFIX[DEBUG
YYFPRINTF (stderr, "Ambiguity detected.\n"); YY_FPRINTF ((stderr, "Ambiguity detected.\n"));
YYFPRINTF (stderr, "Option 1,\n"); YY_FPRINTF ((stderr, "Option 1,\n"));
yyreportTree (yyx0, 2); yyreportTree (yyx0, 2);
YYFPRINTF (stderr, "\nOption 2,\n"); YY_FPRINTF ((stderr, "\nOption 2,\n"));
yyreportTree (yyx1, 2); yyreportTree (yyx1, 2);
YYFPRINTF (stderr, "\n"); YY_FPRINTF ((stderr, "\n"));
#endif #endif
yyerror (]b4_yyerror_args[YY_("syntax is ambiguous")); yyerror (]b4_yyerror_args[YY_("syntax is ambiguous"));
@@ -1787,7 +1809,7 @@ yyresolveLocations (yyGLRState *yys1, int yyn1,
yyGLRStackItem yyrhsloc[1 + YYMAXRHS]; yyGLRStackItem yyrhsloc[1 + YYMAXRHS];
int yynrhs; int yynrhs;
yySemanticOption *yyoption = yys1->yysemantics.yyfirstVal; yySemanticOption *yyoption = yys1->yysemantics.yyfirstVal;
YYASSERT (yyoption); YY_ASSERT (yyoption);
yynrhs = yyrhsLength (yyoption->yyrule); yynrhs = yyrhsLength (yyoption->yyrule);
if (0 < yynrhs) if (0 < yynrhs)
{ {
@@ -1862,7 +1884,7 @@ yyresolveValue (yyGLRState* yys, yyGLRStack* yystackp]b4_user_formals[)
yymerge = yyfalse; yymerge = yyfalse;
break; break;
default: default:
/* This cannot happen so it is not worth a YYASSERT (yyfalse), /* This cannot happen so it is not worth a YY_ASSERT (yyfalse),
but some compilers complain if the default case is but some compilers complain if the default case is
omitted. */ omitted. */
break; break;
@@ -1940,7 +1962,7 @@ yycompressStack (yyGLRStack* yystackp)
yyp->yypred = yyr; yyp->yypred = yyr;
yystackp->yyspaceLeft += yystackp->yynextFree - yystackp->yyitems; yystackp->yyspaceLeft += yystackp->yynextFree - yystackp->yyitems;
yystackp->yynextFree = ((yyGLRStackItem*) yystackp->yysplitPoint) + 1; yystackp->yynextFree = YY_REINTERPRET_CAST (yyGLRStackItem*, yystackp->yysplitPoint) + 1;
yystackp->yyspaceLeft -= yystackp->yynextFree - yystackp->yyitems; yystackp->yyspaceLeft -= yystackp->yynextFree - yystackp->yyitems;
yystackp->yysplitPoint = YY_NULLPTR; yystackp->yysplitPoint = YY_NULLPTR;
yystackp->yylastDeleted = YY_NULLPTR; yystackp->yylastDeleted = YY_NULLPTR;
@@ -1963,9 +1985,10 @@ yyprocessOneStack (yyGLRStack* yystackp, ptrdiff_t yyk,
while (yystackp->yytops.yystates[yyk] != YY_NULLPTR) while (yystackp->yytops.yystates[yyk] != YY_NULLPTR)
{ {
yyStateNum yystate = yystackp->yytops.yystates[yyk]->yylrState; yyStateNum yystate = yystackp->yytops.yystates[yyk]->yylrState;
YYDPRINTF ((stderr, "Stack %ld Entering state %d\n", yyk, yystate)); YY_DPRINTF ((stderr, "Stack %ld Entering state %d\n",
YY_CAST (long, yyk), yystate));
YYASSERT (yystate != YYFINAL); YY_ASSERT (yystate != YYFINAL);
if (yyisDefaultedState (yystate)) if (yyisDefaultedState (yystate))
{ {
@@ -1973,17 +1996,17 @@ yyprocessOneStack (yyGLRStack* yystackp, ptrdiff_t yyk,
yyRuleNum yyrule = yydefaultAction (yystate); yyRuleNum yyrule = yydefaultAction (yystate);
if (yyrule == 0) if (yyrule == 0)
{ {
YYDPRINTF ((stderr, "Stack %ld dies.\n", (long) yyk)); YY_DPRINTF ((stderr, "Stack %ld dies.\n", YY_CAST (long, yyk)));
yymarkStackDeleted (yystackp, yyk); yymarkStackDeleted (yystackp, yyk);
return yyok; return yyok;
} }
yyflag = yyglrReduce (yystackp, yyk, yyrule, yyimmediate[yyrule]]b4_user_args[); yyflag = yyglrReduce (yystackp, yyk, yyrule, yyimmediate[yyrule]]b4_user_args[);
if (yyflag == yyerr) if (yyflag == yyerr)
{ {
YYDPRINTF ((stderr, YY_DPRINTF ((stderr,
"Stack %ld dies " "Stack %ld dies "
"(predicate failure or explicit user error).\n", "(predicate failure or explicit user error).\n",
(long) yyk)); YY_CAST (long, yyk)));
yymarkStackDeleted (yystackp, yyk); yymarkStackDeleted (yystackp, yyk);
return yyok; return yyok;
} }
@@ -2001,8 +2024,8 @@ yyprocessOneStack (yyGLRStack* yystackp, ptrdiff_t yyk,
{ {
YYRESULTTAG yyflag; YYRESULTTAG yyflag;
ptrdiff_t yynewStack = yysplitStack (yystackp, yyk); ptrdiff_t yynewStack = yysplitStack (yystackp, yyk);
YYDPRINTF ((stderr, "Splitting off stack %ld from %ld.\n", YY_DPRINTF ((stderr, "Splitting off stack %ld from %ld.\n",
(long) yynewStack, (long) yyk)); YY_CAST (long, yynewStack), YY_CAST (long, yyk)));
yyflag = yyglrReduce (yystackp, yynewStack, yyflag = yyglrReduce (yystackp, yynewStack,
*yyconflicts, *yyconflicts,
yyimmediate[*yyconflicts]]b4_user_args[); yyimmediate[*yyconflicts]]b4_user_args[);
@@ -2011,7 +2034,7 @@ yyprocessOneStack (yyGLRStack* yystackp, ptrdiff_t yyk,
yyposn]b4_pure_args[)); yyposn]b4_pure_args[));
else if (yyflag == yyerr) else if (yyflag == yyerr)
{ {
YYDPRINTF ((stderr, "Stack %ld dies.\n", (long) yynewStack)); YY_DPRINTF ((stderr, "Stack %ld dies.\n", YY_CAST (long, yynewStack)));
yymarkStackDeleted (yystackp, yynewStack); yymarkStackDeleted (yystackp, yynewStack);
} }
else else
@@ -2023,7 +2046,7 @@ yyprocessOneStack (yyGLRStack* yystackp, ptrdiff_t yyk,
break; break;
else if (yyisErrorAction (yyaction)) else if (yyisErrorAction (yyaction))
{ {
YYDPRINTF ((stderr, "Stack %ld dies.\n", (long) yyk)); YY_DPRINTF ((stderr, "Stack %ld dies.\n", YY_CAST (long, yyk)));
yymarkStackDeleted (yystackp, yyk); yymarkStackDeleted (yystackp, yyk);
break; break;
} }
@@ -2033,10 +2056,10 @@ yyprocessOneStack (yyGLRStack* yystackp, ptrdiff_t yyk,
yyimmediate[-yyaction]]b4_user_args[); yyimmediate[-yyaction]]b4_user_args[);
if (yyflag == yyerr) if (yyflag == yyerr)
{ {
YYDPRINTF ((stderr, YY_DPRINTF ((stderr,
"Stack %ld dies " "Stack %ld dies "
"(predicate failure or explicit user error).\n", "(predicate failure or explicit user error).\n",
(long) yyk)); YY_CAST (long, yyk)));
yymarkStackDeleted (yystackp, yyk); yymarkStackDeleted (yystackp, yyk);
break; break;
} }
@@ -2058,18 +2081,18 @@ yyreportSyntaxError (yyGLRStack* yystackp]b4_user_formals[)
#else #else
{ {
yySymbol yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); yySymbol yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
ptrdiff_t yysize0 = yytnamerr (YY_NULLPTR, yytokenName (yytoken));
ptrdiff_t yysize = yysize0;
yybool yysize_overflow = yyfalse; yybool yysize_overflow = yyfalse;
char* yymsg = YY_NULLPTR; char* yymsg = YY_NULLPTR;
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
/* Internationalized format string. */ /* Internationalized format string. */
const char *yyformat = YY_NULLPTR; const char *yyformat = YY_NULLPTR;
/* Arguments of yyformat. */ /* Arguments of yyformat: reported tokens (one for the "unexpected",
one per "expected"). */
char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
/* Number of reported tokens (one for the "unexpected", one per /* Actual size of YYARG. */
"expected"). */
int yycount = 0; int yycount = 0;
/* Cumulated lengths of YYARG. */
ptrdiff_t yysize = 0;
/* There are many possibilities here to consider: /* There are many possibilities here to consider:
- If this state is a consistent state with a default action, then - If this state is a consistent state with a default action, then
@@ -2097,6 +2120,8 @@ yyreportSyntaxError (yyGLRStack* yystackp]b4_user_formals[)
if (yytoken != YYEMPTY) if (yytoken != YYEMPTY)
{ {
int yyn = yypact[yystackp->yytops.yystates[0]->yylrState]; int yyn = yypact[yystackp->yytops.yystates[0]->yylrState];
ptrdiff_t yysize0 = yytnamerr (YY_NULLPTR, yytokenName (yytoken));
yysize = yysize0;
yyarg[yycount++] = yytokenName (yytoken); yyarg[yycount++] = yytokenName (yytoken);
if (!yypact_value_is_default (yyn)) if (!yypact_value_is_default (yyn))
{ {
@@ -2147,7 +2172,9 @@ yyreportSyntaxError (yyGLRStack* yystackp]b4_user_formals[)
} }
{ {
ptrdiff_t yysz = (ptrdiff_t) strlen (yyformat); /* Don't count the "%s"s in the final size, but reserve room for
the terminator. */
ptrdiff_t yysz = YY_CAST (ptrdiff_t, strlen (yyformat)) - 2 * yycount + 1;
if (YYSIZEMAX - yysize < yysz) if (YYSIZEMAX - yysize < yysz)
yysize_overflow = yytrue; yysize_overflow = yytrue;
else else
@@ -2155,7 +2182,7 @@ yyreportSyntaxError (yyGLRStack* yystackp]b4_user_formals[)
} }
if (!yysize_overflow) if (!yysize_overflow)
yymsg = (char *) YYMALLOC ((size_t) yysize); yymsg = YY_CAST (char *, YYMALLOC (YY_CAST (size_t, yysize)));
if (yymsg) if (yymsg)
{ {
@@ -2170,8 +2197,8 @@ yyreportSyntaxError (yyGLRStack* yystackp]b4_user_formals[)
} }
else else
{ {
yyp++; ++yyp;
yyformat++; ++yyformat;
} }
} }
yyerror (]b4_lyyerror_args[yymsg); yyerror (]b4_lyyerror_args[yymsg);
@@ -2308,7 +2335,7 @@ yyrecoverSyntaxError (yyGLRStack* yystackp]b4_user_formals[)
yyGLRStack* const yystackp = &yystack; yyGLRStack* const yystackp = &yystack;
ptrdiff_t yyposn; ptrdiff_t yyposn;
YYDPRINTF ((stderr, "Starting parse\n")); YY_DPRINTF ((stderr, "Starting parse\n"));
yychar = YYEMPTY; yychar = YYEMPTY;
yylval = yyval_default;]b4_locations_if([ yylval = yyval_default;]b4_locations_if([
@@ -2339,7 +2366,7 @@ b4_dollar_popdef])[]dnl
while (yytrue) while (yytrue)
{ {
yyStateNum yystate = yystack.yytops.yystates[0]->yylrState; yyStateNum yystate = yystack.yytops.yystates[0]->yylrState;
YYDPRINTF ((stderr, "Entering state %d\n", yystate)); YY_DPRINTF ((stderr, "Entering state %d\n", yystate));
if (yystate == YYFINAL) if (yystate == YYFINAL)
goto yyacceptlab; goto yyacceptlab;
if (yyisDefaultedState (yystate)) if (yyisDefaultedState (yystate))
@@ -2389,7 +2416,7 @@ b4_dollar_popdef])[]dnl
ptrdiff_t yys; ptrdiff_t yys;
for (yys = 0; yys < yystack.yytops.yysize; yys += 1) for (yys = 0; yys < yystack.yytops.yysize; yys += 1)
yystackp->yytops.yylookaheadNeeds[yys] = (yybool) (yychar != YYEMPTY); yystackp->yytops.yylookaheadNeeds[yys] = yychar != YYEMPTY;
/* yyprocessOneStack returns one of three things: /* yyprocessOneStack returns one of three things:
@@ -2419,7 +2446,7 @@ b4_dollar_popdef])[]dnl
if (yystack.yytops.yysize == 0) if (yystack.yytops.yysize == 0)
yyFail (&yystack][]b4_lpure_args[, YY_("syntax error")); yyFail (&yystack][]b4_lpure_args[, YY_("syntax error"));
YYCHK1 (yyresolveStack (&yystack]b4_user_args[)); YYCHK1 (yyresolveStack (&yystack]b4_user_args[));
YYDPRINTF ((stderr, "Returning to deterministic operation.\n"));]b4_locations_if([[ YY_DPRINTF ((stderr, "Returning to deterministic operation.\n"));]b4_locations_if([[
yystack.yyerror_range[1].yystate.yyloc = yylloc;]])[ yystack.yyerror_range[1].yystate.yyloc = yylloc;]])[
yyreportSyntaxError (&yystack]b4_user_args[); yyreportSyntaxError (&yystack]b4_user_args[);
goto yyuser_error; goto yyuser_error;
@@ -2440,19 +2467,19 @@ b4_dollar_popdef])[]dnl
int yyaction = yygetLRActions (yystate, yytoken_to_shift, int yyaction = yygetLRActions (yystate, yytoken_to_shift,
&yyconflicts); &yyconflicts);
/* Note that yyconflicts were handled by yyprocessOneStack. */ /* Note that yyconflicts were handled by yyprocessOneStack. */
YYDPRINTF ((stderr, "On stack %ld, ", (long) yys)); YY_DPRINTF ((stderr, "On stack %ld, ", YY_CAST (long, yys)));
YY_SYMBOL_PRINT ("shifting", yytoken_to_shift, &yylval, &yylloc); YY_SYMBOL_PRINT ("shifting", yytoken_to_shift, &yylval, &yylloc);
yyglrShift (&yystack, yys, yyaction, yyposn, yyglrShift (&yystack, yys, yyaction, yyposn,
&yylval]b4_locations_if([, &yylloc])[); &yylval]b4_locations_if([, &yylloc])[);
YYDPRINTF ((stderr, "Stack %ld now in state #%d\n", YY_DPRINTF ((stderr, "Stack %ld now in state #%d\n",
(long) yys, YY_CAST (long, yys),
yystack.yytops.yystates[yys]->yylrState)); yystack.yytops.yystates[yys]->yylrState));
} }
if (yystack.yytops.yysize == 1) if (yystack.yytops.yysize == 1)
{ {
YYCHK1 (yyresolveStack (&yystack]b4_user_args[)); YYCHK1 (yyresolveStack (&yystack]b4_user_args[));
YYDPRINTF ((stderr, "Returning to deterministic operation.\n")); YY_DPRINTF ((stderr, "Returning to deterministic operation.\n"));
yycompressStack (&yystack); yycompressStack (&yystack);
break; break;
} }
@@ -2468,7 +2495,7 @@ b4_dollar_popdef])[]dnl
goto yyreturn; goto yyreturn;
yybuglab: yybuglab:
YYASSERT (yyfalse); YY_ASSERT (yyfalse);
goto yyabortlab; goto yyabortlab;
yyabortlab: yyabortlab:
@@ -2525,19 +2552,19 @@ yy_yypstack (yyGLRState* yys)
if (yys->yypred) if (yys->yypred)
{ {
yy_yypstack (yys->yypred); yy_yypstack (yys->yypred);
YYFPRINTF (stderr, " -> "); YY_FPRINTF ((stderr, " -> "));
} }
YYFPRINTF (stderr, "%d@@%ld", yys->yylrState, (long) yys->yyposn); YY_FPRINTF ((stderr, "%d@@%ld", yys->yylrState, YY_CAST (long, yys->yyposn)));
} }
static void static void
yypstates (yyGLRState* yyst) yypstates (yyGLRState* yyst)
{ {
if (yyst == YY_NULLPTR) if (yyst == YY_NULLPTR)
YYFPRINTF (stderr, "<null>"); YY_FPRINTF ((stderr, "<null>"));
else else
yy_yypstack (yyst); yy_yypstack (yyst);
YYFPRINTF (stderr, "\n"); YY_FPRINTF ((stderr, "\n"));
} }
static void static void
@@ -2546,48 +2573,53 @@ yypstack (yyGLRStack* yystackp, ptrdiff_t yyk)
yypstates (yystackp->yytops.yystates[yyk]); yypstates (yystackp->yytops.yystates[yyk]);
} }
#define YYINDEX(YYX) \
((YYX) == YY_NULLPTR ? -1 : (yyGLRStackItem*) (YYX) - yystackp->yyitems)
static void static void
yypdumpstack (yyGLRStack* yystackp) yypdumpstack (yyGLRStack* yystackp)
{ {
#define YYINDEX(YYX) \
YY_CAST (long, \
((YYX) \
? YY_REINTERPRET_CAST (yyGLRStackItem*, (YYX)) - yystackp->yyitems \
: -1))
yyGLRStackItem* yyp; yyGLRStackItem* yyp;
ptrdiff_t yyi;
for (yyp = yystackp->yyitems; yyp < yystackp->yynextFree; yyp += 1) for (yyp = yystackp->yyitems; yyp < yystackp->yynextFree; yyp += 1)
{ {
YYFPRINTF (stderr, "%3ld. ", YY_FPRINTF ((stderr, "%3ld. ",
(long) (yyp - yystackp->yyitems)); YY_CAST (long, yyp - yystackp->yyitems)));
if (*(yybool *) yyp) if (*YY_REINTERPRET_CAST (yybool *, yyp))
{ {
YYASSERT (yyp->yystate.yyisState); YY_ASSERT (yyp->yystate.yyisState);
YYASSERT (yyp->yyoption.yyisState); YY_ASSERT (yyp->yyoption.yyisState);
YYFPRINTF (stderr, "Res: %d, LR State: %d, posn: %ld, pred: %ld", YY_FPRINTF ((stderr, "Res: %d, LR State: %d, posn: %ld, pred: %ld",
yyp->yystate.yyresolved, yyp->yystate.yylrState, yyp->yystate.yyresolved, yyp->yystate.yylrState,
(long) yyp->yystate.yyposn, YY_CAST (long, yyp->yystate.yyposn),
(long) YYINDEX (yyp->yystate.yypred)); YYINDEX (yyp->yystate.yypred)));
if (! yyp->yystate.yyresolved) if (! yyp->yystate.yyresolved)
YYFPRINTF (stderr, ", firstVal: %ld", YY_FPRINTF ((stderr, ", firstVal: %ld",
(long) YYINDEX (yyp->yystate YYINDEX (yyp->yystate.yysemantics.yyfirstVal)));
.yysemantics.yyfirstVal));
} }
else else
{ {
YYASSERT (!yyp->yystate.yyisState); YY_ASSERT (!yyp->yystate.yyisState);
YYASSERT (!yyp->yyoption.yyisState); YY_ASSERT (!yyp->yyoption.yyisState);
YYFPRINTF (stderr, "Option. rule: %d, state: %ld, next: %ld", YY_FPRINTF ((stderr, "Option. rule: %d, state: %ld, next: %ld",
yyp->yyoption.yyrule - 1, yyp->yyoption.yyrule - 1,
(long) YYINDEX (yyp->yyoption.yystate), YYINDEX (yyp->yyoption.yystate),
(long) YYINDEX (yyp->yyoption.yynext)); YYINDEX (yyp->yyoption.yynext)));
} }
YYFPRINTF (stderr, "\n"); YY_FPRINTF ((stderr, "\n"));
} }
YYFPRINTF (stderr, "Tops:");
for (yyi = 0; yyi < yystackp->yytops.yysize; yyi += 1) YY_FPRINTF ((stderr, "Tops:"));
YYFPRINTF (stderr, "%ld: %ld; ", (long) yyi, {
(long) YYINDEX (yystackp->yytops.yystates[yyi])); ptrdiff_t yyi;
YYFPRINTF (stderr, "\n"); for (yyi = 0; yyi < yystackp->yytops.yysize; yyi += 1)
YY_FPRINTF ((stderr, "%ld: %ld; ", YY_CAST (long, yyi),
YYINDEX (yystackp->yytops.yystates[yyi])));
YY_FPRINTF ((stderr, "\n"));
}
#undef YYINDEX
} }
#endif #endif
+17 -2
View File
@@ -1,6 +1,6 @@
# C++ GLR skeleton for Bison # C++ GLR skeleton for Bison
# Copyright (C) 2002-2015, 2018-2019 Free Software Foundation, Inc. # Copyright (C) 2002-2015, 2018-2020 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@@ -257,6 +257,21 @@ b4_percent_code_get([[requires]])[
]b4_attribute_define[ ]b4_attribute_define[
]b4_null_define[ ]b4_null_define[
// This skeleton is based on C, yet compiles it as C++.
// So expect warnings about C style casts.
#if defined __clang__ && 306 <= __clang_major__ * 100 + __clang_minor__
# pragma clang diagnostic ignored "-Wold-style-cast"
#elif defined __GNUC__ && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
# pragma GCC diagnostic ignored "-Wold-style-cast"
#endif
// On MacOS, PTRDIFF_MAX is defined as long long, which Clang's
// -pedantic reports as being a C++11 extension.
#if defined __APPLE__ && YY_CPLUSPLUS < 201103L \
&& defined __clang__ && 4 <= __clang_major__
# pragma clang diagnostic ignored "-Wc++11-long-long"
#endif
// Whether we are compiled with exception support. // Whether we are compiled with exception support.
#ifndef YY_EXCEPTIONS #ifndef YY_EXCEPTIONS
# if defined __GNUC__ && !defined __EXCEPTIONS # if defined __GNUC__ && !defined __EXCEPTIONS
@@ -353,7 +368,7 @@ b4_percent_define_flag_if([[global_tokens_and_yystype]],
b4_defines_if( b4_defines_if(
[b4_output_begin([b4_spec_header_file]) [b4_output_begin([b4_spec_header_file])
b4_copyright([Skeleton interface for Bison GLR parsers in C++], b4_copyright([Skeleton interface for Bison GLR parsers in C++],
[2002-2015, 2018-2019])[ [2002-2015, 2018-2020])[
// C++ GLR parser skeleton written by Akim Demaille. // C++ GLR parser skeleton written by Akim Demaille.
]b4_disclaimer[ ]b4_disclaimer[
+1 -1
View File
@@ -2,7 +2,7 @@
# Java skeleton dispatching for Bison. # Java skeleton dispatching for Bison.
# Copyright (C) 2007, 2009-2015, 2018-2019 Free Software Foundation, # Copyright (C) 2007, 2009-2015, 2018-2020 Free Software Foundation,
# Inc. # Inc.
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
+8 -6
View File
@@ -2,7 +2,7 @@
# Java language support for Bison # Java language support for Bison
# Copyright (C) 2007-2015, 2018-2019 Free Software Foundation, Inc. # Copyright (C) 2007-2015, 2018-2020 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@@ -147,18 +147,20 @@ b4_symbol_foreach([b4_token_enum])])])
# b4-case(ID, CODE) # b4-case(ID, CODE)
# ----------------- # -----------------
# We need to fool Java's stupid unreachable code detection. # We need to fool Java's stupid unreachable code detection.
m4_define([b4_case], [ case $1: m4_define([b4_case],
[ case $1:
if (yyn == $1) if (yyn == $1)
$2; $2;
break; break;
]) ])
# b4_predicate_case(LABEL, CONDITIONS) # b4_predicate_case(LABEL, CONDITIONS)
# ------------------------------------ # ------------------------------------
m4_define([b4_predicate_case], [ case $1: m4_define([b4_predicate_case],
[ case $1:
if (! ($2)) YYERROR; if (! ($2)) YYERROR;
break; break;
]) ])
## -------- ## ## -------- ##
@@ -361,4 +363,4 @@ m4_define([b4_var_decl],
# ----------------------- # -----------------------
# Expand to either an empty string or "throws THROWS". # Expand to either an empty string or "throws THROWS".
m4_define([b4_maybe_throws], m4_define([b4_maybe_throws],
[m4_ifval($1, [throws $1])]) [m4_ifval($1, [ throws $1])])
+30 -22
View File
@@ -1,6 +1,6 @@
# C++ skeleton for Bison # C++ skeleton for Bison
# Copyright (C) 2002-2015, 2018-2019 Free Software Foundation, Inc. # Copyright (C) 2002-2015, 2018-2020 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@@ -23,6 +23,7 @@ m4_define([b4_value_type_setup_variant])
# Check the value of %define parse.lac, where LAC stands for lookahead # Check the value of %define parse.lac, where LAC stands for lookahead
# correction. # correction.
b4_percent_define_default([[parse.lac]], [[none]]) b4_percent_define_default([[parse.lac]], [[none]])
b4_percent_define_check_values([[[[parse.lac]], [[full]], [[none]]]])
b4_define_flag_if([lac]) b4_define_flag_if([lac])
m4_define([b4_lac_flag], m4_define([b4_lac_flag],
[m4_if(b4_percent_define_get([[parse.lac]]), [m4_if(b4_percent_define_get([[parse.lac]]),
@@ -143,7 +144,7 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param))])])
m4_pushdef([b4_copyright_years], m4_pushdef([b4_copyright_years],
[2002-2015, 2018-2019]) [2002-2015, 2018-2020])
m4_define([b4_parser_class], m4_define([b4_parser_class],
[b4_percent_define_get([[api.parser.class]])]) [b4_percent_define_get([[api.parser.class]])])
@@ -174,6 +175,7 @@ m4_define([b4_shared_declarations],
]b4_variant_if([b4_variant_includes])[ ]b4_variant_if([b4_variant_includes])[
]b4_attribute_define[ ]b4_attribute_define[
]b4_cast_define[
]b4_null_define[ ]b4_null_define[
]b4_YYDEBUG_define[ ]b4_YYDEBUG_define[
@@ -267,7 +269,9 @@ m4_define([b4_shared_declarations],
static const ]b4_int_type(b4_table_ninf, b4_table_ninf)[ yytable_ninf_; static const ]b4_int_type(b4_table_ninf, b4_table_ninf)[ yytable_ninf_;
/// Convert a scanner token number \a t to a symbol number. /// Convert a scanner token number \a t to a symbol number.
static token_number_type yytranslate_ (]b4_token_ctor_if([token_type], [int])[ t); /// In theory \a t should be a token_type, but character literals
/// are valid, yet not members of the token_type enum.
static token_number_type yytranslate_ (int t);
// Tables. // Tables.
]b4_parser_tables_declare[]b4_error_verbose_if([ ]b4_parser_tables_declare[]b4_error_verbose_if([
@@ -332,7 +336,8 @@ m4_define([b4_shared_declarations],
symbol_number_type type_get () const YY_NOEXCEPT; symbol_number_type type_get () const YY_NOEXCEPT;
/// The state number used to denote an empty symbol. /// The state number used to denote an empty symbol.
enum { empty_state = -1 }; /// We use the initial state, as it does not have a value.
enum { empty_state = 0 };
/// The state. /// The state.
/// \a empty when empty. /// \a empty when empty.
@@ -396,6 +401,10 @@ m4_define([b4_shared_declarations],
/// Pop \a n symbols from the stack. /// Pop \a n symbols from the stack.
void yypop_ (int n = 1); void yypop_ (int n = 1);
/// Some specific tokens.
static const token_number_type yy_error_token_ = 1;
static const token_number_type yy_undef_token_ = ]b4_undef_token_number[;
/// Constants. /// Constants.
enum enum
{ {
@@ -403,8 +412,6 @@ m4_define([b4_shared_declarations],
yylast_ = ]b4_last[, ///< Last index in yytable_. yylast_ = ]b4_last[, ///< Last index in yytable_.
yynnts_ = ]b4_nterms_number[, ///< Number of nonterminal symbols. yynnts_ = ]b4_nterms_number[, ///< Number of nonterminal symbols.
yyfinal_ = ]b4_final_state_number[, ///< Termination state number. yyfinal_ = ]b4_final_state_number[, ///< Termination state number.
yyterror_ = 1,
yyerrcode_ = 256,
yyntokens_ = ]b4_tokens_number[ ///< Number of tokens. yyntokens_ = ]b4_tokens_number[ ///< Number of tokens.
}; };
@@ -634,7 +641,7 @@ m4_if(b4_prefix, [yy], [],
if (state == empty_state) if (state == empty_state)
return empty_symbol; return empty_symbol;
else else
return yystos_[state]; return yystos_[+state];
} }
]b4_parser_class[::stack_symbol_type::stack_symbol_type () ]b4_parser_class[::stack_symbol_type::stack_symbol_type ()
@@ -860,7 +867,7 @@ b4_dollar_popdef])[]dnl
`-----------*/ `-----------*/
yybackup: yybackup:
// Try to take a decision without lookahead. // Try to take a decision without lookahead.
yyn = yypact_[yystack_[0].state]; yyn = yypact_[+yystack_[0].state];
if (yy_pact_value_is_default_ (yyn)) if (yy_pact_value_is_default_ (yyn))
goto yydefault; goto yydefault;
@@ -915,7 +922,7 @@ b4_dollar_popdef])[]dnl
--yyerrstatus_; --yyerrstatus_;
// Shift the lookahead token. // Shift the lookahead token.
yypush_ ("Shifting", static_cast<state_type> (yyn), YY_MOVE (yyla));]b4_lac_if([[ yypush_ ("Shifting", state_type (yyn), YY_MOVE (yyla));]b4_lac_if([[
yy_lac_discard_ ("shift");]])[ yy_lac_discard_ ("shift");]])[
goto yynewstate; goto yynewstate;
@@ -924,7 +931,7 @@ b4_dollar_popdef])[]dnl
| yydefault -- do the default action for the current state. | | yydefault -- do the default action for the current state. |
`-----------------------------------------------------------*/ `-----------------------------------------------------------*/
yydefault: yydefault:
yyn = yydefact_[yystack_[0].state]; yyn = yydefact_[+yystack_[0].state];
if (yyn == 0) if (yyn == 0)
goto yyerrlab; goto yyerrlab;
goto yyreduce; goto yyreduce;
@@ -1051,11 +1058,11 @@ b4_dollar_popdef])[]dnl
stack_symbol_type error_token; stack_symbol_type error_token;
for (;;) for (;;)
{ {
yyn = yypact_[yystack_[0].state]; yyn = yypact_[+yystack_[0].state];
if (!yy_pact_value_is_default_ (yyn)) if (!yy_pact_value_is_default_ (yyn))
{ {
yyn += yyterror_; yyn += yy_error_token_;
if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yyterror_) if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yy_error_token_)
{ {
yyn = yytable_[yyn]; yyn = yytable_[yyn];
if (0 < yyn) if (0 < yyn)
@@ -1078,7 +1085,7 @@ b4_dollar_popdef])[]dnl
// Shift the error token.]b4_lac_if([[ // Shift the error token.]b4_lac_if([[
yy_lac_discard_ ("error recovery");]])[ yy_lac_discard_ ("error recovery");]])[
error_token.state = static_cast<state_type> (yyn); error_token.state = state_type (yyn);
yypush_ ("Shifting", YY_MOVE (error_token)); yypush_ ("Shifting", YY_MOVE (error_token));
} }
goto yynewstate; goto yynewstate;
@@ -1160,13 +1167,13 @@ b4_dollar_popdef])[]dnl
state_type top_state = (yylac_stack_.empty () state_type top_state = (yylac_stack_.empty ()
? yystack_[lac_top].state ? yystack_[lac_top].state
: yylac_stack_.back ()); : yylac_stack_.back ());
int yyrule = yypact_[top_state]; int yyrule = yypact_[+top_state];
if (yy_pact_value_is_default_ (yyrule) if (yy_pact_value_is_default_ (yyrule)
|| (yyrule += yytoken) < 0 || yylast_ < yyrule || (yyrule += yytoken) < 0 || yylast_ < yyrule
|| yycheck_[yyrule] != yytoken) || yycheck_[yyrule] != yytoken)
{ {
// Use the default action. // Use the default action.
yyrule = yydefact_[top_state]; yyrule = yydefact_[+top_state];
if (yyrule == 0) if (yyrule == 0)
{ {
YYCDEBUG << " Err\n"; YYCDEBUG << " Err\n";
@@ -1195,10 +1202,10 @@ b4_dollar_popdef])[]dnl
{ {
std::ptrdiff_t yylen = yyr2_[yyrule]; std::ptrdiff_t yylen = yyr2_[yyrule];
// First pop from the LAC stack as many tokens as possible. // First pop from the LAC stack as many tokens as possible.
std::ptrdiff_t lac_size = (std::ptrdiff_t) yylac_stack_.size (); std::ptrdiff_t lac_size = std::ptrdiff_t (yylac_stack_.size ());
if (yylen < lac_size) if (yylen < lac_size)
{ {
yylac_stack_.resize ((std::size_t) (lac_size - yylen)); yylac_stack_.resize (std::size_t (lac_size - yylen));
yylen = 0; yylen = 0;
} }
else if (lac_size) else if (lac_size)
@@ -1329,7 +1336,7 @@ b4_error_verbose_if([state_type yystate, const symbol_type& yyla],
*/ */
if (!yyla.empty ()) if (!yyla.empty ())
{ {
int yytoken = yyla.type_get (); symbol_number_type yytoken = yyla.type_get ();
yyarg[yycount++] = yytname_[yytoken];]b4_lac_if([[ yyarg[yycount++] = yytname_[yytoken];]b4_lac_if([[
#if ]b4_api_PREFIX[DEBUG #if ]b4_api_PREFIX[DEBUG
@@ -1339,11 +1346,12 @@ b4_error_verbose_if([state_type yystate, const symbol_type& yyla],
yy_lac_check_ (yytoken); yy_lac_check_ (yytoken);
#endif]])[ #endif]])[
int yyn = yypact_[yystate]; int yyn = yypact_[+yystate];
if (!yy_pact_value_is_default_ (yyn)) if (!yy_pact_value_is_default_ (yyn))
{]b4_lac_if([[ {]b4_lac_if([[
for (int yyx = 0; yyx < yyntokens_; ++yyx) for (int yyx = 0; yyx < yyntokens_; ++yyx)
if (yyx != yyterror_ && yy_lac_check_(yyx)) if (yyx != yy_error_token_ && yyx != yy_undef_token_
&& yy_lac_check_ (yyx))
{]], [[ {]], [[
/* Start YYX at -YYN if negative to avoid negative indexes in /* Start YYX at -YYN if negative to avoid negative indexes in
YYCHECK. In other words, skip the first -YYN actions for YYCHECK. In other words, skip the first -YYN actions for
@@ -1353,7 +1361,7 @@ b4_error_verbose_if([state_type yystate, const symbol_type& yyla],
int yychecklim = yylast_ - yyn + 1; int yychecklim = yylast_ - yyn + 1;
int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_; int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_;
for (int yyx = yyxbegin; yyx < yyxend; ++yyx) for (int yyx = yyxbegin; yyx < yyxend; ++yyx)
if (yycheck_[yyx + yyn] == yyx && yyx != yyterror_ if (yycheck_[yyx + yyn] == yyx && yyx != yy_error_token_
&& !yy_table_value_is_error_ (yytable_[yyx + yyn])) && !yy_table_value_is_error_ (yytable_[yyx + yyn]))
{]])[ {]])[
if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
+82 -94
View File
@@ -1,6 +1,6 @@
# D skeleton for Bison -*- autoconf -*- # D skeleton for Bison -*- autoconf -*-
# Copyright (C) 2007-2012, 2019 Free Software Foundation, Inc. # Copyright (C) 2007-2012, 2019-2020 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@@ -20,7 +20,7 @@ m4_include(b4_skeletonsdir/[d.m4])
b4_output_begin([b4_parser_file_name]) b4_output_begin([b4_parser_file_name])
b4_copyright([Skeleton implementation for Bison LALR(1) parsers in D], b4_copyright([Skeleton implementation for Bison LALR(1) parsers in D],
[2007-2012, 2019])[ [2007-2012, 2019-2020])[
]b4_percent_define_ifdef([package], [module b4_percent_define_get([package]); ]b4_percent_define_ifdef([package], [module b4_percent_define_get([package]);
])[ ])[
@@ -187,9 +187,6 @@ b4_user_union_members
{ {
]b4_identification[ ]b4_identification[
/** True if verbose error messages are enabled. */
public bool errorVerbose = ]b4_flag_value([error_verbose])[;
]b4_locations_if([[ ]b4_locations_if([[
private final ]b4_location_type[ yylloc_from_stack (ref YYStack rhs, int n) private final ]b4_location_type[ yylloc_from_stack (ref YYStack rhs, int n)
{ {
@@ -400,7 +397,8 @@ b4_user_union_members
ref ]b4_yystype[ yyvaluep]dnl ref ]b4_yystype[ yyvaluep]dnl
b4_locations_if([, ref ]b4_location_type[ yylocationp])[) b4_locations_if([, ref ]b4_location_type[ yylocationp])[)
{ {
if (0 < yydebug) { if (0 < yydebug)
{
string message = s ~ (yytype < yyntokens_ ? " token " : " nterm ") string message = s ~ (yytype < yyntokens_ ? " token " : " nterm ")
~ yytname_[yytype] ~ " ("]b4_locations_if([ ~ yytname_[yytype] ~ " ("]b4_locations_if([
~ yylocationp.toString() ~ ": "])[; ~ yylocationp.toString() ~ ": "])[;
@@ -619,8 +617,8 @@ m4_popdef([b4_at_dollar])])dnl
yyn = yypact_[yystate]; yyn = yypact_[yystate];
if (!yy_pact_value_is_default_ (yyn)) if (!yy_pact_value_is_default_ (yyn))
{ {
yyn += yyterror_; yyn += yy_error_token_;
if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yyterror_) if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yy_error_token_)
{ {
yyn = yytable_[yyn]; yyn = yytable_[yyn];
if (0 < yyn) if (0 < yyn)
@@ -667,78 +665,74 @@ m4_popdef([b4_at_dollar])])dnl
// Generate an error message. // Generate an error message.
private final string yysyntax_error (int yystate, int tok) private final string yysyntax_error (int yystate, int tok)
{ {]b4_error_verbose_if([[
if (errorVerbose) /* There are many possibilities here to consider:
- Assume YYFAIL is not used. It's too flawed to consider.
See
<http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
for details. YYERROR is fine as it does not invoke this
function.
- If this state is a consistent state with a default action,
then the only way this function was invoked is if the
default action is an error action. In that case, don't
check for expected tokens because there are none.
- The only way there can be no lookahead present (in tok) is
if this state is a consistent state with a default action.
Thus, detecting the absence of a lookahead is sufficient to
determine that there is no unexpected or expected token to
report. In that case, just report a simple "syntax error".
- Don't assume there isn't a lookahead just because this
state is a consistent state with a default action. There
might have been a previous inconsistent state, consistent
state with a non-default action, or user semantic action
that manipulated yychar. (However, yychar is currently out
of scope during semantic actions.)
- Of course, the expected token list depends on states to
have correct lookahead information, and it depends on the
parser not to perform extra reductions after fetching a
lookahead from the scanner and before detecting a syntax
error. Thus, state merging (from LALR or IELR) and default
reductions corrupt the expected token list. However, the
list is correct for canonical LR with one exception: it
will still contain any token that will not be accepted due
to an error action in a later state.
*/
if (tok != yyempty_)
{ {
/* There are many possibilities here to consider: // FIXME: This method of building the message is not compatible
- Assume YYFAIL is not used. It's too flawed to consider. // with internationalization.
See string res = "syntax error, unexpected ";
<http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html> res ~= yytnamerr_ (yytname_[tok]);
for details. YYERROR is fine as it does not invoke this int yyn = yypact_[yystate];
function. if (!yy_pact_value_is_default_ (yyn))
- If this state is a consistent state with a default action,
then the only way this function was invoked is if the
default action is an error action. In that case, don't
check for expected tokens because there are none.
- The only way there can be no lookahead present (in tok) is
if this state is a consistent state with a default action.
Thus, detecting the absence of a lookahead is sufficient to
determine that there is no unexpected or expected token to
report. In that case, just report a simple "syntax error".
- Don't assume there isn't a lookahead just because this
state is a consistent state with a default action. There
might have been a previous inconsistent state, consistent
state with a non-default action, or user semantic action
that manipulated yychar. (However, yychar is currently out
of scope during semantic actions.)
- Of course, the expected token list depends on states to
have correct lookahead information, and it depends on the
parser not to perform extra reductions after fetching a
lookahead from the scanner and before detecting a syntax
error. Thus, state merging (from LALR or IELR) and default
reductions corrupt the expected token list. However, the
list is correct for canonical LR with one exception: it
will still contain any token that will not be accepted due
to an error action in a later state.
*/
if (tok != yyempty_)
{ {
// FIXME: This method of building the message is not compatible /* Start YYX at -YYN if negative to avoid negative
// with internationalization. indexes in YYCHECK. In other words, skip the first
string res = "syntax error, unexpected "; -YYN actions for this state because they are default
res ~= yytnamerr_ (yytname_[tok]); actions. */
int yyn = yypact_[yystate]; int yyxbegin = yyn < 0 ? -yyn : 0;
if (!yy_pact_value_is_default_ (yyn)) /* Stay within bounds of both yycheck and yytname. */
{ int yychecklim = yylast_ - yyn + 1;
/* Start YYX at -YYN if negative to avoid negative int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_;
indexes in YYCHECK. In other words, skip the first int count = 0;
-YYN actions for this state because they are default for (int x = yyxbegin; x < yyxend; ++x)
actions. */ if (yycheck_[x + yyn] == x && x != yy_error_token_
int yyxbegin = yyn < 0 ? -yyn : 0; && !yy_table_value_is_error_ (yytable_[x + yyn]))
/* Stay within bounds of both yycheck and yytname. */ ++count;
int yychecklim = yylast_ - yyn + 1; if (count < 5)
int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_; {
int count = 0; count = 0;
for (int x = yyxbegin; x < yyxend; ++x) for (int x = yyxbegin; x < yyxend; ++x)
if (yycheck_[x + yyn] == x && x != yyterror_ if (yycheck_[x + yyn] == x && x != yy_error_token_
&& !yy_table_value_is_error_ (yytable_[x + yyn])) && !yy_table_value_is_error_ (yytable_[x + yyn]))
++count; {
if (count < 5) res ~= count++ == 0 ? ", expecting " : " or ";
{ res ~= yytnamerr_ (yytname_[x]);
count = 0; }
for (int x = yyxbegin; x < yyxend; ++x) }
if (yycheck_[x + yyn] == x && x != yyterror_
&& !yy_table_value_is_error_ (yytable_[x + yyn]))
{
res ~= count++ == 0 ? ", expecting " : " or ";
res ~= yytnamerr_ (yytname_[x]);
}
}
}
return res;
} }
} return res;
}]])[
return "syntax error"; return "syntax error";
} }
@@ -771,14 +765,6 @@ m4_popdef([b4_at_dollar])])dnl
]b4_parser_tables_define[ ]b4_parser_tables_define[
/* TOKEN_NUMBER_[YYLEX-NUM] -- Internal symbol number corresponding
to YYLEX-NUM. */
private static immutable ]b4_int_type_for([b4_toknum])[[]
yytoken_number_ =
@{
]b4_toknum[
@};
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
First, the terminals, then, starting at \a yyntokens_, nonterminals. */ First, the terminals, then, starting at \a yyntokens_, nonterminals. */
private static immutable string[] yytname_ = private static immutable string[] yytname_ =
@@ -814,36 +800,38 @@ m4_popdef([b4_at_dollar])])dnl
} }
]])[ ]])[
private static ]b4_int_type_for([b4_translate])[ yytranslate_ (int t) private static token_number_type yytranslate_ (int t)
{ {
]b4_api_token_raw_if( ]b4_api_token_raw_if(
[[ import std.conv : to; [[ import std.conv : to;
return to!byte (t);]], return to!byte (t);]],
[[ /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ [[ /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
immutable ]b4_int_type_for([b4_translate])[[] translate_table = immutable token_number_type[] translate_table =
@{ @{
]b4_translate[ ]b4_translate[
@}; @};
immutable int user_token_number_max_ = ]b4_user_token_number_max[;
immutable token_number_type undef_token_ = ]b4_undef_token_number[;
if (t <= 0) if (t <= 0)
return YYTokenType.EOF; return YYTokenType.EOF;
else if (t <= yyuser_token_number_max_) else if (t <= user_token_number_max_)
return translate_table[t]; return translate_table[t];
else else
return yyundef_token_;]])[ return undef_token_;]])[
} }
alias ]b4_int_type_for([b4_translate])[ token_number_type;
private static immutable token_number_type yy_error_token_ = 1;
private static immutable int yylast_ = ]b4_last[; private static immutable int yylast_ = ]b4_last[;
private static immutable int yynnts_ = ]b4_nterms_number[; private static immutable int yynnts_ = ]b4_nterms_number[;
private static immutable int yyempty_ = -2; private static immutable int yyempty_ = -2;
private static immutable int yyfinal_ = ]b4_final_state_number[; private static immutable int yyfinal_ = ]b4_final_state_number[;
private static immutable int yyterror_ = 1;
private static immutable int yyerrcode_ = 256;
private static immutable int yyntokens_ = ]b4_tokens_number[; private static immutable int yyntokens_ = ]b4_tokens_number[;
private static immutable int yyuser_token_number_max_ = ]b4_user_token_number_max[;
private static immutable int yyundef_token_ = ]b4_undef_token_number[;
private final struct YYStackElement { private final struct YYStackElement {
int state; int state;
]b4_yystype[ value;]b4_locations_if( ]b4_yystype[ value;]b4_locations_if(
+63 -65
View File
@@ -1,6 +1,6 @@
# Java skeleton for Bison -*- autoconf -*- # Java skeleton for Bison -*- autoconf -*-
# Copyright (C) 2007-2015, 2018-2019 Free Software Foundation, Inc. # Copyright (C) 2007-2015, 2018-2020 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@@ -65,8 +65,8 @@ m4_define([b4_define_state],[[
int label = YYNEWSTATE; int label = YYNEWSTATE;
/* Error handling. */ /* Error handling. */
int yynerrs_ = 0; int yynerrs_ = 0;]b4_locations_if([[
]b4_locations_if([[/* The location where the error started. */ /* The location where the error started. */
]b4_location_type[ yyerrloc = null; ]b4_location_type[ yyerrloc = null;
/* Location. */ /* Location. */
@@ -78,7 +78,7 @@ m4_define([b4_define_state],[[
]b4_output_begin([b4_parser_file_name])[ ]b4_output_begin([b4_parser_file_name])[
]b4_copyright([Skeleton implementation for Bison LALR(1) parsers in Java], ]b4_copyright([Skeleton implementation for Bison LALR(1) parsers in Java],
[2007-2015, 2018-2019])[ [2007-2015, 2018-2020])[
]b4_percent_define_ifdef([package], [package b4_percent_define_get([package]);[ ]b4_percent_define_ifdef([package], [package b4_percent_define_get([package]);[
]])[ ]])[
]b4_user_pre_prologue[ ]b4_user_pre_prologue[
@@ -182,7 +182,7 @@ b4_locations_if([[
]b4_token_enums[ ]b4_token_enums[
]b4_locations_if([[/** ]b4_locations_if([[/**
* Method to retrieve the beginning position of the last scanned token. * Method to retrieve the beginning position of the last scanned token.
* @@return the position at which the last scanned token starts. * @@return the position at which the last scanned token starts.
*/ */
@@ -206,13 +206,13 @@ b4_locations_if([[
* ]b4_locations_if([and beginning/ending positions ])[of the token. * ]b4_locations_if([and beginning/ending positions ])[of the token.
* @@return the token identifier corresponding to the next token. * @@return the token identifier corresponding to the next token.
*/ */
int yylex () ]b4_maybe_throws([b4_lex_throws])[; int yylex ()]b4_maybe_throws([b4_lex_throws])[;
/** /**
* Entry point for error reporting. Emits an error * Entry point for error reporting. Emits an error
* ]b4_locations_if([referring to the given location ])[in a user-defined way. * ]b4_locations_if([referring to the given location ])[in a user-defined way.
* *
* ]b4_locations_if([[@@param loc The location of the element to which the *]b4_locations_if([[ @@param loc The location of the element to which the
* error message is related]])[ * error message is related]])[
* @@param msg The string for the error message. * @@param msg The string for the error message.
*/ */
@@ -224,22 +224,23 @@ b4_locations_if([[
]b4_percent_code_get([[lexer]])[ ]b4_percent_code_get([[lexer]])[
} }
]])[/** ]])[
/**
* The object doing lexical analysis for us. * The object doing lexical analysis for us.
*/ */
private Lexer yylexer; private Lexer yylexer;
]b4_parse_param_vars[ ]b4_parse_param_vars[
]b4_lexer_if([[ ]b4_lexer_if([[
/** /**
* Instantiates the Bison-generated parser. * Instantiates the Bison-generated parser.
*/ */
public ]b4_parser_class (b4_parse_param_decl([b4_lex_param_decl])[) ]b4_maybe_throws([b4_init_throws])[ public ]b4_parser_class (b4_parse_param_decl([b4_lex_param_decl])[)]b4_maybe_throws([b4_init_throws])[
{ {
]b4_percent_code_get([[init]])[ ]b4_percent_code_get([[init]])[
this.yylexer = new YYLexer(]b4_lex_param_call[); this.yylexer = new YYLexer(]b4_lex_param_call[);
]b4_parse_param_cons[ ]b4_parse_param_cons[
} }
]])[ ]])[
@@ -247,11 +248,11 @@ b4_locations_if([[
* Instantiates the Bison-generated parser. * Instantiates the Bison-generated parser.
* @@param yylexer The scanner that will supply tokens to the parser. * @@param yylexer The scanner that will supply tokens to the parser.
*/ */
]b4_lexer_if([[protected]], [[public]]) b4_parser_class[ (]b4_parse_param_decl([[Lexer yylexer]])[) ]b4_maybe_throws([b4_init_throws])[ ]b4_lexer_if([[protected]], [[public]]) b4_parser_class[ (]b4_parse_param_decl([[Lexer yylexer]])[)]b4_maybe_throws([b4_init_throws])[
{ {
]b4_percent_code_get([[init]])[ ]b4_percent_code_get([[init]])[
this.yylexer = yylexer; this.yylexer = yylexer;
]b4_parse_param_cons[ ]b4_parse_param_cons[
} }
]b4_parse_trace_if([[ ]b4_parse_trace_if([[
@@ -320,8 +321,8 @@ b4_locations_if([[
}]])[ }]])[
private final class YYStack { private final class YYStack {
private int[] stateStack = new int[16]; private int[] stateStack = new int[16];]b4_locations_if([[
]b4_locations_if([[private ]b4_location_type[[] locStack = new ]b4_location_type[[16];]])[ private ]b4_location_type[[] locStack = new ]b4_location_type[[16];]])[
private ]b4_yystype[[] valueStack = new ]b4_yystype[[16]; private ]b4_yystype[[] valueStack = new ]b4_yystype[[16];
public int size = 16; public int size = 16;
@@ -334,8 +335,7 @@ b4_locations_if([[
{ {
int[] newStateStack = new int[size * 2]; int[] newStateStack = new int[size * 2];
System.arraycopy (stateStack, 0, newStateStack, 0, height); System.arraycopy (stateStack, 0, newStateStack, 0, height);
stateStack = newStateStack; stateStack = newStateStack;]b4_locations_if([[
]b4_locations_if([[
]b4_location_type[[] newLocStack = new ]b4_location_type[[size * 2]; ]b4_location_type[[] newLocStack = new ]b4_location_type[[size * 2];
System.arraycopy (locStack, 0, newLocStack, 0, height); System.arraycopy (locStack, 0, newLocStack, 0, height);
locStack = newLocStack;]]) locStack = newLocStack;]])
@@ -347,8 +347,8 @@ b4_locations_if([[
size *= 2; size *= 2;
} }
stateStack[height] = state; stateStack[height] = state;]b4_locations_if([[
]b4_locations_if([[locStack[height] = loc;]])[ locStack[height] = loc;]])[
valueStack[height] = value; valueStack[height] = value;
} }
@@ -359,8 +359,8 @@ b4_locations_if([[
public final void pop (int num) { public final void pop (int num) {
// Avoid memory leaks... garbage collection is a white lie! // Avoid memory leaks... garbage collection is a white lie!
if (0 < num) { if (0 < num) {
java.util.Arrays.fill (valueStack, height - num + 1, height + 1, null); java.util.Arrays.fill (valueStack, height - num + 1, height + 1, null);]b4_locations_if([[
]b4_locations_if([[java.util.Arrays.fill (locStack, height - num + 1, height + 1, null);]])[ java.util.Arrays.fill (locStack, height - num + 1, height + 1, null);]])[
} }
height -= num; height -= num;
} }
@@ -368,8 +368,9 @@ b4_locations_if([[
public final int stateAt (int i) { public final int stateAt (int i) {
return stateStack[height - i]; return stateStack[height - i];
} }
]b4_locations_if([[
]b4_locations_if([[public final ]b4_location_type[ locationAt (int i) { public final ]b4_location_type[ locationAt (int i) {
return locStack[height - i]; return locStack[height - i];
} }
@@ -452,7 +453,7 @@ b4_locations_if([[
return yydefgoto_[yysym - yyntokens_]; return yydefgoto_[yysym - yyntokens_];
} }
private int yyaction (int yyn, YYStack yystack, int yylen) ]b4_maybe_throws([b4_throws])[ private int yyaction (int yyn, YYStack yystack, int yylen)]b4_maybe_throws([b4_throws])[
{ {
/* If YYLEN is nonzero, implement the default value of the action: /* If YYLEN is nonzero, implement the default value of the action:
'$$ = $1'. Otherwise, use the top of the stack. '$$ = $1'. Otherwise, use the top of the stack.
@@ -460,8 +461,8 @@ b4_locations_if([[
Otherwise, the following line sets YYVAL to garbage. Otherwise, the following line sets YYVAL to garbage.
This behavior is undocumented and Bison This behavior is undocumented and Bison
users should not rely upon it. */ users should not rely upon it. */
]b4_yystype[ yyval = (0 < yylen) ? yystack.valueAt (yylen - 1) : yystack.valueAt (0); ]b4_yystype[ yyval = (0 < yylen) ? yystack.valueAt (yylen - 1) : yystack.valueAt (0);]b4_locations_if([[
]b4_locations_if([b4_location_type[ yyloc = yylloc (yystack, yylen);]])[]b4_parse_trace_if([[ ]b4_location_type[ yyloc = yylloc (yystack, yylen);]])[]b4_parse_trace_if([[
yyReducePrint (yyn, yystack);]])[ yyReducePrint (yyn, yystack);]])[
@@ -541,29 +542,28 @@ b4_locations_if([[
* @@return <tt>true</tt> if the parsing succeeds. Note that this does not * @@return <tt>true</tt> if the parsing succeeds. Note that this does not
* imply that there were no syntax errors. * imply that there were no syntax errors.
*/ */
public boolean parse () ]b4_maybe_throws([b4_list2([b4_lex_throws], [b4_throws])])[]])[ public boolean parse ()]b4_maybe_throws([b4_list2([b4_lex_throws], [b4_throws])])[]])[
]b4_push_if([ ]b4_push_if([
/** /**
* Push Parse input from external lexer * Push Parse input from external lexer
* *
* @@param yylextoken current token * @@param yylextoken current token
* @@param yylexval current lval * @@param yylexval current lval]b4_locations_if([[
]b4_locations_if([ * @@param yylexloc current position])[ * @@param yylexloc current position]])[
* *
* @@return <tt>YYACCEPT, YYABORT, YYPUSH_MORE</tt> * @@return <tt>YYACCEPT, YYABORT, YYPUSH_MORE</tt>
*/ */
public int push_parse (int yylextoken, b4_yystype yylexval[]b4_locations_if([, b4_location_type yylexloc])) public int push_parse (int yylextoken, b4_yystype yylexval[]b4_locations_if([, b4_location_type yylexloc]))b4_maybe_throws([b4_list2([b4_lex_throws], [b4_throws])])])[
b4_maybe_throws([b4_list2([b4_lex_throws], [b4_throws])])])[ {]b4_locations_if([[
{ /* @@$. */
]b4_locations_if([/* @@$. */ ]b4_location_type[ yyloc;]])[
b4_location_type yyloc;])[
]b4_push_if([],[[ ]b4_push_if([],[[
]b4_define_state[]b4_parse_trace_if([[ ]b4_define_state[]b4_parse_trace_if([[
yycdebug ("Starting parse\n");]])[ yycdebug ("Starting parse\n");]])[
yyerrstatus_ = 0; yyerrstatus_ = 0;
/* Initialize the stack. */ /* Initialize the stack. */
yystack.push (yystate, yylval ]b4_locations_if([, yylloc])[); yystack.push (yystate, yylval]b4_locations_if([, yylloc])[);
]m4_ifdef([b4_initial_action], [ ]m4_ifdef([b4_initial_action], [
b4_dollar_pushdef([yylval], [], [], [yylloc])dnl b4_dollar_pushdef([yylval], [], [], [yylloc])dnl
b4_user_initial_action b4_user_initial_action
@@ -706,7 +706,8 @@ b4_dollar_popdef[]dnl
yyerror (]b4_locations_if([yylloc, ])[yysyntax_error (yystate, yytoken)); yyerror (]b4_locations_if([yylloc, ])[yysyntax_error (yystate, yytoken));
} }
]b4_locations_if([yyerrloc = yylloc;])[ ]b4_locations_if([[
yyerrloc = yylloc;]])[
if (yyerrstatus_ == 3) if (yyerrstatus_ == 3)
{ {
/* If just tried and failed to reuse lookahead token after an /* If just tried and failed to reuse lookahead token after an
@@ -730,8 +731,8 @@ b4_dollar_popdef[]dnl
/*-------------------------------------------------. /*-------------------------------------------------.
| errorlab -- error raised explicitly by YYERROR. | | errorlab -- error raised explicitly by YYERROR. |
`-------------------------------------------------*/ `-------------------------------------------------*/
case YYERROR: case YYERROR:]b4_locations_if([[
]b4_locations_if([yyerrloc = yystack.locationAt (yylen - 1);])[ yyerrloc = yystack.locationAt (yylen - 1);]])[
/* Do not reclaim the symbols of the rule which action triggered /* Do not reclaim the symbols of the rule which action triggered
this YYERROR. */ this YYERROR. */
yystack.pop (yylen); yystack.pop (yylen);
@@ -751,8 +752,8 @@ b4_dollar_popdef[]dnl
yyn = yypact_[yystate]; yyn = yypact_[yystate];
if (!yyPactValueIsDefault (yyn)) if (!yyPactValueIsDefault (yyn))
{ {
yyn += yyterror_; yyn += yy_error_token_;
if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yyterror_) if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yy_error_token_)
{ {
yyn = yytable_[yyn]; yyn = yytable_[yyn];
if (0 < yyn) if (0 < yyn)
@@ -765,7 +766,8 @@ b4_dollar_popdef[]dnl
if (yystack.height == 0) if (yystack.height == 0)
]b4_push_if([{label = YYABORT; break;}],[return false;])[ ]b4_push_if([{label = YYABORT; break;}],[return false;])[
]b4_locations_if([yyerrloc = yystack.locationAt (0);])[ ]b4_locations_if([[
yyerrloc = yystack.locationAt (0);]])[
yystack.pop (); yystack.pop ();
yystate = yystack.stateAt (0);]b4_parse_trace_if([[ yystate = yystack.stateAt (0);]b4_parse_trace_if([[
if (0 < yydebug) if (0 < yydebug)
@@ -776,12 +778,12 @@ b4_dollar_popdef[]dnl
/* Leave the switch. */ /* Leave the switch. */
break; break;
]b4_locations_if([ ]b4_locations_if([[
/* Muck with the stack to setup for yylloc. */ /* Muck with the stack to setup for yylloc. */
yystack.push (0, null, yylloc); yystack.push (0, null, yylloc);
yystack.push (0, null, yyerrloc); yystack.push (0, null, yyerrloc);
yyloc = yylloc (yystack, 2); yyloc = yylloc (yystack, 2);
yystack.pop (2);])[ yystack.pop (2);]])[
/* Shift the error token. */]b4_parse_trace_if([[ /* Shift the error token. */]b4_parse_trace_if([[
yySymbolPrint ("Shifting", yystos_[yyn], yySymbolPrint ("Shifting", yystos_[yyn],
@@ -823,10 +825,10 @@ b4_dollar_popdef[]dnl
this.label = YYNEWSTATE; this.label = YYNEWSTATE;
/* Error handling. */ /* Error handling. */
this.yynerrs_ = 0; this.yynerrs_ = 0;]b4_locations_if([[
]b4_locations_if([/* The location where the error started. */ /* The location where the error started. */
this.yyerrloc = null; this.yyerrloc = null;
this.yylloc = new b4_location_type (null, null);])[ this.yylloc = new ]b4_location_type[ (null, null);]])[
/* Semantic value of the lookahead. */ /* Semantic value of the lookahead. */
this.yylval = null; this.yylval = null;
@@ -846,8 +848,7 @@ b4_dollar_popdef[]dnl
* *
* @@return <tt>YYACCEPT, YYABORT, YYPUSH_MORE</tt> * @@return <tt>YYACCEPT, YYABORT, YYPUSH_MORE</tt>
*/ */
public int push_parse (int yylextoken, b4_yystype yylexval, b4_position_type yylexpos) public int push_parse (int yylextoken, b4_yystype yylexval, b4_position_type yylexpos)b4_maybe_throws([b4_list2([b4_lex_throws], [b4_throws])])
b4_maybe_throws([b4_list2([b4_lex_throws], [b4_throws])])
{ {
return push_parse (yylextoken, yylexval, new b4_location_type (yylexpos)); return push_parse (yylextoken, yylexval, new b4_location_type (yylexpos));
} }
@@ -862,7 +863,7 @@ b4_dollar_popdef[]dnl
* @@return <tt>true</tt> if the parsing succeeds. Note that this does not * @@return <tt>true</tt> if the parsing succeeds. Note that this does not
* imply that there were no syntax errors. * imply that there were no syntax errors.
*/ */
public boolean parse () ]b4_maybe_throws([b4_list2([b4_lex_throws], [b4_throws])])[ public boolean parse ()]b4_maybe_throws([b4_list2([b4_lex_throws], [b4_throws])])[
{ {
if (yylexer == null) if (yylexer == null)
throw new NullPointerException("Null Lexer"); throw new NullPointerException("Null Lexer");
@@ -872,9 +873,9 @@ b4_dollar_popdef[]dnl
]b4_yystype[ lval = yylexer.getLVal(); ]b4_yystype[ lval = yylexer.getLVal();
]b4_locations_if([dnl ]b4_locations_if([dnl
b4_location_type yyloc = new b4_location_type (yylexer.getStartPos (), b4_location_type yyloc = new b4_location_type (yylexer.getStartPos (),
yylexer.getEndPos ());])[ yylexer.getEndPos ());])[]b4_locations_if([[
]b4_locations_if([status = push_parse(token,lval,yyloc);],[ status = push_parse(token,lval,yyloc);]], [[
status = push_parse(token,lval);])[ status = push_parse(token,lval);]])[
} while (status == YYPUSH_MORE); } while (status == YYPUSH_MORE);
return (status == YYACCEPT); return (status == YYACCEPT);
} }
@@ -931,14 +932,14 @@ b4_dollar_popdef[]dnl
int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_; int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_;
int count = 0; int count = 0;
for (int x = yyxbegin; x < yyxend; ++x) for (int x = yyxbegin; x < yyxend; ++x)
if (yycheck_[x + yyn] == x && x != yyterror_ if (yycheck_[x + yyn] == x && x != yy_error_token_
&& !yyTableValueIsError (yytable_[x + yyn])) && !yyTableValueIsError (yytable_[x + yyn]))
++count; ++count;
if (count < 5) if (count < 5)
{ {
count = 0; count = 0;
for (int x = yyxbegin; x < yyxend; ++x) for (int x = yyxbegin; x < yyxend; ++x)
if (yycheck_[x + yyn] == x && x != yyterror_ if (yycheck_[x + yyn] == x && x != yy_error_token_
&& !yyTableValueIsError (yytable_[x + yyn])) && !yyTableValueIsError (yytable_[x + yyn]))
{ {
res.append (count++ == 0 ? ", expecting " : " or "); res.append (count++ == 0 ? ", expecting " : " or ");
@@ -976,9 +977,6 @@ b4_dollar_popdef[]dnl
private static final ]b4_int_type_for([b4_table])[ yytable_ninf_ = ]b4_table_ninf[; private static final ]b4_int_type_for([b4_table])[ yytable_ninf_ = ]b4_table_ninf[;
]b4_parser_tables_define[ ]b4_parser_tables_define[
]b4_integral_parser_table_define([token_number], [b4_toknum],
[[YYTOKEN_NUMBER[YYLEX-NUM] -- Internal symbol number corresponding
to YYLEX-NUM.]])[
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
First, the terminals, then, starting at \a yyntokens_, nonterminals. */ First, the terminals, then, starting at \a yyntokens_, nonterminals. */
@@ -1018,27 +1016,27 @@ b4_dollar_popdef[]dnl
} }
]], ]],
[[ { [[ {
int user_token_number_max_ = ]b4_user_token_number_max[;
]b4_int_type_for([b4_translate])[ undef_token_ = ]b4_undef_token_number[;
if (t <= 0) if (t <= 0)
return Lexer.EOF; return Lexer.EOF;
else if (t <= yyuser_token_number_max_) else if (t <= user_token_number_max_)
return yytranslate_table_[t]; return yytranslate_table_[t];
else else
return yyundef_token_; return undef_token_;
} }
]b4_integral_parser_table_define([translate_table], [b4_translate])[ ]b4_integral_parser_table_define([translate_table], [b4_translate])[
]])[ ]])[
private static final ]b4_int_type_for([b4_translate])[ yy_error_token_ = 1;
private static final int yylast_ = ]b4_last[; private static final int yylast_ = ]b4_last[;
private static final int yynnts_ = ]b4_nterms_number[; private static final int yynnts_ = ]b4_nterms_number[;
private static final int yyempty_ = -2; private static final int yyempty_ = -2;
private static final int yyfinal_ = ]b4_final_state_number[; private static final int yyfinal_ = ]b4_final_state_number[;
private static final int yyterror_ = 1;
private static final int yyerrcode_ = 256;
private static final int yyntokens_ = ]b4_tokens_number[; private static final int yyntokens_ = ]b4_tokens_number[;
private static final int yyuser_token_number_max_ = ]b4_user_token_number_max[;
private static final int yyundef_token_ = ]b4_undef_token_number[;
/* User implementation code. */ /* User implementation code. */
]b4_percent_code_get[]dnl ]b4_percent_code_get[]dnl
+41 -29
View File
@@ -1,6 +1,6 @@
# C++ skeleton for Bison # C++ skeleton for Bison
# Copyright (C) 2002-2015, 2018-2019 Free Software Foundation, Inc. # Copyright (C) 2002-2015, 2018-2020 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@@ -16,7 +16,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
m4_pushdef([b4_copyright_years], m4_pushdef([b4_copyright_years],
[2002-2015, 2018-2019]) [2002-2015, 2018-2020])
# b4_position_file # b4_position_file
@@ -62,11 +62,14 @@ m4_define([b4_location_define],
[[ /// A point in a source file. [[ /// A point in a source file.
class position class position
{ {
public:]m4_ifdef([b4_location_constructors], [[ public:
/// Type for line and column numbers.
typedef int counter_type;
]m4_ifdef([b4_location_constructors], [[
/// Construct a position. /// Construct a position.
explicit position (]b4_percent_define_get([[filename_type]])[* f = YY_NULLPTR, explicit position (]b4_percent_define_get([[filename_type]])[* f = YY_NULLPTR,
int l = ]b4_location_initial_line[, counter_type l = ]b4_location_initial_line[,
int c = ]b4_location_initial_column[) counter_type c = ]b4_location_initial_column[)
: filename (f) : filename (f)
, line (l) , line (l)
, column (c) , column (c)
@@ -75,8 +78,8 @@ m4_define([b4_location_define],
]])[ ]])[
/// Initialization. /// Initialization.
void initialize (]b4_percent_define_get([[filename_type]])[* fn = YY_NULLPTR, void initialize (]b4_percent_define_get([[filename_type]])[* fn = YY_NULLPTR,
int l = ]b4_location_initial_line[, counter_type l = ]b4_location_initial_line[,
int c = ]b4_location_initial_column[) counter_type c = ]b4_location_initial_column[)
{ {
filename = fn; filename = fn;
line = l; line = l;
@@ -86,7 +89,7 @@ m4_define([b4_location_define],
/** \name Line and Column related manipulators /** \name Line and Column related manipulators
** \{ */ ** \{ */
/// (line related) Advance to the COUNT next lines. /// (line related) Advance to the COUNT next lines.
void lines (int count = 1) void lines (counter_type count = 1)
{ {
if (count) if (count)
{ {
@@ -96,7 +99,7 @@ m4_define([b4_location_define],
} }
/// (column related) Advance to the COUNT next columns. /// (column related) Advance to the COUNT next columns.
void columns (int count = 1) void columns (counter_type count = 1)
{ {
column = add_ (column, count, ]b4_location_initial_column[); column = add_ (column, count, ]b4_location_initial_column[);
} }
@@ -105,13 +108,13 @@ m4_define([b4_location_define],
/// File name to which this position refers. /// File name to which this position refers.
]b4_percent_define_get([[filename_type]])[* filename; ]b4_percent_define_get([[filename_type]])[* filename;
/// Current line number. /// Current line number.
int line; counter_type line;
/// Current column number. /// Current column number.
int column; counter_type column;
private: private:
/// Compute max (min, lhs+rhs). /// Compute max (min, lhs+rhs).
static int add_ (int lhs, int rhs, int min) static counter_type add_ (counter_type lhs, counter_type rhs, counter_type min)
{ {
return lhs + rhs < min ? min : lhs + rhs; return lhs + rhs < min ? min : lhs + rhs;
} }
@@ -119,7 +122,7 @@ m4_define([b4_location_define],
/// Add \a width columns, in place. /// Add \a width columns, in place.
inline position& inline position&
operator+= (position& res, int width) operator+= (position& res, position::counter_type width)
{ {
res.columns (width); res.columns (width);
return res; return res;
@@ -127,21 +130,21 @@ m4_define([b4_location_define],
/// Add \a width columns. /// Add \a width columns.
inline position inline position
operator+ (position res, int width) operator+ (position res, position::counter_type width)
{ {
return res += width; return res += width;
} }
/// Subtract \a width columns, in place. /// Subtract \a width columns, in place.
inline position& inline position&
operator-= (position& res, int width) operator-= (position& res, position::counter_type width)
{ {
return res += -width; return res += -width;
} }
/// Subtract \a width columns. /// Subtract \a width columns.
inline position inline position
operator- (position res, int width) operator- (position res, position::counter_type width)
{ {
return res -= width; return res -= width;
} }
@@ -181,6 +184,8 @@ m4_define([b4_location_define],
class location class location
{ {
public: public:
/// Type for line and column numbers.
typedef position::counter_type counter_type;
]m4_ifdef([b4_location_constructors], [ ]m4_ifdef([b4_location_constructors], [
/// Construct a location from \a b to \a e. /// Construct a location from \a b to \a e.
location (const position& b, const position& e) location (const position& b, const position& e)
@@ -196,8 +201,8 @@ m4_define([b4_location_define],
/// Construct a 0-width location in \a f, \a l, \a c. /// Construct a 0-width location in \a f, \a l, \a c.
explicit location (]b4_percent_define_get([[filename_type]])[* f, explicit location (]b4_percent_define_get([[filename_type]])[* f,
int l = ]b4_location_initial_line[, counter_type l = ]b4_location_initial_line[,
int c = ]b4_location_initial_column[) counter_type c = ]b4_location_initial_column[)
: begin (f, l, c) : begin (f, l, c)
, end (f, l, c) , end (f, l, c)
{} {}
@@ -205,8 +210,8 @@ m4_define([b4_location_define],
])[ ])[
/// Initialization. /// Initialization.
void initialize (]b4_percent_define_get([[filename_type]])[* f = YY_NULLPTR, void initialize (]b4_percent_define_get([[filename_type]])[* f = YY_NULLPTR,
int l = ]b4_location_initial_line[, counter_type l = ]b4_location_initial_line[,
int c = ]b4_location_initial_column[) counter_type c = ]b4_location_initial_column[)
{ {
begin.initialize (f, l, c); begin.initialize (f, l, c);
end = begin; end = begin;
@@ -222,13 +227,13 @@ m4_define([b4_location_define],
} }
/// Extend the current location to the COUNT next columns. /// Extend the current location to the COUNT next columns.
void columns (int count = 1) void columns (counter_type count = 1)
{ {
end += count; end += count;
} }
/// Extend the current location to the COUNT next lines. /// Extend the current location to the COUNT next lines.
void lines (int count = 1) void lines (counter_type count = 1)
{ {
end.lines (count); end.lines (count);
} }
@@ -243,39 +248,45 @@ m4_define([b4_location_define],
}; };
/// Join two locations, in place. /// Join two locations, in place.
inline location& operator+= (location& res, const location& end) inline location&
operator+= (location& res, const location& end)
{ {
res.end = end.end; res.end = end.end;
return res; return res;
} }
/// Join two locations. /// Join two locations.
inline location operator+ (location res, const location& end) inline location
operator+ (location res, const location& end)
{ {
return res += end; return res += end;
} }
/// Add \a width columns to the end position, in place. /// Add \a width columns to the end position, in place.
inline location& operator+= (location& res, int width) inline location&
operator+= (location& res, location::counter_type width)
{ {
res.columns (width); res.columns (width);
return res; return res;
} }
/// Add \a width columns to the end position. /// Add \a width columns to the end position.
inline location operator+ (location res, int width) inline location
operator+ (location res, location::counter_type width)
{ {
return res += width; return res += width;
} }
/// Subtract \a width columns to the end position, in place. /// Subtract \a width columns to the end position, in place.
inline location& operator-= (location& res, int width) inline location&
operator-= (location& res, location::counter_type width)
{ {
return res += -width; return res += -width;
} }
/// Subtract \a width columns to the end position. /// Subtract \a width columns to the end position.
inline location operator- (location res, int width) inline location
operator- (location res, location::counter_type width)
{ {
return res -= width; return res -= width;
} }
@@ -304,7 +315,8 @@ m4_define([b4_location_define],
std::basic_ostream<YYChar>& std::basic_ostream<YYChar>&
operator<< (std::basic_ostream<YYChar>& ostr, const location& loc) operator<< (std::basic_ostream<YYChar>& ostr, const location& loc)
{ {
int end_col = 0 < loc.end.column ? loc.end.column - 1 : 0; location::counter_type end_col
= 0 < loc.end.column ? loc.end.column - 1 : 0;
ostr << loc.begin; ostr << loc.begin;
if (loc.end.filename if (loc.end.filename
&& (!loc.begin.filename && (!loc.begin.filename
+3 -2
View File
@@ -1,6 +1,6 @@
# C++ skeleton for Bison # C++ skeleton for Bison
# Copyright (C) 2002-2015, 2018-2019 Free Software Foundation, Inc. # Copyright (C) 2002-2015, 2018-2020 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@@ -90,10 +90,11 @@ m4_define([b4_stack_define],
{ {
return index_type (seq_.size ()); return index_type (seq_.size ());
} }
std::ptrdiff_t std::ptrdiff_t
ssize () const YY_NOEXCEPT ssize () const YY_NOEXCEPT
{ {
return (std::ptrdiff_t) size (); return std::ptrdiff_t (size ());
} }
/// Iterator on top of the stack (going downwards). /// Iterator on top of the stack (going downwards).
+21 -21
View File
@@ -1,6 +1,6 @@
# C++ skeleton for Bison # C++ skeleton for Bison
# Copyright (C) 2002-2015, 2018-2019 Free Software Foundation, Inc. # Copyright (C) 2002-2015, 2018-2020 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@@ -72,9 +72,9 @@ m4_map([ b4_symbol_tag_comment], [$@])dnl
# The needed includes for variants support. # The needed includes for variants support.
m4_define([b4_variant_includes], m4_define([b4_variant_includes],
[b4_parse_assert_if([[#include <typeinfo>]])[ [b4_parse_assert_if([[#include <typeinfo>]])[
#ifndef YYASSERT #ifndef YY_ASSERT
# include <cassert> # include <cassert>
# define YYASSERT assert # define YY_ASSERT assert
#endif #endif
]]) ]])
@@ -111,14 +111,14 @@ m4_define([b4_value_type_declare],
semantic_type (YY_RVREF (T) t)]b4_parse_assert_if([ semantic_type (YY_RVREF (T) t)]b4_parse_assert_if([
: yytypeid_ (&typeid (T))])[ : yytypeid_ (&typeid (T))])[
{ {
YYASSERT (sizeof (T) <= size); YY_ASSERT (sizeof (T) <= size);
new (yyas_<T> ()) T (YY_MOVE (t)); new (yyas_<T> ()) T (YY_MOVE (t));
} }
/// Destruction, allowed only if empty. /// Destruction, allowed only if empty.
~semantic_type () YY_NOEXCEPT ~semantic_type () YY_NOEXCEPT
{]b4_parse_assert_if([ {]b4_parse_assert_if([
YYASSERT (!yytypeid_); YY_ASSERT (!yytypeid_);
])[} ])[}
# if 201103L <= YY_CPLUSPLUS # if 201103L <= YY_CPLUSPLUS
@@ -127,8 +127,8 @@ m4_define([b4_value_type_declare],
T& T&
emplace (U&&... u) emplace (U&&... u)
{]b4_parse_assert_if([ {]b4_parse_assert_if([
YYASSERT (!yytypeid_); YY_ASSERT (!yytypeid_);
YYASSERT (sizeof (T) <= size); YY_ASSERT (sizeof (T) <= size);
yytypeid_ = & typeid (T);])[ yytypeid_ = & typeid (T);])[
return *new (yyas_<T> ()) T (std::forward <U>(u)...); return *new (yyas_<T> ()) T (std::forward <U>(u)...);
} }
@@ -138,8 +138,8 @@ m4_define([b4_value_type_declare],
T& T&
emplace () emplace ()
{]b4_parse_assert_if([ {]b4_parse_assert_if([
YYASSERT (!yytypeid_); YY_ASSERT (!yytypeid_);
YYASSERT (sizeof (T) <= size); YY_ASSERT (sizeof (T) <= size);
yytypeid_ = & typeid (T);])[ yytypeid_ = & typeid (T);])[
return *new (yyas_<T> ()) T (); return *new (yyas_<T> ()) T ();
} }
@@ -149,8 +149,8 @@ m4_define([b4_value_type_declare],
T& T&
emplace (const T& t) emplace (const T& t)
{]b4_parse_assert_if([ {]b4_parse_assert_if([
YYASSERT (!yytypeid_); YY_ASSERT (!yytypeid_);
YYASSERT (sizeof (T) <= size); YY_ASSERT (sizeof (T) <= size);
yytypeid_ = & typeid (T);])[ yytypeid_ = & typeid (T);])[
return *new (yyas_<T> ()) T (t); return *new (yyas_<T> ()) T (t);
} }
@@ -179,9 +179,9 @@ m4_define([b4_value_type_declare],
T& T&
as () YY_NOEXCEPT as () YY_NOEXCEPT
{]b4_parse_assert_if([ {]b4_parse_assert_if([
YYASSERT (yytypeid_); YY_ASSERT (yytypeid_);
YYASSERT (*yytypeid_ == typeid (T)); YY_ASSERT (*yytypeid_ == typeid (T));
YYASSERT (sizeof (T) <= size);])[ YY_ASSERT (sizeof (T) <= size);])[
return *yyas_<T> (); return *yyas_<T> ();
} }
@@ -190,9 +190,9 @@ m4_define([b4_value_type_declare],
const T& const T&
as () const YY_NOEXCEPT as () const YY_NOEXCEPT
{]b4_parse_assert_if([ {]b4_parse_assert_if([
YYASSERT (yytypeid_); YY_ASSERT (yytypeid_);
YYASSERT (*yytypeid_ == typeid (T)); YY_ASSERT (*yytypeid_ == typeid (T));
YYASSERT (sizeof (T) <= size);])[ YY_ASSERT (sizeof (T) <= size);])[
return *yyas_<T> (); return *yyas_<T> ();
} }
@@ -208,8 +208,8 @@ m4_define([b4_value_type_declare],
void void
swap (self_type& that) YY_NOEXCEPT swap (self_type& that) YY_NOEXCEPT
{]b4_parse_assert_if([ {]b4_parse_assert_if([
YYASSERT (yytypeid_); YY_ASSERT (yytypeid_);
YYASSERT (*yytypeid_ == *that.yytypeid_);])[ YY_ASSERT (*yytypeid_ == *that.yytypeid_);])[
std::swap (as<T> (), that.as<T> ()); std::swap (as<T> (), that.as<T> ());
} }
@@ -401,7 +401,7 @@ m4_define([_b4_token_constructor_define],
b4_symbol_if([$1], [has_type], [std::move (v)]), b4_symbol_if([$1], [has_type], [std::move (v)]),
b4_locations_if([std::move (l)]))[) b4_locations_if([std::move (l)]))[)
{ {
YYASSERT (]m4_join([ || ], m4_map_sep([_b4_type_clause], [, ], [$@]))[); YY_ASSERT (]m4_join([ || ], m4_map_sep([_b4_type_clause], [, ], [$@]))[);
} }
#else #else
symbol_type (]b4_join( symbol_type (]b4_join(
@@ -413,7 +413,7 @@ m4_define([_b4_token_constructor_define],
b4_symbol_if([$1], [has_type], [v]), b4_symbol_if([$1], [has_type], [v]),
b4_locations_if([l]))[) b4_locations_if([l]))[)
{ {
YYASSERT (]m4_join([ || ], m4_map_sep([_b4_type_clause], [, ], [$@]))[); YY_ASSERT (]m4_join([ || ], m4_map_sep([_b4_type_clause], [, ], [$@]))[);
} }
#endif #endif
]])]) ]])])
+53 -35
View File
@@ -1,11 +1,11 @@
# -*- C -*- # -*- C -*-
# Yacc compatible skeleton for Bison # Yacc compatible skeleton for Bison
# Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software # Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2020 Free Software
# Foundation, Inc. # Foundation, Inc.
m4_pushdef([b4_copyright_years], m4_pushdef([b4_copyright_years],
[1984, 1989-1990, 2000-2015, 2018-2019]) [1984, 1989-1990, 2000-2015, 2018-2020])
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@@ -339,13 +339,13 @@ m4_if(b4_api_prefix, [yy], [],
#define yylex ]b4_prefix[lex #define yylex ]b4_prefix[lex
#define yyerror ]b4_prefix[error #define yyerror ]b4_prefix[error
#define yydebug ]b4_prefix[debug #define yydebug ]b4_prefix[debug
#define yynerrs ]b4_prefix[nerrs #define yynerrs ]b4_prefix[nerrs]]b4_pure_if([], [[
]]b4_pure_if([], [[
#define yylval ]b4_prefix[lval #define yylval ]b4_prefix[lval
#define yychar ]b4_prefix[char]b4_locations_if([[ #define yychar ]b4_prefix[char]b4_locations_if([[
#define yylloc ]b4_prefix[lloc]])]))[ #define yylloc ]b4_prefix[lloc]])]))[
]b4_user_pre_prologue[ ]b4_user_pre_prologue[
]b4_cast_define[
]b4_null_define[ ]b4_null_define[
/* Enabling verbose error messages. */ /* Enabling verbose error messages. */
@@ -400,10 +400,13 @@ m4_if(b4_api_prefix, [yy], [],
# endif # endif
#endif #endif
#define YYSIZE_MAXIMUM ((YYPTRDIFF_T) (YYPTRDIFF_MAXIMUM < (YYSIZE_T) -1 \ #define YYSIZE_MAXIMUM \
? YYPTRDIFF_MAXIMUM : (YYSIZE_T) -1)) YY_CAST (YYPTRDIFF_T, \
(YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \
? YYPTRDIFF_MAXIMUM \
: YY_CAST (YYSIZE_T, -1)))
#define YYSIZEOF(X) ((YYPTRDIFF_T) sizeof (X)) #define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
/* Stored state numbers (used for stacks). */ /* Stored state numbers (used for stacks). */
typedef ]b4_int_type(0, m4_eval(b4_states_number - 1))[ yy_state_t; typedef ]b4_int_type(0, m4_eval(b4_states_number - 1))[ yy_state_t;
@@ -557,7 +560,7 @@ union yyalloc
# ifndef YYCOPY # ifndef YYCOPY
# if defined __GNUC__ && 1 < __GNUC__ # if defined __GNUC__ && 1 < __GNUC__
# define YYCOPY(Dst, Src, Count) \ # define YYCOPY(Dst, Src, Count) \
__builtin_memcpy (Dst, Src, (YYSIZE_T) (Count) * sizeof (*(Src))) __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
# else # else
# define YYCOPY(Dst, Src, Count) \ # define YYCOPY(Dst, Src, Count) \
do \ do \
@@ -752,7 +755,7 @@ do { \
{ {
YYFPRINTF (stderr, " $%d = ", yyi + 1); YYFPRINTF (stderr, " $%d = ", yyi + 1);
yy_symbol_print (stderr, yy_symbol_print (stderr,
yystos[yyssp[yyi + 1 - yynrhs]], yystos[+yyssp[yyi + 1 - yynrhs]],
&]b4_rhs_value(yynrhs, yyi + 1)[ &]b4_rhs_value(yynrhs, yyi + 1)[
]b4_locations_if([, &]b4_rhs_location(yynrhs, yyi + 1))[]dnl ]b4_locations_if([, &]b4_rhs_location(yynrhs, yyi + 1))[]dnl
b4_user_args[); b4_user_args[);
@@ -832,8 +835,9 @@ yy_lac_stack_realloc (YYPTRDIFF_T *yycapacity, YYPTRDIFF_T yyadd,
if (YYMAXDEPTH < yyalloc) if (YYMAXDEPTH < yyalloc)
yyalloc = YYMAXDEPTH; yyalloc = YYMAXDEPTH;
yybottom_new = yybottom_new =
(yy_state_t *) YYSTACK_ALLOC ((YYSIZE_T) YY_CAST (yy_state_t *,
(yyalloc * YYSIZEOF (*yybottom_new))); YYSTACK_ALLOC (YY_CAST (YYSIZE_T,
yyalloc * YYSIZEOF (*yybottom_new))));
if (!yybottom_new) if (!yybottom_new)
{ {
YYDPRINTF ((stderr, "%srealloc failed%s", yydebug_prefix, YYDPRINTF ((stderr, "%srealloc failed%s", yydebug_prefix,
@@ -850,8 +854,10 @@ yy_lac_stack_realloc (YYPTRDIFF_T *yycapacity, YYPTRDIFF_T yyadd,
*yybottom = yybottom_new; *yybottom = yybottom_new;
*yycapacity = yyalloc;]m4_if(b4_percent_define_get([[parse.lac.memory-trace]]), *yycapacity = yyalloc;]m4_if(b4_percent_define_get([[parse.lac.memory-trace]]),
[full], [[ [full], [[
YY_IGNORE_USELESS_CAST_BEGIN
YYDPRINTF ((stderr, "%srealloc to %ld%s", yydebug_prefix, YYDPRINTF ((stderr, "%srealloc to %ld%s", yydebug_prefix,
(long) yyalloc, yydebug_suffix));]])[ YY_CAST (long, yyalloc), yydebug_suffix));
YY_IGNORE_USELESS_CAST_END]])[
} }
return 0; return 0;
} }
@@ -949,12 +955,12 @@ yy_lac (yy_state_t *yyesa, yy_state_t **yyes,
} }
while (1) while (1)
{ {
int yyrule = yypact[*yyesp]; int yyrule = yypact[+*yyesp];
if (yypact_value_is_default (yyrule) if (yypact_value_is_default (yyrule)
|| (yyrule += yytoken) < 0 || YYLAST < yyrule || (yyrule += yytoken) < 0 || YYLAST < yyrule
|| yycheck[yyrule] != yytoken) || yycheck[yyrule] != yytoken)
{ {
yyrule = yydefact[*yyesp]; yyrule = yydefact[+*yyesp];
if (yyrule == 0) if (yyrule == 0)
{ {
YYDPRINTF ((stderr, " Err\n")); YYDPRINTF ((stderr, " Err\n"));
@@ -1008,7 +1014,9 @@ yy_lac (yy_state_t *yyesa, yy_state_t **yyes,
if (yyesp == yyes_prev) if (yyesp == yyes_prev)
{ {
yyesp = *yyes; yyesp = *yyes;
*yyesp = (yy_state_t) yystate; YY_IGNORE_USELESS_CAST_BEGIN
*yyesp = YY_CAST (yy_state_t, yystate);
YY_IGNORE_USELESS_CAST_END
} }
else else
{ {
@@ -1021,7 +1029,9 @@ yy_lac (yy_state_t *yyesa, yy_state_t **yyes,
YYDPRINTF ((stderr, "\n")); YYDPRINTF ((stderr, "\n"));
return 2; return 2;
} }
*++yyesp = (yy_state_t) yystate; YY_IGNORE_USELESS_CAST_BEGIN
*++yyesp = YY_CAST (yy_state_t, yystate);
YY_IGNORE_USELESS_CAST_END
} }
YYDPRINTF ((stderr, " G%d", yystate)); YYDPRINTF ((stderr, " G%d", yystate));
} }
@@ -1033,7 +1043,7 @@ yy_lac (yy_state_t *yyesa, yy_state_t **yyes,
# ifndef yystrlen # ifndef yystrlen
# if defined __GLIBC__ && defined _STRING_H # if defined __GLIBC__ && defined _STRING_H
# define yystrlen(S) ((YYPTRDIFF_T) strlen (S)) # define yystrlen(S) (YY_CAST (YYPTRDIFF_T, strlen (S)))
# else # else
/* Return the length of YYSTR. */ /* Return the length of YYSTR. */
]b4_function_define([yystrlen], [static YYPTRDIFF_T], ]b4_function_define([yystrlen], [static YYPTRDIFF_T],
@@ -1133,16 +1143,16 @@ yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg,
]b4_lac_if([[yy_state_t *yyesa, yy_state_t **yyes, ]b4_lac_if([[yy_state_t *yyesa, yy_state_t **yyes,
YYPTRDIFF_T *yyes_capacity, ]])[yy_state_t *yyssp, int yytoken) YYPTRDIFF_T *yyes_capacity, ]])[yy_state_t *yyssp, int yytoken)
{ {
YYPTRDIFF_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
YYPTRDIFF_T yysize = yysize0;
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
/* Internationalized format string. */ /* Internationalized format string. */
const char *yyformat = YY_NULLPTR; const char *yyformat = YY_NULLPTR;
/* Arguments of yyformat. */ /* Arguments of yyformat: reported tokens (one for the "unexpected",
one per "expected"). */
char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
/* Number of reported tokens (one for the "unexpected", one per /* Actual size of YYARG. */
"expected"). */
int yycount = 0; int yycount = 0;
/* Cumulated lengths of YYARG. */
YYPTRDIFF_T yysize = 0;
/* There are many possibilities here to consider: /* There are many possibilities here to consider:
- If this state is a consistent state with a default action, then - If this state is a consistent state with a default action, then
@@ -1174,7 +1184,9 @@ yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg,
*/ */
if (yytoken != YYEMPTY) if (yytoken != YYEMPTY)
{ {
int yyn = yypact[*yyssp];]b4_lac_if([[ int yyn = yypact[+*yyssp];
YYPTRDIFF_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
yysize = yysize0;]b4_lac_if([[
YYDPRINTF ((stderr, "Constructing syntax error message\n"));]])[ YYDPRINTF ((stderr, "Constructing syntax error message\n"));]])[
yyarg[yycount++] = yytname[yytoken]; yyarg[yycount++] = yytname[yytoken];
if (!yypact_value_is_default (yyn)) if (!yypact_value_is_default (yyn))
@@ -1213,8 +1225,8 @@ yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg,
} }
yyarg[yycount++] = yytname[yyx]; yyarg[yycount++] = yytname[yyx];
{ {
YYPTRDIFF_T yysize1 = yysize + yytnamerr (YY_NULLPTR, YYPTRDIFF_T yysize1
yytname[yyx]); = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
yysize = yysize1; yysize = yysize1;
else else
@@ -1245,7 +1257,9 @@ yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg,
} }
{ {
YYPTRDIFF_T yysize1 = yysize + yystrlen (yyformat); /* Don't count the "%s"s in the final size, but reserve room for
the terminator. */
YYPTRDIFF_T yysize1 = yysize + (yystrlen (yyformat) - 2 * yycount) + 1;
if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
yysize = yysize1; yysize = yysize1;
else else
@@ -1275,8 +1289,8 @@ yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg,
} }
else else
{ {
yyp++; ++yyp;
yyformat++; ++yyformat;
} }
} }
return 0; return 0;
@@ -1342,7 +1356,7 @@ b4_function_define([[yyparse]], [[int]], b4_parse_param)[
yypstate *yyps;]b4_pure_if([], [[ yypstate *yyps;]b4_pure_if([], [[
if (yypstate_allocated) if (yypstate_allocated)
return YY_NULLPTR;]])[ return YY_NULLPTR;]])[
yyps = (yypstate *) malloc (sizeof *yyps); yyps = YY_CAST (yypstate *, malloc (sizeof *yyps));
if (!yyps) if (!yyps)
return YY_NULLPTR; return YY_NULLPTR;
yyps->yynew = 1;]b4_pure_if([], [[ yyps->yynew = 1;]b4_pure_if([], [[
@@ -1484,7 +1498,9 @@ yynewstate:
yysetstate: yysetstate:
YYDPRINTF ((stderr, "Entering state %d\n", yystate)); YYDPRINTF ((stderr, "Entering state %d\n", yystate));
YY_ASSERT (0 <= yystate && yystate < YYNSTATES); YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
*yyssp = (yy_state_t) yystate; YY_IGNORE_USELESS_CAST_BEGIN
*yyssp = YY_CAST (yy_state_t, yystate);
YY_IGNORE_USELESS_CAST_END
if (yyss + yystacksize - 1 <= yyssp) if (yyss + yystacksize - 1 <= yyssp)
#if !defined yyoverflow && !defined YYSTACK_RELOCATE #if !defined yyoverflow && !defined YYSTACK_RELOCATE
@@ -1527,8 +1543,8 @@ yysetstate:
{ {
yy_state_t *yyss1 = yyss; yy_state_t *yyss1 = yyss;
union yyalloc *yyptr = union yyalloc *yyptr =
(union yyalloc *) YYSTACK_ALLOC ((YYSIZE_T) YY_CAST (union yyalloc *,
YYSTACK_BYTES (yystacksize)); YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
if (! yyptr) if (! yyptr)
goto yyexhaustedlab; goto yyexhaustedlab;
YYSTACK_RELOCATE (yyss_alloc, yyss); YYSTACK_RELOCATE (yyss_alloc, yyss);
@@ -1544,8 +1560,10 @@ yysetstate:
yyvsp = yyvs + yysize - 1;]b4_locations_if([ yyvsp = yyvs + yysize - 1;]b4_locations_if([
yylsp = yyls + yysize - 1;])[ yylsp = yyls + yysize - 1;])[
YY_IGNORE_USELESS_CAST_BEGIN
YYDPRINTF ((stderr, "Stack size increased to %ld\n", YYDPRINTF ((stderr, "Stack size increased to %ld\n",
(long) yystacksize)); YY_CAST (long, yystacksize)));
YY_IGNORE_USELESS_CAST_END
if (yyss + yystacksize - 1 <= yyssp) if (yyss + yystacksize - 1 <= yyssp)
YYABORT; YYABORT;
@@ -1758,7 +1776,7 @@ yyerrlab:
{ {
if (yymsg != yymsgbuf) if (yymsg != yymsgbuf)
YYSTACK_FREE (yymsg); YYSTACK_FREE (yymsg);
yymsg = (char *) YYSTACK_ALLOC ((YYSIZE_T) yymsg_alloc); yymsg = YY_CAST (char *, YYSTACK_ALLOC (YY_CAST (YYSIZE_T, yymsg_alloc)));
if (!yymsg) if (!yymsg)
{ {
yymsg = yymsgbuf; yymsg = yymsgbuf;
@@ -1922,7 +1940,7 @@ yyreturn:
while (yyssp != yyss) while (yyssp != yyss)
{ {
yydestruct ("Cleanup: popping", yydestruct ("Cleanup: popping",
yystos[*yyssp], yyvsp]b4_locations_if([, yylsp])[]b4_user_args[); yystos[+*yyssp], yyvsp]b4_locations_if([, yylsp])[]b4_user_args[);
YYPOPSTACK (1); YYPOPSTACK (1);
} }
#ifndef yyoverflow #ifndef yyoverflow
+1 -1
View File
@@ -3,7 +3,7 @@
<!-- <!--
bison.xsl - common templates for Bison XSLT. bison.xsl - common templates for Bison XSLT.
Copyright (C) 2007-2015, 2018-2019 Free Software Foundation, Inc. Copyright (C) 2007-2015, 2018-2020 Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler. This file is part of Bison, the GNU Compiler Compiler.
+1 -1
View File
@@ -3,7 +3,7 @@
<!-- <!--
xml2dot.xsl - transform Bison XML Report into DOT. xml2dot.xsl - transform Bison XML Report into DOT.
Copyright (C) 2007-2015, 2018-2019 Free Software Foundation, Inc. Copyright (C) 2007-2015, 2018-2020 Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler. This file is part of Bison, the GNU Compiler Compiler.
+1 -1
View File
@@ -3,7 +3,7 @@
<!-- <!--
xml2text.xsl - transform Bison XML Report into plain text. xml2text.xsl - transform Bison XML Report into plain text.
Copyright (C) 2007-2015, 2018-2019 Free Software Foundation, Inc. Copyright (C) 2007-2015, 2018-2020 Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler. This file is part of Bison, the GNU Compiler Compiler.
+1 -1
View File
@@ -3,7 +3,7 @@
<!-- <!--
xml2html.xsl - transform Bison XML Report into XHTML. xml2html.xsl - transform Bison XML Report into XHTML.
Copyright (C) 2007-2015, 2018-2019 Free Software Foundation, Inc. Copyright (C) 2007-2015, 2018-2020 Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler. This file is part of Bison, the GNU Compiler Compiler.
+1
View File
@@ -16,6 +16,7 @@
/bison.help /bison.help
/bison.html /bison.html
/bison.info /bison.info
/bison.info.bak
/bison.log /bison.log
/bison.pdf /bison.pdf
/bison.ps /bison.ps
+368 -186
View File
File diff suppressed because it is too large Load Diff
+445 -380
View File
File diff suppressed because it is too large Load Diff
+18 -1
View File
@@ -1,4 +1,4 @@
## Copyright (C) 2001-2003, 2005-2015, 2018-2019 Free Software ## Copyright (C) 2001-2003, 2005-2015, 2018-2020 Free Software
## Foundation, Inc. ## Foundation, Inc.
## This program is free software: you can redistribute it and/or modify ## This program is free software: you can redistribute it and/or modify
@@ -54,6 +54,23 @@ $(CROSS_OPTIONS_TEXI): doc/bison.help $(CROSS_OPTIONS_PL)
$(AM_V_at)mv $@.tmp $@ $(AM_V_at)mv $@.tmp $@
MAINTAINERCLEANFILES = $(CROSS_OPTIONS_TEXI) MAINTAINERCLEANFILES = $(CROSS_OPTIONS_TEXI)
# Fix Info's @code in @deftype
# https://lists.gnu.org/archive/html/help-texinfo/2019-11/msg00004.html
all: $(srcdir)/$(doc_bison).info.bak
$(srcdir)/$(doc_bison).info.bak: $(srcdir)/$(doc_bison).info
$(AM_V_GEN) $(PERL) -pi.bak -0777 \
-e 's{(^ --.*\n(?: {10}.*\n)*)}' \
-e '{' \
-e ' $$def = $$1;' \
-e ' $$def =~ s/|//g;' \
-e ' $$def;' \
-e '}gem;' $(srcdir)/$(doc_bison).info
@ touch $@
EXTRA_DIST += $(srcdir)/$(doc_bison).info.bak
MAINTAINERCLEANFILES += $(srcdir)/$(doc_bison).info.bak
## ---------- ## ## ---------- ##
## Ref card. ## ## Ref card. ##
## ---------- ## ## ---------- ##
+1 -1
View File
@@ -19,7 +19,7 @@
\def\finalout{\overfullrule=0pt} \def\finalout{\overfullrule=0pt}
%\finalout %\finalout
% Copyright (c) 1998, 2001, 2009-2015, 2018-2019 Free Software % Copyright (c) 1998, 2001, 2009--2015, 2018--2020 Free Software
% Foundation, Inc. % Foundation, Inc.
% %
% This file is part of Bison. % This file is part of Bison.
+1 -1
View File
@@ -16,7 +16,7 @@ straightforward use of _build/src/bison would.)
-- --
Copyright (C) 2006, 2009-2015, 2018-2019 Free Software Foundation, Inc. Copyright (C) 2006, 2009-2015, 2018-2020 Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler. This file is part of Bison, the GNU Compiler Compiler.
+1 -1
View File
@@ -1,6 +1,6 @@
#! /usr/bin/perl -w #! /usr/bin/perl -w
# Copyright (C) 2006, 2008-2015, 2018-2019 Free Software Foundation, # Copyright (C) 2006, 2008-2015, 2018-2020 Free Software Foundation,
# Inc. # Inc.
# #
# This file is part of Bison, the GNU Compiler Compiler. # This file is part of Bison, the GNU Compiler Compiler.
+1 -1
View File
@@ -1,4 +1,4 @@
## Copyright (C) 2006, 2008-2015, 2018-2019 Free Software Foundation, ## Copyright (C) 2006, 2008-2015, 2018-2020 Free Software Foundation,
## Inc. ## Inc.
## This program is free software: you can redistribute it and/or modify ## This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -17,7 +17,7 @@ fill-column: 76
ispell-dictionary: "american" ispell-dictionary: "american"
End: End:
Copyright (C) 2018-2019 Free Software Foundation, Inc. Copyright (C) 2018-2020 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or under the terms of the GNU Free Documentation License, Version 1.3 or
+1 -1
View File
@@ -46,7 +46,7 @@ fill-column: 76
ispell-dictionary: "american" ispell-dictionary: "american"
End: End:
Copyright (C) 2018-2019 Free Software Foundation, Inc. Copyright (C) 2018-2020 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or under the terms of the GNU Free Documentation License, Version 1.3 or
+1 -1
View File
@@ -36,7 +36,7 @@ fill-column: 76
ispell-dictionary: "american" ispell-dictionary: "american"
End: End:
Copyright (C) 2018-2019 Free Software Foundation, Inc. Copyright (C) 2018-2020 Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler. This file is part of Bison, the GNU Compiler Compiler.
+1 -1
View File
@@ -1,6 +1,6 @@
#! /bin/sh #! /bin/sh
# Copyright (C) 2005-2015, 2018-2019 Free Software Foundation, Inc. # Copyright (C) 2005-2015, 2018-2020 Free Software Foundation, Inc.
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
+1 -1
View File
@@ -1,4 +1,4 @@
## Copyright (C) 2005-2006, 2008-2015, 2018-2019 Free Software ## Copyright (C) 2005-2006, 2008-2015, 2018-2020 Free Software
## Foundation, Inc. ## Foundation, Inc.
## ##
## This program is free software: you can redistribute it and/or modify ## This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -1,4 +1,4 @@
## Copyright (C) 2018-2019 Free Software Foundation, Inc. ## Copyright (C) 2018-2020 Free Software Foundation, Inc.
## ##
## This program is free software: you can redistribute it and/or modify ## This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by ## it under the terms of the GNU General Public License as published by
+1 -1
View File
@@ -1,6 +1,6 @@
#! /bin/sh #! /bin/sh
# Copyright (C) 2018-2019 Free Software Foundation, Inc. # Copyright (C) 2018-2020 Free Software Foundation, Inc.
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
+1 -1
View File
@@ -1,5 +1,5 @@
/* /*
Copyright (C) 2008-2015, 2018-2019 Free Software Foundation, Inc. Copyright (C) 2008-2015, 2018-2020 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
+1 -1
View File
@@ -1,6 +1,6 @@
#! /bin/sh #! /bin/sh
# Copyright (C) 2018-2019 Free Software Foundation, Inc. # Copyright (C) 2018-2020 Free Software Foundation, Inc.
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
+1 -1
View File
@@ -1,5 +1,5 @@
/* /*
Copyright (C) 2008-2015, 2018-2019 Free Software Foundation, Inc. Copyright (C) 2008-2015, 2018-2020 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
+1 -1
View File
@@ -45,7 +45,7 @@ fill-column: 76
ispell-dictionary: "american" ispell-dictionary: "american"
End: End:
Copyright (C) 2018-2019 Free Software Foundation, Inc. Copyright (C) 2018-2020 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or under the terms of the GNU Free Documentation License, Version 1.3 or
+1 -1
View File
@@ -9,7 +9,7 @@ fill-column: 76
ispell-dictionary: "american" ispell-dictionary: "american"
End: End:
Copyright (C) 2019 Free Software Foundation, Inc. Copyright (C) 2019-2020 Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler. This file is part of Bison, the GNU Compiler Compiler.
+1 -1
View File
@@ -1,6 +1,6 @@
#! /bin/sh #! /bin/sh
# Copyright (C) 2019 Free Software Foundation, Inc. # Copyright (C) 2019-2020 Free Software Foundation, Inc.
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
+1 -1
View File
@@ -1,4 +1,4 @@
## Copyright (C) 2019 Free Software Foundation, Inc. ## Copyright (C) 2019-2020 Free Software Foundation, Inc.
## ##
## This program is free software: you can redistribute it and/or modify ## This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by ## it under the terms of the GNU General Public License as published by
+1 -1
View File
@@ -9,7 +9,7 @@ fill-column: 76
ispell-dictionary: "american" ispell-dictionary: "american"
End: End:
Copyright (C) 2018-2019 Free Software Foundation, Inc. Copyright (C) 2018-2020 Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler. This file is part of Bison, the GNU Compiler Compiler.
+1 -1
View File
@@ -1,6 +1,6 @@
#! /bin/sh #! /bin/sh
# Copyright (C) 2018-2019 Free Software Foundation, Inc. # Copyright (C) 2018-2020 Free Software Foundation, Inc.
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
+1 -1
View File
@@ -1,4 +1,4 @@
## Copyright (C) 2018-2019 Free Software Foundation, Inc. ## Copyright (C) 2018-2020 Free Software Foundation, Inc.
## ##
## This program is free software: you can redistribute it and/or modify ## This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by ## it under the terms of the GNU General Public License as published by
+1 -1
View File
@@ -1,4 +1,4 @@
## Copyright (C) 2018-2019 Free Software Foundation, Inc. ## Copyright (C) 2018-2020 Free Software Foundation, Inc.
## ##
## This program is free software: you can redistribute it and/or modify ## This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by ## it under the terms of the GNU General Public License as published by
+1 -1
View File
@@ -1,4 +1,4 @@
## Copyright (C) 2005-2006, 2008-2015, 2018-2019 Free Software ## Copyright (C) 2005-2006, 2008-2015, 2018-2020 Free Software
## Foundation, Inc. ## Foundation, Inc.
## ##
## This program is free software: you can redistribute it and/or modify ## This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -1,6 +1,6 @@
#! /bin/sh #! /bin/sh
# Copyright (C) 2005-2015, 2018-2019 Free Software Foundation, Inc. # Copyright (C) 2005-2015, 2018-2020 Free Software Foundation, Inc.
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
+1 -1
View File
@@ -26,7 +26,7 @@ fill-column: 76
ispell-dictionary: "american" ispell-dictionary: "american"
End: End:
Copyright (C) 2018-2019 Free Software Foundation, Inc. Copyright (C) 2018-2020 Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler. This file is part of Bison, the GNU Compiler Compiler.
+1 -1
View File
@@ -1,4 +1,4 @@
## Copyright (C) 2019 Free Software Foundation, Inc. ## Copyright (C) 2019-2020 Free Software Foundation, Inc.
## ##
## This program is free software: you can redistribute it and/or modify ## This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by ## it under the terms of the GNU General Public License as published by
+3 -1
View File
@@ -1,6 +1,6 @@
#! /bin/sh #! /bin/sh
# Copyright (C) 2018-2019 Free Software Foundation, Inc. # Copyright (C) 2018-2020 Free Software Foundation, Inc.
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@@ -15,6 +15,8 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
seq 0 >/dev/null || exit 77
cat >input <<EOF cat >input <<EOF
1+2*3 1+2*3
EOF EOF
+1 -1
View File
@@ -1,4 +1,4 @@
## Copyright (C) 2005-2006, 2008-2015, 2018-2019 Free Software ## Copyright (C) 2005-2006, 2008-2015, 2018-2020 Free Software
## Foundation, Inc. ## Foundation, Inc.
## ##
## This program is free software: you can redistribute it and/or modify ## This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -1,6 +1,6 @@
#! /bin/sh #! /bin/sh
# Copyright (C) 2005-2015, 2018-2019 Free Software Foundation, Inc. # Copyright (C) 2005-2015, 2018-2020 Free Software Foundation, Inc.
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
+1 -1
View File
@@ -15,7 +15,7 @@ fill-column: 76
ispell-dictionary: "american" ispell-dictionary: "american"
End: End:
Copyright (C) 2018-2019 Free Software Foundation, Inc. Copyright (C) 2018-2020 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or under the terms of the GNU Free Documentation License, Version 1.3 or
+1 -1
View File
@@ -1,6 +1,6 @@
#! /bin/sh #! /bin/sh
# Copyright (C) 2018-2019 Free Software Foundation, Inc. # Copyright (C) 2018-2020 Free Software Foundation, Inc.
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
+1 -1
View File
@@ -1,4 +1,4 @@
## Copyright (C) 2018-2019 Free Software Foundation, Inc. ## Copyright (C) 2018-2020 Free Software Foundation, Inc.
## ##
## This program is free software: you can redistribute it and/or modify ## This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by ## it under the terms of the GNU General Public License as published by
+1 -1
View File
@@ -3,7 +3,7 @@
# This file is part of GNU Bison # This file is part of GNU Bison
# Copyright (C) 1992, 2000-2001, 2005-2006, 2009-2015, 2018-2019 Free # Copyright (C) 1992, 2000-2001, 2005-2006, 2009-2015, 2018-2020 Free
# Software Foundation, Inc. # Software Foundation, Inc.
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -1,6 +1,6 @@
#! /bin/sh #! /bin/sh
# Copyright (C) 2018-2019 Free Software Foundation, Inc. # Copyright (C) 2018-2020 Free Software Foundation, Inc.
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
+1 -1
View File
@@ -16,7 +16,7 @@ fill-column: 76
ispell-dictionary: "american" ispell-dictionary: "american"
End: End:
Copyright (C) 2018-2019 Free Software Foundation, Inc. Copyright (C) 2018-2020 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or under the terms of the GNU Free Documentation License, Version 1.3 or
+1 -1
View File
@@ -1,4 +1,4 @@
## Copyright (C) 2018-2019 Free Software Foundation, Inc. ## Copyright (C) 2018-2020 Free Software Foundation, Inc.
## ##
## This program is free software: you can redistribute it and/or modify ## This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by ## it under the terms of the GNU General Public License as published by
+1 -1
View File
@@ -1,4 +1,4 @@
## Copyright (C) 2005, 2008-2015, 2018-2019 Free Software Foundation, ## Copyright (C) 2005, 2008-2015, 2018-2020 Free Software Foundation,
## Inc. ## Inc.
## ##
## This program is free software: you can redistribute it and/or modify ## This program is free software: you can redistribute it and/or modify
+15 -15
View File
@@ -1,6 +1,6 @@
#! /bin/sh #! /bin/sh
# Copyright (C) 2005-2015, 2018-2019 Free Software Foundation, Inc. # Copyright (C) 2005-2015, 2018-2020 Free Software Foundation, Inc.
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@@ -31,18 +31,18 @@ exit=true
cwd=$(pwd) cwd=$(pwd)
# The exercised program. # The exercised program.
for p in "$cwd/examples/$medir/$me" abs_medir=$cwd/examples/$medir
do if test -x "$abs_medir/$me"; then
if test -x "$p"; then prog ()
prog=$p {
break "$abs_medir/$me" "$@"
elif test -f "$p.class"; then }
pwd elif test -f "$abs_medir/$me.class"; then
prog="$SHELL $cwd/javaexec.sh -cp $(dirname $p) $(basename $p)" prog ()
break {
fi "$SHELL" "$cwd/javaexec.sh" -cp "$abs_medir" "$me" "$@"
done }
if test x"$prog" = x; then else
echo "$me: ERROR: cannot find program to exercise in:" echo "$me: ERROR: cannot find program to exercise in:"
echo "$me: ERROR: $cwd/examples/$medir/$me" echo "$me: ERROR: $cwd/examples/$medir/$me"
exit 1 exit 1
@@ -55,7 +55,7 @@ cleanup ()
{ {
status=$? status=$?
if test -z "$DEBUG"; then if test -z "$DEBUG"; then
cd $cwd cd "$cwd"
rm -rf $$.dir rm -rf $$.dir
fi fi
exit $status exit $status
@@ -82,7 +82,7 @@ run ()
shift shift
# Effective exit status. # Effective exit status.
sta_eff=0 sta_eff=0
$prog "$@" - <input >out_eff 2>err_eff || sta_eff=$? prog "$@" - <input >out_eff 2>err_eff || sta_eff=$?
# Combine effective output and error streams. # Combine effective output and error streams.
out_eff=$(cat out_eff && $noerr || sed -e 's/^/err: /g' err_eff) out_eff=$(cat out_eff && $noerr || sed -e 's/^/err: /g' err_eff)
if test $sta_eff -eq $sta_exp; then if test $sta_eff -eq $sta_exp; then
+1 -1
Submodule gnulib updated: 56ca994d47...4fcedca004
+15
View File
@@ -16,6 +16,7 @@
/argmatch.c /argmatch.c
/argmatch.h /argmatch.h
/asnprintf.c /asnprintf.c
/asprintf.c
/assure.h /assure.h
/basename-lgpl.c /basename-lgpl.c
/basename.c /basename.c
@@ -137,13 +138,19 @@
/isnanl-nolibm.h /isnanl-nolibm.h
/isnanl.c /isnanl.c
/iswblank.c /iswblank.c
/iswdigit.c
/iswxdigit.c
/itold.c /itold.c
/lc-charset-dispatch.c
/lc-charset-dispatch.h
/ldexpl.c /ldexpl.c
/libc-config.h /libc-config.h
/limits.h /limits.h
/limits.in.h /limits.in.h
/localcharset.c /localcharset.c
/localcharset.h /localcharset.h
/locale.h
/locale.in.h
/localtime-buffer.c /localtime-buffer.c
/localtime-buffer.h /localtime-buffer.h
/lstat.c /lstat.c
@@ -157,10 +164,14 @@
/mbchar.h /mbchar.h
/mbfile.c /mbfile.c
/mbfile.h /mbfile.h
/mbrtowc-impl-utf8.h
/mbrtowc-impl.h
/mbrtowc.c /mbrtowc.c
/mbsinit.c /mbsinit.c
/mbswidth.c /mbswidth.c
/mbswidth.h /mbswidth.h
/mbtowc-lock.c
/mbtowc-lock.h
/memchr.c /memchr.c
/memchr.valgrind /memchr.valgrind
/minmax.h /minmax.h
@@ -208,6 +219,9 @@
/sched.h /sched.h
/sched.in.h /sched.in.h
/setenv.c /setenv.c
/setlocale-lock.c
/setlocale_null.c
/setlocale_null.h
/sig-handler.c /sig-handler.c
/sig-handler.h /sig-handler.h
/sigaction.c /sigaction.c
@@ -303,6 +317,7 @@
/unsetenv.c /unsetenv.c
/vasnprintf.c /vasnprintf.c
/vasnprintf.h /vasnprintf.h
/vasprintf.c
/verify.h /verify.h
/vfprintf.c /vfprintf.c
/vsnprintf.c /vsnprintf.c
+1 -1
View File
@@ -1,6 +1,6 @@
/* get-errno.c - get and set errno. /* get-errno.c - get and set errno.
Copyright (C) 2002, 2006, 2009-2015, 2018-2019 Free Software Copyright (C) 2002, 2006, 2009-2015, 2018-2020 Free Software
Foundation, Inc. Foundation, Inc.
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -1,6 +1,6 @@
/* get-errno.h - get and set errno. /* get-errno.h - get and set errno.
Copyright (C) 2002, 2009-2015, 2018-2019 Free Software Foundation, Copyright (C) 2002, 2009-2015, 2018-2020 Free Software Foundation,
Inc. Inc.
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -1,4 +1,4 @@
## Copyright (C) 2001-2015, 2018-2019 Free Software Foundation, Inc. ## Copyright (C) 2001-2015, 2018-2020 Free Software Foundation, Inc.
## ##
## This program is free software: you can redistribute it and/or modify ## This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by ## it under the terms of the GNU General Public License as published by
+1 -1
View File
@@ -1,6 +1,6 @@
/* Yacc library main function. /* Yacc library main function.
Copyright (C) 2002, 2009-2015, 2018-2019 Free Software Foundation, Copyright (C) 2002, 2009-2015, 2018-2020 Free Software Foundation,
Inc. Inc.
This file is part of Bison, the GNU Compiler Compiler. This file is part of Bison, the GNU Compiler Compiler.
+1 -1
View File
@@ -1,5 +1,5 @@
/* Concatenate path components. /* Concatenate path components.
Copyright (C) 2018-2019 Free Software Foundation, Inc. Copyright (C) 2018-2020 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify it This program is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the under the terms of the GNU General Public License as published by the
+1 -1
View File
@@ -1,5 +1,5 @@
/* Concatenate path components. /* Concatenate path components.
Copyright (C) 2018-2019 Free Software Foundation, Inc. Copyright (C) 2018-2020 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify it This program is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the under the terms of the GNU General Public License as published by the
+1 -1
View File
@@ -1,7 +1,7 @@
/* This file contains the definitions for timing variables used to -*- C -*- /* This file contains the definitions for timing variables used to -*- C -*-
measure run-time performance of the compiler. measure run-time performance of the compiler.
Copyright (C) 2002, 2007, 2009-2015, 2018-2019 Free Software Copyright (C) 2002, 2007, 2009-2015, 2018-2020 Free Software
Foundation, Inc. Foundation, Inc.
Contributed by Akim Demaille <akim@freefriends.org>. Contributed by Akim Demaille <akim@freefriends.org>.

Some files were not shown because too many files have changed in this diff Show More