Files
bison/tests
Akim Demaille 01898726e2 generate the default semantic action
Currently, in C, the default semantic action is implemented by being
always run before running the actual user semantic action.  As a
consequence, when the user action is run, $$ is already set as $1.

In C++ with variants, we don't do that, since we cannot manipulate the
semantic value without knowing its exact type.  When variants are
enabled, the only guarantee is that $$ is default contructed and ready
to the used.

Some users still would like the default action to be run with
variants.  Frank Heckenbach's parser in
C++17 (http://lists.gnu.org/archive/html/bug-bison/2018-04/msg00011.html)
provides this feature, but relying on std::variant's dynamic typing,
which we forbid in lalr1.cc.

The simplest seems to be actually generating the default semantic
action (in all languages/skeletons).  This makes the pre-action (that
sets $$ to $1) useless.  But...  maybe some users depend on this, in
spite of the comments that clearly warn againt this.  So let's not
turn this off just yet.

* src/reader.c (grammar_rule_check_and_complete): Rename as...
(grammar_rule_check_and_complete): this.
Install the default semantic action when applicable.
* examples/variant-11.yy, examples/variant.yy, tests/calc.at:
Exercise the default semantic action, even with variants.
2018-10-14 18:53:21 +02:00
..
2008-11-16 19:46:16 +01:00
2018-10-14 18:53:21 +02:00
2018-10-05 07:01:04 +02:00
2018-10-05 07:01:05 +02:00
2018-10-05 07:01:05 +02:00
2018-05-12 18:18:41 +02:00
2018-05-12 18:18:41 +02:00
2018-06-17 18:43:59 +02:00
2018-05-12 18:18:41 +02:00
2018-08-11 18:09:29 +02:00
2018-05-12 18:18:41 +02:00
2018-05-12 18:18:41 +02:00
2018-09-23 11:50:58 +02:00