
On 4/20/2010 1:14 PM, OvermindDL1 wrote:
On Mon, Apr 19, 2010 at 8:22 AM, Lars Rohwedder
wrote: EricB schrieb:
is there any way to manage this with 1.6.4
If only need to checked whether the string contains the same number of '(' and ')' what about
int counter=0;
rule<> r = ch_p('(')[increment_a(counter)]>> ~ch_p(')')>> ch_p(')')[decrement_a(counter)]
if(counter!=0) { // unbalanced! }
Unnecessary, slower, and error-prone. There is still a 'raw' equivalent in Spirit1 as I recall, but I do not know the syntax, you
Spirit1 is always "raw" in the sense that it is basically a transduction parser and returns the iterators to the matching range in the input. Regards, -- Joel de Guzman http://www.boostpro.com http://spirit.sf.net http://www.facebook.com/djowel Meet me at BoostCon http://www.boostcon.com/home http://www.facebook.com/boostcon