4.5.0
Freundlich's C++ toolkit
Loading...
Searching...
No Matches
fcppt::parse::separator< Inner, Ch > Class Template Reference

Detailed Description

template<typename Inner, typename Ch>
class fcppt::parse::separator< Inner, Ch >

Parses a list of elements, delimited by a separator, e.g., a_1,...,a_n.

Inner is tried first. If this suceeds, this provides the first element r_1 of the result. Then, Separator is tried, followed by Inner. This is done as long as possible, giving the remaining elements r_2, ..., r_n of the result, which are again taken from Inner.

Equivalent to:

Inner >> *(Sep >> Inner)
Template Parameters
SepA parser with result type unit.
Inheritance diagram for fcppt::parse::separator< Inner, Ch >:
fcppt::parse::tag

Public Types

using result_type = std::vector<fcppt::parse::result_of<Inner>>
 

Public Member Functions

 separator (Inner &&, Sep &&)
 
template<typename Ch , typename Skipper >
fcppt::parse::result< Ch, result_typeparse (fcppt::reference< fcppt::parse::basic_stream< Ch > >, Skipper const &) const
 

Member Typedef Documentation

◆ result_type

template<typename Inner , typename Ch >
using fcppt::parse::separator< Inner, Ch >::result_type = std::vector<fcppt::parse::result_of<Inner>>

Constructor & Destructor Documentation

◆ separator()

template<typename Inner , typename Ch >
fcppt::parse::separator< Inner, Ch >::separator ( Inner && ,
Sep &&  )

Member Function Documentation

◆ parse()

template<typename Inner , typename Ch >
template<typename Ch , typename Skipper >
fcppt::parse::result< Ch, result_type > fcppt::parse::separator< Inner, Ch >::parse ( fcppt::reference< fcppt::parse::basic_stream< Ch > > ,
Skipper const &  ) const
nodiscard