Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

xml_exp_visitor.hh

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 #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   } // rat
00092 
00093 } // vcsn
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        // VCSN_INCLUDE_XML()

Generated on Mon Jul 24 16:56:39 2006 for Vaucanson by  doxygen 1.4.4