code: public void printTree(CommonTree t, int indent) {
          if ( t != null ) {
              StringBuffer sb = new StringBuffer(indent);
              for ( int i = 0; i < indent; i++ )
                  sb = sb.append("   ");
              for ( int i = 0; i < t.getChildCount(); i++ ) {
                  System.out.println("" + i + sb.toString() + t.getChild(i).toString());
                  printTree((CommonTree)t.getChild(i), indent+1);
              }
          }
      }
docs: /* from http://www.antlr.org/wiki/display/ANTLR3/Interfacing+AST+with+Java