Boost logo

Boost :

Subject: Re: [boost] [spirit][qi] Dynamically combine Boost.Spirit.Qi rules at runtime
From: Daniel F. (the.source_at_[hidden])
Date: 2011-05-11 15:13:54


Hello Roland,

that looks like an interesting way of doing it, I will keep it in mind.
The reason why I'm not entirely convinced is that it requires to build
another layer of grammar/rules and parsing machinery on top of
Boost.Spirit.Qi. It seems to me that such a task should be possible to
solve within the confines of Boost.Spirit.Qi using the rule composition
functionality that is already there.

Best regards,
Daniel

On 5/11/2011 8:37 PM, Roland Bock wrote:
> 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:
>>
>>
> Hi,
>
> 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.
>
> Regards,
>
> Roland
>
>
>
> _______________________________________________
> Unsubscribe& other changes: http://lists.boost.org/mailman/listinfo.cgi/boost


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk