From 78fe61bdc07f6eb13cac8c353a77fbb064a5aa79 Mon Sep 17 00:00:00 2001 From: WrinklyNinja Date: Mon, 22 Jul 2013 13:59:44 +0100 Subject: [PATCH] Update legacy-parser.h Started to adapt the legacy parser to create a list of Plugin objects that holds conditional Bash Tags and messages. --- src/backend/legacy-parser.h | 183 +++++++++--------------------------- 1 file changed, 47 insertions(+), 136 deletions(-) diff --git a/src/backend/legacy-parser.h b/src/backend/legacy-parser.h index df67d63d..e1dbbb2b 100644 --- a/src/backend/legacy-parser.h +++ b/src/backend/legacy-parser.h @@ -32,14 +32,9 @@ #define BOOST_SPIRIT_UNICODE #endif -#include "Parsing/Grammar.h" -#include "Common/Globals.h" -#include "Common/Error.h" -#include "Support/Helpers.h" -#include "Support/Logger.h" -#include "Output/Output.h" -#include "Common/Classes.h" -#include "Common/Game.h" +#include "metadata.h" +#include "error.h" +#include "game.h" #include #include @@ -56,33 +51,6 @@ #include #include - -////////////////////////////// -// Modlist data conversions -////////////////////////////// - -BOOST_FUSION_ADAPT_STRUCT( - boss::MasterlistVar, - (std::string, conditions) - (std::string, data) -) - -BOOST_FUSION_ADAPT_STRUCT( - boss::Message, - (std::string, conditions) - (uint32_t, key) - (std::string, data) -) - -BOOST_FUSION_ADAPT_STRUCT( - boss::Item, - (std::string, conditions) - (uint32_t, type) - (std::string, data) - (std::vector, messages) -) - - namespace boss { namespace fs = boost::filesystem; namespace qi = boost::spirit::qi; @@ -126,28 +94,16 @@ namespace boss { struct masterlistMsgKey_ : qi::symbols { masterlistMsgKey_::masterlistMsgKey_() { add //New Message keywords. - ("say",SAY) - ("tag",TAG) - ("req",REQ) - ("inc", INC) - ("dirty",DIRTY) - ("warn",WARN) - ("error",ERR) + ("say",g_message_say) + ("req",g_message_say) + ("inc", g_message_say) + ("dirty",g_message_warn) + ("warn",g_message_warn) + ("error",g_message_error) ; } }; - struct typeKey_ : qi::symbols { - typeKey_::typeKey_() { - add //Group keywords. - ("begingroup:", BEGINGROUP) //Needs the colon there unfortunately. - ("endgroup:", ENDGROUP) //Needs the colon there unfortunately. - ("endgroup", ENDGROUP) - ("mod:", MOD) //Needs the colon there unfortunately. - ("regex:", REGEX) - ; - } - }; /////////////////////////////// @@ -155,7 +111,8 @@ namespace boss { /////////////////////////////// //Skipper for userlist, modlist and ini parsers. - class Skipper : public grammar { +