Vcsn  2.0
Be Rational
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
info.hxx
Go to the documentation of this file.
1 #ifndef VCSN_CORE_RAT_INFO_HXX
2 # define VCSN_CORE_RAT_INFO_HXX
3 
4 namespace vcsn
5 {
6  namespace rat
7  {
8 
9 # define DEFINE \
10  template <typename RatExpSet> \
11  inline \
12  auto \
13  info<RatExpSet>
14 
15  DEFINE::operator()(const node_t& v)
16  -> void
17  {
18  atom = 0;
19  complement = 0;
20  conjunction = 0;
21  lweight = 0;
22  ldiv = 0;
23  one = 0;
24  prod = 0;
25  rweight = 0;
26  shuffle = 0;
27  star = 0;
28  sum = 0;
29  transposition = 0;
30  zero = 0;
31  v.accept(*this);
32  }
33 
34 # define VISIT(Type) \
35  DEFINE::visit(const Type ## _t& v) \
36  -> void
37 
39  {
40  ++sum;
41  for (const auto& c: v)
42  c->accept(*this);
43  }
44 
46  {
47  ++prod;
48  for (const auto& c: v)
49  c->accept(*this);
50  }
51 
53  {
54  ++conjunction;
55  for (const auto& c: v)
56  c->accept(*this);
57  }
58 
60  {
61  ++shuffle;
62  for (const auto& c: v)
63  c->accept(*this);
64  }
65 
66 
68  {
69  ++ldiv;
70  for (const auto& c: v)
71  c->accept(*this);
72  }
73 
75  {
76  ++star;
77  v.sub()->accept(*this);
78  }
79 
81  {
82  ++complement;
83  v.sub()->accept(*this);
84  }
85 
87  {
88  ++transposition;
89  v.sub()->accept(*this);
90  }
91 
93  {
94  (void) v;
95  ++zero;
96  }
97 
99  {
100  (void) v;
101  ++one;
102  }
103 
105  {
106  (void) v;
107  ++atom;
108  }
109 
111  {
112  ++lweight;
113  v.sub()->accept(*this);
114  }
115 
117  {
118  ++rweight;
119  v.sub()->accept(*this);
120  }
121 
122 # undef VISIT
123 # undef DEFINE
124 
125  } // namespace rat
126 } // namespace vcsn
127 
128 #endif // !VCSN_CORE_RAT_INFO_HXX
variadic< type_t::ldiv, Context > ldiv
Definition: fwd.hh:132
unary< type_t::complement, Context > complement
Definition: fwd.hh:110
An inner node with multiple children.
Definition: fwd.hh:123
weight_node< type_t::rweight, Context > rweight
Definition: fwd.hh:151
unary< type_t::transposition, Context > transposition
Definition: fwd.hh:116
variadic< type_t::prod, Context > prod
Definition: fwd.hh:126
variadic< type_t::sum, Context > sum
Definition: fwd.hh:138
typename ratexpset_t::node_t node_t
Definition: info.hh:18
unary< type_t::star, Context > star
Definition: fwd.hh:113
constant< type_t::one, Context > one
Definition: fwd.hh:100
constant< type_t::zero, Context > zero
Definition: fwd.hh:97
An inner node implementing a weight.
Definition: fwd.hh:145
#define VISIT(Type)
Definition: info.hxx:34
variadic< type_t::shuffle, Context > shuffle
Definition: fwd.hh:135
virtual void accept(typename super_t::const_visitor &v) const
Definition: ratexp.hxx:191
weight_node< type_t::lweight, Context > lweight
Definition: fwd.hh:148
variadic< type_t::conjunction, Context > conjunction
Definition: fwd.hh:129