diff --git a/DMS/Debug/DMS.log b/DMS/Debug/DMS.log index 2580785..03034fa 100644 --- a/DMS/Debug/DMS.log +++ b/DMS/Debug/DMS.log @@ -1,4 +1,2 @@  LineParser.cpp - value.cpp - Generating Code... DMS.vcxproj -> C:\Users\Ryan\source\repos\DMS\Debug\DMS.exe diff --git a/DMS/Debug/DMS.tlog/CL.command.1.tlog b/DMS/Debug/DMS.tlog/CL.command.1.tlog index b056d61..44e8581 100644 Binary files a/DMS/Debug/DMS.tlog/CL.command.1.tlog and b/DMS/Debug/DMS.tlog/CL.command.1.tlog differ diff --git a/DMS/Debug/DMS.tlog/CL.read.1.tlog b/DMS/Debug/DMS.tlog/CL.read.1.tlog index 457a328..f573d0d 100644 Binary files a/DMS/Debug/DMS.tlog/CL.read.1.tlog and b/DMS/Debug/DMS.tlog/CL.read.1.tlog differ diff --git a/DMS/Debug/DMS.tlog/CL.write.1.tlog b/DMS/Debug/DMS.tlog/CL.write.1.tlog index dbe3517..a248f36 100644 Binary files a/DMS/Debug/DMS.tlog/CL.write.1.tlog and b/DMS/Debug/DMS.tlog/CL.write.1.tlog differ diff --git a/DMS/Debug/DMS.tlog/link.read.1.tlog b/DMS/Debug/DMS.tlog/link.read.1.tlog index 2d620b8..58e18cf 100644 Binary files a/DMS/Debug/DMS.tlog/link.read.1.tlog and b/DMS/Debug/DMS.tlog/link.read.1.tlog differ diff --git a/DMS/Debug/LineParser.obj b/DMS/Debug/LineParser.obj index 6a0494b..588b284 100644 Binary files a/DMS/Debug/LineParser.obj and b/DMS/Debug/LineParser.obj differ diff --git a/DMS/Debug/vc142.idb b/DMS/Debug/vc142.idb index 5b94980..6e5346c 100644 Binary files a/DMS/Debug/vc142.idb and b/DMS/Debug/vc142.idb differ diff --git a/DMS/Debug/vc142.pdb b/DMS/Debug/vc142.pdb index a78382e..2817db2 100644 Binary files a/DMS/Debug/vc142.pdb and b/DMS/Debug/vc142.pdb differ diff --git a/DMS/LineParser.cpp b/DMS/LineParser.cpp index 1e8aa0f..75aaac4 100644 --- a/DMS/LineParser.cpp +++ b/DMS/LineParser.cpp @@ -136,13 +136,6 @@ namespace dms { } return false; } - - - - // Todo create a match method that matches until a certain symbol... We need to finish the choice block stuff as well! - - - bool LineParser::match(tokenstream stream, tokens::tokentype* t1, tokens::tokentype* t2, tokens::tokentype* t3, tokens::tokentype* t4, tokens::tokentype* t5, tokens::tokentype* t6, tokens::tokentype* t7, tokens::tokentype* t8, tokens::tokentype* t9, tokens::tokentype* t10, tokens::tokentype* t11, tokens::tokentype* t12) { tokens::tokentype* types[12] = { t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12 }; for (size_t i = 0; i < 12; i++) { @@ -313,14 +306,35 @@ namespace dms { token control = stream.next(); if (control.raw == codes::CHOI && stream.peek().type==tokens::string) { // Let's parse choice blocks. - print("Choice block found!"); + std::string prompt = stream.next().name; + print("Prompt: ",prompt); bool good = true; + size_t c = 0; while (good) { - if (match(stream, new tokentype[2]{ tokens::string,tokens::none })) { + if (match(stream, tokens::tab,tokens::string,tokens::name)) { + stream.next(); + std::string choice = stream.next().name; + std::string func = stream.next().name; + print("Choice: <",c,"> ",choice," Funcname: ",func); + std::vector funcstuff = stream.next(tokens::newline); + //We need to process the function data and finish creating + + c++; + } + else if (match(stream, tokens::tab) || match(stream,tokens::newline)) { + stream.next(); // Allow tabs and newlines to pass like normal + } + else { + good = false; + print("Choice handled!"); + wait(); } } } + else if (control.raw == codes::IFFF) { + // This will probably be the toughest one of them all + } } // Displays both with a target and without if (match(stream, tokens::tab, tokens::string, tokens::newline)) { @@ -583,6 +597,9 @@ namespace dms { else if (str == "nil") { t_vec.push_back(token{ tokens::nil,codes::NOOP,"",line }); } + else if (str == "goto") { + t_vec.push_back(token{ tokens::gotoo,codes::NOOP,"",line }); + } else if (utils::isalphanum(str) && str.size()>0) { t_vec.push_back(token{ tokens::name,codes::NOOP,stream.processBuffer(buffer),line }); } diff --git a/DMS/token.h b/DMS/token.h index 562c13c..2c43c38 100644 --- a/DMS/token.h +++ b/DMS/token.h @@ -37,6 +37,7 @@ namespace dms::tokens { tab, eof, ret, + gotoo, nil };//stream, t_vec, line, isNum, buffer struct token { @@ -93,6 +94,7 @@ namespace dms::tokens { "tab", "eof", "ret", + "gotoo", "nil" }; out << "Line <" << c.line_num << ">" << codes::list[c.raw] << " " << temp1[c.type] << " \t\t " << c.name; diff --git a/Debug/DMS.exe b/Debug/DMS.exe index f7aa694..f7e6290 100644 Binary files a/Debug/DMS.exe and b/Debug/DMS.exe differ diff --git a/Debug/DMS.ilk b/Debug/DMS.ilk index 3216b3b..883ffbf 100644 Binary files a/Debug/DMS.ilk and b/Debug/DMS.ilk differ diff --git a/Debug/DMS.pdb b/Debug/DMS.pdb index faf3d1e..43a4769 100644 Binary files a/Debug/DMS.pdb and b/Debug/DMS.pdb differ