+ virtual NodeParser* parseEndMap() { m_callback(m_data); return this; }
+
+ const std::string& packetStr() const { return m_packetStr; }
+ Packet packet() const { return m_packet; }
+ const std::string& resultStr() const { return m_resultStr; }
+ bool result() const { return m_result; }
+ const PairsParser::Pairs& reply() const { return m_reply; }
+ const PairsParser::Pairs& modify() const { return m_modify; }
+
+ private:
+ std::string m_packetStr;
+ Packet m_packet;
+ std::string m_resultStr;
+ bool m_result;
+ PairsParser::Pairs m_reply;
+ PairsParser::Pairs m_modify;
+
+ PacketParser m_packetParser;
+ ResultParser m_resultParser;
+ PairsParser m_replyParser;
+ PairsParser m_modifyParser;
+
+ Callback m_callback;
+ void* m_data;
+};
+
+class ProtoParser : public Parser
+{
+ public:
+ ProtoParser(TopParser::Callback callback, void* data)
+ : Parser( &m_topParser ),
+ m_topParser(callback, data)
+ {}
+
+ const std::string& packetStr() const { return m_topParser.packetStr(); }
+ Packet packet() const { return m_topParser.packet(); }
+ const std::string& resultStr() const { return m_topParser.resultStr(); }
+ bool result() const { return m_topParser.result(); }
+ const PairsParser::Pairs& reply() const { return m_topParser.reply(); }
+ const PairsParser::Pairs& modify() const { return m_topParser.modify(); }
+
+ private:
+ TopParser m_topParser;
+};
+
+class PacketGen : public Gen