Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Struct template or_parser

boost::parser::or_parser

Synopsis

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

template<typename ParserTuple> 
struct or_parser {

  // public member functions
  ();
  template<typename Iter, typename Sentinel, typename Context, 
           typename SkipParser> 
     (, , , , 
              , ) ;
  template<typename Iter, typename Sentinel, typename Context, 
           typename SkipParser, typename Attribute> 
     (, , , , 
              , , ) ;

  // public data members
   parsers_;
};

Description

Applies each parser in ParserTuple, in order, stopping after the application of the first one that succeeds. The parse succeeds iff one of the sub-parsers succeeds. The attribute produced is a std::variant over the types of attribute produced by the parsers in ParserTuple.

or_parser public member functions

  1. ( parsers);
  2. template<typename Iter, typename Sentinel, typename Context, 
             typename SkipParser> 
       ( first,  last,  context, 
                 skip,  flags,  success) ;
  3. template<typename Iter, typename Sentinel, typename Context, 
             typename SkipParser, typename Attribute> 
       ( first,  last,  context, 
                 skip,  flags,  success, 
                 retval) ;

PrevUpHomeNext