00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef VCSN_ALGEBRA_IMPLEMENTATION_MONOID_STR_WORDS_HH
00019 # define VCSN_ALGEBRA_IMPLEMENTATION_MONOID_STR_WORDS_HH
00020
00021
00022 # include <string>
00023
00024 # include <vaucanson/algebra/implementation/monoid/free_monoid.hh>
00025 # include <vaucanson/algebra/implementation/alphabets/alphabet_set.hh>
00026
00027 namespace vcsn {
00028
00029 namespace algebra {
00030
00031
00032
00033
00034
00035 template <typename A>
00036 std::pair<bool, int>
00037 op_parse(const FreeMonoid<A>& s,
00038 std::basic_string<typename A::letter_t>& v,
00039 const std::string& in);
00040
00041 template <typename A>
00042 void
00043 op_in_mul(const algebra::FreeMonoid<A>& s,
00044 std::basic_string<typename A::letter_t>& dst,
00045 const std::basic_string<typename A::letter_t>& src);
00046
00047 template<typename A>
00048 std::basic_string<typename A::letter_t>
00049 op_mul(const algebra::FreeMonoid<A>& s,
00050 const std::basic_string<typename A::letter_t>& a,
00051 const std::basic_string<typename A::letter_t>& b);
00052
00053 template<typename A, typename St>
00054 St&
00055 op_rout(const FreeMonoid<A>& s,
00056 St& st,
00057 const std::basic_string<typename A::letter_t>& v);
00058
00059 template<typename A>
00060 const std::basic_string<typename A::letter_t>&
00061 identity_value(SELECTOR(algebra::FreeMonoid<A>),
00062 SELECTOR(std::basic_string<typename A::letter_t>));
00063
00064
00065 template<typename A>
00066 std::basic_string<typename A::letter_t>
00067 op_convert(SELECTOR(algebra::FreeMonoid<A>),
00068 SELECTOR(std::basic_string<typename A::letter_t>),
00069 const typename A::letter_t& c);
00070
00071
00072
00073
00074
00079 template <typename A>
00080 struct word_traits<FreeMonoid<A>,
00081 std::basic_string<typename A::letter_t> >
00082 {
00084 typedef A alphabet_t;
00085
00087 typedef Element<FreeMonoid<A>,
00088 std::basic_string<typename alphabet_t::letter_t> > word_t;
00089
00091 typedef typename word_t::value_t word_value_t;
00092
00094 typedef typename alphabet_traits<typename alphabet_t::set_t,
00095 typename alphabet_t::value_t>::
00096 first_projection_t first_projection_alphabet_t;
00097
00099 typedef typename alphabet_traits<typename alphabet_t::set_t,
00100 typename alphabet_t::value_t>::
00101 second_projection_t second_projection_alphabet_t;
00102
00104 typedef FreeMonoid<first_projection_alphabet_t> first_monoid_t;
00105
00107 typedef FreeMonoid<second_projection_alphabet_t> second_monoid_t;
00108
00110 typedef Element<first_monoid_t,
00111 std::basic_string<typename first_projection_alphabet_t::
00112 letter_t> > first_projection_t;
00113
00115 typedef typename first_projection_t::value_t first_projection_value_t;
00116
00118 typedef Element<second_monoid_t,
00119 std::basic_string<typename second_projection_alphabet_t::
00120 letter_t> > second_projection_t;
00121
00123 typedef typename second_projection_t::value_t second_projection_value_t;
00124
00126 static first_projection_t first_projection(const first_monoid_t&,
00127 const word_t&);
00128 static first_projection_value_t first_projection(const word_value_t&);
00129
00131 static second_projection_t second_projection(const second_monoid_t&,
00132 const word_t&);
00133 static second_projection_value_t second_projection(const word_value_t&);
00134 };
00135
00136 }
00137
00138 }
00139
00140 # if !defined VCSN_USE_INTERFACE_ONLY || defined VCSN_USE_LIB
00141 # include <vaucanson/algebra/implementation/monoid/str_words.hxx>
00142 # endif // ! VCSN_USE_INTERFACE_ONLY
00143
00144 #endif // ! VCSN_ALGEBRA_IMPLEMENTATION_MONOID_STR_WORDS_HH