Hi
On 12/12/2013 20:13, Michael Caisse wrote: On 12/12/2013 10:47 AM, Francois Mauger wrote:
On 12/12/2013 15:24, TONGARI J wrote:
However I don't understand the "()" after the "std::vector<char>". what does it mean ? Does it refer to the std::vector constructor ?
It is function declaration syntax. It is specifying a function that returns a std::vector<char> and takes no parameters. Qi uses this syntax to specify what the rule will synthesize (produce or return) and the inherited parameters (arguments to the rule).
ok. now that's clearer (while the syntax is rather obfuscating)
Attribute parsing is the way to go. Avoid semantic actions as much as possible. Parse into a data structure and then post process that structure if needed. Foo might be a tuple or it might be some complex, recursive data structure... it will depend on what you are parsing.
well, this will be my approach after this first discovery round. I like it because post-processing will give me more freedom to manipulate the sink object.
Perhaps this will help some.
I know this (good) tutorial (yours... congratulation!).
unfortunately I was really confused by the example with
BOOST_FUSION_ADAPT_CLASS_NAMED in a first attempt to bind one of my
class with Spirit/Qi/karma. I cannot find this macro in Boost 1.53.
But see:
<pre>
$ tail -3 boost/version.hpp
#define BOOST_LIB_VERSION "1_53"
#endif
$ tail -3 boost/fusion/include/adapt_assoc_class.hpp
#include