17 #ifndef VCSN_ALGEBRA_IMPLEMENTATION_SERIES_RAT_DISPATCH_VISITOR_HXX
18 # define VCSN_ALGEBRA_IMPLEMENTATION_SERIES_RAT_DISPATCH_VISITOR_HXX
20 # include <vaucanson/algebra/implementation/series/rat/dispatch_visitor.hh>
28 template <
class Matcher,
class Mono
id,
class Semiring>
29 DispatchVisitor<Matcher, Monoid, Semiring>::DispatchVisitor(Matcher& m) :
33 template <
class Matcher,
class Mono
id,
class Semiring>
34 DispatchVisitor<Matcher, Monoid, Semiring>::~DispatchVisitor()
37 template <
class Matcher,
class Mono
id,
class Semiring>
39 DispatchVisitor<Matcher, Monoid, Semiring>::
40 product(
const node_t* lhs,
const node_t* rhs)
42 ret_ = matcher_.match_nodeProduct(
typename Matcher::Product(lhs, rhs));
45 template <
class Matcher,
class Mono
id,
class Semiring>
47 DispatchVisitor<Matcher, Monoid, Semiring>::
48 sum(
const node_t* lhs,
const node_t* rhs)
50 ret_ = matcher_.match_nodeSum(
typename Matcher::Sum(lhs, rhs));
53 template <
class Matcher,
class Mono
id,
class Semiring>
56 star(
const node_t* node)
58 ret_ = matcher_.match_nodeStar(
typename Matcher::Star(node));
61 template <
class Matcher,
class Mono
id,
class Semiring>
63 DispatchVisitor<Matcher, Monoid, Semiring>::
64 left_weight(
const semiring_elt_value_t& w,
const node_t* node)
66 ret_ = matcher_.match_nodeLeftWeight(
typename Matcher::LeftWeight(w,
70 template <
class Matcher,
class Mono
id,
class Semiring>
72 DispatchVisitor<Matcher, Monoid, Semiring>::
73 right_weight(
const semiring_elt_value_t& w,
const node_t* node)
75 ret_ = matcher_.match_nodeRightWeight(
typename
76 Matcher::RightWeight(node, w));
79 template <
class Matcher,
class Mono
id,
class Semiring>
81 DispatchVisitor<Matcher, Monoid, Semiring>::
82 constant(
const monoid_elt_value_t& m)
84 ret_ = matcher_.match_nodeConstant(
typename Matcher::Constant(m));
87 template <
class Matcher,
class Mono
id,
class Semiring>
89 DispatchVisitor<Matcher, Monoid, Semiring>::
92 ret_ = matcher_.match_nodeZero(
typename Matcher::Zero());
95 template <
class Matcher,
class Mono
id,
class Semiring>
97 DispatchVisitor<Matcher, Monoid, Semiring>::
100 ret_ = matcher_.match_nodeOne(
typename Matcher::One());
103 template <
class Matcher,
class Mono
id,
class Semiring>
104 typename DispatchVisitor<Matcher, Monoid, Semiring>::return_type
105 DispatchVisitor<Matcher, Monoid, Semiring>::
111 template <
class M,
class W>
112 template <
class Matcher>
113 typename Matcher::return_type
114 DispatchFunction< rat::exp<M, W> >::d(Matcher& matcher,
115 const rat::exp<M, W>& exp)
117 DispatchVisitor<Matcher, M, W> v(matcher);
126 #endif // ! VCSN_ALGEBRA_IMPLEMENTATION_SERIES_RAT_DISPATCH_VISITOR_HXX