Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

PrevUpHomeNext

Function template callback_prefix_parse

boost::parser::callback_prefix_parse

Synopsis

// In header: <boost/parser/parser.hpp>


template<parsable_iter I, std::sentinel_for< I > S, typename Parser, 
         typename GlobalState, 
         error_handler< I, S, GlobalState > ErrorHandler, typename SkipParser, 
         typename Callbacks> 
  bool callback_prefix_parse(I & first, S last, 
                             parser_interface< Parser, GlobalState, ErrorHandler > const & parser, 
                             parser_interface< SkipParser > const & skip, 
                             Callbacks const & callbacks, 
                             trace trace_mode = trace::off);

Description

Parses [first, last) using parser, skipping all input recognized by skip between the application of any two parsers, and returns whether the parse was successful. When a callback rule r is successful during the parse, one of two things happens: 1) if r has an attribute, callbacks(tag, x) will be called (where tag is decltype(r)::tag_type{}, and x is the attribute produced by r); or 2) if r has no attribute, callbacks(tag) will be called. Callbacks is expected to be an invocable with the correct overloads required to support all successful rule parses that might occur. If trace_mode == trace::on, a verbose trace of the parse will be streamed to std::cout.


PrevUpHomeNext