in fooparser.yy :
Код: Выделить всё
// %define api.value.type {std::string}
%define api.value.type variant
...
// %token HELLO
// %token WORLD
%token HELLO
%token WORLD
Код: Выделить всё
// int yylex(std::string *const yylval);
int yylex(yy::parser::value_type *const yylval);
Код: Выделить всё
#pragma once
#include
#if ! defined(yyFlexLexerOnce)
#include
#endif
class FooLexer : public yyFlexLexer
{
public:
int yylex(yy::parser::value_type *const yylval);
};
fooParser.tab.hh:666:21: error: expected ‘)’ before ‘&’ token
666 | parser (FooLexer &lexer_yyarg);
| ~ ^~
| )
fooParser.tab.hh
1099 | FooLexer &lexer;
| ^~~~~~~~
< /code>
Итак, как я могу это решить? Заранее большое спасибо
Подробнее здесь: https://stackoverflow.com/questions/796 ... h-variants
Мобильная версия