...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
boost::parser::rule_parser
// In header: <boost/parser/parser_fwd.hpp> template<bool CanUseCallbacks, typename TagType, typename Attribute, typename LocalState, typename ParamsTuple> struct rule_parser { };
Applies another parser p
, associated with this parser via TagType
. The attribute produced is Attribute
. Both a default-constructed object of type LocalState
, and a default-constructed object of type ParamsTuple
, are added to the parse context before the associated parser is applied. The parse succeeds iff p
succeeds. If CanUseCallbacks
is true
, and if this parser is used within a call to callback_parse()
, the attribute is produced via callback; otherwise, the attribute is produced as normal (as a return value, or as an out-param). The rule may be constructed with user-friendly diagnostic text that will appear if the top-level parse is executed with trace_mode == boost::parser::trace::on
.