Vcsn  2.3
Be Rational
vcsn::char_letters Class Reference

Represent alphabets whose "letters" are plain chars. More...

#include <char.hh>

Collaboration diagram for vcsn::char_letters:

Public Types

using letter_t = char
 
using word_t = std::string
 

Public Member Functions

word_t to_word (const letter_t l) const
 Convert to word. More...
 
const word_tto_word (const word_t &l) const
 Convert to word. More...
 
word_t mul (const letter_t l, const letter_t r) const
 Concatenation. More...
 
word_t mul (const word_t &l, const letter_t r) const
 Concatenation. More...
 
word_t mul (const letter_t l, const word_t &r) const
 Concatenation. More...
 
word_t mul (const word_t &l, const word_t &r) const
 Concatenation. More...
 
word_t delimit (const word_t &w) const
 Add the special character first and last. More...
 
word_t undelimit (const word_t &w) const
 Remove first and last characters, that must be "special". More...
 
word_t transpose (const word_t &w) const
 Mirror label. More...
 
letter_t transpose (letter_t l) const
 Mirror label. More...
 
bool is_letter (const letter_t) const
 Whether is a letter. More...
 
bool is_letter (const word_t &w) const
 Whether is a single-letter word. More...
 
std::ostream & print (const letter_t l, std::ostream &o, format fmt={}) const
 Print a letter. More...
 
std::ostream & print (const word_t &w, std::ostream &o, format fmt={}) const
 Print a word. More...
 

Static Public Member Functions

static symbol sname ()
 
static word_t empty_word ()
 One. More...
 
static bool is_empty_word (const word_t &w)
 Whether is one. More...
 
static bool equal (const letter_t l, const letter_t r)
 Whether l == r. More...
 
static bool equal (const word_t &l, const word_t &r)
 Whether l == r. More...
 
static bool less (const letter_t l, const letter_t r)
 Whether l < r. More...
 
static bool less (const word_t &l, const word_t &r)
 Whether l < r. More...
 
static constexpr letter_t one_letter ()
 The reserved letter used to forge the "one" label (the unit, the identity). More...
 
static letter_t get_letter (std::istream &i, bool quoted=true)
 Read one letter from i. More...
 
template<typename T = letter_t>
static T special ()
 Special character, used to label transitions from pre() and to post(). More...
 

Static Private Member Functions

static constexpr letter_t special_letter ()
 The reserved letter used to forge the labels for initial and final transitions. More...
 

Detailed Description

Represent alphabets whose "letters" are plain chars.

Definition at line 16 of file char.hh.

Member Typedef Documentation

Definition at line 19 of file char.hh.

using vcsn::char_letters::word_t = std::string

Definition at line 20 of file char.hh.

Member Function Documentation

word_t vcsn::char_letters::delimit ( const word_t w) const
inline

Add the special character first and last.

Definition at line 81 of file char.hh.

References mul(), and special_letter().

Here is the call graph for this function:

static word_t vcsn::char_letters::empty_word ( )
inlinestatic

One.

Definition at line 98 of file char.hh.

static bool vcsn::char_letters::equal ( const letter_t  l,
const letter_t  r 
)
inlinestatic

Whether l == r.

Definition at line 126 of file char.hh.

static bool vcsn::char_letters::equal ( const word_t l,
const word_t r 
)
inlinestatic

Whether l == r.

Definition at line 132 of file char.hh.

static letter_t vcsn::char_letters::get_letter ( std::istream &  i,
bool  quoted = true 
)
inlinestatic

Read one letter from i.

Either a single char, or a "letter" enclosed in single-quotes.

Definition at line 181 of file char.hh.

References vcsn::eat(), vcsn::get_char(), and vcsn::res.

Here is the call graph for this function:

static bool vcsn::char_letters::is_empty_word ( const word_t w)
inlinestatic

Whether is one.

Definition at line 105 of file char.hh.

bool vcsn::char_letters::is_letter ( const letter_t  ) const
inline

Whether is a letter.

Definition at line 152 of file char.hh.

bool vcsn::char_letters::is_letter ( const word_t w) const
inline

Whether is a single-letter word.

Definition at line 158 of file char.hh.

static bool vcsn::char_letters::less ( const letter_t  l,
const letter_t  r 
)
inlinestatic

Whether l < r.

Definition at line 138 of file char.hh.

static bool vcsn::char_letters::less ( const word_t l,
const word_t r 
)
inlinestatic

Whether l < r.

Definition at line 145 of file char.hh.

word_t vcsn::char_letters::mul ( const letter_t  l,
const letter_t  r 
) const
inline

Concatenation.

Definition at line 44 of file char.hh.

References one_letter().

Referenced by delimit().

Here is the call graph for this function:

word_t vcsn::char_letters::mul ( const word_t l,
const letter_t  r 
) const
inline

Concatenation.

Definition at line 61 of file char.hh.

References one_letter().

Here is the call graph for this function:

word_t vcsn::char_letters::mul ( const letter_t  l,
const word_t r 
) const
inline

Concatenation.

Definition at line 68 of file char.hh.

References one_letter().

Here is the call graph for this function:

word_t vcsn::char_letters::mul ( const word_t l,
const word_t r 
) const
inline

Concatenation.

Definition at line 75 of file char.hh.

static constexpr letter_t vcsn::char_letters::one_letter ( )
inlinestatic

The reserved letter used to forge the "one" label (the unit, the identity).

Definition at line 165 of file char.hh.

Referenced by mul().

std::ostream& vcsn::char_letters::print ( const letter_t  l,
std::ostream &  o,
format  fmt = {} 
) const
inline

Print a letter.

Definition at line 197 of file char.hh.

std::ostream& vcsn::char_letters::print ( const word_t w,
std::ostream &  o,
format  fmt = {} 
) const
inline

Print a word.

Definition at line 237 of file char.hh.

static symbol vcsn::char_letters::sname ( )
inlinestatic

Definition at line 22 of file char.hh.

References vcsn::res.

template<typename T = letter_t>
static T vcsn::char_letters::special ( )
static

Special character, used to label transitions from pre() and to post().

static constexpr letter_t vcsn::char_letters::special_letter ( )
inlinestaticprivate

The reserved letter used to forge the labels for initial and final transitions.

Use the public special() interface.

The value is chosen to put subliminal transitions last when sorted. Requires unsigned comparison.

Definition at line 175 of file char.hh.

Referenced by delimit(), and undelimit().

word_t vcsn::char_letters::to_word ( const letter_t  l) const
inline

Convert to word.

Definition at line 30 of file char.hh.

const word_t& vcsn::char_letters::to_word ( const word_t l) const
inline

Convert to word.

Definition at line 37 of file char.hh.

word_t vcsn::char_letters::transpose ( const word_t w) const
inline

Mirror label.

Definition at line 112 of file char.hh.

letter_t vcsn::char_letters::transpose ( letter_t  l) const
inline

Mirror label.

Definition at line 120 of file char.hh.

word_t vcsn::char_letters::undelimit ( const word_t w) const
inline

Remove first and last characters, that must be "special".

Definition at line 87 of file char.hh.

References special_letter().

Here is the call graph for this function:


The documentation for this class was generated from the following file: