Creates base of script class

This commit is contained in:
2019-05-21 12:59:15 +02:00
parent 37e770f1cb
commit ad3e61128c
7 changed files with 70 additions and 12 deletions

21
src/Script.cpp Normal file
View File

@@ -0,0 +1,21 @@
#include <utility>
#include "Script.hpp"
Script Script::Create(string script) {
auto s = Script();
s.Parse(std::move(script));
return s;
}
void Script::Parse(string script) {
auto lexer = Lexer(std::move(script));
auto lexResult = lexer.Lex();
auto parser = Parser(lexResult);
auto parseResult = parser.Parse();
for (auto token : lexResult){
delete token;
}
lexResult.clear();
}