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