I have the following grammar and when I compile I have many errors.
#include <boost/spirit/include/qi.hpp>
namespace qi = boost::spirit::qi;
template <typename It>
struct parser : qi::grammar<It, std::string()>
{
parser() : parser::base_type(E)
{
using namespace qi;
E = F >> E1;
E1 = *( '+' >> F | '-' >> F );
F = ('(' >> E >> ')') | P | alnum;
P = '@' >> +(~ char_('@') - V) >> V;
V = string(".pv@") | string(".cv@");
}
private:
qi::rule<It, std::string()> E, E1, F, P, V;
};
Could you tell me What I have wrong? I know that the errors are with the * y alnum, but I don't know why?