OpenADFortTk (including Open64 and OpenAnalysis references)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
XAIF_SAXHandler.h
Go to the documentation of this file.
1 #ifndef XAIF_SAXhandler_INCLUDED_h
2 #define XAIF_SAXHandler_INCLUDED_h
3 
4 #include <stack>
5 
6 #include <xercesc/util/XercesDefs.hpp>
7 #include <xercesc/util/PlatformUtils.hpp>
8 
9 #include <xercesc/dom/DOM.hpp>
10 
11 #include <xercesc/sax2/Attributes.hpp>
12 #include <xercesc/sax2/DefaultHandler.hpp>
13 #include <xercesc/sax2/SAX2XMLReader.hpp>
14 
15 #include "PUXlationContext.h"
16 
17 namespace xaif2whirl {
18 
19  class XAIF_SAXHandler : public xercesc::DefaultHandler {
20 
21  public:
22 
23  XAIF_SAXHandler(PU_Info* pu_forest, const XMLCh* implementationFeatures);
25 
26  void initialize(bool validateAgainstSchema);
27 
28  void parse(std::string theXMLFileName);
29 
30  void startElement(const XMLCh* const uri,
31  const XMLCh* const localname,
32  const XMLCh* const qname,
33  const xercesc::Attributes& attrs);
34 
35  void endElement(const XMLCh* const uri,
36  const XMLCh* const localname,
37  const XMLCh* const qname);
38 
39  bool getParserErrorStatus();
40 
41  void deleteParser();
42 
43  private:
44 
49 
54 
56 
58 
59  xercesc::SAX2XMLReader* myParser_p;
60 
61  xercesc::DOMImplementation* myDOMImplementation_p;
62 
63  xercesc::DOMDocument* myDOMDocument_p;
64 
65  std::stack<xercesc::DOMElement*> myElementStack;
66 
67  bool inDOMMode;
68 
69  void copyAttributes(xercesc::DOMElement* theElement, const xercesc::Attributes& theAttributes);
70 
71  }; // end class XAIF_SAXHandler
72 
73 } // end namespace xaif2whirl
74 
75 #endif