OvermindDL1 | 1 Aug 02:25
Picon

Re: string_switch

On Fri, Jul 31, 2009 at 6:34 AM, Hartmut Kaiser<hartmut.kaiser <at> gmail.com> wrote:
>> My first go at making a more elaborate terminal, although mostly
>> shamelessly ripped from symbol.
>>
>> See attached file, should be a drop in over your boost directory, it
>> overwrites one file (adds a header include to it) that normally comes
>> with the spirit distribution.  Also includes a test file (that I may
>> still add more things to), and a barely started documentation file.
>>
>> Can this be tested, tell me what is broken, how it can be fixed,
>> etc...?
>
> Looks great! Since I didn't run it yet first a couple of formal comments:
>
> - I think this component is meant to end up in the repository, so you need
> to change the directory structure accordingly
> - please remove all tabs from the files (Boost guidelines, you won't even be
> able to commit a file containing tabs)
> - Is it really necessary to re-implement the whole symbols class? Wouldn't a
> simpler:
>
>    template <
>          typename RuleType
>        , typename Lookup = tst<
>              typename std::iterator_traits<
>                  RuleType::iterator_type>::value_type
>            , RuleType>
>        , typename Filter = tst_pass_through>
>    struct string_switch
>      : symbols<
(Continue reading)

OvermindDL1 | 1 Aug 02:39
Picon

Re: string_switch

On Fri, Jul 31, 2009 at 6:25 PM, OvermindDL1<overminddl1 <at> gmail.com> wrote:
> /* snip */

Why are things in the 'repository' in their own directories and
namespace?  That makes it a bit more cumbersome to include.  Why not
just include straight into Spirit, at least things that are agnostic
(like the thing that I and the other person posted, unlike things like
url parsers)?

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
OvermindDL1 | 1 Aug 04:26
Picon

Re: string_switch

On Fri, Jul 31, 2009 at 6:39 PM, OvermindDL1<overminddl1 <at> gmail.com> wrote:
> On Fri, Jul 31, 2009 at 6:25 PM, OvermindDL1<overminddl1 <at> gmail.com> wrote:
>> /* snip */
>
> Why are things in the 'repository' in their own directories and
> namespace?  That makes it a bit more cumbersome to include.  Why not
> just include straight into Spirit, at least things that are agnostic
> (like the thing that I and the other person posted, unlike things like
> url parsers)?

It is in the repository directories now, however every time I wrap the
string_switch in a repository namespace, I start getting some really
weird compile errors (thing about not being able to find
string_switch, inside the class itself, a wtf kind of error).  Thus I
do not have it in a repository namespace, it acts like it *really*
wants to be in the QI namespace, nothing else seems to compile.
Should not something like this be added to Spirit itself though?  It
is certainly generic enough, like the symbol struct.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
Hartmut Kaiser | 1 Aug 17:29
Picon
Gravatar

Repository policies (was: string_switch)

> > Why are things in the 'repository' in their own directories and
> > namespace?  That makes it a bit more cumbersome to include.  Why not
> > just include straight into Spirit, at least things that are agnostic
> > (like the thing that I and the other person posted, unlike things
> like
> > url parsers)?

Joel and I talked about the policies for the repository yesterday but really
would like to hear everybody's opinion on that. Let me just throw out all
the different points to be considered. Please add more points to the
discussion if we missed something. 

Some organizational remarks:

The repository is meant to be a loose collection of parser/generator
components and grammars contributed by the Spirit community. The aim is to
broaden the scope of the Spirit library while being able to maintain its
high standards in terms of code quality, flexibility, and maintainability.
At the same time it encourages people to contribute even small components as
it lessens the hurdle of becoming a Boost and Spirit author. 

Maintainability of the code and author commitment over a longer period of
time are crucial for Spirit's success (as it is for the whole Boost
project). That allows the repository to play an additional role in terms of
being a proving ground for interested authors. It is a lot easier to remove
code from the repository than from the Spirit core library. So if an author
can't maintain his/her contribution anymore for any reason, we could remove
those parts from the repository more easily.

The repository is an excellent way of evolving things. The Spirit core has
(Continue reading)

Hartmut Kaiser | 1 Aug 17:41
Picon
Gravatar

Re: string_switch

> > - Is it really necessary to re-implement the whole symbols class?
> Wouldn't a
> > simpler:
> >
> >    template <
> >          typename RuleType
> >        , typename Lookup = tst<
> >              typename std::iterator_traits<
> >                  RuleType::iterator_type>::value_type
> >            , RuleType>
> >        , typename Filter = tst_pass_through>
> >    struct string_switch
> >      : symbols<
> >            typename std::iterator_traits<
> >                typename RuleType::iterator_type
> >            >::value_type>
> >          , RuleType
> >          , Lookup
> >          , Filer
> >        >
> >    {
> >        struct attribute { ...overload attribute... };
> >        bool parse() { ...overload parse(); ... }
> >        info what() { ...overload what ... }
> >    };
> >
> > do the trick as well?
> 
> I tried that for about 4 hours.  Nothing I did, nothing that I
> attempted ever got it to run parse in my class, it always ran the one
(Continue reading)

