struct usmtf : public grammar<usmtf> { template <typename ScannerT> struct definition { definition(usmtf const& self) { message = mainText; exerciseSet = !eol_p >> str_p("EXER")[do_print("EXER")]
ch_p('/') >> *(field >> ch_p('/')) >> ch_p('/'); messageIdentifierSet = str_p("MSGID")[do_print("MSGID")] ch_p('/') >> *(field >> ch_p('/')) >> ch_p('/');
field = lexeme_d [ +(upper_p - ch_p('/') - eol_p) ]; mainText = exerciseSet >> eol_p >> messageIdentifierSet
end_p; };
rule<ScannerT> message, mainText, exerciseSet, messageIdentifierSet, field; rule<ScannerT> const& start() const { return message; } }; }; Using this grammar above, it will parse EXER/EE/FF//MSGID// using mainText = exerciseSet >> messageIdentifierSet >> end_p; However, I want it to parse EXER/EE/FF// MSGID// and mainText = exerciseSet >> eol_p >> messageIdentifierSet >> end_p; does not work. Why? How do I parse what I want?