|
Boost : |
From: Hartmut Kaiser (hartmut.kaiser_at_[hidden])
Date: 2008-05-29 19:59:28
Thanks Troy!
I just wanted to start investigating and - voila! You already did it! I'll
incorporate your patch asap.
Regards Hartmut
> -----Original Message-----
> From: boost-bounces_at_[hidden] [mailto:boost-
> bounces_at_[hidden]] On Behalf Of troy d. straszheim
> Sent: Thursday, May 29, 2008 2:29 PM
> To: boost_at_[hidden]
> Subject: Re: [boost] [spirit] trunk: circular dependency parse <->
> construct <-> assign_to (?)
>
> Hey Hartmut,
>
> I've got a workaround, like so:
>
> If you forward declare the construct() overloads for the different
> primitive Attribute types, gcc seems to not greedily match this one
> (the current error):
>
> template <typename Attribute, typename Iterator>
> inline void
> construct(Attribute& attr, Iterator const& first, Iterator
> const& last)
> {
> attr = Attribute(first, last);
> }
>
> and instead to wait for this one (correct):
>
> template <typename Iterator>
> inline void
> construct(unsigned int& attr, Iterator const& first,
> Iterator const& last)
> {
> Iterator first_ = first;
> parse(first_, last, uint_, attr);
> }
>
> So I've got local mods of adding
>
> #include <boost/spirit/home/qi/detail/construct_fwd.hpp>
>
> to the top of assign_to.hpp, and the construct_fwd.hpp is attached.
>
> I don't entirely get it, but I do like the looks of this:
>
> troy_at_uranium:~/Projects/boost/trunk/libs/spirit/example/lex
> % gcc -o example4 example4.cpp -I . -I ../../../.. -lstdc++
>
> troy_at_uranium:~/Projects/boost/trunk/libs/spirit/example/lex
> % ./example4
> assignment statement to: a
> if expression: variable
> assignment statement to: b
> if expression: 2
> assignment statement to: c
> assignment statement to: d
> if expression: x
> while expression: 10
> assignment statement to: variable
> -------------------------
> Parsing succeeded
> -------------------------
> Bye... :-)
>
>
>
> Best,
>
> -t
>
>
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk