#define __SINST__ // g++ header bug #include #include "AST.h" #include "decls.h" #include "dump.h" void ddump(const TreeNode *x) { x->dump(cout, 0); cout << endl; } void TreeNode::dumpPrefix( ostream &sink, unsigned depth ) const { sink << '('; ::dump( sink, depth, this ); } void TreeNode::dumpSuffix( ostream &sink, unsigned ) const { sink << ')'; } void TreeNode::dump( ostream &sink, unsigned depth ) const { dumpPrefix( sink, depth ); dumpSuffix( sink, depth ); } void OmittedNode::dump( ostream &sink, unsigned depth ) const { sink << '@'; } void TreeListNode::dump( ostream &sink, unsigned depth ) const { sink << "[\n"; foriter (child, allChildren(), ConstChildIter) { indent( sink, depth + 1 ); (*child)->dump( sink, depth + 1 ); sink << '\n'; } indent( sink, depth ); sink << ']'; } #include "dump-nodes.cc"