00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef VCSN_ALGEBRA_CONCEPT_LETTER_HXX
00018 # define VCSN_ALGEBRA_CONCEPT_LETTER_HXX
00019
00020 # include <string>
00021 # include <vector>
00022
00023 # include <vaucanson/misc/contract.hh>
00024 # include <vaucanson/algebra/concept/letter.hh>
00025
00026 namespace vcsn {
00027
00028 namespace algebra {
00029
00030
00031 template <typename L>
00032 L
00033 letter_traits<L>::literal_to_letter(const std::string&)
00034 {
00035 return 0;
00036 }
00037
00038
00039 template <typename L>
00040 std::string
00041 letter_traits<L>::letter_to_literal(const L&)
00042 {
00043 return 0;
00044 }
00045
00046
00047 # define STATIC_DEFAULT(name) \
00048 template <typename L> \
00049 const std::string \
00050 letter_traits<L>::default_##name () \
00051 { \
00052 static_error(need_default_##name) \
00053 return 0; \
00054 } \
00055 template <> \
00056 inline const std::string \
00057 letter_traits<misc::true_t>::default_##name () \
00058 { \
00059 return ""; \
00060 }
00061
00062 STATIC_DEFAULT(open_par)
00063 STATIC_DEFAULT(close_par)
00064 STATIC_DEFAULT(plus)
00065 STATIC_DEFAULT(times)
00066 STATIC_DEFAULT(star)
00067 STATIC_DEFAULT(epsilon)
00068 STATIC_DEFAULT(zero)
00069 STATIC_DEFAULT(open_weight)
00070 STATIC_DEFAULT(close_weight)
00071 STATIC_DEFAULT(space)
00072
00073 # undef STATIC_DEFAULT
00074
00075
00076 template <typename L>
00077 token_representation<L>::token_representation() :
00078 open_par(letter_traits<L>::default_open_par()),
00079 close_par(letter_traits<L>::default_close_par()),
00080 plus(letter_traits<L>::default_plus()),
00081 times(letter_traits<L>::default_times()),
00082 star(letter_traits<L>::default_star()),
00083 one(letter_traits<L>::default_epsilon()),
00084 zero(letter_traits<L>::default_zero()),
00085 open_weight(letter_traits<L>::default_open_weight()),
00086 close_weight(letter_traits<L>::default_close_weight())
00087 {
00088 spaces.push_back(letter_traits<L>::default_space());
00089 }
00090
00091
00092 template <typename L>
00093 template <typename U>
00094 token_representation<L>::
00095 token_representation(const token_representation<U>& arg) :
00096 open_par(arg.open_par),
00097 close_par(arg.close_par),
00098 plus(arg.plus),
00099 times(arg.times),
00100 star(arg.star),
00101 one(arg.one),
00102 zero(arg.zero),
00103 open_weight(arg.open_weight),
00104 close_weight(arg.close_weight),
00105 spaces(arg.spaces)
00106 {
00107 }
00108
00109 }
00110
00111 }
00112
00113 #endif // ! VCSN_ALGEBRA_CONCEPT_LETTER_HXX