xml_exp_visitor.hh

Go to the documentation of this file.
00001 // xml_exp_visitor.hh: this file is part of the Vaucanson project.
00002 //
00003 // Vaucanson, a generic library for finite state machines.
00004 //
00005 // Copyright (C) 2006 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 
00018 #ifndef VCSN_ALGEBRA_IMPLEMENTATION_SERIES_RAT_XML_EXP_VISITOR_HH
00019 # define VCSN_ALGEBRA_IMPLEMENTATION_SERIES_RAT_XML_EXP_VISITOR_HH
00020 
00029 # include <xercesc/dom/DOM.hpp>
00030 # include <xercesc/util/XMLString.hpp>
00031 # include <xercesc/util/PlatformUtils.hpp>
00032 # include <vaucanson/misc/usual_macros.hh>
00033 # include <string>
00034 # include <cstddef>
00035 
00036 # include <vaucanson/algebra/implementation/series/rat/nodes.hh>
00037 
00038 namespace vcsn {
00039 
00040   namespace rat {
00041 
00042     template<typename M_, typename W_>
00043     class XmlExpVisitor : public ConstNodeVisitor<M_, W_>
00044     {
00045     public:
00046       XmlExpVisitor(xercesc::DOMDocument* doc, const char* node_name);
00047 
00048       virtual void
00049       product(const Node<M_, W_>* left_, const Node<M_, W_>* right_);
00050 
00051       virtual void
00052       sum(const Node<M_, W_>* left_, const Node<M_, W_>* right_);
00053 
00054       virtual void
00055       star(const Node<M_, W_>* node);
00056 
00057       virtual void
00058       left_weight(const W_&, const Node<M_, W_>* node);
00059 
00060       virtual void
00061       right_weight(const W_&, const Node<M_, W_>* node);
00062 
00063       virtual void
00064       constant(const M_& m);
00065 
00066       virtual void zero();
00067 
00068       virtual void one();
00069 
00070       xercesc::DOMElement* get() const;
00071 
00072       xercesc::DOMDocument* set(xercesc::DOMDocument* v);
00073 
00074     protected:
00075       void sum_or_product(const Node<M_, W_>* left_, const Node<M_, W_>* right_);
00076       void weight_or_star(const Node<M_, W_>* node);
00077 
00078     protected:
00079       xercesc::DOMDocument*     doc_;
00080       xercesc::DOMElement*      label_;
00081       xercesc::DOMElement*      current_;
00082       std::string               weight_;
00083     };
00084 
00085   } // rat
00086 
00087 } // vcsn
00088 
00089 # if !defined VCSN_USE_INTERFACE_ONLY || defined VCSN_USE_LIB
00090 #  include <vaucanson/algebra/implementation/series/rat/xml_exp_visitor.hxx>
00091 # endif // VCSN_USE_INTERFACE_ONLY
00092 
00093 #endif // ! VCSN_ALGEBRA_IMPLEMENTATION_SERIES_RAT_XML_EXP_VISITOR_HH

Generated on Sun Jul 29 19:35:31 2007 for Vaucanson by  doxygen 1.5.2