22 lines
431 B
C++
22 lines
431 B
C++
|
#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();
|
||
|
}
|