Re: [PATCH] cex: fix reporting of null nonterminals

Akim Demaille <[email protected]>
Newsgroups gmane.comp.parsers.bison.patches
Message-ID <[email protected]>
Hi Vincent,

Yes, indeed, it was the empty rules that made the reports confusing.
Good hunch, good catch!

> Le 21 juin 2020 à 22:20, Vincent Imbimbo <[email protected]> a écrit :
> 
> I implemented this to print A ::= [ ], but A ::= [ %empty ] might be clearer.

I tend to prefer %empty, indeed.

It is true though that it looks heavier

Example              B . b c
First derivation     S ::=[ B ::=[ A ::=[ B . ] b A ::=[ ] ] C ::=[ A ::=[ ] c A ::=[ ] ] ]
Second derivation    S ::=[ B C ::=[ A ::=[ B ::=[ A ::=[ . ] b A ::=[ ] ] ] c A ::=[ ] ] ]

Example              B . b c
First derivation     S ::=[ B ::=[ A ::=[ B . ] b A ::=[ %empty ] ] C ::=[ A ::=[ %empty ] c A ::=[ %empty ] ] ]
Second derivation    S ::=[ B C ::=[ A ::=[ B ::=[ A ::=[ %empty . ] b A ::=[ %empty ] ] ] c A ::=[ %empty ] ] ]

but this example is artificial.  With "real world" symbol names, it's
probably more natural.

Let's wait for a possible other opinion, but eventually, I think I'll
use %empty instead.


Thanks a lot for this fix, Vincent, installed.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.