Vcsn
2.0
Be Rational
Main Page
Namespaces
Classes
Files
File List
File Members
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;
17
using
node_t
=
node<context_t>
;
18
using
inner_t
=
inner<context_t>
;
19
using
leaf_t
=
leaf<context_t>
;
20
template
<type_t Type>
21
using
unary_t
=
rat::unary<Type, context_t>
;
22
template
<type_t Type>
23
using
variadic_t
=
rat::variadic<Type, context_t>
;
24
template
<type_t Type>
25
using
weight_node_t
=
rat::weight_node<Type, context_t>
;
26
27
# define DEFINE(Type) \
28
using Type ## _t = Type<context_t>; \
29
virtual void visit(const Type ## _t& v)
30
31
DEFINE
(
atom
);
32
DEFINE
(
complement
);
33
DEFINE
(
conjunction
);
34
DEFINE
(
ldiv
);
35
DEFINE
(
lweight
);
36
DEFINE
(
one
);
37
DEFINE
(
prod
);
38
DEFINE
(
rweight
);
39
DEFINE
(
shuffle
);
40
DEFINE
(
star
);
41
DEFINE
(
sum
);
42
DEFINE
(
transposition
);
43
DEFINE
(
zero
);
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
vcsn::rat::variadic
An inner node with multiple children.
Definition:
fwd.hh:123
visitor.hxx
raise.hh
vcsn::rat::node
The abstract parameterized, root for all rational expression types.
Definition:
fwd.hh:80
fwd.hh
vcsn::rat::atom
Definition:
fwd.hh:82
vcsn::rat::weight_node
An inner node implementing a weight.
Definition:
fwd.hh:145
vcsn::rat::const_visitor::context_t
Context context_t
Definition:
visitor.hh:16
vcsn::rat::unary
Definition:
fwd.hh:107
vcsn::rat::leaf
The root from which to derive the final node types.
Definition:
fwd.hh:81
vcsn::rat::inner
An inner node.
Definition:
fwd.hh:83
DEFINE
#define DEFINE(Type)
Definition:
visitor.hh:27
vcsn::rat::constant
Definition:
fwd.hh:94
vcsn
core
rat
visitor.hh
Generated by
1.8.7