00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #include <vaucanson/config/system.hh>
00019
00020 #if not defined (VCSN_ALGEBRA_IMPLEMENTATION_SERIES_RAT_XML_EXP_VISITOR_HH) \
00021 and VCSN_INCLUDE_XML()
00022 # define VCSN_ALGEBRA_IMPLEMENTATION_SERIES_RAT_XML_EXP_VISITOR_HH
00023
00024 # ifndef VCSN_USE_XML
00025 # error Vaucanson XML support is disabled.
00026 # endif
00027
00036 # include <xercesc/dom/DOM.hpp>
00037 # include <xercesc/util/XMLString.hpp>
00038 # include <xercesc/util/PlatformUtils.hpp>
00039 # include <vaucanson/misc/usual_macros.hh>
00040 # include <string>
00041 # include <cstddef>
00042
00043 # include <vaucanson/algebra/implementation/series/rat/nodes.hh>
00044
00045 namespace vcsn {
00046
00047 namespace rat {
00048
00049 template<typename M_, typename W_>
00050 class XmlExpVisitor : public ConstNodeVisitor<M_, W_>
00051 {
00052 public:
00053 XmlExpVisitor(xercesc::DOMDocument* doc, char* node_name);
00054
00055 virtual void
00056 product(const Node<M_, W_>* left_, const Node<M_, W_>* right_);
00057
00058 virtual void
00059 sum(const Node<M_, W_>* left_, const Node<M_, W_>* right_);
00060
00061 virtual void
00062 star(const Node<M_, W_>* node);
00063
00064 virtual void
00065 left_weight(const W_&, const Node<M_, W_>* node);
00066
00067 virtual void
00068 right_weight(const W_&, const Node<M_, W_>* node);
00069
00070 virtual void
00071 constant(const M_& m);
00072
00073 virtual void zero();
00074
00075 virtual void one();
00076
00077 xercesc::DOMElement* get() const;
00078
00079 xercesc::DOMDocument* set(xercesc::DOMDocument* v);
00080
00081 protected:
00082 void sum_or_product(const Node<M_, W_>* left_, const Node<M_, W_>* right_);
00083 void weight_or_star(const Node<M_, W_>* node);
00084
00085 protected:
00086 xercesc::DOMDocument* doc_;
00087 xercesc::DOMElement* label_;
00088 xercesc::DOMElement* current_;
00089 };
00090
00091 }
00092
00093 }
00094
00095 # ifndef VCSN_USE_INTERFACE_ONLY
00096 # include <vaucanson/algebra/implementation/series/rat/xml_exp_visitor.hxx>
00097 # endif // VCSN_USE_INTERFACE_ONLY
00098
00099 #endif // ! VCSN_ALGEBRA_IMPLEMENTATION_SERIES_RAT_XML_EXP_VISITOR_HH &&
00100