From: Alexander N. <an...@go...> - 2006-03-21 11:02:22
|
Hi all. I have two problems, help me please. 1.================================== I'd like to have something like: struct test:public grammar<test> { template<typename scannerT> struct definition { typedef stored_rule<scannerT> TRule; vector<TRule> m_rules; definition(const test & self) { ///some code anychar_p[push_back_a(m_rules, ch_p(arg1))]; ///some code } } but it's ill-formed. This anychar_p[push_back_a(m_rules, bind(&ch_p, arg1))]; cause an error: internal compiler error: in resolve_overloaded_unification, at cp/pt.c:9227. GCC 3.4.0. anychar_p[push_back_a(m_rules, construct_<chlit<> >(arg1))]; - ill-formed The desire is to implement that in one line. What is the Right Way? 2.=================================================== TRule r = anychar_p(++var(m_count)); //some code TRule r1 = repeat(m_count, m_count)[anychar_p]; first = r >> r1; How should I create rule r1 with lazy-evaluated m_count? I'm thinking on using lazy_p, but I don't really get how to. Thank you. -- Regards, Alexander Nemish |