[Q] boost::spirit BOOST_FUSION_ADAPT_STRUCT error

Hello, I am attempting to parse
FuncName(arg1,arg2,... argN)
with Spirit, such that args are saved in a vector
and func name is saved into a funct_nm
I am just in the beginning of this (I have not learned yet how
to construct a grammar that allows comma delimited args within braces )
But running into a compilation error
on line
(std::string, funct_nm)
within
BOOST_FUSION_ADAPT_STRUCT
I am using mini_xml1.cpp as an example
Would like to ask for help/pointers to resolve it.
I want to mention that my project on boost 1.38 and also includes
json_spirit which uses
( I am guessing the 'classic version' of spirit).
thank you in advance,
Vlad
---------------------------------------
#include

I found a couple of typos with my code, but still not working
First problem was
that I need to specify a fully qualified name in the 'struct' name as
the first argument
Second, I added the two include files
#include
Hello, I am attempting to parse
FuncName(arg1,arg2,... argN)
with Spirit, such that args are saved in a vector and func name is saved into a funct_nm
I am just in the beginning of this (I have not learned yet how to construct a grammar that allows comma delimited args within braces )
But running into a compilation error
on line
(std::string, funct_nm)
within BOOST_FUSION_ADAPT_STRUCT
I am using mini_xml1.cpp as an example
Would like to ask for help/pointers to resolve it. I want to mention that my project on boost 1.38 and also includes json_spirit which uses ( I am guessing the 'classic version' of spirit).
thank you in advance, Vlad
---------------------------------------
#include
/* boost spirit parser specifics START */ #include
#include #include #include #include #include #include #include <iostream> #include <string> #include <complex>
/* boost spirit parser specifics end */
using namespace std;
using namespace boost::spirit; using namespace boost::spirit::qi; using namespace boost::spirit::ascii; using namespace boost::spirit::arg_names;
namespace fusion = boost::fusion; namespace phoenix = boost::phoenix;
//VP do not use this namespace,it is clashes with //regular boost //using namespace boost::spirit::arg_names;
/* using phoenix::at_c; using boost::phoenix::ref; using boost::phoenix::push_back; using boost::phoenix::val; using boost::phoenix::construct; */
using namespace json_spirit;
struct cmdfunct_2arg; //an argument of a function typedef boost::variant< boost::recursive_wrapper
, std::string > t_cmd_arg; //function with name and a list of arguments struct cmdfunct_arg { std::string funct_nm; std::vector args; }; // We need to tell fusion about cmdfunct struct // to make it a first-class fusion citizen //[tutorial_xml1_adapt_structures BOOST_FUSION_ADAPT_STRUCT( cmdfunct_arg, (std::string, funct_nm) (std::vector
, args) ) -- V S P toreason@fastmail.fm
-- http://www.fastmail.fm - Does exactly what it says on the tin
-- V S P toreason@fastmail.fm -- http://www.fastmail.fm - Access all of your messages and folders wherever you are

AMDG V S P wrote:
I found a couple of typos with my code, but still not working
First problem was that I need to specify a fully qualified name in the 'struct' name as the first argument
<snip> //function with name and a list of arguments struct cmdfunct_arg { std::string funct_nm; std::vector
args; }; BOOST_FUSION_ADAPT_STRUCT( setrak::pplg::cmdfunct_arg, (std::string, funct_nm) )
BOOST_FUSION_ADAPT_STRUCT needs to appear in the global namespace. In Christ, Steven Watanabe

V S P wrote:
I found a couple of typos with my code, but still not working
BTW, you might want to post to Spirit's mailing list: http://www.boost.org/community/groups.html#spirit Regards, -- Joel de Guzman http://www.boostpro.com http://spirit.sf.net
participants (3)
-
Joel de Guzman
-
Steven Watanabe
-
V S P