24 static auto res =
symbol{
"char_letters"};
93 return w.substr(1, s-2);
115 return {w.rbegin(), w.rend()};
141 return uint8_t(l) < uint8_t(r);
160 return w.size() == 1;
184 if (quoted && res ==
'\'')
216 o <<
"\\backslash{}";
261 template <
typename T = letter_t>
268 char_letters::special<char_letters::letter_t>()
270 return special_letter();
276 char_letters::special<char_letters::word_t>()
278 return {special_letter()};
word_t mul(const letter_t l, const letter_t r) const
Concatenation.
bool is_letter(const word_t &w) const
Whether is a single-letter word.
Print as rich UTF-8 text, escaped.
static bool equal(const word_t &l, const word_t &r)
Whether l == r.
char get_char(std::istream &i)
Read a single char, with possible -escape support.
static bool less(const word_t &l, const word_t &r)
Whether l < r.
word_t undelimit(const word_t &w) const
Remove first and last characters, that must be "special".
std::ostream & str_escape(std::ostream &os, const std::string &str, const char *special=nullptr)
Output a string, escaping special characters.
Print as is. For instance, don't try to escape labels.
static bool less(const letter_t l, const letter_t r)
Whether l < r.
weightset_mixin< detail::r_impl > r
An input/output format for valuesets.
char eat(std::istream &is, char c)
Check lookahead character and advance.
Provide a variadic mul on top of a binary mul(), and one().
static bool equal(const letter_t l, const letter_t r)
Whether l == r.
bool is_letter(const letter_t) const
Whether is a letter.
static letter_t get_letter(std::istream &i, bool quoted=true)
Read one letter from i.
letter_t transpose(letter_t l) const
Mirror label.
std::ostream & print(const word_t &w, std::ostream &o, format fmt={}) const
Print a word.
static bool is_empty_word(const word_t &w)
Whether is one.
boost::flyweight< std::string, boost::flyweights::no_tracking, boost::flyweights::intermodule_holder > symbol
An internalized string.
word_t delimit(const word_t &w) const
Add the special character first and last.
Print as plain (ASCII) text, escaped.
std::ostream & print(const letter_t l, std::ostream &o, format fmt={}) const
Print a letter.
Represent alphabets whose "letters" are plain chars.
word_t mul(const letter_t l, const word_t &r) const
Concatenation.
word_t transpose(const word_t &w) const
Mirror label.
word_t to_word(const letter_t l) const
Convert to word.
static constexpr letter_t special_letter()
The reserved letter used to forge the labels for initial and final transitions.
Print as a parsable type string.
const word_t & to_word(const word_t &l) const
Convert to word.
static T special()
Special character, used to label transitions from pre() and to post().
word_t mul(const word_t &l, const letter_t r) const
Concatenation.
static constexpr letter_t one_letter()
The reserved letter used to forge the "one" label (the unit, the identity).
word_t mul(const word_t &l, const word_t &r) const
Concatenation.
static word_t empty_word()
One.