Vaucanson 1.4
|
00001 // letter.hh: this file is part of the Vaucanson project. 00002 // 00003 // Vaucanson, a generic library for finite state machines. 00004 // 00005 // Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2008 The 00006 // Vaucanson Group. 00007 // 00008 // This program is free software; you can redistribute it and/or 00009 // modify it under the terms of the GNU General Public License 00010 // as published by the Free Software Foundation; either version 2 00011 // of the License, or (at your option) any later version. 00012 // 00013 // The complete GNU General Public Licence Notice can be found as the 00014 // `COPYING' file in the root directory. 00015 // 00016 // The Vaucanson Group consists of people listed in the `AUTHORS' file. 00017 // 00018 #ifndef VCSN_ALGEBRA_CONCEPT_LETTER_HH 00019 # define VCSN_ALGEBRA_CONCEPT_LETTER_HH 00020 00021 # include <string> 00022 # include <vector> 00023 # include <utility> 00024 00025 # include <vaucanson/design_pattern/predecls.hh> 00026 # include <vaucanson/misc/static.hh> 00027 00028 namespace vcsn { 00029 00030 namespace algebra { 00031 00032 template <class L> 00033 struct letter_traits 00034 { 00035 // When we do not know the type we assume false. 00036 typedef misc::false_t is_char_letter; 00037 00038 // Default value 00039 enum 00040 { 00041 cardinal = misc::static_pow<2, sizeof(L) * 8>::value 00042 }; 00043 00046 00048 // FIXME: we must add traits to monoids to handle this better 00049 static std::string kind(); 00050 static int dim(); 00051 00053 typedef undefined_type first_projection_t; 00054 00056 typedef undefined_type second_projection_t; 00057 00060 static std::pair<bool, L> literal_to_letter(const std::string&); 00061 00063 static std::string letter_to_literal(const L&); 00064 }; 00065 00066 } // ! algebra 00067 00068 } // ! vcsn 00069 00070 # if !defined VCSN_USE_INTERFACE_ONLY || defined VCSN_USE_LIB 00071 # include <vaucanson/algebra/concept/letter.hxx> 00072 # endif // ! VCSN_USE_INTERFACE_ONLY 00073 00074 #endif // ! VCSN_ALGEBRA_CONCEPT_LETTER_HH