Redefining the literal string associated to the YYerror symbol

Daniele Nicolodi <[email protected]>
Newsgroups gmane.comp.parsers.bison.general
Message-ID <[email protected]>
Hello,

in Bison 3.6 is it possible to redefine the literal string associated to
the YYerror symbol (and to the YYEOF, YYUNDEF ones, although I don't
have immediate need for this)?

Doing it in the naive way:

%token YYerror "ERROR"

results in a warning:

warning: symbol YYerror given more than one literal string [-Wother]
  180 | %token YYerror "ERROR"
      |                ^~~~~~~

and in the literal string not being updated.

Thank you.

Cheers,
Dan
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.