Skip to content

Commit

Permalink
for 循环加上最后的 goto 语句
Browse files Browse the repository at this point in the history
  • Loading branch information
IceCapriccio committed Dec 10, 2018
1 parent 7fe3a70 commit 24cdae9
Show file tree
Hide file tree
Showing 40 changed files with 407 additions and 3,820 deletions.
29 changes: 0 additions & 29 deletions .idea/codeStyles/Project.xml

This file was deleted.

303 changes: 134 additions & 169 deletions .idea/workspace.xml

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion IntermediateCodeGenerate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,10 +249,15 @@ CodeSequence Visitor::VisitForSentence(AbstractSyntaxTreeNode *root, int ForSent
}
int expression2_true = supportTable.NewLabel();
int expression2_false = ForSentence_next;
int expression2_begin = supportTable.NewLabel();
supportTable.LabelAssign(expression2_begin, total);
CodeTerm codeTerm(DefLabel, -1, -1, expression2_begin);
code.push_back(codeTerm);
total++;
// child[3] = ;
Exp2Code = VisitExpression(root->child[4], expression2_true, expression2_false);
code.push_back(Exp2Code);
CodeTerm codeTerm = CodeTerm(DefLabel, -1, -1, expression2_true);
codeTerm = CodeTerm(DefLabel, -1, -1, expression2_true);
supportTable.LabelAssign(expression2_true, total);
code.push_back(codeTerm);
total++;
Expand All @@ -270,6 +275,7 @@ CodeSequence Visitor::VisitForSentence(AbstractSyntaxTreeNode *root, int ForSent
code.push_back(codeTerm1);
total++;
}
codeTerm = CodeTerm(Goto, -1, -1, expression2_begin);
return code;
}

Expand Down
16 changes: 11 additions & 5 deletions cmake-build-debug/CMakeCache.txt

Large diffs are not rendered by default.

73 changes: 0 additions & 73 deletions cmake-build-debug/CMakeFiles/3.12.2/CMakeCCompiler.cmake

This file was deleted.

76 changes: 0 additions & 76 deletions cmake-build-debug/CMakeFiles/3.12.2/CMakeCXXCompiler.cmake

This file was deleted.

Binary file not shown.
Binary file not shown.
6 changes: 0 additions & 6 deletions cmake-build-debug/CMakeFiles/3.12.2/CMakeRCCompiler.cmake

This file was deleted.

15 changes: 0 additions & 15 deletions cmake-build-debug/CMakeFiles/3.12.2/CMakeSystem.cmake

This file was deleted.

Loading

0 comments on commit 24cdae9

Please sign in to comment.