15 #include <boost/spirit/include/classic_core.hpp>
16 #include <boost/spirit/include/classic_push_back_actor.hpp>
20 using namespace boost::spirit;
22 using namespace boost::spirit::classic;
29 void operator()(
const char)
const { conjInfo_.back().mode_ = mode_; }
36 typedef scanner_policies<skip_parser_iteration_policy<nothing_parser, iteration_policy>, match_policy, action_policy>
41 bool decayParser(
const string& iValue, vector<ConjInfo>& oStrings) {
42 using namespace boost::spirit;
44 Rule_1 label = ((+alnum_p) >> *ch_p(
':') >> *ch_p(
'_') >> *alnum_p)[push_back_a(oStrings)];
45 Rule_1 conj = (ch_p(
'@') >> !((ch_p(
'b') >> ch_p(
'a') >> ch_p(
'r')[
ModeSetter(oStrings, ConjInfo::kBar)]) |
47 ch_p(
'-')[
ModeSetter(oStrings, ConjInfo::kMinus)]));
49 return parse(iValue.c_str(), ((
label >> !conj) % blank_p), nothing_p).
full;
rule< ScannerUsed_1 > Rule_1
ModeSetter(vector< ConjInfo > &iVect, ConjInfo::Mode iMode)
vector< ConjInfo > & conjInfo_
void operator()(const char) const
bool decayParser(const std::string &iValue, std::vector< ConjInfo > &oStrings)
scanner< const char *, ScannerPolicy > ScannerUsed_1
scanner_policies< skip_parser_iteration_policy< nothing_parser, iteration_policy >, match_policy, action_policy > ScannerPolicy