[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: document new features of parse.error
From: |
Adrian Vogelsgesang |
Subject: |
Re: document new features of parse.error |
Date: |
Wed, 29 Jan 2020 10:01:00 +0000 |
User-agent: |
Microsoft-MacOutlook/10.10.12.200112 |
Hi Akim
> When a true alternative is offered, then we might deprecate verbose.
makes sense. For now, we could at least put some note in the documentation that
recommends using
“detailed” instead of “verbose” for new projects. If I would be a new-comer
looking into the bison
docs for the first time, I would probably be confused if I should choose
detailed or verbose.
> I have proposed […] to generate a CSV file with facts about the tokens […],
> but received no answer
As I have no experience with auto-generated scanners, I can’t provide you any
good feedback on this
idea, though. In general the CSV file sounds reasonable to me, too (although
escaping in CSV can be a
huge time sink. There are a lot of quirks re escaping in various
implementations such as Python
libraries, Excel, OpenOffice, … Not sure how bad it is on the “emitting CSV
side”, I only know the parsing
side of CSV)
> Do you plan to port these features to lalr1.cc?<http://lalr1.cc?>
Yes, I do. However, I currently don’t have time for it, and depending on your
timeline and how critical
the C++ implementation is for you, it might be faster if you do it yourself.
I would probably need a few weeks before I can look into it
Cheers,
Adrian
From: Akim Demaille <address@hidden>
Date: Tuesday, 28 January 2020 at 07:20
To: Adrian Vogelsgesang <address@hidden>
Cc: Bison Patches <address@hidden>
Subject: Re: document new features of parse.error
Hi Adrian,
> Le 27 janv. 2020 à 10:19, Adrian Vogelsgesang <address@hidden> a écrit :
>
> Hi Akim,
>
> do you think it makes sense to deprecate `verbose` already with the
> introduction of `detailed`?
> As far as I see it, there is no good reason to use `verbose` over `detailed`,
> or am I missing something?
It's too soon to declare verbose obsolete, and anyway we don't yet provide an
alternative for people who depend on yytname for their scanner
(https://www.gnu.org/software/bison/manual/html_node/Tokens-from-Literals.html#Tokens-from-Literals<https://www.gnu.org/software/bison/manual/html_node/Tokens-from-Literals.html#Tokens-from-Literals>).
On purpose I made this feature impossible to use with custom/detailed because
string aliases are not fit to define the tokens. So they clearly cannot move to
'detailed' just yet (without sacrificing their scanner implementation).
When a true alternative is offered, then we might deprecate verbose.
That being said, I really think we should stop depending on the locale when
emitting yytname. It should only escape " and \ IMHO, and not touch the rest.
Let's address this in 3.6 too.
Also, I have proposed, to help people who use yytname for their scanner, to
generate a CSV file with facts about the tokens (numbers, strings, etc.). I
think that this would be useful, especially for those, like Rici, that run
tools to generate part of their scanner/parser, but received no answer.
> Also:
>> +Control the generation syntax error messages. @xref{Error Reporting}.
Thanks!
Do you plan to port these features to lalr1.cc?<http://lalr1.cc?>