17 #ifndef VCSN_AUTOMATA_CONCEPT_TRANSLATE_HXX
18 # define VCSN_AUTOMATA_CONCEPT_TRANSLATE_HXX
20 # include <vaucanson/automata/concept/translate.hh>
21 # include <vaucanson/automata/concept/handlers.hh>
26 template<
typename lhs_t,
typename rhs_t,
typename F>
29 const F& translate_fun)
32 std::map<typename rhs_t::hstate_t, typename lhs_t::hstate_t> stmap;
35 dst.series() = from.series();
36 for (
typename rhs_t::state_iterator i = from.states().begin();
37 i != from.states().end();
40 typename lhs_t::hstate_t s = dst.add_state();
41 dst.set_final(s, from.get_final(*i));
42 dst.set_initial(s, from.get_initial(*i));
45 for (
typename rhs_t::transition_iterator i = from.transitions().begin();
46 i != from.transitions().end();
48 dst.add_series_transition(stmap[from.src_of(*i)], stmap[from.dst_of(*i)],
49 translate_fun(from.series_of(*i)));
53 template<
typename auto_t,
typename F>
63 #endif // ! VCSN_AUTOMATA_CONCEPT_TRANSLATE_HXX