This commit is contained in:
Valk Richard Li
2019-08-08 20:59:12 +08:00
committed by GitHub
parent beee878e94
commit 19362e936b
5 changed files with 392 additions and 370 deletions
+14 -14
View File
@@ -5,15 +5,6 @@
int main()
{
nasal::nasal_list m;
nasal::nasal_hash n;
nasal::var k;
k.type=VAR_STRING;
k.data=new std::string;
*((std::string *)k.data)="hello";
m.append(k);
m.pop();
std::string command;
std::cout<<">> input \"help\" to find help."<<std::endl;
while(1)
@@ -22,22 +13,31 @@ int main()
std::cin>>command;
if(command=="help")
{
std::cout<<">> 1.input file name to run the nasal script."<<std::endl;
std::cout<<">> 2.command cls to clear the screen."<<std::endl;
std::cout<<">> 3.command exit to shut down the program."<<std::endl;
std::cout<<">> 1. input file name to run the nasal script."<<std::endl;
std::cout<<">> 2. command cls to clear the screen."<<std::endl;
std::cout<<">> 3. command exit to shut down the program."<<std::endl;
std::cout<<">> 4. command lexer to see tokens in stack."<<std::endl;
std::cout<<">> 5. command del to delete all elements in stack."<<std::endl;
std::cout<<">> 6. command run to run the programme in stack."<<std::endl;
}
else if(command=="cls")
{
system("cls");
//linux system("clear");
//macOS system(clear");
//macOS system("clear");
}
else if(command=="exit")
break;
else
else if(command=="lexer")
nasal::nasal_lexer.print();
else if(command=="del")
nasal::nasal_lexer.delete_all();
else if(command=="run")
{
;
}
else
nasal::RunProcess(command);
}
return 0;
}