MCPcopy Create free account
hub / github.com/devosoft/avida / VisitIfBlock

Method VisitIfBlock

avida-core/source/script/cSemanticASTVisitor.cc:183–202  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

181
182
183void cSemanticASTVisitor::VisitIfBlock(cASTIfBlock& node)
184{
185 // Check main condition and code
186 node.GetCondition()->Accept(*this);
187 checkCast(node.GetCondition()->GetType(), TYPEINFO(BOOL));
188
189 node.GetCode()->Accept(*this);
190
191 // Check all elseif blocks
192 tListIterator<cASTIfBlock::cElseIf> it = node.ElseIfIterator();
193 cASTIfBlock::cElseIf* ei = NULL;
194 while ((ei = it.Next())) {
195 ei->GetCondition()->Accept(*this);
196 checkCast(ei->GetCondition()->GetType(), TYPEINFO(BOOL));
197 ei->GetCode()->Accept(*this);
198 }
199
200 // Check else block if there is one
201 if (node.GetElseCode()) node.GetElseCode()->Accept(*this);
202}
203
204
205void cSemanticASTVisitor::VisitWhileBlock(cASTWhileBlock& node)

Callers

nothing calls this directly

Calls 7

AcceptMethod · 0.80
ElseIfIteratorMethod · 0.80
GetElseCodeMethod · 0.80
GetConditionMethod · 0.45
GetTypeMethod · 0.45
GetCodeMethod · 0.45
NextMethod · 0.45

Tested by

no test coverage detected