bug-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mismatch between HTML report and y.output


From: Akim Demaille
Subject: Re: Mismatch between HTML report and y.output
Date: Sat, 20 Nov 2021 09:04:18 +0100

Domingo,

> Le 18 nov. 2021 à 13:50, Domingo Alvarez Duarte <mingodad@gmail.com> a écrit :
> 
> Hello !
> 
> Trying to figure out the differences in detected conflicts between 
> byacc/bison/lemon here https://github.com/mingodad/lalr-parser-test, I 
> noticed that the generated states on "HTML report" doesn't seem to match with 
> the ones on "y.output" for example for 
> https://github.com/mingodad/cfront-3/blob/master/src/gram.y with bison 3.8.2 
> and it seems to obfuscate rather than clarify the problem.
> 
> y.output:
> 
> ====
> 
> State 130
> 
>   174 decl: decl arg_lp • elist RP
>   373 arg_list: arg_lp • arg_type_list ellipsis_opt RP fct_attributes

This is the so-called "kernel" (or "core") of the item set of the state.  Bison 
needs to "complete" this core with the "consequences".  For instance because of 
rule 174 you can be at the beginning of all the RHS of rules whose LHS is 
elist.  And you do do the closure of this process.

You are comparing the text report with the complete html report (which, btw, 
also includes the lookaheads).  See --report to generate more complete text 
reports.

It is true that it's a pity not to highlight the core.  It would be clearer.

Cheers.

> 
>     DELETE       shift, and go to state 156
>     ENUM         shift, and go to state 3
>     NEW          shift, and go to state 157
>     OPERATOR     shift, and go to state 158
>     SIZEOF       shift, and go to state 159
>     THIS         shift, and go to state 160
>     LP           shift, and go to state 161
>     NOT          shift, and go to state 162
> 
> ====
> 
> But in the HTML report:
> 
> ====
> 
> State 130
>    48 tname → • qualified_tname
>    49       | • qualified_tname lt temp_inst_parms gt
>    50       | • NAME lt temp_inst_parms gt
>    51 tp → • TYPE
>    52    | • LINKAGE
>    53    | • tname
>    54    | • tn_list DECL_MARKER
>    55    | • class_dcl
>    56    | • enum_dcl
>    57    | • DECL_MARKER
>    58 type → • tp
>    59      | • type TYPE
>    60      | • type tname
>    61      | • type class_dcl
>    62      | • type enum_dcl
>    63      | • type DECL_MARKER
>    78 enum_dcl → • ENUM LC moe_list RC
>    79          | • ENUM enumtag LC moe_list RC
>    80          | • ENUM enumtag
>    96 class_dcl → • class_head cl_mem_list RC inline_mem_defs
>    97           | • AGGR tag
>    98           | • AGGR qualified_tname lt temp_inst_parms gt
>    99           | • AGGR DECL_MARKER
>   111 class_head → • AGGR LC
>   112            | • AGGR tag base_list LC
>   113            | • AGGR qualified_tname lt temp_inst_parms gt base_list LC
>   161 scope_qualifiers → • tn_list
>   162 tn_list → • tscope
>   163         | • tn_list tscope
>   164 qualified_tname → • tn_list TNAME
>   165                 | • TNAME
>   174 decl → decl arg_lp • elist RP
>   244 elist → • ex_list
>   245 ex_list → • initializer
>   246         | • ex_list CM initializer
>   247 initializer → • e
>   248             | • LC elist RC
> 
> ...
> 
> ====
> 
> Cheers !
> 
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]