4.6.0
Freundlich's C++ toolkit
|
Parses a set of characters and returns which one has matched.
For the character set S
, this parser returns c
if c is the next input character and c is in S. Otherwise, an error is returned.
Note that instead of using basic_char_set{c_1,...,c_n}
, one could also use P = basic_char{c_1} | ... | basic_char{c_n}
. However, basic_char_set is more efficient, since it looks up the next character in a hash map, whereas P would first try to match against c_1, then c_2, and so on.
Public Types | |
using | char_set_type = fcppt::parse::basic_char_set_container<Ch> |
using | result_type = Ch |
Public Member Functions | |
basic_char_set (std::initializer_list< Ch > const &) | |
basic_char_set (char_set_type &&) | |
template<typename Skipper > | |
fcppt::parse::result< Ch, result_type > | parse (fcppt::reference< fcppt::parse::basic_stream< Ch > >, Skipper const &) const |
char_set_type const & | chars () const |
using fcppt::parse::basic_char_set< Ch >::char_set_type = fcppt::parse::basic_char_set_container<Ch> |
using fcppt::parse::basic_char_set< Ch >::result_type = Ch |
fcppt::parse::basic_char_set< Ch >::basic_char_set | ( | std::initializer_list< Ch > const & | ) |
|
explicit |
|
nodiscard |
|
nodiscard |