OMNeT++ NEDXML  6.0.3
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 "common/saxparser.h"
24 
25 namespace omnetpp {
26 namespace nedxml {
27 
28 
48 class NEDXML_API ASTBuilder : public omnetpp::common::SaxHandler
49 {
50  ASTNode *root = nullptr;
51  ASTNode *current = nullptr;
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;
78 };
79 
80 } // namespace nedxml
81 } // namespace omnetpp
82 
83 
84 #endif
85 
astnode.h
NEDXML_API
#define NEDXML_API
Definition: nedxmldefs.h:31
omnetpp
Definition: astbuilder.h:25
omnetpp::nedxml::ASTNode
Definition: astnode.h:87
errorstore.h
omnetpp::nedxml::ASTBuilder
SAX handler (to be used with SAXParser) that builds an AST.
Definition: astbuilder.h:48
omnetpp::nedxml::ErrorStore
Definition: errorstore.h:37