![]() |
Vcsn
2.0
Be Rational
|
#include <fwd.hh>
Public Types | |
| using | ratexpset_t = RatExpSet |
| using | context_t = context_t_of< ratexpset_t > |
| using | identities_t = typename ratexpset_t::identities_t |
| using | weight_t = typename context_t::weightset_t::value_t |
| using | super_t = typename ratexpset_t::const_visitor |
| using | node_t = typename super_t::node_t |
| using | inner_t = typename super_t::inner_t |
| template<type_t Type> | |
| using | unary_t = typename super_t::template unary_t< Type > |
| template<type_t Type> | |
| using | variadic_t = typename super_t::template variadic_t< Type > |
| using | leaf_t = typename super_t::leaf_t |
Public Member Functions | |
| printer (const ratexpset_t &rs, std::ostream &out, const bool debug=!!getenv("VCSN_PARENS")) | |
| void | format (symbol format) |
| Set output format. More... | |
| std::ostream & | operator() (const node_t &v) |
| Entry point: print v. More... | |
| std::ostream & | operator() (const std::shared_ptr< const node_t > &v) |
| Entry point: print v. More... | |
| template<type_t Type> | |
| auto | print_ (const unary_t< Type > &v, const char *op) -> void |
| template<type_t Type> | |
| auto | print_ (const variadic_t< Type > &n, const char *op) -> void |
Private Types | |
| enum | precedence_t { precedence_t::sum, precedence_t::shuffle, precedence_t::conjunction, precedence_t::ldiv, precedence_t::prod, precedence_t::word = prod, precedence_t::lweight, precedence_t::rweight, precedence_t::star, precedence_t::complement, precedence_t::transposition, precedence_t::zero, precedence_t::one, precedence_t::atom } |
| The possible node precedence levels, increasing. More... | |
| using | atom_t = typename super_t::atom_t |
| using | complement_t = typename super_t::complement_t |
| using | conjunction_t = typename super_t::conjunction_t |
| using | ldiv_t = typename super_t::ldiv_t |
| using | lweight_t = typename super_t::lweight_t |
| using | one_t = typename super_t::one_t |
| using | prod_t = typename super_t::prod_t |
| using | rweight_t = typename super_t::rweight_t |
| using | shuffle_t = typename super_t::shuffle_t |
| using | star_t = typename super_t::star_t |
| using | sum_t = typename super_t::sum_t |
| using | transposition_t = typename super_t::transposition_t |
| using | zero_t = typename super_t::zero_t |
Private Member Functions | |
| virtual void | visit (const atom_t &v) |
| virtual void | visit (const complement_t &v) |
| virtual void | visit (const conjunction_t &v) |
| virtual void | visit (const ldiv_t &v) |
| virtual void | visit (const lweight_t &v) |
| virtual void | visit (const one_t &v) |
| virtual void | visit (const prod_t &v) |
| virtual void | visit (const rweight_t &v) |
| virtual void | visit (const shuffle_t &v) |
| virtual void | visit (const star_t &v) |
| virtual void | visit (const sum_t &v) |
| virtual void | visit (const transposition_t &v) |
| virtual void | visit (const zero_t &v) |
| bool | is_word_ (const node_t &v) const |
| Whether is an atom whose label is not a letter. More... | |
| precedence_t | precedence_ (const node_t &v) const |
| The precedence of v (to decide when to print parens). More... | |
| void | print_child_ (const node_t &child, const node_t &parent) |
| Print the given child node, also knowing its parent. More... | |
| template<rat::exp::type_t Type> | |
| void | print_ (const unary_t< Type > &n, const char *op) |
| Print a unary node. More... | |
| template<rat::exp::type_t Type> | |
| void | print_ (const variadic_t< Type > &n, const char *op) |
| Print an n-ary node. More... | |
| ATTRIBUTE_PURE bool | shows_left_weight_ (const node_t &n) |
| Whether the left weight shows. More... | |
Private Attributes | |
| std::ostream & | out_ |
| Output stream. More... | |
| std::string | format_ |
| Output format. More... | |
| const context_t & | ctx_ |
| Context to decode labels and weights. More... | |
| const identities_t | identities_ |
| const bool | debug_ |
| Whether to be overly verbose. More... | |
| const char * | lgroup_ = nullptr |
| Left and right boundaries (typically braces for LaTeX). More... | |
| const char * | rgroup_ = nullptr |
| const char * | langle_ = nullptr |
| Left and right angle brackets for weights. More... | |
| const char * | rangle_ = nullptr |
| const char * | lparen_ = nullptr |
| Left and right parentheses. More... | |
| const char * | rparen_ = nullptr |
| const char * | lmul_ = nullptr |
| External product. More... | |
| const char * | rmul_ = nullptr |
| const char * | ldiv_ = nullptr |
| Quotient. More... | |
| const char * | star_ = nullptr |
| The ratexp operators. More... | |
| const char * | complement_ = nullptr |
| const char * | transposition_ = nullptr |
| const char * | conjunction_ = nullptr |
| const char * | shuffle_ = nullptr |
| const char * | product_ = nullptr |
| const char * | sum_ = nullptr |
| const char * | zero_ = nullptr |
| The constants. More... | |
| const char * | one_ = nullptr |
|
private |
Definition at line 59 of file printer.hh.
|
private |
Definition at line 60 of file printer.hh.
|
private |
Definition at line 61 of file printer.hh.
| using vcsn::rat::printer< Context >::context_t = context_t_of<ratexpset_t> |
Definition at line 24 of file printer.hh.
| using vcsn::rat::printer< Context >::identities_t = typename ratexpset_t::identities_t |
Definition at line 25 of file printer.hh.
| using vcsn::rat::printer< Context >::inner_t = typename super_t::inner_t |
Definition at line 29 of file printer.hh.
|
private |
Definition at line 62 of file printer.hh.
| using vcsn::rat::printer< Context >::leaf_t = typename super_t::leaf_t |
Definition at line 34 of file printer.hh.
|
private |
Definition at line 63 of file printer.hh.
| using vcsn::rat::printer< Context >::node_t = typename super_t::node_t |
Definition at line 28 of file printer.hh.
|
private |
Definition at line 64 of file printer.hh.
|
private |
Definition at line 65 of file printer.hh.
| using vcsn::rat::printer< Context >::ratexpset_t = RatExpSet |
Definition at line 23 of file printer.hh.
|
private |
Definition at line 66 of file printer.hh.
|
private |
Definition at line 67 of file printer.hh.
|
private |
Definition at line 68 of file printer.hh.
|
private |
Definition at line 69 of file printer.hh.
| using vcsn::rat::printer< Context >::super_t = typename ratexpset_t::const_visitor |
Definition at line 27 of file printer.hh.
|
private |
Definition at line 70 of file printer.hh.
| using vcsn::rat::printer< Context >::unary_t = typename super_t::template unary_t<Type> |
Definition at line 31 of file printer.hh.
| using vcsn::rat::printer< Context >::variadic_t = typename super_t::template variadic_t<Type> |
Definition at line 33 of file printer.hh.
| using vcsn::rat::printer< Context >::weight_t = typename context_t::weightset_t::value_t |
Definition at line 26 of file printer.hh.
|
private |
Definition at line 71 of file printer.hh.
|
strongprivate |
The possible node precedence levels, increasing.
When printing a word (i.e., a label with several letters), beware that it may require parens. Think of star(atom(ab)): if we print it as 'ab*', it actually means 'a(b*)'. Then give words a precedence lower than that of star. This is the role of 'word' below.
| Enumerator | |
|---|---|
| sum | |
| shuffle | |
| conjunction | |
| ldiv | |
| prod | |
| word | |
| lweight | |
| rweight | |
| star | |
| complement | |
| transposition | |
| zero | |
| one | |
| atom | |
Definition at line 89 of file printer.hh.
|
inline |
Definition at line 41 of file printer.hxx.
|
inline |
Set output format.
Definition at line 75 of file printer.hxx.
References vcsn::dyn::detail::product_(), vcsn::rat::series, vcsn::dyn::detail::shuffle_(), and vcsn::str_escape().
|
inlineprivate |
Whether is an atom whose label is not a letter.
Definition at line 76 of file printer.hh.
References vcsn::rat::printer< Context >::ctx_.
|
inline |
Entry point: print v.
Definition at line 57 of file printer.hxx.
References vcsn::address(), vcsn::decendl(), vcsn::incendl(), vcsn::print(), and vcsn::rat::series.
Referenced by vcsn::rat::printer< Context >::operator()().
|
inline |
Entry point: print v.
Definition at line 48 of file printer.hh.
References vcsn::rat::printer< Context >::operator()().
|
inlineprivate |
The precedence of v (to decide when to print parens).
Definition at line 126 of file printer.hxx.
References CASE.
|
private |
Print a unary node.
Referenced by vcsn::rat::printer< Context >::visit().
|
private |
Print an n-ary node.
|
inline |
Definition at line 216 of file printer.hxx.
|
inline |
Definition at line 227 of file printer.hxx.
|
inlineprivate |
Print the given child node, also knowing its parent.
Definition at line 192 of file printer.hxx.
|
inlineprivate |
Whether the left weight shows.
Definition at line 123 of file printer.hh.
References vcsn::rat::lweight.
|
inlineprivatevirtual |
Definition at line 187 of file printer.hxx.
|
inlineprivatevirtual |
Definition at line 60 of file printer.hh.
References vcsn::rat::printer< Context >::complement_, and vcsn::rat::printer< Context >::print_().
|
inlineprivatevirtual |
Definition at line 61 of file printer.hh.
References vcsn::rat::printer< Context >::conjunction_, and vcsn::rat::printer< Context >::print_().
|
inlineprivatevirtual |
Definition at line 62 of file printer.hh.
References vcsn::rat::printer< Context >::ldiv_, and vcsn::rat::printer< Context >::print_().
|
inlineprivatevirtual |
Definition at line 159 of file printer.hxx.
|
inlineprivatevirtual |
Definition at line 181 of file printer.hxx.
|
inlineprivatevirtual |
Definition at line 65 of file printer.hh.
References vcsn::rat::printer< Context >::print_(), and vcsn::rat::printer< Context >::product_.
|
inlineprivatevirtual |
Definition at line 167 of file printer.hxx.
|
inlineprivatevirtual |
Definition at line 67 of file printer.hh.
References vcsn::rat::printer< Context >::print_(), and vcsn::rat::printer< Context >::shuffle_.
|
inlineprivatevirtual |
Definition at line 68 of file printer.hh.
References vcsn::rat::printer< Context >::print_(), and vcsn::rat::printer< Context >::star_.
|
inlineprivatevirtual |
Definition at line 69 of file printer.hh.
References vcsn::rat::printer< Context >::print_(), and vcsn::rat::printer< Context >::sum_.
|
inlineprivatevirtual |
Definition at line 70 of file printer.hh.
References vcsn::rat::printer< Context >::print_(), and vcsn::rat::printer< Context >::transposition_.
|
inlineprivatevirtual |
Definition at line 175 of file printer.hxx.
|
private |
Definition at line 157 of file printer.hh.
Referenced by vcsn::rat::printer< Context >::visit().
|
private |
Definition at line 159 of file printer.hh.
Referenced by vcsn::rat::printer< Context >::visit().
|
private |
Context to decode labels and weights.
Definition at line 133 of file printer.hh.
Referenced by vcsn::rat::printer< Context >::is_word_().
|
private |
Whether to be overly verbose.
Definition at line 136 of file printer.hh.
|
private |
Output format.
Definition at line 131 of file printer.hh.
|
private |
Definition at line 134 of file printer.hh.
|
private |
Left and right angle brackets for weights.
Definition at line 145 of file printer.hh.
|
private |
Quotient.
Definition at line 154 of file printer.hh.
Referenced by vcsn::rat::printer< Context >::visit().
|
private |
Left and right boundaries (typically braces for LaTeX).
Used to group operand of unary operators, e.g. "a" -> "a", "a*" -> "{a}^{*}" and "a**" -> "{{a}^{*}}^{*}".
Definition at line 142 of file printer.hh.
|
private |
External product.
Definition at line 151 of file printer.hh.
|
private |
Left and right parentheses.
Definition at line 148 of file printer.hh.
|
private |
Definition at line 165 of file printer.hh.
|
private |
Output stream.
Definition at line 129 of file printer.hh.
|
private |
Definition at line 161 of file printer.hh.
Referenced by vcsn::rat::printer< Context >::visit().
|
private |
Definition at line 146 of file printer.hh.
|
private |
Definition at line 143 of file printer.hh.
|
private |
Definition at line 152 of file printer.hh.
|
private |
Definition at line 149 of file printer.hh.
|
private |
Definition at line 160 of file printer.hh.
Referenced by vcsn::rat::printer< Context >::visit().
|
private |
The ratexp operators.
Definition at line 156 of file printer.hh.
Referenced by vcsn::rat::printer< Context >::visit().
|
private |
Definition at line 162 of file printer.hh.
Referenced by vcsn::rat::printer< Context >::visit().
|
private |
Definition at line 158 of file printer.hh.
Referenced by vcsn::rat::printer< Context >::visit().
|
private |
The constants.
Definition at line 164 of file printer.hh.