Vcsn  2.0
Be Rational
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
visitor.hh
Go to the documentation of this file.
1 #ifndef VCSN_CORE_RAT_VISITOR_HH
2 # define VCSN_CORE_RAT_VISITOR_HH
3 
4 # include <vcsn/core/rat/fwd.hh>
5 # include <vcsn/misc/raise.hh>
6 
7 namespace vcsn
8 {
9  namespace rat
10  {
11 
12  template <typename Context>
13  class const_visitor
14  {
15  public:
16  using context_t = Context;
20  template <type_t Type>
22  template <type_t Type>
24  template <type_t Type>
26 
27 # define DEFINE(Type) \
28  using Type ## _t = Type<context_t>; \
29  virtual void visit(const Type ## _t& v)
30 
44 # undef DEFINE
45  };
46 
47  } // namespace rat
48 } // namespace vcsn
49 
50 # define VCSN_RAT_VISIT(Type, Val) \
51  using Type ## _t = typename super_t::Type ## _t; \
52  virtual void visit(const Type ## _t& Val)
53 
54 # define VCSN_RAT_UNSUPPORTED(Type) \
55  VCSN_RAT_VISIT(Type,) \
56  { \
57  raise(me(), ": " #Type " is not supported"); \
58  }
59 
60 # include <vcsn/core/rat/visitor.hxx>
61 
62 #endif // !VCSN_CORE_RAT_VISITOR_HH
An inner node with multiple children.
Definition: fwd.hh:123
The abstract parameterized, root for all rational expression types.
Definition: fwd.hh:80
An inner node implementing a weight.
Definition: fwd.hh:145
The root from which to derive the final node types.
Definition: fwd.hh:81
An inner node.
Definition: fwd.hh:83
#define DEFINE(Type)
Definition: visitor.hh:27