5 #include <vcsn/dyn/registries.hh>
28 else if (format ==
"latex" || format ==
"utf8")
29 detail::print_expansion_registry().call(w, out, format);
30 else if (format ==
"text" || format ==
"default" || format ==
"")
35 const std::string format =
"text";
36 detail::print_expansion_registry().call(w, out, format);
39 raise(
"invalid output format for expansion: ",
str_escape(format));
54 else if (format ==
"null")
56 else if (format ==
"dot"
57 || format ==
"dot,logical" || format ==
"dot,physical"
58 || format ==
"latex" || format ==
"utf8")
59 detail::print_expression_registry().call(exp, out, format);
60 else if (format ==
"text" || format ==
"default" || format ==
"")
65 const std::string format =
"text";
66 detail::print_expression_registry().call(exp, out, format);
69 raise(
"invalid output format for expression: ",
str_escape(format));
81 print(
const dyn::label& w, std::ostream& out,
const std::string& format)
85 else if (format ==
"latex" || format ==
"utf8")
86 detail::print_label_registry().call(w, out, format);
87 else if (format ==
"text" || format ==
"default" || format ==
"")
92 const std::string format =
"text";
93 detail::print_label_registry().call(w, out, format);
96 raise(
"invalid output format for label: ",
str_escape(format));
108 print(
const polynomial& p, std::ostream& out,
const std::string& format)
110 if (format ==
"list")
111 detail::list_polynomial_registry().call(p, out);
112 else if (format ==
"null")
114 else if (format ==
"latex" || format ==
"utf8")
115 detail::print_polynomial_registry().call(p, out, format);
116 else if (format ==
"text" || format ==
"default" || format ==
"")
121 const std::string format =
"text";
122 detail::print_polynomial_registry().call(p, out, format);
125 raise(
"invalid output format for polynomial: ",
str_escape(format));
139 if (format ==
"null")
141 else if (format ==
"latex" || format ==
"utf8")
142 detail::print_weight_registry().call(w, out, format);
143 else if (format ==
"text" || format ==
"default" || format ==
"")
148 const std::string format =
"text";
149 detail::print_weight_registry().call(w, out, format);
152 raise(
"invalid output format for weight: ",
str_escape(format));
166 static auto formats = std::set<std::string>{};
std::ostream & print(const automaton &aut, std::ostream &out=std::cout, const std::string &format="default")
Print automaton a on out using format format.
std::ostream & print_polynomial(const polynomial &polynomial, std::ostream &o, const std::string &fmt)
Bridge (print).
value_impl< detail::weight_tag > weight
An input/output format for valuesets.
Provide a variadic mul on top of a binary mul(), and one().
std::ostream & list_polynomial(const polynomial &polynomial, std::ostream &o)
Bridge (list).
std::string get_format(std::ostream &out)
Get the output format for out.
std::ostream & print_expansion(const expansion &expansion, std::ostream &o, const std::string &fmt)
Bridge (print).
Declaration of vcsn::xalloc.
std::ostream & print_expression(const expression &exp, std::ostream &o, const std::string &fmt)
Bridge (print).
xalloc< const std::string * > format_flag
Allocate slots in std::ostreams.
auto out(const Aut &aut, state_t_of< Aut > s)
Indexes of visible transitions leaving state s.
Template-less root for contexts.
std::ostream & operator<<(std::ostream &o, const automaton &a)
Output automaton a on o.
std::ostream & str_escape(std::ostream &os, const std::string &str, const char *special=nullptr)
Output a string, escaping special characters.
std::ostream & print_label(const label &label, std::ostream &o, const std::string &fmt)
Bridge (print).
std::ostream & print_weight(const weight &weight, std::ostream &o, const std::string &fmt)
Bridge (print).
value_impl< detail::label_tag > label
value_impl< detail::expression_tag > expression
void set_format(std::ostream &out, const std::string &format)
Specify the output format for out.
std::ostream & info(const automaton &aut, std::ostream &out=std::cout, unsigned details=2)
Output various facts about an automaton.
value_impl< detail::polynomial_tag > polynomial