Update tips
This commit is contained in:
parent
c088438896
commit
cd46d8eaf8
|
@ -12,13 +12,13 @@ int main()
|
||||||
if(command=="help")
|
if(command=="help")
|
||||||
{
|
{
|
||||||
std::cout<<">> nasal script by ValKmjolnir"<<std::endl;
|
std::cout<<">> nasal script by ValKmjolnir"<<std::endl;
|
||||||
std::cout<<">> 1. |input file name to run the lexer."<<std::endl;
|
std::cout<<">> 1. |input file name to run the lexer. (-lexer)"<<std::endl;
|
||||||
std::cout<<">> 2. \"cls\" |clear the screen."<<std::endl;
|
std::cout<<">> 2. \"cls\" |clear the screen."<<std::endl;
|
||||||
std::cout<<">> 3. \"exit\" |shut down the program."<<std::endl;
|
std::cout<<">> 3. \"exit\" |shut down the program."<<std::endl;
|
||||||
std::cout<<">> 4. \"lexer\" |see tokens in stack."<<std::endl;
|
std::cout<<">> 4. \"lexer\" |see tokens in stack."<<std::endl;
|
||||||
std::cout<<">> 5. \"parser\"|run parser."<<std::endl;
|
std::cout<<">> 5. \"parser\"|run parser. (-parser)"<<std::endl;
|
||||||
std::cout<<">> 6. \"del\" |delete all elements in stack."<<std::endl;
|
std::cout<<">> 6. \"del\" |delete all elements in stack."<<std::endl;
|
||||||
std::cout<<">> 7. \"run\" |run the programme in stack."<<std::endl;
|
std::cout<<">> 7. \"run\" |run the programme in stack. (-lexer -parser)"<<std::endl;
|
||||||
std::cout<<">> 8. \"rs\" |check the source program."<<std::endl;
|
std::cout<<">> 8. \"rs\" |check the source program."<<std::endl;
|
||||||
}
|
}
|
||||||
else if(command=="cls")
|
else if(command=="cls")
|
||||||
|
@ -42,6 +42,7 @@ int main()
|
||||||
nasal::nasal_parse.stack_set_empty();
|
nasal::nasal_parse.stack_set_empty();
|
||||||
nasal::nasal_var_stack.delete_all();
|
nasal::nasal_var_stack.delete_all();
|
||||||
nasal::nasal_func_stack.delete_all();
|
nasal::nasal_func_stack.delete_all();
|
||||||
|
std::cout<<">>[Delete] Complete."<<std::endl;
|
||||||
}
|
}
|
||||||
else if(command=="parser")
|
else if(command=="parser")
|
||||||
{
|
{
|
||||||
|
|
|
@ -243,7 +243,7 @@ void RunProcess(std::string &FileName)
|
||||||
std::ifstream fin(FileName);
|
std::ifstream fin(FileName);
|
||||||
if(fin.fail())
|
if(fin.fail())
|
||||||
{
|
{
|
||||||
std::cout<<"[Error] Failed to load file: "<<FileName<<std::endl;
|
std::cout<<">>[Error] Failed to load file: "<<FileName<<std::endl;
|
||||||
fin.close();
|
fin.close();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -261,7 +261,7 @@ void RunProcess(std::string &FileName)
|
||||||
nasal_lexer.append(line,Syn,token);
|
nasal_lexer.append(line,Syn,token);
|
||||||
}
|
}
|
||||||
//nasal_lexer.print(); //for debug mode
|
//nasal_lexer.print(); //for debug mode
|
||||||
std::cout<<">> Complete scanning \""<<FileName<<"\"."<<std::endl;
|
std::cout<<">>[Lexer] Complete scanning \""<<FileName<<"\"."<<std::endl;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1381,7 +1381,7 @@ void parse::print_error()
|
||||||
}
|
}
|
||||||
if(!temp_stack.empty())
|
if(!temp_stack.empty())
|
||||||
{
|
{
|
||||||
std::cout<<">>[Error]: Parse error."<<std::endl;
|
std::cout<<">>[Error] Parse error."<<std::endl;
|
||||||
while(!temp_stack.empty())
|
while(!temp_stack.empty())
|
||||||
{
|
{
|
||||||
int l=temp_stack.top().line;
|
int l=temp_stack.top().line;
|
||||||
|
@ -1398,7 +1398,7 @@ void parse::print_error()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
std::cout<<">> Parse analysis complete."<<std::endl;
|
std::cout<<">>[Parser] Parse analysis complete."<<std::endl;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue