00001 // krat_exp_proxy.hh: this file is part of the Vaucanson project. 00002 // 00003 // Vaucanson, a generic library for finite state machines. 00004 // 00005 // Copyright (C) 2008 The Vaucanson Group. 00006 // 00007 // This program is free software; you can redistribute it and/or 00008 // modify it under the terms of the GNU General Public License 00009 // as published by the Free Software Foundation; either version 2 00010 // of the License, or (at your option) any later version. 00011 // 00012 // The complete GNU General Public Licence Notice can be found as the 00013 // `COPYING' file in the root directory. 00014 // 00015 // The Vaucanson Group consists of people listed in the `AUTHORS' file. 00016 // 00017 00018 #ifndef VCSN_ALGEBRA_IMPLEMENTATION_SERIES_KRAT_EXP_PROXY_HH 00019 # define VCSN_ALGEBRA_IMPLEMENTATION_SERIES_KRAT_EXP_PROXY_HH 00020 # include <vaucanson/design_pattern/design_pattern.hh> 00021 00022 namespace vcsn { 00023 00024 namespace algebra { 00025 00033 struct semiring_virtual 00034 { 00035 virtual semiring_virtual& operator=(semiring_virtual& sem) = 0; 00036 virtual ~semiring_virtual() {} 00037 }; 00038 00044 struct krat_exp_virtual 00045 { 00046 /* Virtual fonctions used in the parser */ 00047 virtual krat_exp_virtual& operator=(krat_exp_virtual& exp) = 0; 00048 virtual krat_exp_virtual* operator+(krat_exp_virtual* exp) = 0; 00049 virtual krat_exp_virtual* operator*(krat_exp_virtual* exp) = 0; 00050 virtual void star() = 0; 00051 virtual void left_weight(semiring_virtual* sem) = 0; 00052 virtual void right_weight(semiring_virtual* sem) = 0; 00053 virtual ~krat_exp_virtual() {} 00054 }; 00055 00060 template <class S, class T> 00061 struct krat_exp_proxy : public krat_exp_virtual 00062 { 00063 typedef typename Element<S, T>::monoid_elt_t monoid_elt_t; 00064 00065 // Constructors && Destructor 00066 krat_exp_proxy(Element<S, T> exp); 00067 ~krat_exp_proxy() {} 00068 00069 krat_exp_virtual& operator=(krat_exp_virtual& exp); 00070 krat_exp_virtual* operator+(krat_exp_virtual* exp); 00071 krat_exp_virtual* operator*(krat_exp_virtual* exp); 00072 void star(); 00073 void left_weight(semiring_virtual* sem); 00074 void right_weight(semiring_virtual* sem); 00075 00076 // Attibutes 00077 Element<S, T> self; 00078 }; 00079 00084 template <class S, class T> 00085 struct semiring_proxy : public semiring_virtual 00086 { 00087 typedef typename Element<S, T>::semiring_elt_t semiring_elt_t; 00088 00089 //Constructor && Destructor 00090 semiring_proxy(semiring_elt_t& sem); 00091 ~semiring_proxy() {} 00092 00093 semiring_virtual& operator=(semiring_virtual& sem); 00094 00095 // Attibutes 00096 semiring_elt_t self; 00097 }; 00098 00101 } // algebra 00102 00103 } // vcsn 00104 00105 # if !defined VCSN_USE_INTERFACE_ONLY || defined VCSN_USE_LIB 00106 # include <vaucanson/algebra/implementation/series/krat_exp_proxy.hxx> 00107 # endif // VCSN_USE_INTERFACE_ONLY 00108 00109 #endif // !VCSN_ALGEBRA_IMPLEMENTATION_SERIES_KRAT_EXP_PROXY_HH //