1 #ifndef VCSN_ALPHABETS_CHAR_HH
2 # define VCSN_ALPHABETS_CHAR_HH
21 return "char_letters";
24 virtual std::string
vname(
bool =
true)
const
88 return w.substr(1, s-2);
107 return {w.rbegin(), w.rend()};
137 return w.size() == 1;
159 require(res != EOF,
"invalid label: unexpected end-of-file");
193 o << ((s == 1) ?
"" :
str_escape(w.substr(1)));
203 template <
typename T = letter_t>
210 char_letters::special<char_letters::letter_t>()
212 return special_letter();
218 char_letters::special<char_letters::word_t>()
220 return {special_letter()};
225 #endif // !VCSN_ALPHABETS_CHAR_HH
bool is_letter(const letter_t &) const
word_t undelimit(const word_t &w) const
Remove first and last characters, that must be "special".
const word_t & to_word(const word_t &l) const
virtual std::string vname(bool=true) const
static word_t empty_word()
word_t delimit(const word_t &w) const
Add the special character first and last.
word_t concat(const word_t &l, const letter_t r) const
std::ostream & str_escape(std::ostream &os, const std::string &str)
Output a string, escaping special characters.
word_t concat(const word_t &l, const word_t &r) const
bool equals(const word_t &w1, const word_t &w2) const
word_t transpose(const word_t &w) const
static letter_t get_letter(std::istream &i)
Read one letter from i.
static T special()
Special character, used to label transitions from pre() and to post().
letter_t transpose(letter_t l) const
static constexpr letter_t special_letter()
The reserved letter used to forge the labels for initial and final transitions.
static std::string sname()
static constexpr letter_t one_letter()
The reserved letter used to forge the "one" label (the unit, the identity).
word_t to_word(const letter_t l) const
static char get_char(std::istream &i)
Read a single char, with possible -escape support.
static bool is_empty_word(const word_t &w)
Provide a variadic mul on top of a binary mul(), and one().
std::ostream & print(const letter_t &l, std::ostream &o) const
word_t concat(const letter_t l, const word_t &r) const
bool equals(const letter_t &l1, const letter_t &l2) const
bool is_letter(const word_t &w) const
word_t concat(const letter_t l, const letter_t r) const
variadic_mul_mixin< detail::r_impl > r
void require(bool b, Args &&...args)
If b is not verified, raise an error with args as message.
std::ostream & print(const word_t &w, std::ostream &o) const