[Top][All Lists]

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

Re: custom error messages

From: Akim Demaille
Subject: Re: custom error messages
Date: Thu, 9 Jan 2020 06:26:27 +0100

Hi Adrian,

> Le 8 janv. 2020 à 22:30, Adrian Vogelsgesang <address@hidden> a écrit :
> Hi Akim,
> > I don't know what you understood about my proposal,

That does not sound nice.  I really meant that I was unsure whether
what I had in mind is what I managed to express.  Sometimes my sentences
are confusing (as reading the quoted one here shows), which was my
concern here.

> > And I do not want to encourage the use of yytname to write
> > scanners, to me this is a dead end
> I think this is the part of information which I missed.

That's what I meant in the release announcement of 3.5:

> The purpose of string literals has been clarified.  Indeed, they are used
> for two different purposes: freeing from having to implement the keyword
> matching in the scanner, and improving error messages.  Most of the time
> both can be achieved at the same time, but on occasions, it does not work so
> well.  We promote their use for error messages.  We still support the former
> case (at least for historical skeletons), but it is _not_ a recommended
> practice.  The documentation now warns against this use.  A new warning,
> -Wdangling-alias, should help users who want to enforce the use of aliases
> only for error messages.

> I thought you
> were still not sure if yytname would be the right way to go or not.

For a long time, I could not make my mind, that's right.  But it's now
very clear to me: that feature is too limited, it does not free the
user from having to write scanner rules for all the tokens.  So of the
two uses of string literals, that's the one to drop.  Because the problem
needs a completely different answer, which will be a significant part
of the effort for Bison 4.

> I have no overview about the potential solutions re. generating
> scanners based on the grammars – sorry for the noise

There was no noise :)  Just legitimate questions.


reply via email to

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