[spirit-karma] skipping tokens while generation
Hello *,
I am somehow stuck when trying to skip tokens to be generated. My
configuration is boost 1.47 and visual c++ 2010. I also do not understand
how some mechanics are intended to work.
Example 1:
Lets say I have a string: ///
And I want my generator to generate: / from it or if the string is not
'///' leave it as it is. So I wrote:
using namespace std;
string result;
typedef std::back_insert_iterator<string> oiter_t;
oiter_t out(result);
string input = "///";
namespace k=karma;
k::generate(out, &k::string("///") << "/" | k::string, input);
And that works fine.
Example 2:
Now I would like to the slash to be a dynamic part, so I go ahead and
define a rule:
string root("/");
k::rule
participants (1)
-
Ovanes Markarian