I have a working grammar similar to the following:
stock_price = symbol_ >> date_ >> price_; stock_prices_ = stock_price_ >> stock_prices_ | eps; grammar_ = lit( "PRICES" ) >> stock_prices_ >> lit( "END" );
The problem is that when the list of stock prices becomes too high (say, around 1000 prices), seg-faults are parsed using exc_bad_access. I really can solve this:
stock_prices_ = stock_price_ >> stock_price_ >> stock_price_ >> stock_price >> stock_prices_ | stock_price_ >> stock_prices_ | eps;
but I do not see this as an elegant solution. Is there a better solution?
c ++ recursion boost-spirit boost-spirit-qi
statguy
source share