Fawkes API  Fawkes Development Version
parser.h
1 
2 /***************************************************************************
3  * parser.h - Interface config parser
4  *
5  * Created: Tue Oct 10 17:29:33 2006
6  * Copyright 2006-2015 Tim Niemueller [www.niemueller.de]
7  ****************************************************************************/
8 
9 /* This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU Library General Public License for more details.
18  *
19  * Read the full text in the LICENSE.GPL file in the doc directory.
20  */
21 
22 #ifndef __INTERFACES_GENERATOR_PARSER_H_
23 #define __INTERFACES_GENERATOR_PARSER_H_
24 
25 #include "field.h"
26 #include "constant.h"
27 #include "enum_constant.h"
28 #include "message.h"
29 #include "pseudomap.h"
30 
31 #include <vector>
32 #include <string>
33 
34 namespace xmlpp {
35  class DomParser;
36  class Node;
37 }
38 
40 {
41  public:
42  InterfaceParser(std::string config_filename);
43  ~InterfaceParser();
44 
45  std::vector<InterfaceField> getFields(xmlpp::Node *node);
46  std::vector<InterfacePseudoMap> getPseudoMaps(xmlpp::Node *node,
47  std::vector<InterfaceField> &fields);
48  void parse();
49 
50  void printFields(std::vector<InterfaceField> &fields);
51  void printPseudoMaps(std::vector<InterfacePseudoMap> &pseudo_maps);
52  void print();
53  void printParsed(std::vector<InterfaceConstant> & constants,
54  std::vector<InterfaceEnumConstant> & enum_constants,
55  std::vector<InterfaceField> & data_fields,
56  std::vector<InterfacePseudoMap> & pseudo_maps,
57  std::vector<InterfaceMessage> & messages);
58 
59  std::string getInterfaceName();
60  std::string getInterfaceAuthor();
61  std::string getInterfaceYear();
62  std::string getInterfaceCreationDate();
63  std::vector<InterfaceConstant> getConstants();
64  std::vector<InterfaceEnumConstant> getEnumConstants();
65  std::vector<InterfaceField> getDataFields();
66  std::vector<InterfacePseudoMap> getPseudoMaps();
67  std::string getDataComment();
68  std::vector<InterfaceMessage> getMessages();
69 
70  private:
71  xmlpp::DomParser *dom;
72  xmlpp::Node *root;
73  std::string name;
74  std::string author;
75  std::string year;
76  std::string creation_date;
77  std::string data_comment;
78 
79  std::vector<InterfaceConstant> constants;
80  std::vector<InterfaceEnumConstant> enum_constants;
81  std::vector<InterfaceField> data_fields;
82  std::vector<InterfacePseudoMap> pseudo_maps;
83  std::vector<InterfaceMessage> messages;
84 
85 };
86 
87 
88 #endif
Parser used to get information out of interface template.
Definition: parser.h:39
Definition: parser.h:34