This commit is contained in:
Saturneric 2021-05-13 00:27:10 +08:00
parent 9bbc406364
commit 79d9c3976a
No known key found for this signature in database
GPG Key ID: 90536ECE5E7D918A
2 changed files with 30 additions and 28 deletions

View File

@ -21,7 +21,10 @@ int main(int argc, const char* argv[]) {
try {
printf("Compile Program Based on LR(1) Written By Saturneric\n");
wcout << "Compile Program Based on LR(1) Written By Saturneric(胡宇 2018303206)" << endl;
wcout << "老师注意:本程序区分关键字的大小写!!!" << endl
<< "这样做的原因是本人在实践上还没有见过有哪门语言不区分关键字大小写的" << endl;
if (argc < 2) {
printf("Usage: <Input Path>\n");

View File

@ -14,7 +14,7 @@ void SyntaxParser::parse() {
auto *p_step = atg->findActionStep(status_stack.top(), tokens_queue.front());
if (p_step == nullptr) {
printError(output);
printError();
return;
}
@ -42,8 +42,7 @@ void SyntaxParser::parse() {
string_buffer << p_symbol->name << " ";
tokens_queue.pop();
_line_index++;
}
else if(p_step->action == REDUCE) {
} else if (p_step->action == REDUCE) {
auto *p_pdt = p_step->target.production;
output << "REDUCE BY" << "(AUTOMATA STATUS " << status_stack.top() << "): [";