Vcsn
2.2
Be Rational
|
A set of letters of type L. More...
#include <setalpha.hh>
Classes | |
struct | has_range |
Whether the genset supports the range concept: whether we can use '++' on letters. More... | |
struct | has_range< Letter, decltype((++std::declval< Letter & >(), void()))> |
Public Types | |
using | letter_t = typename L::letter_t |
using | word_t = typename L::word_t |
using | letters_t = boost::container::flat_set< letter_t, vcsn::less< L, letter_t >> |
using | value_type = letter_t |
The type of our values, when seen as a container. More... | |
using | iterator = typename letters_t::const_iterator |
using | const_iterator = typename letters_t::const_iterator |
Public Member Functions | |
set_alphabet ()=default | |
set_alphabet (const set_alphabet &)=default | |
set_alphabet (std::initializer_list< letter_t > l) | |
set_alphabet (const letters_t &l) | |
bool | open (bool o) const |
Whether unknown letters should be added, or rejected. More... | |
set_alphabet & | add_letter (letter_t l) |
Modify this by adding l, and return *this. More... | |
auto | add_range (letter_t l1, letter_t l2) -> set_alphabet & |
Add a range of letters, if it is accepted by the labelset. More... | |
template<typename Letter > | |
auto | add_range_ (Letter l1, Letter l2) -> std::enable_if_t< has_range< Letter > |
set_alphabet & | if (L::equal(l1, l2)) add_letter(l1) |
template<typename Letter > | |
auto | add_range_ (Letter, Letter) -> std::enable_if_t<!has_range< Letter > |
set_alphabet &bool | has (letter_t l) const |
Whether l is a letter. More... | |
word_t | get_word (std::istream &i) const |
Extract and return the next word from i. More... | |
const_iterator | begin () const |
const_iterator | end () const |
const_iterator | cbegin () const |
const_iterator | cend () const |
bool | empty () const |
Whether this alphabet has no letters. More... | |
const_iterator | find (letter_t l) const |
std::ostream & | print_set (std::ostream &o, format fmt={}) const |
Static Public Member Functions | |
static symbol | sname () |
static set_alphabet | make (std::istream &is) |
Public Attributes | |
return * | this |
Private Attributes | |
letters_t | alphabet_ |
bool | open_ = false |
Friends | |
set_alphabet | set_intersection (const set_alphabet &lhs, const set_alphabet &rhs) |
Compute the intersection with another alphabet. More... | |
set_alphabet | set_union (const set_alphabet &lhs, const set_alphabet &rhs) |
Compute the union with another alphabet. More... | |
A set of letters of type L.
L is not simply char
or so. Rather, see char_letters.
Definition at line 35 of file setalpha.hh.
using vcsn::set_alphabet< L >::const_iterator = typename letters_t::const_iterator |
Definition at line 245 of file setalpha.hh.
using vcsn::set_alphabet< L >::iterator = typename letters_t::const_iterator |
Definition at line 244 of file setalpha.hh.
using vcsn::set_alphabet< L >::letter_t = typename L::letter_t |
Definition at line 38 of file setalpha.hh.
using vcsn::set_alphabet< L >::letters_t = boost::container::flat_set<letter_t, vcsn::less<L, letter_t>> |
Definition at line 41 of file setalpha.hh.
using vcsn::set_alphabet< L >::value_type = letter_t |
The type of our values, when seen as a container.
Definition at line 43 of file setalpha.hh.
using vcsn::set_alphabet< L >::word_t = typename L::word_t |
Definition at line 39 of file setalpha.hh.
|
default |
|
default |
|
inline |
Definition at line 116 of file setalpha.hh.
|
inline |
Definition at line 123 of file setalpha.hh.
|
inline |
Modify this by adding l, and return *this.
Definition at line 138 of file setalpha.hh.
References vcsn::set_alphabet< L >::alphabet_, and vcsn::require().
Referenced by vcsn::set_alphabet< L >::has(), and vcsn::set_alphabet< L >::make().
|
inline |
Add a range of letters, if it is accepted by the labelset.
Definition at line 158 of file setalpha.hh.
Referenced by vcsn::set_alphabet< L >::make().
|
inline |
Definition at line 165 of file setalpha.hh.
|
inline |
Definition at line 179 of file setalpha.hh.
|
inline |
Definition at line 247 of file setalpha.hh.
References vcsn::set_alphabet< L >::alphabet_.
|
inline |
Definition at line 257 of file setalpha.hh.
References vcsn::set_alphabet< L >::alphabet_.
|
inline |
Definition at line 262 of file setalpha.hh.
References vcsn::set_alphabet< L >::alphabet_.
|
inline |
Whether this alphabet has no letters.
Definition at line 268 of file setalpha.hh.
References vcsn::set_alphabet< L >::alphabet_.
|
inline |
Definition at line 252 of file setalpha.hh.
References vcsn::set_alphabet< L >::alphabet_.
|
inline |
Definition at line 273 of file setalpha.hh.
References vcsn::set_alphabet< L >::alphabet_.
|
inline |
Extract and return the next word from i.
Definition at line 201 of file setalpha.hh.
References vcsn::set_alphabet< L >::has(), vcsn::require(), vcsn::str_escape(), and VCSN_REQUIRE.
|
inline |
Whether l is a letter.
Definition at line 187 of file setalpha.hh.
References vcsn::set_alphabet< L >::add_letter(), vcsn::set_alphabet< L >::alphabet_, vcsn::has(), and vcsn::set_alphabet< L >::open_.
Referenced by vcsn::set_alphabet< L >::get_word().
set_alphabet& vcsn::set_alphabet< L >::if | ( | L:: | equall1, l2 | ) |
|
inlinestatic |
Definition at line 51 of file setalpha.hh.
References vcsn::set_alphabet< L >::add_letter(), vcsn::set_alphabet< L >::add_range(), vcsn::eat(), vcsn::set_alphabet< L >::open_, and vcsn::set_alphabet< L >::sname().
|
inline |
Whether unknown letters should be added, or rejected.
o | whether to accept |
Definition at line 130 of file setalpha.hh.
References vcsn::set_alphabet< L >::open_.
|
inline |
Definition at line 279 of file setalpha.hh.
|
inlinestatic |
Definition at line 45 of file setalpha.hh.
References vcsn::sname().
Referenced by vcsn::set_alphabet< L >::make().
|
friend |
Compute the intersection with another alphabet.
Definition at line 331 of file setalpha.hh.
|
friend |
Compute the union with another alphabet.
Definition at line 338 of file setalpha.hh.
|
mutableprivate |
Definition at line 345 of file setalpha.hh.
Referenced by vcsn::set_alphabet< L >::add_letter(), vcsn::set_alphabet< L >::begin(), vcsn::set_alphabet< L >::cbegin(), vcsn::set_alphabet< L >::cend(), vcsn::set_alphabet< L >::empty(), vcsn::set_alphabet< L >::end(), vcsn::set_alphabet< L >::find(), and vcsn::set_alphabet< L >::has().
|
mutableprivate |
Definition at line 346 of file setalpha.hh.
Referenced by vcsn::set_alphabet< L >::has(), vcsn::set_alphabet< L >::make(), and vcsn::set_alphabet< L >::open().
return* vcsn::set_alphabet< L >::this |
Definition at line 175 of file setalpha.hh.