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 parse

boost::parser::parse

Synopsis

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


template<parsable_range R, typename Parser, typename GlobalState, 
         typename ErrorHandler, typename Attr> 
  bool parse(R const & r, 
             parser_interface< Parser, GlobalState, ErrorHandler > const & parser, 
             Attr & attr, trace trace_mode = trace::off);

Description

Parses r using parser, and returns whether the parse was successful. The entire input range r must be consumed for the parse to be considered successful. On success, attr will be assigned the value of the attribute produced by parser. If trace_mode == trace::on, a verbose trace of the parse will be streamed to std::cout.

Template Parameters:

ErrorHandler

Constrained by error_handler<ErrorHandler,std::ranges::iterator_t<decltype(subrange_of(r))>, std::ranges::sentinel_t<decltype(subrange_of(r))>, GlobalState>, where subrange_of is an implementation detail that: creates subranges out of pointers; trims trailing zeros off of bounded arrays (such as string literals); and transcodes to UTF-32 if the input is non-char.

Attr

Constrained by !detail::derived_from_parser_interface_v<std::remove_cvref_t<Attr>.


PrevUpHomeNext