OMNeT++ NEDXML  5.4.1
astbuilder.h
Go to the documentation of this file.
1 //==========================================================================
2 // ASTBUILDER.H - part of
3 //
4 // OMNeT++/OMNEST
5 // Discrete System Simulation in C++
6 //
7 //==========================================================================
8 
9 /*--------------------------------------------------------------*
10  Copyright (C) 2002-2017 Andras Varga
11  Copyright (C) 2006-2017 OpenSim Ltd.
12 
13  This file is distributed WITHOUT ANY WARRANTY. See the file
14  `license' for details on this and other legal matters.
15 *--------------------------------------------------------------*/
16 
17 #ifndef __OMNETPP_NEDXML_ASTBUILDER_H
18 #define __OMNETPP_NEDXML_ASTBUILDER_H
19 
20 
21 #include "errorstore.h"
22 #include "astnode.h"
23 #include "saxparser.h"
24 
25 namespace omnetpp {
26 namespace nedxml {
27 
28 
49 {
50  ASTNode *root;
51  ASTNode *current;
52  const char *sourceFilename;
53  ErrorStore *errors;
54 
55  public:
59  ASTBuilder(const char *filename, ErrorStore *e);
60 
64  virtual ~ASTBuilder();
65 
69  virtual ASTNode *getTree();
70 
73  virtual void startElement(const char *name, const char **atts) override;
74  virtual void endElement(const char *name) override;
75  virtual void characterData(const char *s, int len) override;
76  virtual void processingInstruction(const char *target, const char *data) override;
77  virtual void comment(const char *data) override;
78  virtual void startCdataSection() override;
79  virtual void endCdataSection() override;
81 };
82 
83 } // namespace nedxml
84 } // namespace omnetpp
85 
86 
87 #endif
88 
#define NEDXML_API
Definition: nedxmldefs.h:31
SAX handler (to be used with SAXParser) that builds an AST.
Definition: astbuilder.h:48
Definition: astbuilder.h:25
Base class for SAX event handlers needed by SAXParser. This is a simplified SAX handler interface...
Definition: saxparser.h:40
Definition: astnode.h:75
Definition: errorstore.h:37