star_height_visitor.hh

00001 // star_height_visitor.hh: this file is part of the Vaucanson project.
00002 //
00003 // Vaucanson, a generic library for finite state machines.
00004 //
00005 // Copyright (C) 2005 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_RAT_STAR_HEIGHT_VISITOR_HH
00018 # define VCSN_ALGEBRA_IMPLEMENTATION_SERIES_RAT_STAR_HEIGHT_VISITOR_HH
00019 
00020 
00021 # include <cstddef>
00022 
00023 # include <vaucanson/algebra/implementation/series/rat/nodes.hh>
00024 
00025 namespace vcsn {
00026 
00027   namespace rat {
00028 
00029     template<typename M_, typename W_>
00030     class StarHeightVisitor : public ConstNodeVisitor<M_, W_>
00031     {
00032     protected:
00033       void
00034       sum_or_product(const Node<M_, W_>* left_, const Node<M_, W_>* right_);
00035       void
00036       weight_or_star(const Node<M_, W_>* node);
00037 
00038     public:
00039       StarHeightVisitor() :
00040         h_(0)
00041       {}
00042 
00043       virtual void
00044       product(const Node<M_, W_>* left_, const Node<M_, W_>* right_);
00045 
00046       virtual void
00047       sum(const Node<M_, W_>* left_, const Node<M_, W_>* right_);
00048 
00049       virtual void
00050       star(const Node<M_, W_>* node);
00051 
00052       virtual void
00053       left_weight(const W_&, const Node<M_, W_>* node);
00054 
00055       virtual void
00056       right_weight(const W_&, const Node<M_, W_>* node);
00057 
00058       virtual void
00059       constant(const M_& m);
00060 
00061       virtual void zero();
00062 
00063       virtual void one();
00064 
00065       size_t get() const;
00066 
00067       //FIXME!!!
00068       size_t set(size_t v)
00069       {
00070         this->h_ = v;
00071         return this->h_;
00072       }
00073 
00074     protected:
00075       size_t            h_;
00076     };
00077 
00078   } // rat
00079 
00080 } // vcsn
00081 
00082 # include <vaucanson/algebra/implementation/series/rat/star_height_visitor.hxx>
00083 
00084 #endif // ! VCSN_ALGEBRA_IMPLEMENTATION_SERIES_RAT_STAR_HEIGHT_VISITOR_HH

Generated on Sat Jul 29 17:13:11 2006 for Vaucanson by  doxygen 1.4.6