Hello, I have a string I want to parse that is like that A or A or A or ( C or C or C or ( D) or C) or B. Obviously A and B are just something else but we don't care about it here. I define it as mystring = (A | (ch_p('(') >> A >> ch_p(')'))) >> * ("or" >> (A | mystring)) the problem is that as this is exactly the same over and over, I'm getting the end results in the furthest mystring possible: B will be part of "( C or C or C or ( D) or C) or B" and not of the total string and that messes my grammar :( I have no idea how to pass that trouble, so any help on that would be appreciated (well if anyone understood what I said ;) ) Thanks
john wrote:
Hello,
I have a string I want to parse that is like that
A or A or A or ( C or C or C or ( D) or C) or B.
Obviously A and B are just something else but we don't care about it here.
I define it as mystring = (A | (ch_p('(') >> A >> ch_p(')'))) >> * ("or" >> (A | mystring))
the problem is that as this is exactly the same over and over, I'm getting the end results in the furthest mystring possible: B will be part of "( C or C or C or ( D) or C) or B" and not of the total string and that messes my grammar :(
I have no idea how to pass that trouble, so any help on that would be appreciated (well if anyone understood what I said ;) )
Spirit, I assume? The proper mailing list is: https://lists.sourceforge.net/lists/listinfo/spirit-general Cya there. Regards, -- Joel de Guzman http://www.boost-consulting.com http://spirit.sf.net
participants (2)
-
Joel de Guzman
-
john