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.
Print as is. For instance, don't try to escape labels.
letter_t transpose(letter_t l) const
Mirror label.
char eat(std::istream &is, char c)
Check lookahead character and advance.
Print as a parsable type string.
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.
word_t delimit(const word_t &w) const
Add the special character first and last.
word_t mul(const letter_t l, const word_t &r) const
Concatenation.
An input/output format for valuesets.
weightset_mixin< detail::r_impl > r
static constexpr letter_t one_letter()
The reserved letter used to forge the "one" label (the unit, the identity).
Provide a variadic mul on top of a binary mul(), and one().
word_t mul(const word_t &l, const word_t &r) const
Concatenation.
boost::flyweight< std::string, boost::flyweights::no_tracking, boost::flyweights::intermodule_holder > symbol
An internalized string.
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.
Print as rich UTF-8 text, escaped.
word_t mul(const word_t &l, const letter_t r) const
Concatenation.
Print as plain (ASCII) text, escaped.
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".
char get_char(std::istream &i)
Read a single char, with possible -escape support.
std::ostream & str_escape(std::ostream &os, const std::string &str, const char *special=nullptr)
Output a string, escaping special characters.
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.
Represent alphabets whose "letters" are plain chars.
static letter_t get_letter(std::istream &i, bool quoted=true)
Read one letter from i.
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.
std::ostream & print(const letter_t l, std::ostream &o, format fmt={}) const
Print a letter.
word_t transpose(const word_t &w) const
Mirror label.
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.