Created
June 1, 2015 02:25
-
-
Save redboltz/5c89916d4c9d1992cc93 to your computer and use it in GitHub Desktop.
SpiritX3 example on C++Now2015 Pace41(in PDF)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <boost/config/warning_disable.hpp> | |
#include <boost/spirit/home/x3.hpp> | |
namespace x3 = boost::spirit::x3; | |
int main() { | |
using x3::char_; | |
std::string input( "cosmic pizza" ); | |
auto iter = input.begin(); | |
auto end_iter = input.end(); | |
std::string result1; | |
std::string result2; | |
parse(iter, end_iter, | |
*(~char_(' ')) >> ' ' >> *char_, | |
result1, | |
result2); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment