4.6.0
Freundlich's C++ toolkit
Loading...
Searching...
No Matches
fcppt::parse::sequence< Left, Right > Class Template Reference

Detailed Description

template<typename Left, typename Right>
class fcppt::parse::sequence< Left, Right >

Tries two parsers in succession. Produces a tuple of both results if both parsers do not fail.

Let l and r be parsers and seq = sequence{l,r}. First, the skipper is run. Then, seq tries the parser l. If it succeeds, then the skipper is run again. After that, seq also tries r. If r also succeeds, then the tuple of both results is returned. Otherwise, the first error is returned.

See fcppt::parse::sequence_result for this parser's result type.

Inheritance diagram for fcppt::parse::sequence< Left, Right >:
fcppt::parse::tag

Public Types

using result_type
 

Public Member Functions

 sequence (Left &&, Right &&)
 
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 Left , typename Right >
using fcppt::parse::sequence< Left, Right >::result_type

Constructor & Destructor Documentation

◆ sequence()

template<typename Left , typename Right >
fcppt::parse::sequence< Left, Right >::sequence ( Left && ,
Right &&  )

Member Function Documentation

◆ parse()

template<typename Left , typename Right >
template<typename Ch , typename Skipper >
fcppt::parse::result< Ch, result_type > fcppt::parse::sequence< Left, Right >::parse ( fcppt::reference< fcppt::parse::basic_stream< Ch > > ,
Skipper const &  ) const
nodiscard