Re: Public / protected access to parser's symbol_name() in C++
Martin Blais <[email protected]>
| Newsgroups | gmane.comp.parsers.bison.general |
|---|---|
| Message-ID | <CAK21+hPi8yynZi1TrWtEuze5nk+RCfHGpQBRt25YuxEprCTjMQ@mail.gmail.com> |
On Sat, May 9, 2020 at 12:44 PM Akim Demaille <[email protected]> wrote: > Hi Martin, > > > Le 9 mai 2020 à 17:00, Martin Blais <[email protected]> a écrit : > > > > Hi, > > I'm writing some unit tests for a scanner which I want to assert tokens > by > > name for, for a C++ bison parser. > > I just saw (timely!) that 3.6 always produces a symbol_name(), but > > unfortunately it's private... > > > > I need (public) access to yytname or symbol_name(). > > Protected access would be fine too (I could probably inherit and expose > it). > > Is there any reason it's private? > > > > In trying to kludge my way out of this, I also couldn't find a way to > > insert code inside the C++ parser. > > I'll soon release a version where this is public. It should have been > public. > I had a hunch it had been intended that way. Thank you Akim!