On 4/29/2011 5:04 AM, Hossein Haeri wrote: > Dear all, > > I have an application with the following syntax (with which many of you > are perhaps already familiar through my previous postings): > > x >> &f >> &g > > I can evaluate the above expression into g(f(5)) say when x == 5. I am > quite pleased with how Proto manages this for the compile-time > flexibility that it gives me. > > Now, I'm wondering whether there is any way in which the string "x >> &f > >> &g" can be parsed into its Proto counterpart. So, I started reading > through the Xpressive documentation with the hope of finding a piece of > magic there. I am however not positive at all because, in effect, this > would mean type construction at runtime.
Right, you can't do that. > I would however be so delighted > if someone here who can contradict me. Any ideas please? Xpressive isn't doing what you think it's doing. There are two front ends -- static and dynamic. Both build a DAG representing the FSM from the same basic components. But in the dynamic case, the nodes in the DAG are type-erased (polymorphic base pointers and virtual functions) and in the static case, the nodes are statically typed. Dynamic xpressive cannot build a statically-bound DAG for exactly the reason you cite. -- Eric Niebler BoostPro Computing http://www.boostpro.com _______________________________________________ proto mailing list email@example.com http://lists.boost.org/mailman/listinfo.cgi/proto