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 bool
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 template<typename A>
00073 std::basic_string<typename A::letter_t>
00074 op_convert(SELECTOR(algebra::FreeMonoid<A>),
00075 SELECTOR(std::basic_string<typename A::letter_t>),
00076 const std::string& c);
00077
00078
00079 template<typename A>
00080 std::basic_string<typename A::letter_t>
00081 op_convert(SELECTOR(algebra::FreeMonoid<A>),
00082 SELECTOR(std::basic_string<typename A::letter_t>),
00083 const char* c);
00084
00085
00086
00087
00088
00093 template <typename A>
00094 struct word_traits<FreeMonoid<A>,
00095 std::basic_string<typename A::letter_t> >
00096 {
00098 typedef A alphabet_t;
00099
00101 typedef Element<FreeMonoid<A>,
00102 std::basic_string<typename alphabet_t::letter_t> > word_t;
00103
00105 typedef typename word_t::value_t word_value_t;
00106
00108 typedef typename alphabet_traits<typename alphabet_t::set_t,
00109 typename alphabet_t::value_t>::
00110 first_projection_t first_projection_alphabet_t;
00111
00113 typedef typename alphabet_traits<typename alphabet_t::set_t,
00114 typename alphabet_t::value_t>::
00115 second_projection_t second_projection_alphabet_t;
00116
00118 typedef FreeMonoid<first_projection_alphabet_t> first_monoid_t;
00119
00121 typedef FreeMonoid<second_projection_alphabet_t> second_monoid_t;
00122
00124 typedef Element<first_monoid_t,
00125 std::basic_string<typename first_projection_alphabet_t::
00126 letter_t> > first_projection_t;
00127
00129 typedef typename first_projection_t::value_t first_projection_value_t;
00130
00132 typedef Element<second_monoid_t,
00133 std::basic_string<typename second_projection_alphabet_t::
00134 letter_t> > second_projection_t;
00135
00137 typedef typename second_projection_t::value_t second_projection_value_t;
00138
00140 static first_projection_t first_projection(const first_monoid_t&,
00141 const word_t&);
00142 static first_projection_value_t first_projection(const word_value_t&);
00143
00145 static second_projection_t second_projection(const second_monoid_t&,
00146 const word_t&);
00147 static second_projection_value_t second_projection(const word_value_t&);
00148 };
00149
00150 }
00151
00152 }
00153
00154 # if !defined VCSN_USE_INTERFACE_ONLY || defined VCSN_USE_LIB
00155 # include <vaucanson/algebra/implementation/monoid/str_words.hxx>
00156 # endif // ! VCSN_USE_INTERFACE_ONLY
00157
00158 #endif // ! VCSN_ALGEBRA_IMPLEMENTATION_MONOID_STR_WORDS_HH