00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef __INTERFACES_GENERATOR_PARSER_H_
00024 #define __INTERFACES_GENERATOR_PARSER_H_
00025
00026 #include "field.h"
00027 #include "constant.h"
00028 #include "enum_constant.h"
00029 #include "message.h"
00030 #include "pseudomap.h"
00031
00032 #include <vector>
00033 #include <string>
00034
00035 namespace xmlpp {
00036 class DomParser;
00037 class Node;
00038 }
00039
00040 class InterfaceParser
00041 {
00042 public:
00043 InterfaceParser(std::string config_filename);
00044 ~InterfaceParser();
00045
00046 std::vector<InterfaceField> getFields(xmlpp::Node *node);
00047 std::vector<InterfacePseudoMap> getPseudoMaps(xmlpp::Node *node,
00048 std::vector<InterfaceField> &fields);
00049 void parse();
00050
00051 void printFields(std::vector<InterfaceField> &fields);
00052 void printPseudoMaps(std::vector<InterfacePseudoMap> &pseudo_maps);
00053 void print();
00054 void printParsed(std::vector<InterfaceConstant> & constants,
00055 std::vector<InterfaceEnumConstant> & enum_constants,
00056 std::vector<InterfaceField> & data_fields,
00057 std::vector<InterfacePseudoMap> & pseudo_maps,
00058 std::vector<InterfaceMessage> & messages);
00059
00060 std::string getInterfaceName();
00061 std::string getInterfaceAuthor();
00062 std::string getInterfaceYear();
00063 std::string getInterfaceCreationDate();
00064 std::vector<InterfaceConstant> getConstants();
00065 std::vector<InterfaceEnumConstant> getEnumConstants();
00066 std::vector<InterfaceField> getDataFields();
00067 std::vector<InterfacePseudoMap> getPseudoMaps();
00068 std::string getDataComment();
00069 std::vector<InterfaceMessage> getMessages();
00070
00071 private:
00072 xmlpp::DomParser *dom;
00073 xmlpp::Node *root;
00074 std::string name;
00075 std::string author;
00076 std::string year;
00077 std::string creation_date;
00078 std::string data_comment;
00079
00080 std::vector<InterfaceConstant> constants;
00081 std::vector<InterfaceEnumConstant> enum_constants;
00082 std::vector<InterfaceField> data_fields;
00083 std::vector<InterfacePseudoMap> pseudo_maps;
00084 std::vector<InterfaceMessage> messages;
00085
00086 };
00087
00088
00089 #endif