6 #include <boost/optional.hpp>
7 #include <boost/range/algorithm/for_each.hpp>
18 template <
typename GenSet>
25 using word_t =
typename genset_t::word_t;
57 template <
typename Fun>
65 for (
auto l : this->
genset())
73 boost::optional<letter_t> prev;
74 while (i.peek() != EOF && i.peek() !=
']')
78 "bracket cannot begin with '-'");
82 auto dash = this->
genset().get_letter(i);
92 for (
auto i = std::next(this->
genset().find(prev.get()));
93 i != this->
genset().end() && *i < l2;
134 template <
typename Fun>
149 "invalid label: unexpected ",
str_escape(res));
154 # define DEFINE(Name, Attribute) \
155 template <typename... Args> \
158 Name(Args&&... args) const \
159 -> decltype(this->genset().Name(std::forward<Args>(args)...)) \
161 return this->genset().Name(std::forward<Args>(args)...); \
std::set< T, Compare, Alloc > set_difference(const std::set< T, Compare, Alloc > &set1, const std::set< T, Compare, Alloc > &set2)
The set of members of set1 that are not members of set2.
std::ostream & str_escape(std::ostream &os, const std::string &str)
Output a string, escaping special characters.
letters_t convs_classes_(std::istream &i) const
Read a set of letters.
auto get_word(Args &&...args) const -> decltype(this->genset().get_word(std::forward< Args >(args)...))
This class has no modeling purpose, it only serves to factor code common to letterset, nullableset and wordset.
ATTRIBUTE_PURE auto has(Args &&...args) const -> decltype(this->genset().has(std::forward< Args >(args)...))
typename genset_t::letters_t letters_t
Functor to compare Values of ValueSets.
void convs_classes_(std::istream &i, Fun fun) const
Read and process a class of letters.
ATTRIBUTE_PURE auto equal(Args &&...args) const -> decltype(this->genset().equal(std::forward< Args >(args)...))
char eat(std::istream &is, char c)
Check lookahead character and advance.
ATTRIBUTE_PURE auto is_letter(Args &&...args) const -> decltype(this->genset().is_letter(std::forward< Args >(args)...))
std::shared_ptr< const genset_t > genset_ptr
const genset_t & genset() const
typename genset_t::word_t word_t
auto delimit(Args &&...args) const -> decltype(this->genset().delimit(std::forward< Args >(args)...))
void require(bool b, Args &&...args)
If b is not verified, raise an error with args as message.
auto begin(Args &&...args) const -> decltype(this->genset().begin(std::forward< Args >(args)...))
auto undelimit(Args &&...args) const -> decltype(this->genset().undelimit(std::forward< Args >(args)...))
boost::flyweight< std::string, boost::flyweights::no_tracking, boost::flyweights::intermodule_holder > symbol
An internalized string.
genset_labelset(const genset_ptr &gs)
auto mul(Args &&...args) const -> decltype(this->genset().mul(std::forward< Args >(args)...))
ATTRIBUTE_PURE auto transpose(Args &&...args) const -> decltype(this->genset().transpose(std::forward< Args >(args)...))
#define DEFINE(Name, Attribute)
Use the implementation from genset.
auto end(Args &&...args) const -> decltype(this->genset().end(std::forward< Args >(args)...))
letter_t get_letter(std::istream &i, bool quoted=true) const
Read one letter from i.
typename genset_t::letter_t letter_t
void convs_(std::istream &i, Fun fun) const
Read and process a class of letters.
genset_labelset(const genset_t &gs={})