Joel de Guzman | 1 Aug 19:07
Picon
Favicon

Re: Repository policies (was: string_switch)

Hartmut Kaiser wrote:
>>> Why are things in the 'repository' in their own directories and
>>> namespace?  That makes it a bit more cumbersome to include.  Why not
>>> just include straight into Spirit, at least things that are agnostic
>>> (like the thing that I and the other person posted, unlike things
>> like
>>> url parsers)?
> 
> Joel and I talked about the policies for the repository yesterday [...]

Thanks Hartmut, you beat me to it. I was about to write a post
but I almost forgot it is my wife's birthday.

Regards,
--

-- 
Joel de Guzman
http://www.boostpro.com
http://spirit.sf.net

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
Carl Barron | 1 Aug 20:32

Re: string_switch


On Jul 31, 2009, at 10:26 PM, OvermindDL1 wrote:

> On Fri, Jul 31, 2009 at 6:39 PM, OvermindDL1<overminddl1 <at> gmail.com>  
> wrote:
>> On Fri, Jul 31, 2009 at 6:25 PM, OvermindDL1<overminddl1 <at> gmail.com>  
>> wrote:
>>> /* snip */
>>
>> Why are things in the 'repository' in their own directories and
>> namespace?  That makes it a bit more cumbersome to include.  Why not
>> just include straight into Spirit, at least things that are agnostic
>> (like the thing that I and the other person posted, unlike things  
>> like
>> url parsers)?
>
> It is in the repository directories now, however every time I wrap the
> string_switch in a repository namespace, I start getting some really
> weird compile errors (thing about not being able to find
> string_switch, inside the class itself, a wtf kind of error).  Thus I
> do not have it in a repository namespace, it acts like it *really*
> wants to be in the QI namespace, nothing else seems to compile.
> Should not something like this be added to Spirit itself though?  It
> is certainly generic enough, like the symbol struct.

  Assuming you figure out proto, it should apply the skipper before  
matching the found rule?
that is it should emulate  omit[search[_a=-1] >> lazy(_a) which would  
skip between search and
lazy(_a).   Why cant it contain a symbols and not derive/copy from it.
(Continue reading)

Richard Crossley | 2 Aug 02:54

Confused with Spirit

Hi,

Playing with Spirit (VC9 & boost trunk), just to see how if understand how
it works and I can't see why the following fails. If I remove the literal
"sc#" then it compiles happily.

Suggestions?

Thanks,

Richard.

------------------
#include <boost/spirit/include/qi.hpp>
#include <boost/fusion/adapted/struct/adapt_struct.hpp>

struct st_scrgb{
    double m_a;
    double m_r;
    double m_g;
    double m_b;
};

BOOST_FUSION_ADAPT_STRUCT(	
    st_scrgb,
    (double,m_a)
    (double,m_r)
    (double,m_g)
    (double,m_b)
)    
(Continue reading)

Hartmut Kaiser | 2 Aug 03:52
Picon
Gravatar

Re: Confused with Spirit

> Playing with Spirit (VC9 & boost trunk), just to see how if understand
> how
> it works and I can't see why the following fails. If I remove the
> literal
> "sc#" then it compiles happily.
> 
> Suggestions?

Use Spirit V2.1 from Boost SVN trunk. It's much more mature and stable (a
lot of bugs have been fixed and rough edges are smoothed, etc.). Your
example compiles just fine as it is (if compiled against V2.1).

The Spirit V2.0 in the latest released Boost versions should have been
dubbed V1.99 as it is really a beta version only.

HTH
Regards Hartmut

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
Carl Barron | 2 Aug 04:10

Re: Confused with Spirit


On Aug 1, 2009, at 8:54 PM, Richard Crossley wrote:

> Hi,
>
> Playing with Spirit (VC9 & boost trunk), just to see how if  
> understand how
> it works and I can't see why the following fails. If I remove the  
> literal
> "sc#" then it compiles happily.
>
> Suggestions?
>
> Thanks,
>
> Richard.
>
> ------------------
> #include <boost/spirit/include/qi.hpp>
> #include <boost/fusion/adapted/struct/adapt_struct.hpp>
>
> struct st_scrgb{
>    double m_a;
>    double m_r;
>    double m_g;
>    double m_b;
> };
>
> BOOST_FUSION_ADAPT_STRUCT(	
>    st_scrgb,
(Continue reading)


Gmane