[spirit] Qi-adapted-struct light bulb
Hello, A light bulb went on for me with regard to adapting structs into Qi parser grammars. Feel free to correct me if I'm wrong. The key is adapting a struct into your grammer's parser(s) using the BOOST_FUSION_ADAPT_STRUCT, which identifies the type (struct) and fields you are synthesizing out of the grammar. It doesn't mean that there can't be other (presumably) public variables, functions, etc, in the struct. It also doesn't mean there can't be private or protected or even a hierarchy of members. It just means that those are the *adapted* fields into which values will be synthesized. Need a style feedback as well. I am finding that I define both the struct and its parser grammar in the same header/source. Is there any reason to separate the two, really? Other than perhaps not everything needs to know about the grammer, just the struct, type thing. Thank you... Regards, Michael Powell
participants (1)
-
Michael Powell