Boost logo

Boost :

Subject: Re: [boost] [local] Review
From: Joel de Guzman (joel_at_[hidden])
Date: 2011-11-21 08:34:10


On 11/21/2011 9:17 PM, Lorenzo Caminiti wrote:

>> Definitely, yes. You can't really be seriously dabbling locals into
>> FP land now, are you? :-)
>
> Well, I am seriously asking for your guidance entering the
> Spirit/Phoenix domain.

Why?

> Would this be a good example or is there a better one?
> http://www.boost.org/doc/libs/1_48_0/libs/spirit/example/qi/num_list4.cpp
> There are quire a few examples in the docs even after num_list4 (which
> is good) so I can use your help in selecting the best one for this
> exercise.

Are you really serious :-) ? Ok, try the simplest calculator
that uses phoenix:

  http://www.boost.org/doc/libs/1_48_0/libs/spirit/example/qi/compiler_tutorial/calc3.cpp

That's the "hello world" for parsers, so to speak. See the
code in square brackets. Those are your phoenix semantic actions.
E.g.:

  term [_val = _1]

Regards,

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

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