Files
bison/tests
Akim Demaille 3911aba39a %merge: associate it to its first definition, not the latest
Currently each time we meet %merge we record this location as the
defining location (and symbol).  Instead, record the first definition.

In the generated code we go from

    yy0->A = merge (*yy0, *yy1);

to

    yy0->S = merge (*yy0, *yy1);

where S was indeed the first symbol, and in the diagnostics we go from

    glr-regr18.y:30.18-24: error: result type clash on merge function 'merge': <type2> != <type1>
       30 | sym2: sym3 %merge<merge> { $$ = $1; } ;
          |                  ^~~~~~~
    glr-regr18.y:29.18-24: note: previous declaration
       29 | sym1: sym2 %merge<merge> { $$ = $1; } ;
          |                  ^~~~~~~
    glr-regr18.y:31.13-19: error: result type clash on merge function 'merge': <type3> != <type2>
       31 | sym3: %merge<merge> { $$ = 0; } ;
          |             ^~~~~~~
    glr-regr18.y:30.18-24: note: previous declaration
       30 | sym2: sym3 %merge<merge> { $$ = $1; } ;
          |                  ^~~~~~~

to

    glr-regr18.y:30.18-24: error: result type clash on merge function 'merge': <type2> != <type1>
       30 | sym2: sym3 %merge<merge> { $$ = $1; } ;
          |                  ^~~~~~~
    glr-regr18.y:29.18-24: note: previous declaration
       29 | sym1: sym2 %merge<merge> { $$ = $1; } ;
          |                  ^~~~~~~
    glr-regr18.y:31.13-19: error: result type clash on merge function 'merge': <type3> != <type1>
       31 | sym3: %merge<merge> { $$ = 0; } ;
          |             ^~~~~~~
    glr-regr18.y:29.18-24: note: previous declaration
       29 | sym1: sym2 %merge<merge> { $$ = $1; } ;
          |                  ^~~~~~~

where both duplicates are reported against definition 1, rather than
using definition 1 as a reference when diagnosing about definition 2,
and then 2 as a reference for 3.

* src/reader.c (record_merge_function_type): Keep the first definition.
* tests/glr-regression.at: Adjust.
2020-12-31 08:07:34 +01:00
..
2019-02-21 06:46:07 +01:00
2020-01-10 19:16:23 +01:00
2020-12-05 11:22:20 +01:00
2020-12-26 14:26:23 +01:00
2020-01-10 19:16:23 +01:00
2020-12-26 14:26:23 +01:00
2020-09-19 17:49:03 +02:00
2020-11-13 07:01:19 +01:00
2020-11-30 16:48:03 +01:00
2020-11-03 08:46:54 +01:00
2020-05-02 09:27:16 +02:00
2020-01-10 19:16:23 +01:00
2020-12-06 15:11:33 +01:00
2020-05-21 20:14:59 +02:00
2020-09-19 17:49:03 +02:00
2020-01-10 19:16:23 +01:00
2020-11-30 16:48:03 +01:00
2020-12-26 14:26:23 +01:00
2020-09-27 19:29:29 +02:00
2019-11-03 10:32:22 +01:00

AT_BISON_OPTION_PUSHDEFS/AT_BISON_OPTION_POPDEFS

These two macros must be given the (main) directives so that they define a number of other macros to:

  • what the language is (so what compiler tool chain to use, what definition of yylex/yyerror, etc.)
  • what skeleton is used

Keywords

  • action
  • api.value.type
  • c++
  • cex: counterexamples.
  • d: d language
  • deprec: deprecated features.
  • diagnostics
  • glr
  • graph
  • java
  • lac
  • %merge
  • multistart
  • push
  • report
  • %union
  • variant