| 223 | |
| 224 | |
| 225 | void |
| 226 | ASTNode::printchildren (std::ostream &out, int indentlevel) const |
| 227 | { |
| 228 | for (size_t i = 0; i < m_children.size(); ++i) { |
| 229 | if (! child(i)) |
| 230 | continue; |
| 231 | indent (out, indentlevel); |
| 232 | if (childname(i)) |
| 233 | out << " " << childname(i); |
| 234 | else |
| 235 | out << " child" << i; |
| 236 | out << ": "; |
| 237 | if (typespec() != TypeSpec() && ! child(i)->next()) |
| 238 | out << " (type: " << typespec().string() << ")"; |
| 239 | out << "\n"; |
| 240 | printlist (out, child(i), indentlevel+1); |
| 241 | } |
| 242 | } |
| 243 | |
| 244 | |
| 245 |