00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
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       
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   } 
00079 
00080 } 
00081 
00082 # include <vaucanson/algebra/implementation/series/rat/star_height_visitor.hxx>
00083 
00084 #endif // ! VCSN_ALGEBRA_IMPLEMENTATION_SERIES_RAT_STAR_HEIGHT_VISITOR_HH