Go to the documentation of this file.00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 #ifndef VCSN_XML_PARSERS_HH
00019 # define VCSN_XML_PARSERS_HH
00020 
00031 # include <iostream>
00032 
00033 # include <xercesc/sax2/SAX2XMLReader.hpp>
00034 
00035 # include <vaucanson/xml/handlers.hh>
00036 # include <vaucanson/xml/xmleq.hh>
00037 
00038 namespace vcsn
00039 {
00040   namespace xml
00041   {
00042     
00043 
00044 
00045     class Parser
00046     {
00047       public:
00048         Parser (bool check = true);
00049         virtual ~Parser ();
00050 
00051       protected:
00052         const std::string&
00053         get_xsd_path ();
00054 
00055         ErrHandler*                     err_handler_;
00057         xercesc::SAX2XMLReader*         parser_;
00059         XMLEq                           eq_;
00060     };
00061 
00062     
00063 
00064 
00065     template <typename Auto>
00066     class AutParser : public Parser
00067     {
00068       public:
00069         AutParser (Auto& a, bool check = true);
00070         virtual ~AutParser ();
00071 
00072         void
00073         parse (std::istream& in);
00074 
00075       protected:
00076         DocAutHandler<Auto>*    doc_handler_;
00077         Auto&                   a_;
00078     };
00079 
00080     
00081 
00082 
00083     template <typename T>
00084     class RegExpParser : public Parser
00085     {
00086       public:
00087         RegExpParser (T& r, bool check = true);
00088         virtual ~RegExpParser ();
00089 
00090         void
00091         parse (std::istream& in);
00092 
00093       protected:
00094         DocRegExpHandler<T>*    doc_handler_;
00095         T&                      r_;
00096     };
00097   } 
00098 } 
00099 
00100 # if !defined VCSN_USE_INTERFACE_ONLY || defined VCSN_USE_LIB
00101 # include <vaucanson/xml/parsers.hxx>
00102 # endif // VCSN_USE_INTERFACE_ONLY
00103 
00104 #endif // !VCSN_XML_PARSERS_HH