#include "nasal.h" nasal_resource resource; nasal_lexer lexer; nasal_parse parse; nasal_import preprocessor; nasal_codegen code_generator; std::string command; std::string inputfile="null"; nasal_runtime runtime; void help() { std::cout<<">> [\"file\"] input a file."<> [clear ] clear the screen."<> [del ] clear the input filename."<> [rs ] print source code."<> [lex ] use lexer to turn code into tokens."<> [ast ] do parsing and check the abstract syntax tree."<> [run ] run abstract syntax tree."<> [exec ] generate byte code."<> [erun ] run byte code."<> [logo ] print logo of nasal ."<> [exit ] quit nasal interpreter."<> [Delete] complete."<> ["<: error(s) occurred,stop."<> [system] Windows system."<> [system] Linux system."<> [system] MacOS system."<> Nasal interpreter ver 3.0 ."<> Code: https://github.com/ValKmjolnir/Nasal-Interpreter"<> Info: http://wiki.flightgear.org/Nasal_scripting_language"<> Input \"help\" to get help ."<> "; std::cin>>command; if(command=="help") help(); else if(command=="clear") { #ifdef _WIN32 system("cls"); #endif #ifdef _linux_ system("clear"); #endif #ifdef TARGET_OS_MAC system("clear"); #endif } else if(command=="del") del_func(); else if(command=="rs") { if(resource.input_file(inputfile)) resource.print_file(); } else if(command=="lex") lex_func(); else if(command=="ast") ast_print(); else if(command=="run") runtime_start(); else if(command=="exec") codegen_start(); else if(command=="erun") execution_start(); else if(command=="logo") logo(); else if(command=="exit") break; else { inputfile=command; std::ifstream fin(command); if(fin.fail()) { std::cout<<">> [file] cannot open file \""<