
On Fri, Aug 11, 2006 at 10:02:18AM +0800, Joel de Guzman <joel@boost-consulting.com> wrote:
Andreas Pokorny wrote:
On Mon, Aug 07, 2006 at 07:47:43AM +0800, Joel de Guzman <joel@boost-consulting.com> wrote:
To be honest, right now, for Spirit-2, I am inclined to use Eric's proto. It's been there for quite some time now and is quite mature. But, like your library, there are no docs yet (as far as I know). I'm not sure when Eric will have the time to get it outside xpressive as a standalone ET library, for review. At any rate, it would be interesting if you can form a collaboration with him. So, instead of having 2 separate ET entries, we can just have one that has the the best of both. Is that possible at all? Or is your library too different from Proto?
The whole thing was derived from proto, I changed some type names. Added a rule system. Then the domain_tag used for rule set dispatching, and finally the fusion-2 map to support attributes. With the attributes a DSL can be defined as a S-attributed grammar.
Ok...
[snip explanations]
I think thats enough for this email at least. I hope I find more time to write tomorrow
Not sure if I follow. I'm an examples type of guy. It would be enlightening if you can provide a simple example. Say, we want to write a DSEL which has primitives a_, b_ and c_ (objects) of types A B and C and operations >> and |. How shall I develop the ET using your library?
Example usage:
a_ >> b_ | c_
Given that a_ >> b_ invokes the operator of the library, e.g. by deriving at least A from a library type, and given the domain_tag can be evaluated from the participating datastructures. These rules have to be written: // domain: struct example_domain {}; // rules: template<typename EnableIfT> struct rule<example_domain,right_shift_tag,A,B,EnableIfT> : defined, mpl::true_ { typedef TYPE_WHICH_ENCODES_THE_EXPRESSION result_type; static result_type init(A const& a, B const& b) { return result_type(...); } }; template<typename EnableIfT> struct rule<example_domain,bitor_tag,TYPE_WHICH_ENCODES_THE_EXPRESSION,C,EnableIfT> : defined, mpl::true_ { typedef TYPE_WHICH_ENCODES_THE_WHOLE_TREE result_type; static result_type init(A const& a, B const& b) { return result_type(...); } }; This weekend I plan to work on the code, clean things up a bit, and try to reintegrate everthing into proto again. Best Regards, Andreas Pokorny