| 724 | return stmt; |
| 725 | } |
| 726 | virtual RefPtr<StatementSyntaxNode> VisitIfStatement(IfStatementSyntaxNode* stmt) override |
| 727 | { |
| 728 | RefPtr<IfInstruction> instr = new IfInstruction(); |
| 729 | variables.PushScope(); |
| 730 | stmt->Predicate->Accept(this); |
| 731 | instr->Operand = PopStack(); |
| 732 | codeWriter.PushNode(); |
| 733 | stmt->PositiveStatement->Accept(this); |
| 734 | instr->TrueCode = codeWriter.PopNode(); |
| 735 | if (stmt->NegativeStatement) |
| 736 | { |
| 737 | codeWriter.PushNode(); |
| 738 | stmt->NegativeStatement->Accept(this); |
| 739 | instr->FalseCode = codeWriter.PopNode(); |
| 740 | } |
| 741 | codeWriter.Insert(instr.Release()); |
| 742 | variables.PopScope(); |
| 743 | return stmt; |
| 744 | } |
| 745 | virtual RefPtr<StatementSyntaxNode> VisitReturnStatement(ReturnStatementSyntaxNode* stmt) override |
| 746 | { |
| 747 | returnRegister = nullptr; |