17 #ifndef AWALI_CORE_RAT_PRINTER_HH 
   18 # define AWALI_CORE_RAT_PRINTER_HH 
   28 namespace awali { 
namespace sttc
 
   33     template <
typename RatExpSet>
 
   35       : 
public RatExpSet::const_visitor
 
   41       using weight_t = 
typename context_t::weightset_t::value_t;
 
   43       using node_t = 
typename super_type::node_t;
 
   44       using inner_t = 
typename super_type::inner_t;
 
   45       template <type_t Type>
 
   47       template <type_t Type>
 
   49       using leaf_t = 
typename super_type::leaf_t;
 
   53               const bool debug = !!getenv(
"AWALI_PARENS"));
 
   70 # define DEFINE(Type)                                           \ 
   71       using Type ## _t = typename super_type::Type ## _t;       \ 
   72       virtual void visit(const Type ## _t& v) 
   75       DEFINE(complement)    { print(v, complement_); }
 
   76       DEFINE(conjunction)   { print(v, conjunction_); }
 
   77       DEFINE(ldiv)          { print(v, ldiv_); }
 
   80       DEFINE(prod)          { print(v, product_); }
 
   82       DEFINE(shuffle)       { print(v, shuffle_); }
 
   83       DEFINE(star)          { print(v, star_); }
 
   84       DEFINE(sum)           { print(v, sum_); }
 
   85       DEFINE(transposition) { print(v, transposition_); }
 
   97       enum class precedence_t
 
  116       precedence_t precedence(
const node_t& v) 
const;
 
  119       void print_child(
const node_t& child, 
const node_t& parent);
 
  122       template <rat::exp::type_t Type>
 
  123       void print(
const unary_t<Type>& n, 
const char* op);
 
  126       template <rat::exp::type_t Type>
 
  127       void print(
const variadic_t<Type>& n, 
const char* op);
 
  131       bool shows_left_weight_(
const node_t& n)
 
  147       const char* lgroup_ = 
nullptr;
 
  148       const char* rgroup_ = 
nullptr;
 
  150       const char* langle_ = 
nullptr;
 
  151       const char* rangle_ = 
nullptr;
 
  153       const char* lparen_ = 
nullptr;
 
  154       const char* rparen_ = 
nullptr;
 
  156       const char* lmul_ = 
nullptr;
 
  157       const char* rmul_ = 
nullptr;
 
  159       const char* ldiv_ = 
nullptr;
 
  161       const char* star_ = 
nullptr;
 
  162       const char* complement_ = 
nullptr;
 
  163       const char* transposition_ = 
nullptr;
 
  164       const char* conjunction_ = 
nullptr;
 
  165       const char* shuffle_ = 
nullptr;
 
  166       const char* product_ = 
nullptr;
 
  167       const char* sum_ = 
nullptr;
 
  169       const char* zero_ = 
nullptr;
 
  170       const char* one_ = 
nullptr;
 
Definition: printer.hh:36
 
std::ostream & operator()(const node_t &v)
Entry point: print v.
Definition: printer.hxx:72
 
typename ratexpset_t::const_visitor super_type
Definition: printer.hh:42
 
typename super_type::node_t node_t
Definition: printer.hh:43
 
RatExpSet ratexpset_t
Definition: printer.hh:38
 
std::ostream & operator()(const std::shared_ptr< const node_t > &v)
Entry point: print v.
Definition: printer.hh:63
 
typename super_type::leaf_t leaf_t
Definition: printer.hh:49
 
typename ratexpset_t::identities_t identities_t
Definition: printer.hh:40
 
typename super_type::inner_t inner_t
Definition: printer.hh:44
 
void format(const std::string &format)
Set output format.
Definition: printer.hxx:93
 
typename super_type::template unary_t< Type > unary_t
Definition: printer.hh:46
 
typename context_t::weightset_t::value_t weight_t
Definition: printer.hh:41
 
printer(const ratexpset_t &rs, std::ostream &out, const bool debug=!!getenv("AWALI_PARENS"))
Definition: printer.hxx:56
 
context_t_of< ratexpset_t > context_t
Definition: printer.hh:39
 
typename super_type::template variadic_t< Type > variadic_t
Definition: printer.hh:48
 
variadic< type_t::sum, Label, Weight > sum
Definition: fwd.hh:154
 
weight_node< type_t::lweight, Label, Weight > lweight
Definition: fwd.hh:164
 
unary< type_t::star, Label, Weight > star
Definition: fwd.hh:129
 
constant< type_t::zero, Label, Weight > zero
Definition: fwd.hh:113
 
variadic< type_t::ldiv, Label, Weight > ldiv
Definition: fwd.hh:148
 
variadic< type_t::conjunction, Label, Weight > conjunction
Definition: fwd.hh:145
 
variadic< type_t::shuffle, Label, Weight > shuffle
Definition: fwd.hh:151
 
weight_node< type_t::rweight, Label, Weight > rweight
Definition: fwd.hh:167
 
unary< type_t::transposition, Label, Weight > transposition
Definition: fwd.hh:132
 
constant< type_t::one, Label, Weight > one
Definition: fwd.hh:116
 
unary< type_t::complement, Label, Weight > complement
Definition: fwd.hh:126
 
variadic< type_t::prod, Label, Weight > prod
Definition: fwd.hh:142
 
typename internal::context_t_of_impl< internal::base_t< ValueSet > >::type context_t_of
Helper to retrieve the type of the context of a value set.
Definition: traits.hh:66
 
Main namespace of Awali.
Definition: ato.hh:22
 
#define DEFINE(Type)
Definition: printer.hh:70