forked from xxq250/Nasal-Interpreter
Add runtime & var
This commit is contained in:
@@ -4,6 +4,7 @@ int main()
|
||||
resource_programme_process prog;
|
||||
nasal_lexer lex;
|
||||
nasal_parser pas;
|
||||
runtime rt;
|
||||
std::string command;
|
||||
std::cout<<">> Nasal interpreter by ValKmjolnir"<<std::endl;
|
||||
std::cout<<">> Input [help] to find help."<<std::endl;
|
||||
@@ -61,6 +62,8 @@ int main()
|
||||
pas.parse_main_work();
|
||||
if(!pas.get_error_num())
|
||||
pas.print_generated_ast();
|
||||
else
|
||||
std::cout<<">>[Abstract_syntax_tree] error(s) occurred,stop."<<std::endl;
|
||||
}
|
||||
else if(command=="run")
|
||||
{
|
||||
@@ -69,9 +72,9 @@ int main()
|
||||
pas.parse_process(lex.return_list());
|
||||
pas.parse_main_work();
|
||||
if(!pas.get_error_num())
|
||||
{
|
||||
;
|
||||
}
|
||||
rt.run_abstract_syntax_tree(pas.get_tree());
|
||||
else
|
||||
std::cout<<">>[Runtime] error(s) occurred,stop."<<std::endl;
|
||||
}
|
||||
else
|
||||
prog.input_file(command);
|
||||
|
||||
Reference in New Issue
Block a user