Awali
Another Weighted Automata library
visitor.hxx
Go to the documentation of this file.
1 // This file is part of Awali.
2 // Copyright 2016-2022 Sylvain Lombardy, Victor Marsault, Jacques Sakarovitch
3 //
4 // Awali is a free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
16 
19 #include <cassert>
20 
21 namespace awali { namespace sttc
22 {
23  namespace rat
24  {
25 #define VISIT(Type, Name) \
26  template <typename Label, typename Weight> \
27  inline \
28  void \
29  const_visitor<Label, Weight>::visit(const Type ## _t& Name)
30 
31  VISIT(prod, v)
32  {
33  for (auto t : v)
34  t->accept(*this);
35  }
36 
37  VISIT(conjunction, v)
38  {
39  for (auto t : v)
40  t->accept(*this);
41  }
42 
43  VISIT(shuffle, v)
44  {
45  for (auto t : v)
46  t->accept(*this);
47  }
48 
49  VISIT(ldiv, v)
50  {
51  for (auto t : v)
52  t->accept(*this);
53  }
54 
55  VISIT(sum, v)
56  {
57  for (auto t : v)
58  t->accept(*this);
59  }
60 
61  VISIT(star, v)
62  {
63  v.sub()->accept(*this);
64  }
65 
67  {
68  v.sub()->accept(*this);
69  }
70 
71  VISIT(rweight, v)
72  {
73  v.sub()->accept(*this);
74  }
75 
76  VISIT(complement, v)
77  {
78  v.sub()->accept(*this);
79  }
80 
82  {
83  v.sub()->accept(*this);
84  }
85 
87  {}
88 
89  VISIT(zero, )
90  {}
91 
93  {}
94 
95 #undef VISIT
96 
97  } // namespace rat
98 }}//end of ns awali::stc
Definition: ratexp.hh:280
Definition: ratexp.hh:262
Definition: ratexp.hh:176
An inner node with multiple children.
Definition: ratexp.hh:115
An inner node implementing a weight.
Definition: ratexp.hh:208
variadic< type_t::sum, Label, Weight > sum
Definition: fwd.hh:154
variadic< type_t::ldiv, Label, Weight > ldiv
Definition: fwd.hh:148
variadic< type_t::shuffle, Label, Weight > shuffle
Definition: fwd.hh:151
unary< type_t::transposition, Label, Weight > transposition
Definition: fwd.hh:132
unary< type_t::complement, Label, Weight > complement
Definition: fwd.hh:126
Main namespace of Awali.
Definition: ato.hh:22
#define VISIT(Type, Name)
Definition: visitor.hxx:25