MCPcopy Create free account
hub / github.com/csyonghe/Spire / VisitWhileStatement

Method VisitWhileStatement

Source/SpireCore/CodeGenerator.cpp:664–678  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

662 return stmt;
663 }
664 virtual RefPtr<StatementSyntaxNode> VisitWhileStatement(WhileStatementSyntaxNode* stmt) override
665 {
666 RefPtr<WhileInstruction> instr = new WhileInstruction();
667 variables.PushScope();
668 codeWriter.PushNode();
669 stmt->Predicate->Accept(this);
670 codeWriter.Insert(new ReturnInstruction(PopStack()));
671 instr->ConditionCode = codeWriter.PopNode();
672 codeWriter.PushNode();
673 stmt->Statement->Accept(this);
674 instr->BodyCode = codeWriter.PopNode();
675 codeWriter.Insert(instr.Release());
676 variables.PopScope();
677 return stmt;
678 }
679 virtual RefPtr<StatementSyntaxNode> VisitDoWhileStatement(DoWhileStatementSyntaxNode* stmt) override
680 {
681 RefPtr<DoInstruction> instr = new DoInstruction();

Callers

nothing calls this directly

Calls 7

PushNodeMethod · 0.80
PopNodeMethod · 0.80
PushScopeMethod · 0.45
AcceptMethod · 0.45
InsertMethod · 0.45
ReleaseMethod · 0.45
PopScopeMethod · 0.45

Tested by

no test coverage detected