コード例 #1
0
ファイル: Parser.cs プロジェクト: katiearriagam/Marbles
 /// <summary>
 /// Called when a <see cref="WhileBlock"/> block is read.
 /// Verifies the structure of the While loop and calls the corresponding functions that
 /// handle the code generation for the loop.
 /// Called by <see cref="INSTRUCTION"/>.
 /// </summary>
 void WHILE()
 {
     Expect(30); // "while"
     QuadrupleManager.WhileBeforeCondition();
     Expect(10); // '('
     SUPER_EXP();
     Expect(12); // ')'
     QuadrupleManager.WhileAfterCondition();
     Expect(7);  // '{'
     while (StartOf(1))
     {
         INSTRUCTION();
     }
     Expect(8);         // '}'
     QuadrupleManager.WhileEnd();
 }