help-bison
[Top][All Lists]
Advanced

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

Public / protected access to parser's symbol_name() in C++


From: Martin Blais
Subject: Public / protected access to parser's symbol_name() in C++
Date: Sat, 9 May 2020 11:00:38 -0400

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.

Any suggestions?


reply via email to

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