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

Method VisitForeachBlock

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

Source from the content-addressed store, hash-verified

159
160
161void cSemanticASTVisitor::VisitForeachBlock(cASTForeachBlock& node)
162{
163 // Check values and make sure we can process it as an array
164 node.GetValues()->Accept(*this);
165 checkCast(node.GetValues()->GetType(), TYPEINFO(ARRAY));
166
167 m_cur_symtbl->PushScope();
168
169 // Check and define the variable in this scope
170 node.GetVariable()->Accept(*this);
171
172 // Check the code
173 m_top_level = true;
174 node.GetCode()->Accept(*this);
175
176 // Check all functions in the current scope level and make sure they have been defined
177 cSymbolTable::cFunctionIterator fit = m_cur_symtbl->ActiveFunctionIterator();
178 while (fit.Next()) if (!fit.HasCode()) SEMANTIC_ERROR(FUNCTION_UNDEFINED, (const char*)fit.GetName());
179 m_cur_symtbl->PopScope();
180}
181
182
183void cSemanticASTVisitor::VisitIfBlock(cASTIfBlock& node)

Callers

nothing calls this directly

Calls 11

AcceptMethod · 0.80
PushScopeMethod · 0.80
GetVariableMethod · 0.80
HasCodeMethod · 0.80
PopScopeMethod · 0.80
GetValuesMethod · 0.45
GetTypeMethod · 0.45
GetCodeMethod · 0.45
NextMethod · 0.45
GetNameMethod · 0.45

Tested by

no test coverage detected