I'm learning Bison in generating c++ parser.
Since %token-table
is obsolescent, is there any alternatives to get the name from token integer value in c++ parser?
I'm learning Bison in generating c++ parser.
Since %token-table
is obsolescent, is there any alternatives to get the name from token integer value in c++ parser?
You can use yysymbol_name()
, described in the manual section on syntax error reporting.
The C++ API apparently has a similar method on the parser context object, called symbol_name
. (See this future question for more information about C++.)