krat_exp_is_finite_app.hxx

00001 // krat_exp_is_finite_app.hxx: 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 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_KRAT_EXP_IS_FINITE_APP_HXX
00018 # define VCSN_ALGEBRA_IMPLEMENTATION_SERIES_KRAT_EXP_IS_FINITE_APP_HXX
00019 
00020 # include <utility>
00021 # include <vaucanson/algebra/implementation/series/krat_exp_pattern.hh>
00022 
00023 namespace vcsn {
00024 
00025   template <class Series, class T, class Dispatch>
00026   class IsFiniteAppMatcher : public algebra::KRatExpMatcher<
00027     IsFiniteAppMatcher<Series, T, Dispatch>,
00028     T,
00029     bool,
00030     Dispatch
00031     >
00032   {
00033   public:
00034     typedef IsFiniteAppMatcher<Series, T, Dispatch>     self_t;
00035     typedef bool                                        return_type;
00036     INHERIT_CONSTRUCTORS(self_t, T, return_type, Dispatch);
00037 
00038     IsFiniteAppMatcher()
00039     {}
00040 
00041     MATCH__(Product, lhs, rhs)
00042     {
00043       return match(lhs) && match(rhs);
00044     }
00045     END
00046 
00047     MATCH__(Sum, lhs, rhs)
00048     {
00049       return match(lhs) && match(rhs);
00050     }
00051     END
00052 
00053     MATCH_(Star, node)
00054     {
00055       return false;
00056     }
00057     END
00058 
00059     MATCH__(LeftWeight, w, node)
00060     {
00061       (void) w;
00062       return match(node);
00063     }
00064     END
00065 
00066     MATCH__(RightWeight, node, w)
00067     {
00068       (void) w;
00069       return match(node);
00070     }
00071     END
00072 
00073     MATCH_(Constant, m)
00074     {
00075       return true;
00076     }
00077     END
00078 
00079     MATCH(Zero)
00080     {
00081       return true;
00082     }
00083     END
00084 
00085     MATCH(One)
00086     {
00087       return true;
00088     }
00089     END
00090 
00091   };
00092 
00093 } // vcsn
00094 
00095 #endif // ! VCSN_ALGEBRA_IMPLEMENTATION_SERIES_KRAT_EXP_IS_FINITE_APP_HXX

Generated on Fri Jul 28 12:18:40 2006 for Vaucanson by  doxygen 1.4.6