> On Nov 12, 2023, at 18:18, James K. Lowden <jklow...@schemamania.org> wrote:
> 
> On Mon, 13 Nov 2023 10:52:02 +0100
> Hans Åberg <haber...@telia.com> wrote:
> 
>>> Let's start, shall we, with "is it a bug"?  
>> 
>> The parser knows how to translate token numbers into names for error
>> messages, but there is no API for that as far as I know.
> 
> I disagree.  Bison might know how to do that, but "the parser" does
> not.

Read the generated parser code: Error message strings are generated by 
translating token numbers into symbol names, first into the symbol-number 
mentioned.

>  Bison is a parser-generator.  I'm writing "the parser" using
> Bison. I implemented yyerror(). I'm producing the error message using
> the only vehicle I've found, yytname.  It's insufficient to the
> purpose.

It generates an error message string, which one is expected to use. Not the 
internal tables directly.



Reply via email to