diff --git a/DMS/Debug/DMS.log b/DMS/Debug/DMS.log index f2f985e..1c01c78 100644 --- a/DMS/Debug/DMS.log +++ b/DMS/Debug/DMS.log @@ -1,9 +1,5 @@ - DMS.cpp - LineParserBuilds.cpp - LineParserMatchProcess.cpp + LineParserBuilds.cpp LineParserParse.cpp - LineParserUtils.cpp chunk.cpp - dms_state.cpp Generating Code... DMS.vcxproj -> F:\VSCWorkspace\DMS\Debug\DMS.exe diff --git a/DMS/Debug/DMS.obj b/DMS/Debug/DMS.obj index 6344264..a11430e 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 36af4a7..4c1ae59 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 65c102a..7d7da95 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 13ea934..cf39db3 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 d943091..28ae491 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/vc142.idb b/DMS/Debug/vc142.idb index 4d7d735..76d1dbc 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 1a8b8da..e68168e 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 41e4e93..c13cd38 100644 --- a/DMS/LineParser.h +++ b/DMS/LineParser.h @@ -54,6 +54,7 @@ namespace dms { std::stack scopes; size_t line = 1; std::vector temp; + std::vector tdump; size_t tabs = 0; dms_state* state; void doCheck(passer* stream, std::vector* t_vec, size_t line, bool& isNum, bool& hasDec, std::vector* buffer); @@ -74,6 +75,7 @@ namespace dms { void buildLabel(std::string l); // Utils + void tokenDump(std::vector* v); bool createBlock(std::string bk_name, blocktype bk_type); bool isBlock(); diff --git a/DMS/LineParserMatchProcess.cpp b/DMS/LineParserMatchProcess.cpp index 6d736cb..489bfd5 100644 --- a/DMS/LineParserMatchProcess.cpp +++ b/DMS/LineParserMatchProcess.cpp @@ -9,7 +9,7 @@ namespace dms { Compound DISP */ - if (isBlock(bt_block) && stream->match(tokens::newline, tokens::string, tokens::newline)) { + 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; print("DISP := ", msg); diff --git a/DMS/LineParserParse.cpp b/DMS/LineParserParse.cpp index f055b2a..4c95ca2 100644 --- a/DMS/LineParserParse.cpp +++ b/DMS/LineParserParse.cpp @@ -289,17 +289,20 @@ namespace dms { data = stream.next(); } t_vec.push_back(token{ tokens::eof,codes::NOOP,"",line - 1 }); - std::ofstream outputFile("dump.txt"); - outputFile << "Token Dump:" << std::endl; - for (size_t i = 0; i < t_vec.size(); i++) { - outputFile << t_vec[i] << std::endl; - } - outputFile.close(); + tokenDump(&t_vec); print("Running tokenizer"); // Tokens build let's parse tokenizer(state, t_vec); 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; + } + outputFile.close(); + } void LineParser::_Parse(tokenstream stream) { token current = stream.next(); while (stream.peek().type != tokens::eof) { @@ -330,7 +333,6 @@ namespace dms { // TODO add usings, kinda useless atm since everything will be packed in. Perhaps extensions? } else if (code == codes::LOAD && tok == tokens::string) { - print("Loading File: ", temp[0].name); LineParser parser = LineParser(); parser.Parse(state, temp[0].name);// Load another file } diff --git a/DMS/LineParserUtils.cpp b/DMS/LineParserUtils.cpp index 6d1e346..46c5cc2 100644 --- a/DMS/LineParserUtils.cpp +++ b/DMS/LineParserUtils.cpp @@ -171,7 +171,6 @@ namespace dms { current_chunk->name = bk_name; chunk_type = bk_type; current_chunk->type = bk_type; - print("Created Block: ",bk_name," <",bk_type,">"); return true; } void LineParser::tokenizer(dms_state* state,std::vector &toks) { diff --git a/DMS/dms_state.cpp b/DMS/dms_state.cpp index a1d48ea..9f11d52 100644 --- a/DMS/dms_state.cpp +++ b/DMS/dms_state.cpp @@ -35,7 +35,6 @@ namespace dms { outputFile.close(); } void dms_state::push_chunk(std::string s, chunk* c) { - std::cout << "Pushing Chunk: " << s << std::endl; chunks.insert_or_assign(s, c); } void dms_state::push_error(errors::error err) { diff --git a/DMS/dump.txt b/DMS/dump.txt index 3ab5ab4..2a8d50a 100644 --- a/DMS/dump.txt +++ b/DMS/dump.txt @@ -12,59 +12,120 @@ Line <3>NOOP name money Line <3>NOOP equal Line <3>NOOP number 0 Line <3>NOOP newline +Line <4>NOOP name test +Line <4>NOOP equal +Line <4>NOOP nil nil Line <4>NOOP newline -Line <5>NOOP bracketo -Line <5>NOOP name Ryan -Line <5>NOOP colon -Line <5>NOOP name char -Line <5>NOOP bracketc Line <5>NOOP newline -Line <6>NOOP name age -Line <6>NOOP equal -Line <6>NOOP number 21 +Line <6>NOOP bracketo +Line <6>NOOP name Ryan +Line <6>NOOP colon +Line <6>NOOP name char +Line <6>NOOP bracketc Line <6>NOOP newline -Line <7>NOOP name money +Line <7>NOOP name age Line <7>NOOP equal -Line <7>NOOP number 1000 +Line <7>NOOP number 21 Line <7>NOOP newline +Line <8>NOOP name money +Line <8>NOOP equal +Line <8>NOOP number 1000 Line <8>NOOP newline -Line <9>NOOP name calm -Line <9>NOOP colon -Line <9>NOOP string ./path/to/file Line <9>NOOP newline -Line <10>NOOP name excited +Line <10>NOOP name calm Line <10>NOOP colon Line <10>NOOP string ./path/to/file Line <10>NOOP newline +Line <11>NOOP name excited +Line <11>NOOP colon +Line <11>NOOP string ./path/to/file Line <11>NOOP newline -Line <12>NOOP bracketo -Line <12>NOOP name step -Line <12>NOOP colon -Line <12>NOOP name function -Line <12>NOOP parao -Line <12>NOOP name a -Line <12>NOOP seperator -Line <12>NOOP name b -Line <12>NOOP seperator -Line <12>NOOP name c -Line <12>NOOP parac -Line <12>NOOP bracketc Line <12>NOOP newline -Line <13>NOOP string Testing... +Line <13>NOOP bracketo +Line <13>NOOP name step +Line <13>NOOP colon +Line <13>NOOP name function +Line <13>NOOP parao +Line <13>NOOP name a +Line <13>NOOP seperator +Line <13>NOOP name b +Line <13>NOOP seperator +Line <13>NOOP name c +Line <13>NOOP parac +Line <13>NOOP bracketc Line <13>NOOP newline -Line <14>NOOP name d -Line <14>NOOP equal -Line <14>NOOP parao -Line <14>NOOP number 100 -Line <14>NOOP plus -Line <14>NOOP name b -Line <14>NOOP parac -Line <14>NOOP divide -Line <14>NOOP name c +Line <14>NOOP string Testing... Line <14>NOOP newline -Line <15>NOOP name e +Line <15>NOOP name d Line <15>NOOP equal -Line <15>NOOP string somestring +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 <16>NOOP name e Line <16>NOOP equal +Line <16>NOOP string somestring +Line <16>NOOP newline +Line <17>NOOP name e +Line <17>NOOP equal +Line <17>NOOP nil nil +Line <17>NOOP newline +Line <18>NOOP name g +Line <18>NOOP equal +Line <18>NOOP false false +Line <18>NOOP newline +Line <19>RETN ret +Line <19>NOOP name d +Line <19>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 newline +Line <22>NOOP name slot1 +Line <22>NOOP number +Line <22>NOOP equal +Line <22>NOOP string +Line <22>NOOP newline +Line <23>NOOP name slot2 +Line <23>NOOP number +Line <23>NOOP equal +Line <23>NOOP string +Line <23>NOOP newline +Line <24>NOOP name slot3 +Line <24>NOOP number +Line <24>NOOP equal +Line <24>NOOP string +Line <24>NOOP newline +Line <25>NOOP name slot4 +Line <25>NOOP number +Line <25>NOOP equal +Line <25>NOOP string +Line <25>NOOP newline +Line <26>NOOP name slot5 +Line <26>NOOP number +Line <26>NOOP equal +Line <26>NOOP string +Line <26>NOOP newline +Line <27>NOOP name slot6 +Line <27>NOOP number +Line <27>NOOP equal +Line <27>NOOP string +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 <29>NOOP name slot8 +Line <29>NOOP number +Line <29>NOOP equal +Line <29>NOOP string +Line <29>NOOP newline +Line <31>NOOP eof diff --git a/DMS/loadtest.dms b/DMS/loadtest.dms index f9feb6f..aeed2ee 100644 --- a/DMS/loadtest.dms +++ b/DMS/loadtest.dms @@ -1,6 +1,7 @@ [default:char] // The default stats for all characters. money = 0 + test = nil [Ryan:char] age = 21 diff --git a/DMS/token.h b/DMS/token.h index c791736..7ad44cc 100644 --- a/DMS/token.h +++ b/DMS/token.h @@ -1,6 +1,7 @@ #pragma once #include #include "codes.h" +#include "utils.h" namespace dms::tokens { enum tokentype { none, @@ -106,6 +107,13 @@ namespace dms::tokens { "gotoo", "jump", "exit", + "debug", + "tilde", + "backtick", + "at", + "pound", + "dollar", + "ampersand", "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 833f3eb..c45a2ce 100644 Binary files a/Debug/DMS.exe and b/Debug/DMS.exe differ diff --git a/Debug/DMS.ilk b/Debug/DMS.ilk index 64a5f7b..b5476f2 100644 Binary files a/Debug/DMS.ilk and b/Debug/DMS.ilk differ diff --git a/Debug/DMS.pdb b/Debug/DMS.pdb index 9f40a17..91a3565 100644 Binary files a/Debug/DMS.pdb and b/Debug/DMS.pdb differ