djowel / spirit_x3

Spirit X3 Experimental
147 stars 33 forks source link

How to shared rules between files ? #11

Open vhiairrassary opened 10 years ago

vhiairrassary commented 10 years ago

Hello,

Using auto, how is it possible to share rules between différents files ? In fact, I need to use a rule in different grammars but :

Thank you in advance ! Victor

djowel commented 10 years ago

The rules will have to be exposed in the header files. Yes, that's a serious drawback, and one reason why I think the concept of type-erased rules (similar to V2 rules) are still crucial.

vhiairrassary commented 10 years ago

Thanks for your rapid answer. Say me if I make a mistake but you will propose a class similar to boost::qi::rule (V2) as explain here http://www.boost.org/doc/libs/1_55_0/libs/spirit/doc/html/spirit/rationale.html ?

P.S. Are you open to contributions ? Because I can't compile with x3 and some error-prone flags with g++ (-W -Werror -Wall -Wfatal-errors -pedantic -pedantic-errors).