Vcsn
2.2a
Be Rational
|
Pretty-printer for rational expressions. More...
#include <dot.hh>
Classes | |
struct | visit_tuple |
struct | visit_tuple< false, Dummy > |
Public Types | |
using | expressionset_t = ExpSet |
using | super_t = typename expressionset_t::const_visitor |
using | self_t = dot_printer |
using | context_t = context_t_of< expressionset_t > |
using | identities_t = typename expressionset_t::identities_t |
using | labelset_t = labelset_t_of< context_t > |
using | label_t = label_t_of< context_t > |
using | weight_t = weight_t_of< context_t > |
using | node_t = typename super_t::node_t |
Actual node, without indirection. More... | |
using | value_t = typename node_t::value_t |
A shared_ptr to node_t. More... | |
template<type_t Type> | |
using | constant_t = typename super_t::template constant_t< Type > |
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 > |
Public Member Functions | |
dot_printer (const expressionset_t &rs, std::ostream &out) | |
A printer. More... | |
void | format (format fmt) |
Set output format. More... | |
std::ostream & | operator() (const value_t &v) |
Entry point: print v as a complete Dot graph. More... | |
std::ostream & | print (const value_t &v) |
Print an expression as a tree. More... | |
Static Public Member Functions | |
static constexpr const char * | me () |
Name of this algorithm, for error messages. More... | |
Private Types | |
using | tuple_t = typename super_t::tuple_t |
Private Member Functions | |
std::ostream & | print_ (const node_t &v) |
Easy recursion: print an expression. More... | |
VCSN_RAT_VISIT (atom, v) | |
VCSN_RAT_VISIT (complement, v) | |
VCSN_RAT_VISIT (conjunction, v) | |
VCSN_RAT_VISIT (infiltration, v) | |
VCSN_RAT_VISIT (ldiv, v) | |
VCSN_RAT_VISIT (lweight, v) | |
VCSN_RAT_VISIT (one, v) | |
VCSN_RAT_VISIT (prod, v) | |
VCSN_RAT_VISIT (rweight, v) | |
VCSN_RAT_VISIT (shuffle, v) | |
VCSN_RAT_VISIT (star, v) | |
VCSN_RAT_VISIT (sum, v) | |
VCSN_RAT_VISIT (transposition, v) | |
VCSN_RAT_VISIT (zero, v) | |
void | visit (const tuple_t &v, std::true_type) override |
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 constant_t< Type > &n, const char *op) |
Print a nullary node. More... | |
template<rat::exp::type_t Type> | |
void | print_ (const variadic_t< Type > &n, const char *op) |
Print a variadic node. More... | |
std::ostream & | print_ (const weight_t &w) |
Print a weight. More... | |
void | print_ (const lweight_t &n) |
Print a left-weight. More... | |
void | print_ (const rweight_t &n) |
Print a right-weight. More... | |
void | print_ (const atom_t &n) |
Print a label. More... | |
Private Attributes | |
std::ostream & | out_ |
Output stream. More... | |
class format | fmt_ |
Output format. More... | |
const expressionset_t & | rs_ |
The expressionset. More... | |
const bool | debug_ = !!getenv("VCSN_PARENS") |
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 * | lexponent_ = nullptr |
Left and right braces for exponents. More... | |
const char * | rexponent_ = nullptr |
const char * | lmul_ = nullptr |
External product. More... | |
const char * | rmul_ = nullptr |
const char * | ldiv_ = nullptr |
Quotient. More... | |
const char * | star_ = nullptr |
The expression operators. More... | |
const char * | complement_ = nullptr |
const char * | transposition_ = nullptr |
const char * | conjunction_ = nullptr |
const char * | infiltration_ = nullptr |
const char * | shuffle_ = nullptr |
const char * | product_ = nullptr |
const char * | sum_ = nullptr |
const char * | tuple_left = nullptr |
Left tuple delimiter. More... | |
const char * | tuple_middle = nullptr |
Tuple tape separator. More... | |
const char * | tuple_right = nullptr |
Right tuple delimiter. More... | |
const char * | zero_ = nullptr |
The constants. More... | |
const char * | one_ = nullptr |
unsigned int | exponent_threshold_ = 0 |
Pretty-printer for rational expressions.
using vcsn::rat::dot_printer< ExpSet >::constant_t = typename super_t::template constant_t<Type> |
using vcsn::rat::dot_printer< ExpSet >::context_t = context_t_of<expressionset_t> |
using vcsn::rat::dot_printer< ExpSet >::expressionset_t = ExpSet |
using vcsn::rat::dot_printer< ExpSet >::identities_t = typename expressionset_t::identities_t |
using vcsn::rat::dot_printer< ExpSet >::label_t = label_t_of<context_t> |
using vcsn::rat::dot_printer< ExpSet >::labelset_t = labelset_t_of<context_t> |
using vcsn::rat::dot_printer< ExpSet >::node_t = typename super_t::node_t |
using vcsn::rat::dot_printer< ExpSet >::self_t = dot_printer |
using vcsn::rat::dot_printer< ExpSet >::super_t = typename expressionset_t::const_visitor |
|
private |
using vcsn::rat::dot_printer< ExpSet >::unary_t = typename super_t::template unary_t<Type> |
using vcsn::rat::dot_printer< ExpSet >::value_t = typename node_t::value_t |
using vcsn::rat::dot_printer< ExpSet >::variadic_t = typename super_t::template variadic_t<Type> |
using vcsn::rat::dot_printer< ExpSet >::weight_t = weight_t_of<context_t> |
|
inline |
|
inline |
Set output format.
Definition at line 53 of file dot.hh.
References vcsn::rat::dot_printer< ExpSet >::complement_, vcsn::rat::dot_printer< ExpSet >::conjunction_, vcsn::rat::dot_printer< ExpSet >::exponent_threshold_, vcsn::rat::dot_printer< ExpSet >::fmt_, vcsn::rat::dot_printer< ExpSet >::infiltration_, vcsn::rat::dot_printer< ExpSet >::langle_, vcsn::format::latex, vcsn::rat::dot_printer< ExpSet >::ldiv_, vcsn::rat::dot_printer< ExpSet >::lexponent_, vcsn::rat::dot_printer< ExpSet >::lgroup_, vcsn::rat::dot_printer< ExpSet >::lmul_, vcsn::rat::dot_printer< ExpSet >::lparen_, vcsn::rat::dot_printer< ExpSet >::one_, vcsn::rat::dot_printer< ExpSet >::product_, vcsn::rat::dot_printer< ExpSet >::rangle_, vcsn::rat::dot_printer< ExpSet >::rexponent_, vcsn::rat::dot_printer< ExpSet >::rgroup_, vcsn::rat::dot_printer< ExpSet >::rmul_, vcsn::rat::dot_printer< ExpSet >::rparen_, vcsn::rat::dot_printer< ExpSet >::rs_, vcsn::rat::dot_printer< ExpSet >::shuffle_, vcsn::rat::dot_printer< ExpSet >::star_, vcsn::rat::dot_printer< ExpSet >::sum_, vcsn::format::text, vcsn::rat::dot_printer< ExpSet >::transposition_, vcsn::rat::dot_printer< ExpSet >::tuple_left, vcsn::rat::dot_printer< ExpSet >::tuple_middle, vcsn::rat::dot_printer< ExpSet >::tuple_right, vcsn::format::utf8, and vcsn::rat::dot_printer< ExpSet >::zero_.
|
inlinestatic |
|
inline |
Entry point: print v as a complete Dot graph.
Definition at line 144 of file dot.hh.
References vcsn::decendl(), vcsn::iendl(), vcsn::incendl(), vcsn::rat::dot_printer< ExpSet >::out_, and vcsn::rat::dot_printer< ExpSet >::print().
|
inline |
Print an expression as a tree.
Definition at line 155 of file dot.hh.
References vcsn::rat::dot_printer< ExpSet >::print_().
Referenced by vcsn::rat::dot_printer< ExpSet >::operator()(), and vcsn::rat::dot_printer< ExpSet >::print_().
|
inlineprivate |
Easy recursion: print an expression.
Definition at line 162 of file dot.hh.
References vcsn::rat::dot_printer< ExpSet >::out_.
Referenced by vcsn::rat::dot_printer< ExpSet >::print(), vcsn::rat::dot_printer< ExpSet >::print_(), and vcsn::rat::dot_printer< ExpSet >::VCSN_RAT_VISIT().
|
inlineprivate |
Print a unary node.
Definition at line 243 of file dot.hh.
References vcsn::address(), vcsn::iendl(), vcsn::rat::dot_printer< ExpSet >::out_, and vcsn::rat::dot_printer< ExpSet >::print().
|
inlineprivate |
Print a nullary node.
Definition at line 254 of file dot.hh.
References vcsn::address(), and vcsn::rat::dot_printer< ExpSet >::out_.
|
inlineprivate |
Print a variadic node.
Definition at line 262 of file dot.hh.
References vcsn::address(), vcsn::iendl(), vcsn::rat::dot_printer< ExpSet >::out_, and vcsn::rat::dot_printer< ExpSet >::print().
|
inlineprivate |
Print a weight.
Definition at line 278 of file dot.hh.
References vcsn::address(), vcsn::rat::dot_printer< ExpSet >::fmt_, vcsn::format::for_weights(), vcsn::rat::dot_printer< ExpSet >::out_, and vcsn::rat::dot_printer< ExpSet >::rs_.
|
inlineprivate |
Print a left-weight.
Definition at line 286 of file dot.hh.
References vcsn::address(), vcsn::iendl(), vcsn::rat::dot_printer< ExpSet >::out_, vcsn::rat::dot_printer< ExpSet >::print(), and vcsn::rat::dot_printer< ExpSet >::print_().
|
inlineprivate |
Print a right-weight.
Definition at line 299 of file dot.hh.
References vcsn::address(), vcsn::iendl(), vcsn::rat::dot_printer< ExpSet >::out_, vcsn::rat::dot_printer< ExpSet >::print(), and vcsn::rat::dot_printer< ExpSet >::print_().
|
inlineprivate |
Print a label.
Definition at line 312 of file dot.hh.
References vcsn::address(), vcsn::rat::dot_printer< ExpSet >::fmt_, vcsn::format::for_labels(), vcsn::rat::dot_printer< ExpSet >::out_, and vcsn::rat::dot_printer< ExpSet >::rs_.
|
inlineprivate |
Definition at line 168 of file dot.hh.
References vcsn::rat::dot_printer< ExpSet >::print_(), and vcsn::detail::v.
|
inlineprivate |
Definition at line 169 of file dot.hh.
References vcsn::rat::dot_printer< ExpSet >::complement_, vcsn::rat::dot_printer< ExpSet >::print_(), and vcsn::detail::v.
|
inlineprivate |
Definition at line 170 of file dot.hh.
References vcsn::rat::dot_printer< ExpSet >::conjunction_, vcsn::rat::dot_printer< ExpSet >::print_(), and vcsn::detail::v.
|
inlineprivate |
Definition at line 171 of file dot.hh.
References vcsn::rat::dot_printer< ExpSet >::infiltration_, vcsn::rat::dot_printer< ExpSet >::print_(), and vcsn::detail::v.
|
inlineprivate |
Definition at line 172 of file dot.hh.
References vcsn::rat::dot_printer< ExpSet >::ldiv_, vcsn::rat::dot_printer< ExpSet >::print_(), and vcsn::detail::v.
|
inlineprivate |
Definition at line 173 of file dot.hh.
References vcsn::rat::dot_printer< ExpSet >::print_(), and vcsn::detail::v.
|
inlineprivate |
Definition at line 174 of file dot.hh.
References vcsn::rat::dot_printer< ExpSet >::one_, vcsn::rat::dot_printer< ExpSet >::print_(), and vcsn::detail::v.
|
inlineprivate |
Definition at line 175 of file dot.hh.
References vcsn::rat::dot_printer< ExpSet >::print_(), vcsn::rat::dot_printer< ExpSet >::product_, and vcsn::detail::v.
|
inlineprivate |
Definition at line 176 of file dot.hh.
References vcsn::rat::dot_printer< ExpSet >::print_(), and vcsn::detail::v.
|
inlineprivate |
Definition at line 177 of file dot.hh.
References vcsn::rat::dot_printer< ExpSet >::print_(), vcsn::rat::dot_printer< ExpSet >::shuffle_, and vcsn::detail::v.
|
inlineprivate |
Definition at line 178 of file dot.hh.
References vcsn::rat::dot_printer< ExpSet >::print_(), vcsn::rat::dot_printer< ExpSet >::star_, and vcsn::detail::v.
|
inlineprivate |
Definition at line 179 of file dot.hh.
References vcsn::rat::dot_printer< ExpSet >::print_(), vcsn::rat::dot_printer< ExpSet >::sum_, and vcsn::detail::v.
|
inlineprivate |
Definition at line 180 of file dot.hh.
References vcsn::rat::dot_printer< ExpSet >::print_(), vcsn::rat::dot_printer< ExpSet >::transposition_, and vcsn::detail::v.
|
inlineprivate |
Definition at line 181 of file dot.hh.
References vcsn::rat::dot_printer< ExpSet >::print_(), vcsn::detail::v, and vcsn::rat::dot_printer< ExpSet >::zero_.
|
inlineoverrideprivate |
Definition at line 236 of file dot.hh.
References vcsn::detail::v.
|
private |
Definition at line 351 of file dot.hh.
Referenced by vcsn::rat::dot_printer< ExpSet >::format(), and vcsn::rat::dot_printer< ExpSet >::VCSN_RAT_VISIT().
|
private |
Definition at line 353 of file dot.hh.
Referenced by vcsn::rat::dot_printer< ExpSet >::format(), and vcsn::rat::dot_printer< ExpSet >::VCSN_RAT_VISIT().
|
private |
|
private |
Definition at line 369 of file dot.hh.
Referenced by vcsn::rat::dot_printer< ExpSet >::format().
|
private |
Output format.
Definition at line 323 of file dot.hh.
Referenced by vcsn::rat::dot_printer< ExpSet >::format(), vcsn::rat::dot_printer< ExpSet >::visit_tuple< bool, Dummy >::print_(), and vcsn::rat::dot_printer< ExpSet >::print_().
|
private |
Definition at line 354 of file dot.hh.
Referenced by vcsn::rat::dot_printer< ExpSet >::format(), and vcsn::rat::dot_printer< ExpSet >::VCSN_RAT_VISIT().
|
private |
Left and right angle brackets for weights.
Definition at line 336 of file dot.hh.
Referenced by vcsn::rat::dot_printer< ExpSet >::format().
|
private |
Quotient.
Definition at line 348 of file dot.hh.
Referenced by vcsn::rat::dot_printer< ExpSet >::format(), and vcsn::rat::dot_printer< ExpSet >::VCSN_RAT_VISIT().
|
private |
Left and right braces for exponents.
Definition at line 342 of file dot.hh.
Referenced by vcsn::rat::dot_printer< ExpSet >::format().
|
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 333 of file dot.hh.
Referenced by vcsn::rat::dot_printer< ExpSet >::format().
|
private |
External product.
Definition at line 345 of file dot.hh.
Referenced by vcsn::rat::dot_printer< ExpSet >::format().
|
private |
Left and right parentheses.
Definition at line 339 of file dot.hh.
Referenced by vcsn::rat::dot_printer< ExpSet >::format().
|
private |
Definition at line 368 of file dot.hh.
Referenced by vcsn::rat::dot_printer< ExpSet >::format(), and vcsn::rat::dot_printer< ExpSet >::VCSN_RAT_VISIT().
|
private |
Output stream.
Definition at line 321 of file dot.hh.
Referenced by vcsn::rat::dot_printer< ExpSet >::operator()(), vcsn::rat::dot_printer< ExpSet >::visit_tuple< bool, Dummy >::operator()(), vcsn::rat::dot_printer< ExpSet >::print_(), and vcsn::rat::dot_printer< ExpSet >::visit_tuple< bool, Dummy >::print_().
|
private |
Definition at line 356 of file dot.hh.
Referenced by vcsn::rat::dot_printer< ExpSet >::format(), and vcsn::rat::dot_printer< ExpSet >::VCSN_RAT_VISIT().
|
private |
Definition at line 337 of file dot.hh.
Referenced by vcsn::rat::dot_printer< ExpSet >::format().
|
private |
Definition at line 343 of file dot.hh.
Referenced by vcsn::rat::dot_printer< ExpSet >::format().
|
private |
Definition at line 334 of file dot.hh.
Referenced by vcsn::rat::dot_printer< ExpSet >::format().
|
private |
Definition at line 346 of file dot.hh.
Referenced by vcsn::rat::dot_printer< ExpSet >::format().
|
private |
Definition at line 340 of file dot.hh.
Referenced by vcsn::rat::dot_printer< ExpSet >::format().
|
private |
The expressionset.
Definition at line 325 of file dot.hh.
Referenced by vcsn::rat::dot_printer< ExpSet >::format(), vcsn::rat::dot_printer< ExpSet >::visit_tuple< bool, Dummy >::print_(), and vcsn::rat::dot_printer< ExpSet >::print_().
|
private |
Definition at line 355 of file dot.hh.
Referenced by vcsn::rat::dot_printer< ExpSet >::format(), and vcsn::rat::dot_printer< ExpSet >::VCSN_RAT_VISIT().
|
private |
The expression operators.
Definition at line 350 of file dot.hh.
Referenced by vcsn::rat::dot_printer< ExpSet >::format(), and vcsn::rat::dot_printer< ExpSet >::VCSN_RAT_VISIT().
|
private |
Definition at line 357 of file dot.hh.
Referenced by vcsn::rat::dot_printer< ExpSet >::format(), and vcsn::rat::dot_printer< ExpSet >::VCSN_RAT_VISIT().
|
private |
Definition at line 352 of file dot.hh.
Referenced by vcsn::rat::dot_printer< ExpSet >::format(), and vcsn::rat::dot_printer< ExpSet >::VCSN_RAT_VISIT().
|
private |
Left tuple delimiter.
Definition at line 360 of file dot.hh.
Referenced by vcsn::rat::dot_printer< ExpSet >::format().
|
private |
Tuple tape separator.
Definition at line 362 of file dot.hh.
Referenced by vcsn::rat::dot_printer< ExpSet >::format(), and vcsn::rat::dot_printer< ExpSet >::visit_tuple< bool, Dummy >::operator()().
|
private |
Right tuple delimiter.
Definition at line 364 of file dot.hh.
Referenced by vcsn::rat::dot_printer< ExpSet >::format().
|
private |
The constants.
Definition at line 367 of file dot.hh.
Referenced by vcsn::rat::dot_printer< ExpSet >::format(), and vcsn::rat::dot_printer< ExpSet >::VCSN_RAT_VISIT().