diff --git a/DMS/DMS.cpp b/DMS/DMS.cpp index 65196f8..61024c5 100644 --- a/DMS/DMS.cpp +++ b/DMS/DMS.cpp @@ -1,23 +1,5 @@ -// DMS.cpp : This file contains the 'main' function. Program execution begins and ends there. -// - -#include -//#include -//#include -#include "value.h" -#include "codes.h" -#include "cmd.h" -#include "dms_exceptions.h" -#include "errors.h" -#include "utils.h" -#include "number_utils.h" -#include "string_utils.h" -#include "LineParser.h" #include "dms.h" -#include "chunk.h" -#include "token.h" using namespace dms; -using namespace dms::utils; int main() { LineParser parser = LineParser("test.dms"); diff --git a/DMS/DMS.vcxproj b/DMS/DMS.vcxproj index 0138754..3e89888 100644 --- a/DMS/DMS.vcxproj +++ b/DMS/DMS.vcxproj @@ -162,7 +162,6 @@ - diff --git a/DMS/DMS.vcxproj.filters b/DMS/DMS.vcxproj.filters index a04945b..77fbc07 100644 --- a/DMS/DMS.vcxproj.filters +++ b/DMS/DMS.vcxproj.filters @@ -104,8 +104,5 @@ Header Files\DMS - - Header Files\DMS - \ No newline at end of file diff --git a/DMS/Debug/DMS.obj b/DMS/Debug/DMS.obj index e28ff6d..c8d22b8 100644 Binary files a/DMS/Debug/DMS.obj and b/DMS/Debug/DMS.obj differ diff --git a/DMS/Debug/DMS.tlog/CL.command.1.tlog b/DMS/Debug/DMS.tlog/CL.command.1.tlog index 7a1cb0f..dcab84c 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 2614eb1..168ffd1 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 ff94f77..4dbfe5f 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/cmd.obj b/DMS/Debug/cmd.obj index 0e15ae2..598f6c6 100644 Binary files a/DMS/Debug/cmd.obj and b/DMS/Debug/cmd.obj differ diff --git a/DMS/Debug/codes.obj b/DMS/Debug/codes.obj index 2fd57f3..ddb8d97 100644 Binary files a/DMS/Debug/codes.obj and b/DMS/Debug/codes.obj differ diff --git a/DMS/Debug/dms_exceptions.obj b/DMS/Debug/dms_exceptions.obj index caa3db9..c783220 100644 Binary files a/DMS/Debug/dms_exceptions.obj and b/DMS/Debug/dms_exceptions.obj differ diff --git a/DMS/Debug/number_utils.obj b/DMS/Debug/number_utils.obj index 7f91812..1338745 100644 Binary files a/DMS/Debug/number_utils.obj and b/DMS/Debug/number_utils.obj differ diff --git a/DMS/Debug/utils.obj b/DMS/Debug/utils.obj index 7ce3e1c..0ece3ae 100644 Binary files a/DMS/Debug/utils.obj and b/DMS/Debug/utils.obj differ diff --git a/DMS/Debug/value.obj b/DMS/Debug/value.obj index e02d89a..f0e248b 100644 Binary files a/DMS/Debug/value.obj and b/DMS/Debug/value.obj differ diff --git a/DMS/Debug/vc142.idb b/DMS/Debug/vc142.idb index 690da6c..0099bde 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 bbcea6b..4076c31 100644 Binary files a/DMS/Debug/vc142.pdb and b/DMS/Debug/vc142.pdb differ diff --git a/DMS/LineParser.h b/DMS/LineParser.h index 6ba9ff6..aab2c85 100644 --- a/DMS/LineParser.h +++ b/DMS/LineParser.h @@ -6,16 +6,14 @@ #include #include #include +#include #include "codes.h" #include "cmd.h" #include "dms_state.h" #include "chunk.h" #include "token.h" #include "utils.h" -#include "Scope.h" #include "errors.h" -#include - namespace dms { struct tokenstream { @@ -52,7 +50,6 @@ namespace dms { chunk* current_chunk = nullptr; std::string chunk_name; blocktype chunk_type = bt_block; - std::stack scopes; size_t line = 1; std::vector temp; std::vector tdump; @@ -61,6 +58,7 @@ namespace dms { dms_state* state = nullptr; void doCheck(passer* stream, std::vector* t_vec, size_t line, bool& isNum, bool& hasDec, std::vector* buffer); void _Parse(tokenstream* stream); + std::stack lastCall; // Match Process Code bool match_process_debug(tokenstream* stream); bool match_process_disp(tokenstream* stream); diff --git a/DMS/LineParserMatchProcess.cpp b/DMS/LineParserMatchProcess.cpp index f8494eb..2d42b10 100644 --- a/DMS/LineParserMatchProcess.cpp +++ b/DMS/LineParserMatchProcess.cpp @@ -9,6 +9,7 @@ namespace dms { Compound DISP */ + lastCall.push("MP_disp"); if ((isBlock(bt_block) || isBlock(bt_method)) && stream->match(tokens::newline, tokens::string, tokens::newline)) { stream->next(); // Standard consumption std::string msg = stream->next().name; @@ -17,6 +18,7 @@ namespace dms { c->args.push(buildValue()); c->args.push(buildValue(msg)); current_chunk->addCmd(c); // Add the cmd to the current chunk + lastCall.pop(); return true; } else if ((isBlock(bt_block) || isBlock(bt_method)) && stream->match(tokens::newline, tokens::name, tokens::colon, tokens::string, tokens::newline)) { @@ -32,6 +34,7 @@ namespace dms { c->args.push(buildValue(msg)); current_chunk->addCmd(c); // Add the cmd to the current chunk // We might have to consume a newline... Depends on what's next + lastCall.pop(); return true; } else if ((isBlock(bt_block) || isBlock(bt_method)) && stream->match(tokens::name,tokens::colon,tokens::cbracketo)) { @@ -78,8 +81,10 @@ namespace dms { } else { badSymbol(stream); + return false; } } + return true; } else if (stream->match(tokens::string)) { cmd* c = new cmd; @@ -92,53 +97,73 @@ namespace dms { } else { badSymbol(stream); + return false; } } } // emotion: "path" // looks like a simple disp command else if (isBlock(bt_character) && stream->match(tokens::tab, tokens::name, tokens::colon, tokens::string, tokens::newline)) { + lastCall.pop(); return true; } // TODO: We still have to implement the compound disp - + lastCall.pop(); return false; } bool LineParser::match_process_assignment(tokenstream* stream) { // something equals something else lets go + lastCall.push("MP_assignment"); if (stream->match(tokens::name,tokens::equal)) { value* var = buildVariable(stream->next().name); // The variable that we will be setting stuff to stream->next(); // Consume the equal cmd* c = new cmd; c->opcode = codes::ASGN; c->args.push(var); - if (stream->match(tokens::True)) { + if (match_process_expression(stream, var)) { + // Expressions can internally set variables + // We actually need to clean up our cmds + lastCall.pop(); + return true; + } + else if (match_process_function(stream, var)) { + // Functions can internally set variables + // We actually need to clean up our cmds + lastCall.pop(); + return true; + } + else if (stream->match(tokens::True)) { stream->next(); c->args.push(buildValue(true)); current_chunk->addCmd(c); + lastCall.pop(); return true; } else if (stream->match(tokens::False)) { stream->next(); c->args.push(buildValue(false)); current_chunk->addCmd(c); + lastCall.pop(); return true; } else if (stream->match(tokens::string)) { c->args.push(buildValue(stream->next().name)); current_chunk->addCmd(c); + lastCall.pop(); return true; } else if (stream->match(tokens::nil)) { stream->next(); c->args.push(buildValue()); current_chunk->addCmd(c); + lastCall.pop(); return true; } else if (stream->match(tokens::number)) { c->args.push(buildValue(std::stod(stream->next().name))); current_chunk->addCmd(c); + lastCall.pop(); return true; } else if (stream->match(tokens::bracketo, tokens::name, tokens::bracketc)) { @@ -147,28 +172,20 @@ namespace dms { c->args.push(buildBlock(stream->next().name)); current_chunk->addCmd(c); stream->next(); - return true; - } - else if (match_process_expression(stream,var)) { - // Expressions can internally set variables - // We actually need to clean up our cmds - current_chunk->cmds.pop_back(); - delete c; - return true; - } - else if (match_process_function(stream,var)) { - // Functions can internally set variables - // We actually need to clean up our cmds - current_chunk->cmds.pop_back(); - delete c; + lastCall.pop(); return true; } else if (stream->match(tokens::name)) { c->args.push(buildVariable(stream->next().name)); current_chunk->addCmd(c); + lastCall.pop(); return true; } + else if (stream->match(tokens::newline)) { + stream->next(); + } } + lastCall.pop(); return false; } bool LineParser::match_process_debug(tokenstream* stream) { @@ -195,6 +212,7 @@ namespace dms { return false; } bool LineParser::match_process_choice(tokenstream* stream) { + lastCall.push("MP_choice"); token temp = stream->peek(); if (temp.raw == codes::CHOI && stream->match(tokens::control,tokens::string)) { // Let's parse choice blocks. @@ -284,8 +302,10 @@ namespace dms { delete cc; if (hasfunc) buildLabel(str); + lastCall.pop(); return true; } + lastCall.pop(); return false; } @@ -294,6 +314,7 @@ namespace dms { delete[] v; // We didn't need it, lets clean it up! } bool LineParser::match_process_function(tokenstream* stream, value* v, bool nested) { + lastCall.push("MP_function"); /* Functions should be able to handle function calls as arguments, HOWEVER functions cannot be passed as values since they aren't values like they are in other languages! @@ -372,6 +393,7 @@ namespace dms { else if (tempstream.match(tokens::number)) { cleanup(tempval); std::string str = tempstream.next().name; + print(str); tempval = buildValue(std::stod(str)); // Get the number and convert it to a double then build a value c->args.push(tempval); // add this argument to the function opcodes } @@ -410,6 +432,7 @@ namespace dms { cleanup(tempval); tempstream.next(); current_chunk->addCmd(c); // We push this onto the chunk after all dependants if any have been handled + lastCall.pop(); return true; } else { @@ -418,6 +441,7 @@ namespace dms { } } } + lastCall.pop(); return false; } bool LineParser::match_process_goto(tokenstream* stream) { @@ -470,7 +494,7 @@ namespace dms { return false; // TODO finish this } bool LineParser::match_process_expression(tokenstream* stream, value* v) { - return false; // Method isn't done yet, we will get an error without this! + return false; // I will have to consume for this to work so we need to keep track of what was incase we return false! size_t start_pos = stream->pos; // It has to start with one of these 3 to even be considered an expression @@ -488,24 +512,6 @@ namespace dms { * MOD val v1 v2 */ - /* lua code which was actually really compact and works! - if not expr:match("[/%^%+%-%*%%]") then --[[print("No math to do!")]] return expr end - -- handle pharanses - expr=expr:gsub("([%W])(%-%d)",function(b,a) - return b.."(0-"..a:match("%d+")..")" - end) - -- Work on functions - expr = expr:gsub("([_%w]+)(%b())",function(func,args) - local v = gen("$") - local fnwr = {self.current_line[1],self.current_line[2],FWNR,self.current_line[4],v.." = "..func..args} - self:parseFNWR(fnwr) - return v - end) - expr = expr:gsub("(%b())",function(a) - return self:parseExpr(a:sub(2,-2)) - end) - return self:chop(expr) - */ token left; // lefthand token op; // opperator token right; // righthand @@ -513,7 +519,8 @@ namespace dms { if (t.type == tokens::parao) { tokenstream temp; temp.init(&(stream->next(tokens::parao, tokens::parac))); // Balanced match! - return match_process_expression(&temp,buildVariable("Work On This")); // Return true is everything else checks out! + value* tmpvalue = buildVariable(); + match_process_expression(&temp,tmpvalue); } // We have a number else if (t.type == tokens::number) { diff --git a/DMS/LineParserParse.cpp b/DMS/LineParserParse.cpp index 4307da3..1f37bd9 100644 --- a/DMS/LineParserParse.cpp +++ b/DMS/LineParserParse.cpp @@ -1,6 +1,11 @@ #include "LineParser.h" using namespace dms::tokens; using namespace dms::utils; +bool is_file_exist(const char* fileName) +{ + std::ifstream infile(fileName); + return infile.good(); +} namespace dms { dms_state* dms::LineParser::Parse() { if (fn == "") { @@ -10,6 +15,7 @@ namespace dms { return Parse(fn); } dms_state* dms::LineParser::Parse(std::string file) { + std::remove("dump.txt"); dms_state* state = new dms_state(); return Parse(state, fn); } @@ -51,12 +57,16 @@ namespace dms { stream.next('\n'); // Seek until you find a newline } else if (data == '\n') { + std::string str = stream.processBuffer(buffer); doCheck(&stream, &t_vec, line, isNum, hasDec, &buffer); t_vec.push_back(token{ tokens::newline,codes::NOOP,"",line }); - if (isNum) { - t_vec.push_back(token{ tokens::number,codes::NOOP,stream.processBuffer(buffer),line }); - buffer.clear(); - isNum = false; + if (isNum && str.size() != 0) { + trim(str); + if (str.size() != 0) { + t_vec.push_back(token{ tokens::number,codes::NOOP,str,line }); + buffer.clear(); + isNum = false; + } } line++; data = ' '; @@ -271,8 +281,11 @@ namespace dms { t_vec.push_back(token{ tokens::debug,codes::NOOP,"",line }); } else if (utils::isNum(str) && str.size()!=0) { - t_vec.push_back(token{ tokens::number,codes::NOOP,stream.processBuffer(buffer),line }); - isNum = false; + trim(str); + if(str!=""){ + t_vec.push_back(token{ tokens::number,codes::NOOP,stream.processBuffer(buffer),line }); + isNum = false; + } } else if (utils::isalphanum(str) && str.size() > 0) { t_vec.push_back(token{ tokens::name,codes::NOOP,stream.processBuffer(buffer),line }); @@ -289,12 +302,22 @@ namespace dms { return state; } void LineParser::tokenDump(std::vector* v) { - std::ofstream outputFile("dump.txt"); - outputFile << "Token Dump:" << std::endl; - for (size_t i = 0; i < v->size(); i++) { - outputFile << (*v)[i] << std::endl; + if (is_file_exist("dump.txt")) { + std::ofstream outputFile; + outputFile.open("dump.txt", std::ios_base::app); // append instead of overwrite + for (size_t i = 0; i < v->size(); i++) { + outputFile << (*v)[i] << std::endl; + } + outputFile.close(); + } + else { + std::ofstream outputFile("dump.txt"); + outputFile << "Token Dump:" << std::endl; + for (size_t i = 0; i < v->size(); i++) { + outputFile << (*v)[i] << std::endl; + } + outputFile.close(); } - outputFile.close(); } void LineParser::_Parse(tokenstream* stream) { token current = stream->next(); diff --git a/DMS/LineParserUtils.cpp b/DMS/LineParserUtils.cpp index 6ad050d..fd0ea3d 100644 --- a/DMS/LineParserUtils.cpp +++ b/DMS/LineParserUtils.cpp @@ -82,7 +82,6 @@ namespace dms { return isBlock(bt_block); // Default block type } bool LineParser::isBlock(blocktype bk_type) { - //print(); if (current_chunk == nullptr) { return false; // If a chunk wasn't defined then code was probably defined outside of a block } @@ -119,10 +118,13 @@ namespace dms { void LineParser::doCheck(passer* stream, std::vector* t_vec, size_t line, bool& isNum, bool& hasDec, std::vector* buffer) { std::string str = stream->processBuffer(*buffer); if (utils::isNum(str) && isNum) { - t_vec->push_back(token{ tokens::number,codes::NOOP,stream->processBuffer(*buffer),line }); - buffer->clear(); - isNum = false; - hasDec = false; + trim(str); + if (str.size() != 0) { + t_vec->push_back(token{ tokens::number,codes::NOOP,stream->processBuffer(*buffer),line }); + buffer->clear(); + isNum = false; + hasDec = false; + } } else if (buffer->size() > 0) { if (str == "nil") { @@ -141,10 +143,13 @@ namespace dms { hasDec = false; } else if (utils::isNum(str) && str.size() > 0) { - t_vec->push_back(token{ tokens::number,codes::NOOP,stream->processBuffer(*buffer),line }); - buffer->clear(); - isNum = false; - hasDec = false; + trim(str); + if (str.size() != 0) { + t_vec->push_back(token{ tokens::number,codes::NOOP,stream->processBuffer(*buffer),line }); + buffer->clear(); + isNum = false; + hasDec = false; + } } else if (utils::isalphanum(str) && str.size() > 0) { t_vec->push_back(token{ tokens::name,codes::NOOP,stream->processBuffer(*buffer),line }); @@ -160,7 +165,7 @@ namespace dms { state->push_error(errors::error{ err,concat("Unexpected symbol '",stream->next().toString(),"'"),true,stream->peek().line_num,current_chunk }); } void LineParser::badSymbol(tokenstream* stream) { - state->push_error(errors::error{ errors::unknown,concat("Unexpected symbol '",stream->next().toString(),"'"),true,stream->peek().line_num,current_chunk }); + state->push_error(errors::error{ errors::unknown,concat("Unexpected symbol '",stream->next().toString(),"' RAW:",stream->last(), " Last Call: ",lastCall.top()),true,stream->peek().line_num,current_chunk }); } void LineParser::badSymbol() { state->push_error(errors::error{ errors::unknown,concat("Unexpected symbol '",_stream->next().toString(),"'"),true,_stream->peek().line_num,current_chunk }); diff --git a/DMS/Scope.h b/DMS/Scope.h deleted file mode 100644 index 2889983..0000000 --- a/DMS/Scope.h +++ /dev/null @@ -1,22 +0,0 @@ -#pragma once -#include -#include "cmd.h" -namespace dms { - enum scopetype { - none, - iff, - elif, - elsee, - disp, - choice, - forr, - whilee, - }; - struct scope { - std::vector cmds; - scopetype type = scopetype::none; - void addCmd(cmd c) { - cmds.push_back(c); - } - }; -} \ No newline at end of file diff --git a/DMS/diaplsy cmd.txt b/DMS/diaplsy cmd.txt index b766a6a..89179d7 100644 --- a/DMS/diaplsy cmd.txt +++ b/DMS/diaplsy cmd.txt @@ -15,10 +15,10 @@ Ryan: { "It's a nice day we are having!" } -DISP "" -DSPD Ryan 100 -DACT Ryan [path defined by: Ryan.calm] -APND Ryan "Hello Bob, " +SSPK Ryan +DSPD 100 +DACT [path defined by: Ryan.calm] +APND "Hello Bob, " WAIT 0.455 -DACT Ryan [path defined by: Ryan.excited] +DACT [path defined by: Ryan.excited] APND "how are you doing?" diff --git a/DMS/dms.h b/DMS/dms.h index 699ff06..a4c962f 100644 --- a/DMS/dms.h +++ b/DMS/dms.h @@ -1,13 +1,14 @@ #pragma once -#include "value.h" -#include "codes.h" +#include "chunk.h" #include "cmd.h" +#include "codes.h" #include "dms_exceptions.h" +#include "dms_state.h" #include "errors.h" -#include "utils.h" +#include "LineParser.h" #include "number_utils.h" #include "string_utils.h" -#include "LineParser.h" -#include "dms.h" -#include "chunk.h" -#include "token.h" \ No newline at end of file +#include "token.h" +#include "utils.h" +#include "value.h" + diff --git a/DMS/dump.bin b/DMS/dump.bin index b2d3f4a..f024800 100644 Binary files a/DMS/dump.bin and b/DMS/dump.bin differ diff --git a/DMS/dump.txt b/DMS/dump.txt index 16b76bd..45a4ca8 100644 --- a/DMS/dump.txt +++ b/DMS/dump.txt @@ -1,157 +1,209 @@ Token Dump: Line <1>NOOP newline Line <1>NOOP newline -Line <1>NOOP bracketo -Line <1>NOOP name default -Line <1>NOOP colon -Line <1>NOOP name char -Line <1>NOOP bracketc +Line <1>ENTR flag +Line <1>NOOP name main Line <1>NOOP newline Line <1>NOOP newline +Line <2>ENAB flag +Line <2>NOOP name warnings Line <2>NOOP newline -Line <3>NOOP name money -Line <3>NOOP equal -Line <3>NOOP number 0 +Line <2>NOOP newline +Line <3>DISA flag +Line <3>NOOP name omniscient Line <3>NOOP newline Line <3>NOOP newline -Line <4>NOOP name test -Line <4>NOOP equal -Line <4>NOOP nil nil +Line <4>ENAB flag +Line <4>NOOP name debugging Line <4>NOOP newline Line <4>NOOP newline Line <5>NOOP newline -Line <5>NOOP newline -Line <6>NOOP bracketo -Line <6>NOOP name Ryan -Line <6>NOOP colon -Line <6>NOOP name char -Line <6>NOOP bracketc +Line <6>VERN flag +Line <6>NOOP number 1.2 Line <6>NOOP newline Line <6>NOOP newline -Line <7>NOOP name age -Line <7>NOOP equal -Line <7>NOOP number 21 +Line <7>USIN flag +Line <7>NOOP name extendedDefine Line <7>NOOP newline Line <7>NOOP newline -Line <8>NOOP name money -Line <8>NOOP equal -Line <8>NOOP number 1000 Line <8>NOOP newline Line <8>NOOP newline +Line <9>NOOP bracketo +Line <9>NOOP name main +Line <9>NOOP bracketc Line <9>NOOP newline -Line <10>NOOP name calm -Line <10>NOOP colon -Line <10>NOOP string ./path/to/file +Line <9>NOOP newline +Line <10>NOOP string hello? Line <10>NOOP newline Line <10>NOOP newline -Line <11>NOOP name excited -Line <11>NOOP colon -Line <11>NOOP string ./path/to/file +Line <11>NOOP name var1 +Line <11>NOOP equal +Line <11>NOOP name func +Line <11>NOOP parao +Line <11>NOOP number 1 +Line <11>NOOP seperator +Line <11>NOOP string string +Line <11>NOOP seperator +Line <11>NOOP name test +Line <11>NOOP parao +Line <11>NOOP number 1 +Line <11>NOOP seperator +Line <11>NOOP number 2 +Line <11>NOOP parac +Line <11>NOOP seperator +Line <11>NOOP name test2 +Line <11>NOOP parao +Line <11>NOOP parac +Line <11>NOOP parac Line <11>NOOP newline Line <11>NOOP newline +Line <12>NOOP name a +Line <12>NOOP equal +Line <12>NOOP number 100 +Line <12>NOOP plus +Line <12>NOOP name func +Line <12>NOOP parao +Line <12>NOOP number 1 +Line <12>NOOP seperator +Line <12>NOOP string string +Line <12>NOOP seperator +Line <12>NOOP number 2 +Line <12>NOOP plus +Line <12>NOOP number 5 +Line <12>NOOP parac +Line <12>NOOP plus +Line <12>NOOP number 100 Line <12>NOOP newline Line <12>NOOP newline -Line <13>NOOP bracketo -Line <13>NOOP name step -Line <13>NOOP colon -Line <13>NOOP name function +Line <13>NOOP name func Line <13>NOOP parao -Line <13>NOOP name a +Line <13>NOOP number 1 Line <13>NOOP seperator -Line <13>NOOP name b +Line <13>NOOP string string Line <13>NOOP seperator -Line <13>NOOP name c +Line <13>NOOP number 2 +Line <13>NOOP plus +Line <13>NOOP number 5 Line <13>NOOP parac -Line <13>NOOP bracketc Line <13>NOOP newline Line <13>NOOP newline -Line <14>NOOP string Testing... +Line <14>NOOP label mylabel +Line <14>NOOP newline Line <14>NOOP newline -Line <15>NOOP name d -Line <15>NOOP equal -Line <15>NOOP parao -Line <15>NOOP number 100 -Line <15>NOOP plus -Line <15>NOOP name b -Line <15>NOOP parac -Line <15>NOOP divide -Line <15>NOOP name c Line <15>NOOP newline Line <15>NOOP newline -Line <16>NOOP name e -Line <16>NOOP equal -Line <16>NOOP string somestring +Line <16>CHOI control +Line <16>NOOP string Pick one: +Line <16>NOOP cbracketo Line <16>NOOP newline Line <16>NOOP newline -Line <17>NOOP name e -Line <17>NOOP equal -Line <17>NOOP nil nil +Line <17>NOOP string first +Line <17>NOOP name func +Line <17>NOOP parao +Line <17>NOOP number 1 +Line <17>NOOP seperator +Line <17>NOOP number 2 +Line <17>NOOP seperator +Line <17>NOOP number 3 +Line <17>NOOP parac Line <17>NOOP newline Line <17>NOOP newline -Line <18>NOOP name g -Line <18>NOOP equal +Line <18>NOOP string second +Line <18>NOOP name func +Line <18>NOOP parao +Line <18>NOOP true true +Line <18>NOOP seperator Line <18>NOOP false false +Line <18>NOOP parac Line <18>NOOP newline Line <18>NOOP newline -Line <19>RETN ret -Line <19>NOOP name d +Line <19>NOOP string third +Line <19>NOOP name func +Line <19>NOOP parao +Line <19>NOOP string hehe +Line <19>NOOP parac Line <19>NOOP newline Line <19>NOOP newline +Line <20>NOOP string forth +Line <20>NOOP name func +Line <20>NOOP parao +Line <20>NOOP string 1 +Line <20>NOOP seperator +Line <20>NOOP number 2 +Line <20>NOOP seperator +Line <20>NOOP false false +Line <20>NOOP parac Line <20>NOOP newline Line <20>NOOP newline -Line <21>NOOP bracketo -Line <21>NOOP name inventory -Line <21>NOOP colon -Line <21>NOOP name env -Line <21>NOOP bracketc +Line <21>NOOP string fifth +Line <21>NOOP gotoo +Line <21>NOOP string here Line <21>NOOP newline Line <21>NOOP newline -Line <22>NOOP name slot1 -Line <22>NOOP number -Line <22>NOOP equal -Line <22>NOOP string +Line <22>NOOP string sixth +Line <22>NOOP gotoo +Line <22>NOOP name name Line <22>NOOP newline Line <22>NOOP newline -Line <23>NOOP name slot2 -Line <23>NOOP number -Line <23>NOOP equal -Line <23>NOOP string +Line <23>NOOP string sevinth +Line <23>NOOP jump +Line <23>NOOP string there Line <23>NOOP newline Line <23>NOOP newline -Line <24>NOOP name slot3 -Line <24>NOOP number -Line <24>NOOP equal -Line <24>NOOP string +Line <24>NOOP string eight +Line <24>NOOP jump +Line <24>NOOP name name Line <24>NOOP newline Line <24>NOOP newline -Line <25>NOOP name slot4 -Line <25>NOOP number -Line <25>NOOP equal -Line <25>NOOP string +Line <25>NOOP string nine +Line <25>NOOP name exit Line <25>NOOP newline Line <25>NOOP newline -Line <26>NOOP name slot5 -Line <26>NOOP number -Line <26>NOOP equal -Line <26>NOOP string +Line <26>NOOP string ten +Line <26>NOOP exit +Line <26>NOOP number 0 Line <26>NOOP newline Line <26>NOOP newline -Line <27>NOOP name slot6 -Line <27>NOOP number -Line <27>NOOP equal -Line <27>NOOP string +Line <27>NOOP cbracketc Line <27>NOOP newline Line <27>NOOP newline -Line <28>NOOP name slot7 -Line <28>NOOP number -Line <28>NOOP equal -Line <28>NOOP string Line <28>NOOP newline Line <28>NOOP newline -Line <29>NOOP name slot8 -Line <29>NOOP number -Line <29>NOOP equal -Line <29>NOOP string +Line <29>NOOP bracketo +Line <29>NOOP name Bob +Line <29>NOOP colon +Line <29>NOOP name char +Line <29>NOOP bracketc Line <29>NOOP newline Line <29>NOOP newline -Line <29>NOOP eof +Line <30>NOOP name age +Line <30>NOOP equal +Line <30>NOOP number 24 +Line <30>NOOP newline +Line <30>NOOP newline +Line <31>NOOP name money +Line <31>NOOP equal +Line <31>NOOP number 100 +Line <31>NOOP newline +Line <31>NOOP newline +Line <32>NOOP newline +Line <32>NOOP newline +Line <33>NOOP bracketo +Line <33>NOOP name newblock +Line <33>NOOP colon +Line <33>NOOP name function +Line <33>NOOP parao +Line <33>NOOP parac +Line <33>NOOP bracketc +Line <33>NOOP newline +Line <33>NOOP newline +Line <34>NOOP string Test #2 +Line <34>NOOP newline +Line <34>NOOP newline +Line <35>NOOP string Does it parse this part properly? +Line <35>NOOP newline +Line <35>NOOP newline +Line <36>NOOP string huh +Line <36>NOOP newline +Line <36>NOOP newline +Line <36>NOOP eof diff --git a/DMS/test.dms b/DMS/test.dms index 610dd1a..36d51b6 100644 --- a/DMS/test.dms +++ b/DMS/test.dms @@ -2,100 +2,13 @@ entry main enable warnings disable omniscient enable debugging -loadfile "loadtest.dms" +//loadfile "loadtest.dms" version 1.2 using extendedDefine [main] - Bob: "Hi Ryan!" - DEBUG "What's up" // Debug lines are removed when debug mode is disabled - Ryan: { - speed 100;calm "Hello Bob, " - wait 0.455 - excited "how are you doing?" - // Becomes: Hello Bob, how are you doing? - } - Bob: { - speed 50 - happy "You won't believe what just happened!" - } - Ryan: "Let me gue..." - Bob: { - speed 150 - excited "I got the job! " - "The pay is amazing, " - speed 50 - calm "but wait theres more!" - excited "I also get to go on a company trip and " - "I'm able to invite 2 friends to come along" - } - Ryan: { - happy "That's awesome! " - curious "Who do you plan on inviting?" - } - Bob: { - calm "Well you obviously, but I'm not sure who else I would want to bring..." - curious "Wanted to ask if you had any suggestions?" - } - Ryan: "Hmm, let me see..." - CHOICE "Who should I pick?" { - "Marie" goto "pickMarie" - "Sammy" goto "pickSammy" - "Ana" goto "pickAna" - "No Idea" goto "noIdea" - } - ::pickMarie:: - Ryan: "I think inviting Marie would be a good idea." - Bob: "I was actually thinking the same thing, let's invite her." - friend = [Marie] // Marie is a character block so obviously we set friend to a block - goto endpick - ::pickSammy:: - Ryan: "I think inviting Sammy would be a good idea." - Bob: "I haven't hung out with Sammy in too long, good pick." - friend = [Sammy] - goto endpick - ::pickAna:: - Ryan: "I think inviting Ana would be a good idea." - Bob: "Ana a name I haven't heard in a long time, sure sounds like a good time." - friend = [Ana] - goto endpick - ::noIdea:: - Ryan: "I really don't know who to bring..." - Bob: "Huh you having issues thinking of someone too. How about we bring Frank?" - Ryan: "Oh man Frank, for sure its been a minute since I last saw him." - friend = [Frank] - ::endpick:: - Bob: "Ill give ${friend} a call later!" - Ryan: "Sounds good looking forward to the trip!" - Bob: "Same, I'll send you the details later as well, see ya!" - Ryan: "Take care!" - - tester = "Hello" - food = 3 - - if statment { - "test" - } elseif statement { - "test" - } if statement { - "test" - "test" - if statement { - "test" - } else { - "test" - } - } elseif statement { - "test" - } else { - "test" - } - - goto "somewhere" - jump "overhere" - - hungry = (-2+4-((5*5)/sqrt(144+5)))^2*2+2 - var1 = func(1,"string", 2+5) + "hello?" + var1 = func(1,"string",test(1,2),test2()) a = 100 + func(1,"string", 2+5) + 100 func(1,"string", 2+5) ::mylabel:: diff --git a/Debug/DMS.exe b/Debug/DMS.exe index 19ba0f9..c12df3f 100644 Binary files a/Debug/DMS.exe and b/Debug/DMS.exe differ diff --git a/Debug/DMS.ilk b/Debug/DMS.ilk index 0273394..29264fe 100644 Binary files a/Debug/DMS.ilk and b/Debug/DMS.ilk differ diff --git a/Debug/DMS.pdb b/Debug/DMS.pdb index 550d803..e8b62d3 100644 Binary files a/Debug/DMS.pdb and b/Debug/DMS.pdb differ