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{}";
230 str_escape(o, l, fmt.meta() ? fmt.meta() :
"|',[-]<> ");
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 to_word(const letter_t l) const
Convert to word.
letter_t transpose(letter_t l) const
Mirror label.
static constexpr letter_t special_letter()
The reserved letter used to forge the labels for initial and final transitions.
const word_t & to_word(const word_t &l) const
Convert to word.
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.
std::ostream & str_escape(std::ostream &os, const std::string &str, const char *special=nullptr)
Output a string, escaping special characters.
word_t mul(const letter_t l, const word_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.
Print as a parsable type string.
char get_char(std::istream &i)
Read a single char, with possible -escape support.
static T special()
Special character, used to label transitions from pre() and to post().
bool is_letter(const word_t &w) const
Whether is a single-letter word.
word_t mul(const word_t &l, const letter_t r) const
Concatenation.
static bool less(const word_t &l, const word_t &r)
Whether l < r.
static word_t empty_word()
One.
word_t undelimit(const word_t &w) const
Remove first and last characters, that must be "special".
An input/output format for valuesets.
static bool less(const letter_t l, const letter_t r)
Whether l < r.
word_t mul(const letter_t l, const letter_t r) const
Concatenation.
Print as is. For instance, don't try to escape labels.
Represent alphabets whose "letters" are plain chars.
static letter_t get_letter(std::istream &i, bool quoted=true)
Read one letter from i.
Print as rich UTF-8 text, escaped.
static bool equal(const word_t &l, const word_t &r)
Whether l == r.
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.
Provide a variadic mul on top of a binary mul(), and one().
Print as plain (ASCII) text, escaped.
std::ostream & print(const letter_t l, std::ostream &o, format fmt={}) const
Print a letter.
char eat(std::istream &is, char c)
Check lookahead character and advance.
word_t transpose(const word_t &w) const
Mirror label.
weightset_mixin< detail::r_impl > r
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.