Boost logo

Boost :

Subject: Re: [boost] [spirit][qi] Dynamically combine Boost.Spirit.Qi rules at runtime
From: Roland Bock (rbock_at_[hidden])
Date: 2011-05-11 14:37:30

On 05/07/2011 10:37 PM, Daniel F. wrote:
> Hi,
> I recently tried to combine an arbitrary number of rules as
> alternatives in Boost.Spirit.Qi. Since rules are implemented as
> objects it seemed feasible to me. My motivation was to make certain
> parts of my grammar easily extensible. Unfortunately, I ran into some
> problems, so I wrote a simple program (see attachment for the complete
> code) demonstrating the unexpected behavior. Here's the key part:

I did something similar last year, writing a runtime-configurable
date/time parser from small building blocks like day-, month- and year
parsers. I used a very small portion of it to create a tutorial section
for Spirit, but I guess Hartmut and Joel got lost in other work, so it
never made it anywhere.

Maybe it will be useful for you though? Please see the attachment and
let me know :-)

In this example, parsers are combined as a sequence, but combining them
as alternatives is equally simple, of course.



Boost list run by bdawes at, gregod at, cpdaniel at, john at