Vaucanson 1.4
series_rep_base.hh
00001 // series_rep_base.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 #ifndef VCSN_ALGEBRA_IMPLEMENTATION_SERIES_SERIES_REP_BASE_HH
00018 # define VCSN_ALGEBRA_IMPLEMENTATION_SERIES_SERIES_REP_BASE_HH
00019 
00020 # include <vector>
00021 # include <string>
00022 
00023 # include <boost/shared_ptr.hpp>
00024 
00025 # include <vaucanson/algebra/concept/letter.hh>
00026 # include <vaucanson/misc/usual_macros.hh>
00027 
00028 namespace vcsn
00029 {
00030   namespace algebra
00031   {
00032     template <template <typename, typename> class B, typename S, typename M>
00033     struct SeriesRepBase
00034     {
00035       // The type of the semiring.
00036       typedef S                                 semiring_t;
00037 
00038       // The type of the monoid.
00039       typedef M                                 monoid_t;
00040 
00041       // The most derived type in the hierarchy.
00042       typedef B<semiring_t, monoid_t>           self_t;
00043 
00044       // Pointer types.
00045       typedef boost::shared_ptr<self_t>         pointer_t;
00046 
00047       // Basic structure attributes.
00048       std::string               open_par;
00049       std::string               close_par;
00050       std::string               plus;
00051       std::string               times;
00052       std::string               star;
00053       std::string               zero;
00054       std::string               open_weight;
00055       std::string               close_weight;
00056       std::vector<std::string>  spaces;
00057       std::vector<std::string>  maybe_zero;
00058 
00059       // Default CTOR
00060       SeriesRepBase();
00061 
00062       // Disambiguate the tokens w.r.t. a monoid.
00063       void disambiguate(const monoid_t&, pointer_t&);
00064     };
00065 
00066     template <template <typename, typename> class B, typename S, typename M>
00067     bool operator==(boost::shared_ptr<SeriesRepBase<B, S, M> >,
00068                     boost::shared_ptr<SeriesRepBase<B, S, M> >);
00069 
00070   } // ! algebra
00071 
00072 } // ! vcsn
00073 
00074 # if !defined VCSN_USE_INTERFACE_ONLY || defined VCSN_USE_LIB
00075 #  include <vaucanson/algebra/implementation/series/series_rep_base.hxx>
00076 # endif // VCSN_USE_INTERFACE_ONLY
00077 
00078 #endif // !VCSN_ALGEBRA_IMPLEMENTATION_SERIES_SERIES_REP_BASE_HH