If the inherited attributes are used in semantic actions, we can use x3::with
directive.
What if we want to use the attributes as part of the parser? For example a simple parser matches 1 or more alphabet characters except the character is from a parameter char set.
qi::rule<std::string::const_iterator, qi::unused_type(char const*)> rule =
+(qi::alpha - qi::char_(qi::_r1));
Or the parameter char set could be used as a lazy parser.
qi::rule<std::string::const_iterator, qi::unused_type(char const*)> rule =
+(qi::alpha - qi::lazy(qi::_r1));
x3::with directive put this local value in the context. I'm not sure if we could use this context outside a semantic action and eventually generate a parser.