| 159 | |
| 160 | |
| 161 | void 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 | |
| 183 | void cSemanticASTVisitor::VisitIfBlock(cASTIfBlock& node) |
nothing calls this directly
no test coverage detected