diff --git a/CMakeLists.txt b/CMakeLists.txt index 6c3d5cf..5a4591b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -55,7 +55,22 @@ add_executable( add_executable(test1 test/test.cpp ) +add_executable( + transit_table + test/transit_table.cpp + src/wxml/expr_lib/base.cpp + src/wxml/expr_lib/bnf.cpp + src/wxml/expr_lib/common.cpp + src/wxml/expr_lib/expr_syntax_tree.cpp + src/wxml/expr_lib/parser.cpp + src/wxml/expr_lib/token.cpp + src/wxml/expr_lib/tokenizer.cpp + src/wxml/expr_lib/transit_table.cpp + ) +add_test(transit_table_test + $ + ) set(CPACK_PROJECT_NAME ${PROJECT_NAME}) set(CPACK_PROJECT_VERSION ${PROJECT_VERSION}) include(CPack) diff --git a/src/include/wxml.h b/src/include/wxml.h index 6190d2a..e50eb9a 100644 --- a/src/include/wxml.h +++ b/src/include/wxml.h @@ -533,20 +533,22 @@ namespace WXML /** * 内存结构: * 00 00 00 00 标识type - * 00 00 00 00... 当标识为0时后面为需要的动态字符串tokenName + * 00 00 00 00... 当标识为0时后面为需要的动态字符串tokenName(char *) * ///// * 03 00 00 00 00 00 00 00 00 00 00 00 70 87 E8 00(std::string地址) + * 00 00 00 00(回调地址) */ private: /* data */ public: int offset_0 = 0; - std::string offset_4; - std::string offset_16; + std::string offset_4 = ""; + std::string offset_12; + // offset_16; Token(/* args */); ~Token(); std::string GetLiteral(void); - const char * GetTokenName(); + std::string GetTokenName(); }; using Offset0Type = int(); @@ -595,9 +597,9 @@ namespace WXML static std::mutex m; static WXML::EXPRLib::TransitTable* instance; void Init_55F1E4(int root, std::string & key, std::vector& offset4List); - void Init_55F1E4_6(int root, std::string & key); void Init_55F1F8(int root, std::string & key); void Init_55F220_0(int root, std::string & key, std::string & offset_4); + void Init_55F20C(int root, std::string & key, std::string & offset_4, int offset_32, std::string &offset_36); public: std::map>> ret; bool offset_24; diff --git a/src/wxml/expr_lib/expr_syntax_tree.cpp b/src/wxml/expr_lib/expr_syntax_tree.cpp index d268920..7f5e00a 100644 --- a/src/wxml/expr_lib/expr_syntax_tree.cpp +++ b/src/wxml/expr_lib/expr_syntax_tree.cpp @@ -51,8 +51,8 @@ namespace WXML // RenderAsOps - 5 if ( this->offset_0[0] == 'O' - && this->offset_0[0] == 'P' - && this->offset_0[0] == '_' + && this->offset_0[1] == 'P' + && this->offset_0[2] == '_' ) { if (this->offset_0 == "OP_PATH") diff --git a/src/wxml/expr_lib/parser.cpp b/src/wxml/expr_lib/parser.cpp index e2befe1..e69f3bd 100644 --- a/src/wxml/expr_lib/parser.cpp +++ b/src/wxml/expr_lib/parser.cpp @@ -83,9 +83,11 @@ namespace WXML this->offset_0.push_back(v70); // WXML::EXPRLib::Parser::Parse - 20 int v49 = 0; - for(auto cur = this->offset_0.rbegin(); cur != this->offset_0.rend(); cur++) + while (true) { - auto v72 = *cur; + if (this->offset_0.begin() == this->offset_0.end()) + break; + auto v72 = *this->offset_0.rbegin(); WXML::EXPRLib::Token v84 = v74[v49]; // ??? int v15 = v72->offset_0(); // WXML::EXPRLib::Parser::Parse - 20-1 @@ -145,8 +147,7 @@ namespace WXML /////////////////////// else { - std::shared_ptr v22(new WXML::EXPRLib::ExprSyntaxTree()); - std::shared_ptr v78; + std::shared_ptr v78(new WXML::EXPRLib::ExprSyntaxTree()); v78->offset_0.assign(v72->offset_4_str); for (size_t i = 0; i < v72->offset_32; i++) { @@ -207,12 +208,13 @@ namespace WXML this->offset_0.pop_back(); std::string v80 = v84.GetTokenName(); std::vector v53 = bnfMap[v80]; - for (int i = v53.size() - 1; i >= 0; i--) + std::vector> baseList = v53[0].offset_0; + for (int i = baseList.size() - 1; i >= 0; i--) { - auto cur = v53[i]; - if( v53[i].offset_8() == 4) + std::shared_ptr cur1 = baseList[i]; + if( cur1->offset_0() == 4) break; - this->offset_0.push_back(v53[i].offset_0[0]); + this->offset_0.push_back(cur1); } } diff --git a/src/wxml/expr_lib/token.cpp b/src/wxml/expr_lib/token.cpp index 86d223a..047bd6d 100644 --- a/src/wxml/expr_lib/token.cpp +++ b/src/wxml/expr_lib/token.cpp @@ -12,9 +12,9 @@ namespace WXML Token::~Token() { } - const char * Token::GetTokenName() + std::string Token::GetTokenName() { - const char *result; + std::string result = "$"; switch ( this->offset_0 ) { case 0u: @@ -48,9 +48,9 @@ namespace WXML if (this->offset_0 != 5) { result = ""; - if (this->offset_16.size()) + if (this->offset_12.size()) { - return this->offset_16; + return this->offset_12; } } } diff --git a/src/wxml/expr_lib/tokenizer.cpp b/src/wxml/expr_lib/tokenizer.cpp index 0eb1e12..fa3de42 100644 --- a/src/wxml/expr_lib/tokenizer.cpp +++ b/src/wxml/expr_lib/tokenizer.cpp @@ -236,8 +236,9 @@ namespace WXML { if (v8) { const char **v31 = KEYWORDS; - std::string v26 = this->offset_0.substr(v29, v27 + 1); + std::string v26 = this->offset_0.substr(v29, v27 + 1 - v29); + v39.offset_12 = v26; for (int i = 0; i < 4; i++) { if (!strcmp(v26.data(), v31[i])) diff --git a/src/wxml/expr_lib/transit_table.cpp b/src/wxml/expr_lib/transit_table.cpp index d504d98..5938cd0 100644 --- a/src/wxml/expr_lib/transit_table.cpp +++ b/src/wxml/expr_lib/transit_table.cpp @@ -33,26 +33,20 @@ namespace WXML return 12; } - void TransitTable::Init_55F1E4_6(int root, std::string & key) - { - std::map> map1 = this->ret[root]; - std::vector exclamationVector = map1[key]; - std::vector> exclamationBaseList; - std::shared_ptr base_1(new WXML::EXPRLib::Base()); - base_1->offset_0 = off_55F1E4; - base_1->offset_4_int = 6; - exclamationBaseList.push_back(base_1); - WXML::EXPRLib::BNF exclamationBNF; - exclamationBNF.offset_0 = exclamationBaseList; - exclamationVector.push_back(exclamationBNF); - map1[key] = exclamationVector; - this->ret[root] = map1; - } void TransitTable::Init_55F1E4(int root, std::string & key, std::vector& offset4List) { std::map> map1 = this->ret[root]; std::vector exclamationVector = map1[key]; - std::vector> exclamationBaseList; + WXML::EXPRLib::BNF bnf; + if (exclamationVector.size() == 0) + { + exclamationVector.push_back(bnf); + } + else + { + bnf = exclamationVector[0]; + } + std::vector> exclamationBaseList = bnf.offset_0; for (auto &&i : offset4List) { @@ -61,10 +55,8 @@ namespace WXML base_1->offset_4_int = i; exclamationBaseList.push_back(base_1); } - - WXML::EXPRLib::BNF exclamationBNF; - exclamationBNF.offset_0 = exclamationBaseList; - exclamationVector.push_back(exclamationBNF); + bnf.offset_0 = exclamationBaseList; + exclamationVector[0] = bnf; map1[key] = exclamationVector; this->ret[root] = map1; } @@ -72,13 +64,21 @@ namespace WXML { std::map> map1 = this->ret[root]; std::vector exclamationVector = map1[key]; - std::vector> exclamationBaseList; + WXML::EXPRLib::BNF bnf; + if (exclamationVector.size() == 0) + { + exclamationVector.push_back(bnf); + } + else + { + bnf = exclamationVector[0]; + } + std::vector> exclamationBaseList = bnf.offset_0; std::shared_ptr base_1(new WXML::EXPRLib::Base()); base_1->offset_0 = off_55F1F8; exclamationBaseList.push_back(base_1); - WXML::EXPRLib::BNF exclamationBNF; - exclamationBNF.offset_0 = exclamationBaseList; - exclamationVector.push_back(exclamationBNF); + bnf.offset_0 = exclamationBaseList; + exclamationVector[0] = bnf; map1[key] = exclamationVector; this->ret[root] = map1; } @@ -86,15 +86,48 @@ namespace WXML { std::map> map1 = this->ret[root]; std::vector exclamationVector = map1[key]; - std::vector> exclamationBaseList; + WXML::EXPRLib::BNF bnf; + if (exclamationVector.size() == 0) + { + exclamationVector.push_back(bnf); + } + else + { + bnf = exclamationVector[0]; + } + std::vector> baseList = bnf.offset_0; std::shared_ptr base_1(new WXML::EXPRLib::Base()); base_1->offset_0 = off_55F220; base_1->offset_4_str = offset_4; base_1->offset_32 = 0; + baseList.push_back(base_1); + bnf.offset_0 = baseList; + exclamationVector[0] = bnf; + map1[key] = exclamationVector; + this->ret[root] = map1; + } + void TransitTable::Init_55F20C(int root, std::string & key, std::string & offset_4, int offset_32, std::string &offset_36) + { + std::map> map1 = this->ret[root]; + std::vector exclamationVector = map1[key]; + WXML::EXPRLib::BNF bnf; + if (exclamationVector.size() == 0) + { + exclamationVector.push_back(bnf); + } + else + { + bnf = exclamationVector[0]; + } + std::vector> exclamationBaseList = bnf.offset_0; + std::shared_ptr base_1(new WXML::EXPRLib::Base()); + base_1->offset_0 = off_55F20C; + base_1->offset_4_str = offset_4; + base_1->offset_32 = offset_32; + base_1->offset_36 = offset_36; exclamationBaseList.push_back(base_1); - WXML::EXPRLib::BNF exclamationBNF; - exclamationBNF.offset_0 = exclamationBaseList; - exclamationVector.push_back(exclamationBNF); + bnf.offset_0 = exclamationBaseList; + exclamationVector[0] = bnf; map1[key] = exclamationVector; this->ret[root] = map1; } @@ -106,6 +139,7 @@ namespace WXML this->offset_24 = true; std::map> map1 = this->ret[1]; + int root; std::vector keyList; std::vector t; keyList.push_back("!"); @@ -157,7 +191,8 @@ namespace WXML t.push_back(15); Init_55F1E4(7, i, t); } - + /////////////////// root - 8 /////////////////// + root = 8; keyList.clear(); keyList.push_back("$"); keyList.push_back(")"); @@ -169,26 +204,18 @@ namespace WXML Init_55F1F8(8, i); } std::string target = "&&"; - std::string offset_4 = ":"; + std::string offset_4; Init_55F220_0(8, target, target); - Init_55F1E4_6(8, target); - { - std::map> map1 = this->ret[8]; - std::vector exclamationVector = map1["&&"]; - std::vector> exclamationBaseList; - std::shared_ptr base_1(new WXML::EXPRLib::Base()); - base_1->offset_0 = off_55F20C; - base_1->offset_4_str = "&&"; - base_1->offset_32 = 2; - base_1->offset_36 = "a=pop();b=pop();c=b&&a;push(c)"; - exclamationBaseList.push_back(base_1); - WXML::EXPRLib::BNF exclamationBNF; - exclamationBNF.offset_0 = exclamationBaseList; - exclamationVector.push_back(exclamationBNF); - map1["&&"] = exclamationVector; - this->ret[8] = map1; - } + t.clear(); + t.push_back(6); + Init_55F1E4(8, target, t); + { + std::string key = "&&"; + std::string offset_36 = "a=pop();b=pop();c=b&&a;push(c)"; + Init_55F20C(root, key, key, 2, offset_36); + } + t.clear(); t.push_back(8); Init_55F1E4(8, target, t); @@ -203,6 +230,7 @@ namespace WXML } ///////////////////////// root - 9 //////////////// + root = 9; keyList.clear(); keyList.push_back("$"); keyList.push_back(")"); @@ -222,7 +250,7 @@ namespace WXML t.push_back(4); t.push_back(9); Init_55F1E4(9, target, t); - + offset_4 = ":"; Init_55F220_0(9, target, offset_4); t.clear(); t.push_back(4); @@ -230,77 +258,47 @@ namespace WXML Init_55F1E4(9, target, t); { - std::map> map1 = this->ret[9]; - std::vector exclamationVector = map1["?:"]; - std::vector> exclamationBaseList; - std::shared_ptr base_1(new WXML::EXPRLib::Base()); - base_1->offset_0 = off_55F20C; - base_1->offset_4_str = "?:"; - base_1->offset_32 = 3; - base_1->offset_36 = "a=pop();b=pop();c=pop();c?b:a"; - exclamationBaseList.push_back(base_1); - WXML::EXPRLib::BNF exclamationBNF; - exclamationBNF.offset_0 = exclamationBaseList; - exclamationVector.push_back(exclamationBNF); - map1["&&"] = exclamationVector; - this->ret[9] = map1; + std::string key = "?"; + std::string offset_4 = "?:"; + std::string offset_36 = "a=pop();b=pop();c=pop();c?b:a"; + Init_55F20C(root, key, offset_4, 3, offset_36); + } //////////////////// root - 10 /////////////////// - + root = 10; target = "["; - Init_55F220_0(10, target, target); + Init_55F220_0(root, target, target); t.clear(); t.push_back(30); - Init_55F1E4(10, target, t); + Init_55F1E4(root, target, t); offset_4 = "]"; - Init_55F220_0(10, target, offset_4); + Init_55F220_0(root, target, offset_4); { - int root = 10; - std::string key = "$VAR"; - std::map> map1 = this->ret[root]; - std::vector exclamationVector = map1[key]; - std::vector> exclamationBaseList; - std::shared_ptr base_1(new WXML::EXPRLib::Base()); - base_1->offset_0 = off_55F20C; - base_1->offset_4_str = "OP_LIST"; - base_1->offset_32 = 1; - base_1->offset_36 = "a=pop;c=make_list(a);push(c)"; - exclamationBaseList.push_back(base_1); - WXML::EXPRLib::BNF exclamationBNF; - exclamationBNF.offset_0 = exclamationBaseList; - exclamationVector.push_back(exclamationBNF); - map1[key] = exclamationVector; - this->ret[root] = map1; + std::string key = "["; + std::string offset_4 = "OP_LIST"; + std::string offset_36 = "a=pop;c=make_list(a);push(c)"; + Init_55F20C(root, key, offset_4, 1, offset_36); + } t.clear(); t.push_back(17); - Init_55F1E4(10, target, t); + Init_55F1E4(root, target, t); target = "$VAR"; - Init_55F220_0(10, target, target); + Init_55F220_0(root, target, target); { - int root = 10; std::string key = "$VAR"; - std::map> map1 = this->ret[root]; - std::vector exclamationVector = map1[key]; - std::vector> exclamationBaseList; - std::shared_ptr base_1(new WXML::EXPRLib::Base()); - base_1->offset_0 = off_55F20C; - base_1->offset_4_str = "OP_PATH"; - base_1->offset_32 = 1; - base_1->offset_36 = "a=pop;c=[];c.append()"; - exclamationBaseList.push_back(base_1); - WXML::EXPRLib::BNF exclamationBNF; - exclamationBNF.offset_0 = exclamationBaseList; - exclamationVector.push_back(exclamationBNF); - map1[key] = exclamationVector; - this->ret[root] = map1; + std::string offset_4 = "OP_PATH"; + std::string offset_36 = "a=pop;c=[];c.append()"; + Init_55F20C(root, key, offset_4, 1, offset_36); + } t.clear(); t.push_back(17); - Init_55F1E4(10, target, t); + Init_55F1E4(root, target, t); ////////////////////// root - 11 //////////////////// + root = 11; target = ">="; Init_55F1F8(11, target); target = ">>"; @@ -310,22 +308,11 @@ namespace WXML Init_55F1E4(11, target, t); { - int root = 11; std::string key = ">>"; - std::map> map1 = this->ret[root]; - std::vector exclamationVector = map1[key]; - std::vector> exclamationBaseList; - std::shared_ptr base_1(new WXML::EXPRLib::Base()); - base_1->offset_0 = off_55F20C; - base_1->offset_4_str = ">>"; - base_1->offset_32 = 2; - base_1->offset_36 = "a=pop();b=pop();c=b>>a;push(c)"; - exclamationBaseList.push_back(base_1); - WXML::EXPRLib::BNF exclamationBNF; - exclamationBNF.offset_0 = exclamationBaseList; - exclamationVector.push_back(exclamationBNF); - map1[key] = exclamationVector; - this->ret[root] = map1; + std::string offset_4 = ">>"; + std::string offset_36 = "a=pop();b=pop();c=b>>a;push(c)"; + Init_55F20C(root, key, offset_4, 2, offset_36); + } t.clear(); t.push_back(11); @@ -337,22 +324,11 @@ namespace WXML t.push_back(22); Init_55F1E4(11, target, t); { - int root = 11; std::string key = "<<"; - std::map> map1 = this->ret[root]; - std::vector exclamationVector = map1[key]; - std::vector> exclamationBaseList; - std::shared_ptr base_1(new WXML::EXPRLib::Base()); - base_1->offset_0 = off_55F20C; - base_1->offset_4_str = "<<"; - base_1->offset_32 = 2; - base_1->offset_36 = "a=pop();b=pop();c=b<ret[root] = map1; + std::string offset_4 = "<<"; + std::string offset_36 = "a=pop();b=pop();c=b<> map1 = this->ret[root]; - std::vector exclamationVector = map1[key]; - std::vector> exclamationBaseList; - std::shared_ptr base_1(new WXML::EXPRLib::Base()); - base_1->offset_0 = off_55F20C; - base_1->offset_4_str = "OP_EXPAND"; - base_1->offset_32 = 1; - base_1->offset_36 = "a=pop();c=expand(a);push(c);"; - exclamationBaseList.push_back(base_1); - WXML::EXPRLib::BNF exclamationBNF; - exclamationBNF.offset_0 = exclamationBaseList; - exclamationVector.push_back(exclamationBNF); - map1[key] = exclamationVector; - this->ret[root] = map1; + std::string offset_4 = "OP_EXPAND"; + std::string offset_36 = "a=pop();c=expand(a);push(c);"; + Init_55F20C(root, key, offset_4, 1, offset_36); + } t.clear(); t.push_back(27); @@ -418,35 +383,7 @@ namespace WXML t.push_back(28); t.push_back(27); Init_55F1E4(root, target, t); - target = "..."; - Init_55F220_0(root, target, target); - t.clear(); - t.push_back(14); - Init_55F1E4(root, target, t); - { - int root = 12; - std::string key = "..."; - std::map> map1 = this->ret[root]; - std::vector exclamationVector = map1[key]; - std::vector> exclamationBaseList; - std::shared_ptr base_1(new WXML::EXPRLib::Base()); - base_1->offset_0 = off_55F20C; - base_1->offset_4_str = "OP_EXPAND"; - base_1->offset_32 = 1; - base_1->offset_36 = "a=pop();c=expand(a);push(c);"; - exclamationBaseList.push_back(base_1); - WXML::EXPRLib::BNF exclamationBNF; - exclamationBNF.offset_0 = exclamationBaseList; - exclamationVector.push_back(exclamationBNF); - map1[key] = exclamationVector; - this->ret[root] = map1; - } - target = "$VAR"; - Init_55F220_0(root, target, target); - t.clear(); - t.push_back(28); - t.push_back(27); - Init_55F1E4(root, target, t); + ////////////////// root - 13 ////////////////////// root = 13; // 0xd target = "..."; @@ -455,22 +392,11 @@ namespace WXML t.push_back(14); Init_55F1E4(root, target, t); { - int root = 12; std::string key = "..."; - std::map> map1 = this->ret[root]; - std::vector exclamationVector = map1[key]; - std::vector> exclamationBaseList; - std::shared_ptr base_1(new WXML::EXPRLib::Base()); - base_1->offset_0 = off_55F20C; - base_1->offset_4_str = "OP_EXPAND"; - base_1->offset_32 = 1; - base_1->offset_36 = "a=pop();c=expand(a);push(c);"; - exclamationBaseList.push_back(base_1); - WXML::EXPRLib::BNF exclamationBNF; - exclamationBNF.offset_0 = exclamationBaseList; - exclamationVector.push_back(exclamationBNF); - map1[key] = exclamationVector; - this->ret[root] = map1; + std::string offset_4 = "OP_EXPAND"; + std::string offset_36 = "a=pop();c=expand(a);push(c);"; + Init_55F20C(root, key, offset_4, 1, offset_36); + } target = "$VAR"; Init_55F220_0(root, target, target); @@ -507,22 +433,11 @@ namespace WXML t.push_back(2); Init_55F1E4(root, target, t); { - std::string key = "==="; - std::map> map1 = this->ret[root]; - std::vector exclamationVector = map1[key]; - std::vector> exclamationBaseList; - std::shared_ptr base_1(new WXML::EXPRLib::Base()); - base_1->offset_0 = off_55F20C; - base_1->offset_4_str = "==="; - base_1->offset_32 = 2; - base_1->offset_36 = "a=pop();b=pop();c=b===a;push(c)"; - exclamationBaseList.push_back(base_1); - WXML::EXPRLib::BNF exclamationBNF; - exclamationBNF.offset_0 = exclamationBaseList; - exclamationVector.push_back(exclamationBNF); - map1[key] = exclamationVector; - this->ret[root] = map1; + std::string offset_4 = "==="; + std::string offset_36 = "a=pop();b=pop();c=b===a;push(c)"; + Init_55F20C(root, key, offset_4, 2, offset_36); + } t.clear(); t.push_back(15); @@ -534,22 +449,11 @@ namespace WXML t.push_back(2); Init_55F1E4(root, target, t); { - std::string key = "!=="; - std::map> map1 = this->ret[root]; - std::vector exclamationVector = map1[key]; - std::vector> exclamationBaseList; - std::shared_ptr base_1(new WXML::EXPRLib::Base()); - base_1->offset_0 = off_55F20C; - base_1->offset_4_str = "!=="; - base_1->offset_32 = 2; - base_1->offset_36 = "a=pop();b=pop();c=b!==a;push(c)"; - exclamationBaseList.push_back(base_1); - WXML::EXPRLib::BNF exclamationBNF; - exclamationBNF.offset_0 = exclamationBaseList; - exclamationVector.push_back(exclamationBNF); - map1[key] = exclamationVector; - this->ret[root] = map1; + std::string offset_4 = "!=="; + std::string offset_36 = "a=pop();b=pop();c=b!==a;push(c)"; + Init_55F20C(root, key, offset_4, 2, offset_36); + } t.clear(); t.push_back(15); @@ -569,22 +473,11 @@ namespace WXML t.push_back(2); Init_55F1E4(root, target, t); { - std::string key = "=="; - std::map> map1 = this->ret[root]; - std::vector exclamationVector = map1[key]; - std::vector> exclamationBaseList; - std::shared_ptr base_1(new WXML::EXPRLib::Base()); - base_1->offset_0 = off_55F20C; - base_1->offset_4_str = "=="; - base_1->offset_32 = 2; - base_1->offset_36 = "a=pop();b=pop();c=b==a;push(c)"; - exclamationBaseList.push_back(base_1); - WXML::EXPRLib::BNF exclamationBNF; - exclamationBNF.offset_0 = exclamationBaseList; - exclamationVector.push_back(exclamationBNF); - map1[key] = exclamationVector; - this->ret[root] = map1; + std::string offset_4 = "=="; + std::string offset_36 = "a=pop();b=pop();c=b==a;push(c)"; + Init_55F20C(root, key, offset_4, 2, offset_36); + } t.clear(); t.push_back(15); @@ -608,22 +501,11 @@ namespace WXML t.push_back(2); Init_55F1E4(root, target, t); { + std::string key = "!="; + std::string offset_4 = "!="; + std::string offset_36 = "a=pop();b=pop();c=b!=a;push(c)"; + Init_55F20C(root, key, offset_4, 2, offset_36); - std::string key = target; - std::map> map1 = this->ret[root]; - std::vector exclamationVector = map1[key]; - std::vector> exclamationBaseList; - std::shared_ptr base_1(new WXML::EXPRLib::Base()); - base_1->offset_0 = off_55F20C; - base_1->offset_4_str = "!="; - base_1->offset_32 = 2; - base_1->offset_36 = "a=pop();b=pop();c=b!=a;push(c)"; - exclamationBaseList.push_back(base_1); - WXML::EXPRLib::BNF exclamationBNF; - exclamationBNF.offset_0 = exclamationBaseList; - exclamationVector.push_back(exclamationBNF); - map1[key] = exclamationVector; - this->ret[root] = map1; } t.clear(); t.push_back(15); @@ -659,22 +541,11 @@ namespace WXML t.push_back(25); Init_55F1E4(root, target, t); { + std::string key = "^"; + std::string offset_4 = "^"; + std::string offset_36 = "a=pop();b=pop();c=b^a;push(c)"; + Init_55F20C(root, key, offset_4, 2, offset_36); - std::string key = target; - std::map> map1 = this->ret[root]; - std::vector exclamationVector = map1[key]; - std::vector> exclamationBaseList; - std::shared_ptr base_1(new WXML::EXPRLib::Base()); - base_1->offset_0 = off_55F20C; - base_1->offset_4_str = "^"; - base_1->offset_32 = 2; - base_1->offset_36 = "a=pop();b=pop();c=b^a;push(c)"; - exclamationBaseList.push_back(base_1); - WXML::EXPRLib::BNF exclamationBNF; - exclamationBNF.offset_0 = exclamationBaseList; - exclamationVector.push_back(exclamationBNF); - map1[key] = exclamationVector; - this->ret[root] = map1; } t.clear(); t.push_back(16); @@ -697,6 +568,22 @@ namespace WXML } target = "("; Init_55F220_0(root, target, target); + t.clear(); + t.push_back(30); + Init_55F1E4(root, target, t); + offset_4 = ")"; + Init_55F220_0(root, target, offset_4); + { + std::string key = target; + std::string offset_4 = "OP_FUNC"; + std::string offset_36 = "a=pop;b=pop;c=b[a]"; + Init_55F20C(root, key, offset_4, 2, offset_36); + + } + t.clear(); + t.push_back(17); + Init_55F1E4(root, target, t); + keyList.clear(); keyList.push_back("+"); keyList.push_back("*"); @@ -709,6 +596,19 @@ namespace WXML } target = "."; Init_55F220_0(root, target, target); + offset_4 = "$VAR"; + Init_55F220_0(root, target, offset_4); + { + std::string key = target; + std::string offset_4 = "OP_DICT"; + std::string offset_36 = "a=pop;c=top;c.append(a)"; + Init_55F20C(root, key, offset_4, 2, offset_36); + + } + t.clear(); + t.push_back(17); + Init_55F1E4(root, target, t); + keyList.clear(); keyList.push_back(":"); keyList.push_back("<<"); @@ -730,27 +630,21 @@ namespace WXML keyList.clear(); keyList.push_back("]"); keyList.push_back("^"); + keyList.push_back("==="); + keyList.push_back("!=="); + keyList.push_back("<"); + keyList.push_back("}"); + keyList.push_back("|"); for (auto &&i : keyList) { Init_55F1F8(root, i); } { - std::string key = target; - std::map> map1 = this->ret[root]; - std::vector exclamationVector = map1[key]; - std::vector> exclamationBaseList; - std::shared_ptr base_1(new WXML::EXPRLib::Base()); - base_1->offset_0 = off_55F20C; - base_1->offset_4_str = "OP_DICT"; - base_1->offset_32 = 2; - base_1->offset_36 = "a=pop;b=pop;c=b[a]"; - exclamationBaseList.push_back(base_1); - WXML::EXPRLib::BNF exclamationBNF; - exclamationBNF.offset_0 = exclamationBaseList; - exclamationVector.push_back(exclamationBNF); - map1[key] = exclamationVector; - this->ret[root] = map1; + std::string offset_4 = "OP_DICT"; + std::string offset_36 = "a=pop;b=pop;c=b[a]"; + Init_55F20C(root, key, offset_4, 2, offset_36); + } t.clear(); t.push_back(17); @@ -771,22 +665,11 @@ namespace WXML t.push_back(3); Init_55F1E4(root, target, t); { - std::string key = target; - std::map> map1 = this->ret[root]; - std::vector exclamationVector = map1[key]; - std::vector> exclamationBaseList; - std::shared_ptr base_1(new WXML::EXPRLib::Base()); - base_1->offset_0 = off_55F20C; - base_1->offset_4_str = "||"; - base_1->offset_32 = 2; - base_1->offset_36 = "a=pop();b=pop();c=b||a;push(c)"; - exclamationBaseList.push_back(base_1); - WXML::EXPRLib::BNF exclamationBNF; - exclamationBNF.offset_0 = exclamationBaseList; - exclamationVector.push_back(exclamationBNF); - map1[key] = exclamationVector; - this->ret[root] = map1; + std::string offset_4 = "||"; + std::string offset_36 = "a=pop();b=pop();c=b||a;push(c)"; + Init_55F20C(root, key, offset_4, 2, offset_36); + } t.clear(); t.push_back(18); @@ -811,9 +694,12 @@ namespace WXML { Init_55F220_0(root, i, i); } + target = "("; t.clear(); t.push_back(14); Init_55F1E4(root, target, t); + offset_4 = ")"; + Init_55F220_0(root, target, offset_4); target = "$KEYWORD"; Init_55F220_0(root, target, target); @@ -849,22 +735,11 @@ namespace WXML t.push_back(1); Init_55F1E4(root, target, t); { - std::string key = target; - std::map> map1 = this->ret[root]; - std::vector exclamationVector = map1[key]; - std::vector> exclamationBaseList; - std::shared_ptr base_1(new WXML::EXPRLib::Base()); - base_1->offset_0 = off_55F20C; - base_1->offset_4_str = ">="; - base_1->offset_32 = 2; - base_1->offset_36 = "a=pop();b=pop();c=b>=a;push(c)"; - exclamationBaseList.push_back(base_1); - WXML::EXPRLib::BNF exclamationBNF; - exclamationBNF.offset_0 = exclamationBaseList; - exclamationVector.push_back(exclamationBNF); - map1[key] = exclamationVector; - this->ret[root] = map1; + std::string offset_4 = ">="; + std::string offset_36 = "a=pop();b=pop();c=b>=a;push(c)"; + Init_55F20C(root, key, offset_4, 2, offset_36); + } t.clear(); t.push_back(20); @@ -885,22 +760,11 @@ namespace WXML t.push_back(1); Init_55F1E4(root, target, t); { - std::string key = target; - std::map> map1 = this->ret[root]; - std::vector exclamationVector = map1[key]; - std::vector> exclamationBaseList; - std::shared_ptr base_1(new WXML::EXPRLib::Base()); - base_1->offset_0 = off_55F20C; - base_1->offset_4_str = "<="; - base_1->offset_32 = 2; - base_1->offset_36 = "a=pop();b=pop();c=b<=a;push(c)"; - exclamationBaseList.push_back(base_1); - WXML::EXPRLib::BNF exclamationBNF; - exclamationBNF.offset_0 = exclamationBaseList; - exclamationVector.push_back(exclamationBNF); - map1[key] = exclamationVector; - this->ret[root] = map1; + std::string offset_4 = "<="; + std::string offset_36 = "a=pop();b=pop();c=b<=a;push(c)"; + Init_55F20C(root, key, offset_4, 2, offset_36); + } t.clear(); t.push_back(20); @@ -924,22 +788,11 @@ namespace WXML t.push_back(1); Init_55F1E4(root, target, t); { - std::string key = target; - std::map> map1 = this->ret[root]; - std::vector exclamationVector = map1[key]; - std::vector> exclamationBaseList; - std::shared_ptr base_1(new WXML::EXPRLib::Base()); - base_1->offset_0 = off_55F20C; - base_1->offset_4_str = "<"; - base_1->offset_32 = 2; - base_1->offset_36 = "a=pop();b=pop();c=bret[root] = map1; + std::string offset_4 = "<"; + std::string offset_36 = "a=pop();b=pop();c=b> map1 = this->ret[root]; - std::vector exclamationVector = map1[key]; - std::vector> exclamationBaseList; - std::shared_ptr base_1(new WXML::EXPRLib::Base()); - base_1->offset_0 = off_55F20C; - base_1->offset_4_str = ">"; - base_1->offset_32 = 2; - base_1->offset_36 = "a=pop();b=pop();c=b>a;push(c)"; - exclamationBaseList.push_back(base_1); - WXML::EXPRLib::BNF exclamationBNF; - exclamationBNF.offset_0 = exclamationBaseList; - exclamationVector.push_back(exclamationBNF); - map1[key] = exclamationVector; - this->ret[root] = map1; + std::string offset_4 = ">"; + std::string offset_36 = "a=pop();b=pop();c=b>a;push(c)"; + Init_55F20C(root, key, offset_4, 2, offset_36); + } t.clear(); t.push_back(20); @@ -1041,6 +883,17 @@ namespace WXML t.push_back(19); Init_55F1E4(root, i, t); } + target = "-"; + t.clear(); + t.push_back(23); + Init_55F1E4(root, target, t); + { + std::string key = target; + std::string offset_4 = "-"; + std::string offset_36 = "a=pop();c=-a;push(c)"; + Init_55F20C(root, key, offset_4, 1, offset_36); + + } ////////////////// root - 24 ////////////////////// root = 24; //0x18 target = "!"; @@ -1050,22 +903,11 @@ namespace WXML Init_55F1E4(root, target, t); { - std::string key = target; - std::map> map1 = this->ret[root]; - std::vector exclamationVector = map1[key]; - std::vector> exclamationBaseList; - std::shared_ptr base_1(new WXML::EXPRLib::Base()); - base_1->offset_0 = off_55F20C; - base_1->offset_4_str = "!"; - base_1->offset_32 = 1; - base_1->offset_36 = "a=pop();c=!a;push(c)"; - exclamationBaseList.push_back(base_1); - WXML::EXPRLib::BNF exclamationBNF; - exclamationBNF.offset_0 = exclamationBaseList; - exclamationVector.push_back(exclamationBNF); - map1[key] = exclamationVector; - this->ret[root] = map1; + std::string offset_4 = "!"; + std::string offset_36 = "a=pop();c=!a;push(c)"; + Init_55F20C(root, key, offset_4, 1, offset_36); + } keyList.clear(); keyList.push_back("$DECIMAL"); @@ -1090,22 +932,11 @@ namespace WXML Init_55F1E4(root, target, t); { - std::string key = target; - std::map> map1 = this->ret[root]; - std::vector exclamationVector = map1[key]; - std::vector> exclamationBaseList; - std::shared_ptr base_1(new WXML::EXPRLib::Base()); - base_1->offset_0 = off_55F20C; - base_1->offset_4_str = "~"; - base_1->offset_32 = 1; - base_1->offset_36 = "a=pop();c=~a;push(c)"; - exclamationBaseList.push_back(base_1); - WXML::EXPRLib::BNF exclamationBNF; - exclamationBNF.offset_0 = exclamationBaseList; - exclamationVector.push_back(exclamationBNF); - map1[key] = exclamationVector; - this->ret[root] = map1; + std::string offset_4 = "~"; + std::string offset_36 = "a=pop();c=~a;push(c)"; + Init_55F20C(root, key, offset_4, 1, offset_36); + } ////////////////// root - 25 ////////////////////// root = 25; //0x19 @@ -1146,22 +977,11 @@ namespace WXML t.push_back(24); Init_55F1E4(root, target, t); { + std::string key = target; + std::string offset_4 = "%"; + std::string offset_36 = "a=pop();b=pop();c=b%a;push(c)"; + Init_55F20C(root, key, offset_4, 2, offset_36); - std::string key = "%"; - std::map> map1 = this->ret[root]; - std::vector exclamationVector = map1[key]; - std::vector> exclamationBaseList; - std::shared_ptr base_1(new WXML::EXPRLib::Base()); - base_1->offset_0 = off_55F20C; - base_1->offset_4_str = "%"; - base_1->offset_32 = 2; - base_1->offset_36 = "a=pop();b=pop();c=b%a;push(c)"; - exclamationBaseList.push_back(base_1); - WXML::EXPRLib::BNF exclamationBNF; - exclamationBNF.offset_0 = exclamationBaseList; - exclamationVector.push_back(exclamationBNF); - map1[key] = exclamationVector; - this->ret[root] = map1; } t.clear(); t.push_back(26); @@ -1183,22 +1003,11 @@ namespace WXML t.push_back(24); Init_55F1E4(root, target, t); { + std::string key = target; + std::string offset_4 = "*"; + std::string offset_36 = "a=pop();b=pop();c=b*a;push(c)"; + Init_55F20C(root, key, offset_4, 2, offset_36); - std::string key = "*"; - std::map> map1 = this->ret[root]; - std::vector exclamationVector = map1[key]; - std::vector> exclamationBaseList; - std::shared_ptr base_1(new WXML::EXPRLib::Base()); - base_1->offset_0 = off_55F20C; - base_1->offset_4_str = "*"; - base_1->offset_32 = 2; - base_1->offset_36 = "a=pop();b=pop();c=b*a;push(c)"; - exclamationBaseList.push_back(base_1); - WXML::EXPRLib::BNF exclamationBNF; - exclamationBNF.offset_0 = exclamationBaseList; - exclamationVector.push_back(exclamationBNF); - map1[key] = exclamationVector; - this->ret[root] = map1; } t.clear(); t.push_back(26); @@ -1218,22 +1027,11 @@ namespace WXML t.push_back(24); Init_55F1E4(root, target, t); { + std::string key = target; + std::string offset_4 = "/"; + std::string offset_36 = "a=pop();b=pop();c=b/a;push(c)"; + Init_55F20C(root, key, offset_4, 2, offset_36); - std::string key = "/"; - std::map> map1 = this->ret[root]; - std::vector exclamationVector = map1[key]; - std::vector> exclamationBaseList; - std::shared_ptr base_1(new WXML::EXPRLib::Base()); - base_1->offset_0 = off_55F20C; - base_1->offset_4_str = "/"; - base_1->offset_32 = 2; - base_1->offset_36 = "a=pop();b=pop();c=b/a;push(c)"; - exclamationBaseList.push_back(base_1); - WXML::EXPRLib::BNF exclamationBNF; - exclamationBNF.offset_0 = exclamationBaseList; - exclamationVector.push_back(exclamationBNF); - map1[key] = exclamationVector; - this->ret[root] = map1; } t.clear(); t.push_back(26); @@ -1272,22 +1070,11 @@ namespace WXML t.push_back(13); Init_55F1E4(root, target, t); { + std::string key = target; + std::string offset_4 = "OP_DICT_CONCAT"; + std::string offset_36 = "a=pop();b=top();c=b.a;"; + Init_55F20C(root, key, offset_4, 2, offset_36); - std::string key = ","; - std::map> map1 = this->ret[root]; - std::vector exclamationVector = map1[key]; - std::vector> exclamationBaseList; - std::shared_ptr base_1(new WXML::EXPRLib::Base()); - base_1->offset_0 = off_55F20C; - base_1->offset_4_str = "OP_DICT_CONCAT"; - base_1->offset_32 = 2; - base_1->offset_36 = "a=pop();b=top();c=b.a;"; - exclamationBaseList.push_back(base_1); - WXML::EXPRLib::BNF exclamationBNF; - exclamationBNF.offset_0 = exclamationBaseList; - exclamationVector.push_back(exclamationBNF); - map1[key] = exclamationVector; - this->ret[root] = map1; } t.clear(); t.push_back(27); @@ -1307,85 +1094,41 @@ namespace WXML t.push_back(14); Init_55F1E4(root, target, t); { + std::string key = target; + std::string offset_4 = "OP_MAKE_DICT"; + std::string offset_36 = "a=pop(),key=pop(),c={key:a};push(c)"; + Init_55F20C(root, key, offset_4, 2, offset_36); - std::string key = ":"; - std::map> map1 = this->ret[root]; - std::vector exclamationVector = map1[key]; - std::vector> exclamationBaseList; - std::shared_ptr base_1(new WXML::EXPRLib::Base()); - base_1->offset_0 = off_55F20C; - base_1->offset_4_str = "OP_MAKE_DICT"; - base_1->offset_32 = 2; - base_1->offset_36 = "a=pop(),key=pop(),c={key:a};push(c)"; - exclamationBaseList.push_back(base_1); - WXML::EXPRLib::BNF exclamationBNF; - exclamationBNF.offset_0 = exclamationBaseList; - exclamationVector.push_back(exclamationBNF); - map1[key] = exclamationVector; - this->ret[root] = map1; } target = "}"; Init_55F1F8(root, target); { + std::string key = target; + std::string offset_4 = "OP_MAKE_DICT"; + std::string offset_36 = "a=pop();c={a:a}"; + Init_55F20C(root, key, offset_4, 1, offset_36); - std::string key = "}"; - std::map> map1 = this->ret[root]; - std::vector exclamationVector = map1[key]; - std::vector> exclamationBaseList; - std::shared_ptr base_1(new WXML::EXPRLib::Base()); - base_1->offset_0 = off_55F20C; - base_1->offset_4_str = "OP_MAKE_DICT"; - base_1->offset_32 = 1; - base_1->offset_36 = "a=pop();c={a:a}"; - exclamationBaseList.push_back(base_1); - WXML::EXPRLib::BNF exclamationBNF; - exclamationBNF.offset_0 = exclamationBaseList; - exclamationVector.push_back(exclamationBNF); - map1[key] = exclamationVector; - this->ret[root] = map1; } target = ","; Init_55F1F8(root, target); { + std::string key = target; + std::string offset_4 = "OP_MAKE_DICT"; + std::string offset_36 = "a=pop();c={a:a}"; + Init_55F20C(root, key, offset_4, 1, offset_36); - std::string key = ","; - std::map> map1 = this->ret[root]; - std::vector exclamationVector = map1[key]; - std::vector> exclamationBaseList; - std::shared_ptr base_1(new WXML::EXPRLib::Base()); - base_1->offset_0 = off_55F20C; - base_1->offset_4_str = "OP_MAKE_DICT"; - base_1->offset_32 = 1; - base_1->offset_36 = "a=pop();c={a:a}"; - exclamationBaseList.push_back(base_1); - WXML::EXPRLib::BNF exclamationBNF; - exclamationBNF.offset_0 = exclamationBaseList; - exclamationVector.push_back(exclamationBNF); - map1[key] = exclamationVector; - this->ret[root] = map1; } target = "$"; Init_55F1F8(root, target); { + std::string key = target; + std::string offset_4 = "OP_MAKE_DICT"; + std::string offset_36 = "a=pop();c={a:a}"; + Init_55F20C(root, key, offset_4, 1, offset_36); - std::string key = "$"; - std::map> map1 = this->ret[root]; - std::vector exclamationVector = map1[key]; - std::vector> exclamationBaseList; - std::shared_ptr base_1(new WXML::EXPRLib::Base()); - base_1->offset_0 = off_55F20C; - base_1->offset_4_str = "OP_MAKE_DICT"; - base_1->offset_32 = 1; - base_1->offset_36 = "a=pop();c={a:a}"; - exclamationBaseList.push_back(base_1); - WXML::EXPRLib::BNF exclamationBNF; - exclamationBNF.offset_0 = exclamationBaseList; - exclamationVector.push_back(exclamationBNF); - map1[key] = exclamationVector; - this->ret[root] = map1; } ////////////////// root - 29 ////////////////////// root = 29; //0x1d @@ -1410,22 +1153,11 @@ namespace WXML t.push_back(21); Init_55F1E4(root, target, t); { + std::string key = target; + std::string offset_4 = "+"; + std::string offset_36 = "a=pop();b=pop();c=b+a;push(c)"; + Init_55F20C(root, key, offset_4, 2, offset_36); - std::string key = "+"; - std::map> map1 = this->ret[root]; - std::vector exclamationVector = map1[key]; - std::vector> exclamationBaseList; - std::shared_ptr base_1(new WXML::EXPRLib::Base()); - base_1->offset_0 = off_55F20C; - base_1->offset_4_str = "+"; - base_1->offset_32 = 2; - base_1->offset_36 = "a=pop();b=pop();c=b+a;push(c)"; - exclamationBaseList.push_back(base_1); - WXML::EXPRLib::BNF exclamationBNF; - exclamationBNF.offset_0 = exclamationBaseList; - exclamationVector.push_back(exclamationBNF); - map1[key] = exclamationVector; - this->ret[root] = map1; } t.clear(); t.push_back(29); @@ -1437,22 +1169,11 @@ namespace WXML t.push_back(21); Init_55F1E4(root, target, t); { + std::string key = target; + std::string offset_4 = "-"; + std::string offset_36 = "a=pop();b=pop();c=b-a;push(c)"; + Init_55F20C(root, key, offset_4, 2, offset_36); - std::string key = "-"; - std::map> map1 = this->ret[root]; - std::vector exclamationVector = map1[key]; - std::vector> exclamationBaseList; - std::shared_ptr base_1(new WXML::EXPRLib::Base()); - base_1->offset_0 = off_55F20C; - base_1->offset_4_str = "-"; - base_1->offset_32 = 2; - base_1->offset_36 = "a=pop();b=pop();c=b-a;push(c)"; - exclamationBaseList.push_back(base_1); - WXML::EXPRLib::BNF exclamationBNF; - exclamationBNF.offset_0 = exclamationBaseList; - exclamationVector.push_back(exclamationBNF); - map1[key] = exclamationVector; - this->ret[root] = map1; } t.clear(); t.push_back(29); @@ -1486,22 +1207,11 @@ namespace WXML t.push_back(9); Init_55F1E4(root, target, t); { + std::string key = target; + std::string offset_4 = "OP_LIST_CONCAT"; + std::string offset_36 = "a=pop();c=make_list(a);push(c)"; + Init_55F20C(root, key, offset_4, 1, offset_36); - std::string key = "!"; - std::map> map1 = this->ret[root]; - std::vector exclamationVector = map1[key]; - std::vector> exclamationBaseList; - std::shared_ptr base_1(new WXML::EXPRLib::Base()); - base_1->offset_0 = off_55F20C; - base_1->offset_4_str = "OP_LIST_CONCAT"; - base_1->offset_32 = 1; - base_1->offset_36 = "a=pop();c=make_list(a);push(c)"; - exclamationBaseList.push_back(base_1); - WXML::EXPRLib::BNF exclamationBNF; - exclamationBNF.offset_0 = exclamationBaseList; - exclamationVector.push_back(exclamationBNF); - map1[key] = exclamationVector; - this->ret[root] = map1; } t.clear(); t.push_back(31); @@ -1513,22 +1223,11 @@ namespace WXML t.push_back(9); Init_55F1E4(root, target, t); { + std::string key = target; + std::string offset_4 = "OP_LIST_CONCAT"; + std::string offset_36 = "a=pop();c=make_list(a);push(c)"; + Init_55F20C(root, key, offset_4, 1, offset_36); - std::string key = "$DECIMAL"; - std::map> map1 = this->ret[root]; - std::vector exclamationVector = map1[key]; - std::vector> exclamationBaseList; - std::shared_ptr base_1(new WXML::EXPRLib::Base()); - base_1->offset_0 = off_55F20C; - base_1->offset_4_str = "OP_LIST_CONCAT"; - base_1->offset_32 = 1; - base_1->offset_36 = "a=pop();c=make_list(a);push(c)"; - exclamationBaseList.push_back(base_1); - WXML::EXPRLib::BNF exclamationBNF; - exclamationBNF.offset_0 = exclamationBaseList; - exclamationVector.push_back(exclamationBNF); - map1[key] = exclamationVector; - this->ret[root] = map1; } t.clear(); t.push_back(31); @@ -1537,22 +1236,11 @@ namespace WXML target = "$"; Init_55F1F8(root, target); { + std::string key = target; + std::string offset_4 = "OP_LIST_CONCAT"; + std::string offset_36 = "c=make_list;push(c)"; + Init_55F20C(root, key, offset_4, 0, offset_36); - std::string key = "$"; - std::map> map1 = this->ret[root]; - std::vector exclamationVector = map1[key]; - std::vector> exclamationBaseList; - std::shared_ptr base_1(new WXML::EXPRLib::Base()); - base_1->offset_0 = off_55F20C; - base_1->offset_4_str = "OP_LIST_CONCAT"; - base_1->offset_32 = 0; - base_1->offset_36 = "c=make_list;push(c)"; - exclamationBaseList.push_back(base_1); - WXML::EXPRLib::BNF exclamationBNF; - exclamationBNF.offset_0 = exclamationBaseList; - exclamationVector.push_back(exclamationBNF); - map1[key] = exclamationVector; - this->ret[root] = map1; } t.clear(); t.push_back(31); @@ -1571,22 +1259,11 @@ namespace WXML t.push_back(9); Init_55F1E4(root, target, t); { - std::string key = i; - std::map> map1 = this->ret[root]; - std::vector exclamationVector = map1[key]; - std::vector> exclamationBaseList; - std::shared_ptr base_1(new WXML::EXPRLib::Base()); - base_1->offset_0 = off_55F20C; - base_1->offset_4_str = "OP_LIST_CONCAT"; - base_1->offset_32 = 1; - base_1->offset_36 = "a=pop();c=make_list(a);push(c)"; - exclamationBaseList.push_back(base_1); - WXML::EXPRLib::BNF exclamationBNF; - exclamationBNF.offset_0 = exclamationBaseList; - exclamationVector.push_back(exclamationBNF); - map1[key] = exclamationVector; - this->ret[root] = map1; + std::string offset_4 = "OP_LIST_CONCAT"; + std::string offset_36 = "a=pop();c=make_list(a);push(c)"; + Init_55F20C(root, key, offset_4, 1, offset_36); + } t.clear(); t.push_back(31); @@ -1596,22 +1273,11 @@ namespace WXML target = ")"; Init_55F1F8(root, target); { - std::string key = target; - std::map> map1 = this->ret[root]; - std::vector exclamationVector = map1[key]; - std::vector> exclamationBaseList; - std::shared_ptr base_1(new WXML::EXPRLib::Base()); - base_1->offset_0 = off_55F20C; - base_1->offset_4_str = "OP_LIST_CONCAT"; - base_1->offset_32 = 0; - base_1->offset_36 = "c=make_list;push(c)"; - exclamationBaseList.push_back(base_1); - WXML::EXPRLib::BNF exclamationBNF; - exclamationBNF.offset_0 = exclamationBaseList; - exclamationVector.push_back(exclamationBNF); - map1[key] = exclamationVector; - this->ret[root] = map1; + std::string offset_4 = "OP_LIST_CONCAT"; + std::string offset_36 = "c=make_list;push(c)"; + Init_55F20C(root, key, offset_4, 0, offset_36); + } t.clear(); t.push_back(31); @@ -1630,22 +1296,11 @@ namespace WXML t.push_back(9); Init_55F1E4(root, target, t); { + std::string key = target; + std::string offset_4 = "OP_LIST_CONCAT"; + std::string offset_36 = "a=pop();c=make_list(a);push(c)"; + Init_55F20C(root, key, offset_4, 1, offset_36); - std::string key = i; - std::map> map1 = this->ret[root]; - std::vector exclamationVector = map1[key]; - std::vector> exclamationBaseList; - std::shared_ptr base_1(new WXML::EXPRLib::Base()); - base_1->offset_0 = off_55F20C; - base_1->offset_4_str = "OP_LIST_CONCAT"; - base_1->offset_32 = 1; - base_1->offset_36 = "a=pop();c=make_list(a);push(c)"; - exclamationBaseList.push_back(base_1); - WXML::EXPRLib::BNF exclamationBNF; - exclamationBNF.offset_0 = exclamationBaseList; - exclamationVector.push_back(exclamationBNF); - map1[key] = exclamationVector; - this->ret[root] = map1; } t.clear(); t.push_back(31); @@ -1655,22 +1310,11 @@ namespace WXML target = "]"; Init_55F1F8(root, target); { - std::string key = target; - std::map> map1 = this->ret[root]; - std::vector exclamationVector = map1[key]; - std::vector> exclamationBaseList; - std::shared_ptr base_1(new WXML::EXPRLib::Base()); - base_1->offset_0 = off_55F20C; - base_1->offset_4_str = "OP_LIST_CONCAT"; - base_1->offset_32 = 0; - base_1->offset_36 = "c=make_list;push(c)"; - exclamationBaseList.push_back(base_1); - WXML::EXPRLib::BNF exclamationBNF; - exclamationBNF.offset_0 = exclamationBaseList; - exclamationVector.push_back(exclamationBNF); - map1[key] = exclamationVector; - this->ret[root] = map1; + std::string offset_4 = "OP_LIST_CONCAT"; + std::string offset_36 = "c=make_list;push(c)"; + Init_55F20C(root, key, offset_4, 0, offset_36); + } t.clear(); t.push_back(31); @@ -1688,22 +1332,11 @@ namespace WXML t.push_back(9); Init_55F1E4(root, target, t); { + std::string key = target; + std::string offset_4 = "OP_LIST_CONCAT"; + std::string offset_36 = "a=pop();c=make_list(a);push(c)"; + Init_55F20C(root, key, offset_4, 1, offset_36); - std::string key = i; - std::map> map1 = this->ret[root]; - std::vector exclamationVector = map1[key]; - std::vector> exclamationBaseList; - std::shared_ptr base_1(new WXML::EXPRLib::Base()); - base_1->offset_0 = off_55F20C; - base_1->offset_4_str = "OP_LIST_CONCAT"; - base_1->offset_32 = 1; - base_1->offset_36 = "a=pop();c=make_list(a);push(c)"; - exclamationBaseList.push_back(base_1); - WXML::EXPRLib::BNF exclamationBNF; - exclamationBNF.offset_0 = exclamationBaseList; - exclamationVector.push_back(exclamationBNF); - map1[key] = exclamationVector; - this->ret[root] = map1; } t.clear(); t.push_back(31); @@ -1726,23 +1359,15 @@ namespace WXML t.push_back(14); Init_55F1E4(root, target, t); { + std::string key = target; + std::string offset_4 = "OP_LIST_CONCAT"; + std::string offset_36 = "a=pop();b=pop();c=b.a"; + Init_55F20C(root, key, offset_4, 2, offset_36); - std::string key = ","; - std::map> map1 = this->ret[root]; - std::vector exclamationVector = map1[key]; - std::vector> exclamationBaseList; - std::shared_ptr base_1(new WXML::EXPRLib::Base()); - base_1->offset_0 = off_55F20C; - base_1->offset_4_str = "OP_LIST_CONCAT"; - base_1->offset_32 = 2; - base_1->offset_36 = "a=pop();b=pop();c=b.a"; - exclamationBaseList.push_back(base_1); - WXML::EXPRLib::BNF exclamationBNF; - exclamationBNF.offset_0 = exclamationBaseList; - exclamationVector.push_back(exclamationBNF); - map1[key] = exclamationVector; - this->ret[root] = map1; } + t.clear(); + t.push_back(31); + Init_55F1E4(root, target, t); target = "$"; Init_55F1F8(root, target); @@ -1756,27 +1381,18 @@ namespace WXML t.push_back(7); Init_55F1E4(root, target, t); { - std::string key = "&"; - std::map> map1 = this->ret[root]; - std::vector exclamationVector = map1[key]; - std::vector> exclamationBaseList; - std::shared_ptr base_1(new WXML::EXPRLib::Base()); - base_1->offset_0 = off_55F20C; - base_1->offset_4_str = "&"; - base_1->offset_32 = 2; - base_1->offset_36 = "a=pop();b=pop();c=b&a;push(c)"; - exclamationBaseList.push_back(base_1); - WXML::EXPRLib::BNF exclamationBNF; - exclamationBNF.offset_0 = exclamationBaseList; - exclamationVector.push_back(exclamationBNF); - map1[key] = exclamationVector; - this->ret[root] = map1; + std::string key = target; + std::string offset_4 = "&"; + std::string offset_36 = "a=pop();b=pop();c=b&a;push(c)"; + Init_55F20C(root, key, offset_4, 2, offset_36); + } t.clear(); t.push_back(32); Init_55F1E4(root, target, t); keyList.clear(); keyList.push_back(")"); + keyList.push_back("}"); keyList.push_back("||"); keyList.push_back(","); keyList.push_back("&&"); @@ -1800,14 +1416,26 @@ namespace WXML keyList.push_back("&&"); keyList.push_back(":"); keyList.push_back("}"); - keyList.push_back("|"); keyList.push_back("?"); for (auto &&i : keyList) { Init_55F1F8(root, i); } - - printf("pause\n"); + target = "|"; + Init_55F220_0(root, target, target); + t.clear(); + t.push_back(5); + Init_55F1E4(root, target, t); + { + std::string key = target; + std::string offset_4 = "|"; + std::string offset_36 = "a=pop();b=pop();c=b|a;push(c)"; + Init_55F20C(root, key, offset_4, 2, offset_36); + + } + t.clear(); + t.push_back(33); + Init_55F1E4(root, target, t); } } } diff --git a/test/disassembly/init.c b/test/disassembly/init.c index 0182063..de31b6e 100644 --- a/test/disassembly/init.c +++ b/test/disassembly/init.c @@ -2969,6 +2969,7 @@ void __fastcall WXML::EXPRLib::TransitTable::Init(int a1) std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count(&v1980, v136); std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count(v1978, v1510); std::vector>::~vector(&v1982); + ////////////////// root - 4 //////////////////// v137 = std::_Rb_tree_header::_Rb_tree_header(v1511); v1979 = 4; std::map>>::operator[](v137); @@ -3266,6 +3267,7 @@ void __fastcall WXML::EXPRLib::TransitTable::Init(int a1) std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count(&v1980, v178); std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count(v1978, v1521); std::vector>::~vector(&v1982); + ////////////////// root - 5 //////////////////// v179 = std::_Rb_tree_header::_Rb_tree_header(v1522); v1979 = 5; std::map>>::operator[](v179); @@ -3563,6 +3565,7 @@ void __fastcall WXML::EXPRLib::TransitTable::Init(int a1) std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count(&v1980, v220); std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count(v1978, v1532); std::vector>::~vector(&v1982); + ////////////////// root - 6 //////////////////// v221 = std::_Rb_tree_header::_Rb_tree_header(v1533); v1979 = 6; std::map>>::operator[](v221); @@ -3860,6 +3863,7 @@ void __fastcall WXML::EXPRLib::TransitTable::Init(int a1) std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count(&v1980, v262); std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count(v1978, v1543); std::vector>::~vector(&v1982); + ////////////////// root - 7 //////////////////// v263 = std::_Rb_tree_header::_Rb_tree_header(v1544); v1979 = 7; std::map>>::operator[](v263); @@ -4157,6 +4161,7 @@ void __fastcall WXML::EXPRLib::TransitTable::Init(int a1) std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count(&v1980, v304); std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count(v1978, v1554); std::vector>::~vector(&v1982); + ////////////////// root - 8 //////////////////// v305 = std::_Rb_tree_header::_Rb_tree_header(v1555); v1979 = 8; std::map>>::operator[](v305); @@ -4325,7 +4330,6 @@ void __fastcall WXML::EXPRLib::TransitTable::Init(int a1) std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count(v1974, v1560); std::vector>::~vector(&v1979); - //////////////////////to be continue//////////// v1979 = 0; v1980 = 0; v1981 = 0; diff --git a/test/transit_table.cpp b/test/transit_table.cpp new file mode 100644 index 0000000..8e3549a --- /dev/null +++ b/test/transit_table.cpp @@ -0,0 +1,135 @@ +#include "../src/include/wxml.h" + +using namespace std; + +void PrintVectorBase(std::vector> &ret) +{ + bool isFirst = true; + for (auto &&i : ret) + { + if (!isFirst) + { + cout << "," << endl; + } + isFirst = false; + cout << "{" << endl; + if (i->offset_0 == WXML::EXPRLib::off_55F20C) + { + cout << "\"offset_0\": " << "\"0x55f20c\"," << endl; + cout << "\"offset_4\": \"" << i->offset_4_str << "\"," << endl; + cout << "\"offset_32\": " << i->offset_32 <<"," << endl; + cout << "\"offset_36\": \"" << i->offset_36 << "\"" << endl; + } + else if(i->offset_0 == WXML::EXPRLib::off_55F220) + { + cout << "\"offset_0\": " << "\"0x55f220\"," << endl; + cout << "\"offset_4\": \"" << i->offset_4_str << "\"," << endl; + cout << "\"offset_32\": 0," << endl; + cout << "\"offset_36\": \"\"" << endl; + } + else if(i->offset_0 == WXML::EXPRLib::off_55F1E4) + { + cout << "\"offset_0\": " << "\"0x55f1e4\"," << endl; + cout << "\"offset_4\": " << i->offset_4_int << "," << endl; + cout << "\"offset_32\": 0," << endl; + cout << "\"offset_36\": \"not available\"" << endl; + } + else if(i->offset_0 == WXML::EXPRLib::off_55F1F8) + { + cout << "\"offset_0\": " << "\"0x55f1f8\"," << endl; + cout << "\"offset_4\": \"0xabababab -> 0xabababab\"," << endl; + cout << "\"offset_32\": 0," << endl; + cout << "\"offset_36\": \"not available\"" << endl; + } + cout << "}" << endl; + } + +} +void PrintBNF(WXML::EXPRLib::BNF & ret) +{ + cout << "{" << endl; + cout << "\"offset_0\": {" << endl; + // cout << "\"type\": \"std::vector\"," << endl; + cout << "\"size\": " << ret.offset_0.size() << "," << endl; + cout << "\"capacity\": " << ret.offset_0.capacity() << "," << endl; + cout << "\"data\": [" << endl; + PrintVectorBase(ret.offset_0); + cout << "]" << endl; + cout << "}" << endl; + cout << "}" << endl; +} +void PrintVectorBNF(std::vector &ret) +{ + // cout << "\"type\": \"std::vector\"," << endl; + cout << "\"size\": " << ret.size() << "," << endl; + cout << "\"capacity\": " << ret.capacity() << "," << endl; + cout << "\"data\": [" << endl; + bool isFirst = true; + for (auto &&i : ret) + { + if (!isFirst) + { + cout << ","; + } + isFirst = false; + PrintBNF(i); + } + + cout << "]" << endl; +} +void PrintMapString(std::map> &ret) +{ + + // cout << "{" << endl; + cout << "\"size\": " << ret.size() << "," << endl; + cout << "\"data\": [" << endl; + bool isFirst = true; + for (auto &&i : ret) + { + if (!isFirst) + { + cout << ","; + } + isFirst = false; + cout << "{" << endl; + cout << "\"key\": \"" << i.first << "\"," << endl; + cout << "\"value\": {" << endl; + PrintVectorBNF(i.second); + cout << "}" << endl; + cout << "}" << endl; + } + cout << "]" << endl; + // cout << "}" << endl; +} +void PrintMapInt(std::map>>& ret) +{ + cout << "{" << endl; + cout << "\"size\": " << ret.size() << "," << endl; + cout << "\"data\": [" << endl; + bool isFirst = true; + for (auto &&i : ret) + { + if (!isFirst) + { + cout << ","; + } + isFirst = false; + cout << "{" << endl; + cout << "\"key\": " << i.first << "," << endl; + cout << "\"value\": {" << endl; + PrintMapString(i.second); + cout << "}" << endl; + cout << "}" << endl; + } + cout << "]" << endl; + cout << "}" << endl; + +} +int main(void) +{ + auto instance = WXML::EXPRLib::TransitTable::GetInstance(); + instance->Init(); + std::map>> ret = instance->ret; + PrintMapInt(ret); + return 0; +} \ No newline at end of file