Boost Spirit Qi parser grammars are wonderful, and I use them for small things all the time. However, there are times when I would like to be able to compose separate grammars.
This is easy to do all-in-one in a single compile by #including the appropriate grammars and stitching them together. However, this makes compile times start going through the roof. There are other drawbacks as well.
Is there any way to compose separately compiled grammars? In other words, I'd like to define a grammar's interface in a header file, implement the template and it's instantiation for a particular Iterator in a separate compilation unit, and then be able to use the grammar from another, without having the full template definition visible at compile time. In other words, I want to be able to use a grammar in a rule indirectly.
Is such a thing possible? If it is, how would one go about it?