Re: yytname woes

2023-11-13 Thread Hans Åberg
> On Nov 12, 2023, at 02:23, James K. Lowden wrote: > > My yytname array is obviously messed up. Whether or not it's needed by > the parser, whether or not ASCII characters can be used as tokens, is > immaterial. > > Let's start, shall we, with "is it a bug"? The parser knows how to tran

Re: yytname woes

2023-11-13 Thread Christian Schoenebeck
On Friday, November 10, 2023 1:57:59 AM CET James K. Lowden wrote: > I can't seem to look up token names in yytname correctly using enum > yytokentype. > > At the end of enum yytokentype, I have > > END_UNSTRING = 893,/* END_UNSTRING */ > END_WRITE = 894, /* END

Re: yytname woes

2023-11-13 Thread James K. Lowden
On Mon, 13 Nov 2023 10:52:02 +0100 Hans Åberg 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

Re: yytname woes

2023-11-13 Thread James K. Lowden
On Mon, 13 Nov 2023 12:33:57 +0100 Christian Schoenebeck wrote: > > When I look up #899, NOT, I get "NOT". But when I look up #900, > > NE, I get "'<'" because that's the next element in yytname (900 - > > 255). > [...] > > Are you aware that yytname[] is indexed by "symbol-number", not by > "t

Re: yytname woes

2023-11-13 Thread lostbits
Christian Schoenebeck; To intrude on this discussion just a bit, let me just say that I have twice volunteered to rewrite portions of the Bison manual, twice refused - never by a response - and many times asked questions. I have even sent partial rewrites, with appropriate signatures, and (lis

Re: yytname woes

2023-11-13 Thread Hans Åberg
> On Nov 12, 2023, at 18:18, James K. Lowden wrote: > > On Mon, 13 Nov 2023 10:52:02 +0100 > Hans Åberg 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 k

Re: yytname woes

2023-11-13 Thread Christian Schoenebeck
On Sunday, November 12, 2023 6:18:30 PM CET James K. Lowden wrote: > On Mon, 13 Nov 2023 12:33:57 +0100 > Christian Schoenebeck wrote: > > > > When I look up #899, NOT, I get "NOT". But when I look up #900, > > > NE, I get "'<'" because that's the next element in yytname (900 - > > > 255). > > [

Re: yytname woes

2023-11-13 Thread James K. Lowden
On Mon, 13 Nov 2023 20:15:44 +0100 Christian Schoenebeck wrote: > > You tell me: what is a "Bison token code"? > > Look, I am not judging how well Bison is documented or what good/bad > terminology Bison authors chose. It's not my business. I appreciate that, Christian, really. FWIW, I think