For example, I return yy::parser::symbol_type
in flex rule via:
[a-zA-Z][a-zA-Z0-9_]* return yy::parser::make_ID(yytext);
where ID
is a token I defined in bison, it will generate the yy::parser::token
structure.
Now I want to do some unit test just for flex's token.l
, when I invoke the yy::parser::symbol_type yylex()
function, I didn't see any API to get yy::parser::token
from yy::parser::symbol_type
in Bison c++ variant manual.
And by the way, in bison manual, return yy::parser::symbol_type
via yy::parser::make_XXX
APIs in flex rule is a recommanded.
Or is there no such API to do this job ? I need to use the symbol_type.kind()
API to get something like yy::parser::symbol_type_kind::S_T_ID
?