boost and stl problem - std::string

Jens Kallup <[email protected]>
Newsgroups gmane.comp.parsers.spirit.general
Message-ID <[email protected]>
Hello,

I want to use ExprNode to store AST informations.
But I fail.
How can I overgive parameters to class ExprNode?

Here are the code sippets:



template <typename TN>
class ExprNode
{
public:
     struct ExprNode *operand1;
     struct ExprNode *operand2;

     char opr;
     int  num;

     ExprNode(char op, struct ExprNode *e1, struct ExprNode *e2)
     {
         opr = op;
         operand1 = e1;
         operand2 = e2;
     }

     ExprNode(int n)
     {
         num = n;
         operand1 = operand2 = nullptr;
     }

     ExprNode() { }

     template<TN>
     ExprNode(TN t, std::string *p1, std::string *p2)
     {
         if (t == 2)
         {
             std::cout << "classler" << endl;
         }
     }
};



         class_definition
             = (tok.kw_class          >> *comments
                 >> tok.identifier    >> *comments
                 >> tok.kw_of         >> *comments
                 >> tok.identifier    >> *comments >> class_body
                 >> tok.kw_endclass)
/* line: 181 */ [
                     ExprNode<int>(
                     2,
                     phx::construct<std::string>(_1),
                     phx::construct<std::string>(_2))

                     //expnode->add(2,"val(_1)","val(_2)")
                     //phx::construct<std::string>(_1),
                     //phx::construct<std::string>(_2))
                 ]
             ;


/home/bak/src/ui/dbase/dBase/src/compiler/source/parser/yymain.cc:181: 
Fehler: no matching function for call to 'ExprNode<int>::ExprNode(int, 
boost::phoenix::actor<boost::phoenix::composite<boost::phoenix::detail::construct_eval<std::__cxx11::basic_string<char> 
 >, boost::fusion::vector<boost::spirit::argument<0>, 
boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, 
boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, 
boost::fusion::void_, boost::fusion::void_, boost::fusion::void_> > >, 
boost::phoenix::actor<boost::phoenix::composite<boost::phoenix::detail::construct_eval<std::__cxx11::basic_string<char> 
 >, boost::fusion::vector<boost::spirit::argument<1>, 
boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, 
boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, 
boost::fusion::void_, boost::fusion::void_, boost::fusion::void_> > >)'
                  [
                  ^

Thanks for helping

Jens

------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.