Enabling Spirit debugging support will help:
a) add a definition
#define BOOST_SPIRIT_QI_DEBUG
and b) add inside the constructor of your grammar a
BOOST_SPIRIT_DEBUG_NODE(r);
for all the rules (here r). As a result, the analyzers will print a runtime tree at runtime, showing you which rules are executed with which input and which attribute values have been filled (see here for more details).
As a general note (and this may not apply to you, as you seem to be trying to create an AST), Spirit parsers are completely related. This means that you don’t need semantic actions to handle attributes (see here , here , and here for tips).
source
share