00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
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   } 
00086 
00087 } 
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