#include "nasal.h" nasal_resource resource; nasal_lexer lexer; nasal_parse parse; std::string command; void help() { std::cout<<">> [\'file\'] input a file."<> [cls ] clear the screen."<> [del ] clear the resource code."<> [lib ] add lib file."<> [rs ] print resource code."<> [lex ] turn code into tokens."<> [par ] turn tokens into abstract syntax tree."<> [ast ] check the abstract syntax tree."<> [run ] run code."<> [logo ] print logo of nasal ."<> [exit ] quit nasal interpreter."<> [lexer] error occurred,stop.\n"; return; } void par_func() { lexer.scanner(resource.get_file()); if(!lexer.get_error()) { parse.set_toklist(lexer.get_token_list()); if(parse.get_error()) std::cout<<">> [parse] error occurred,stop.\n"; } else std::cout<<">> [lexer] error occurred,stop.\n"; return; } int main() { #ifdef _WIN32 // use chcp 65001 to use unicode io system("chcp 65001"); #endif // this curve looks really cool logo(); #ifdef _WIN32 std::cout<<">> [system] Windows system."<> [system] Linux system."<> [system] MacOS system."<> Nasal interpreter ver 3.0 ."<> Code: https://github.com/ValKmjolnir/Nasal-Interpreter"<> More info: http://wiki.flightgear.org/Nasal_scripting_language"<> Input \"help\" to get help ."<> "; std::cin>>command; if(command=="help") help(); else if(command=="cls") { #ifdef _WIN32 system("cls"); #endif #ifdef _linux_ system("clear"); #endif #ifdef TARGET_OS_MAC system("clear"); #endif } else if(command=="del") { resource.delete_file(); lexer.delete_tokens(); parse.clear(); std::cout<<">> [Delete] complete."<