
23 Jun
2003
23 Jun
'03
7:52 p.m.
Hi. I just started playing with spirit and tried the following code to match palindromes of strings consisting of a's and b's. Why won't this work? (It prints 0, not 1) #include "boost/spirit/core.hpp" #include <iostream.h> using namespace boost::spirit; int main(int argc, char* argv[]) { rule <> S; S = ch_p('a') | ch_p('b') | epsilon_p | ('a' >> S >> 'a') | ('b' >> S >> 'b'); char * str = "aabaa"; cout << parse(str, S).full; return 0; }