Vaucanson 1.4
|
00001 // depth_visitor.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 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_DEPTH_VISITOR_HH 00018 # define VCSN_ALGEBRA_IMPLEMENTATION_SERIES_RAT_DEPTH_VISITOR_HH 00019 00020 # include <cstddef> 00021 00022 # include <vaucanson/algebra/implementation/series/rat/nodes.hh> 00023 00024 namespace vcsn { 00025 00026 namespace rat { 00027 00028 template<typename M_, typename W_> 00029 class DepthVisitor : public ConstNodeVisitor<M_, W_> 00030 { 00031 protected: 00032 void 00033 sum_or_product(const Node<M_, W_>* left_, const Node<M_, W_>* right_); 00034 void 00035 weight_or_star(const Node<M_, W_>* node); 00036 00037 public: 00038 virtual void 00039 product(const Node<M_, W_>* left_, const Node<M_, W_>* right_); 00040 00041 virtual void 00042 sum(const Node<M_, W_>* left_, const Node<M_, W_>* right_); 00043 00044 virtual void 00045 star(const Node<M_, W_>* node); 00046 00047 virtual void 00048 left_weight(const W_&, const Node<M_, W_>* node); 00049 00050 virtual void 00051 right_weight(const W_&, const Node<M_, W_>* node); 00052 00053 virtual void 00054 constant(const M_& m); 00055 00056 virtual void zero(); 00057 00058 virtual void one(); 00059 00060 size_t get() const; 00061 00062 protected: 00063 size_t d; 00064 }; 00065 00066 } // rat 00067 00068 } // vcsn 00069 00070 # if !defined VCSN_USE_INTERFACE_ONLY || defined VCSN_USE_LIB 00071 # include <vaucanson/algebra/implementation/series/rat/depth_visitor.hxx> 00072 # endif // VCSN_USE_INTERFACE_ONLY 00073 00074 #endif // ! VCSN_ALGEBRA_IMPLEMENTATION_SERIES_RAT_DEPTH_VISITOR_HH