Example #1
0
 public String toStringTree() {
   if (children == null || children.size() == 0) {
     return this.toString(); // + "[" + this.info() + "]";
   }
   StringBuffer buf = new StringBuffer();
   if (!isNil()) {
     buf.append("(");
     buf.append(this.toString()); // + "[" + this.info() + "]");
     buf.append(' ');
   }
   for (int i = 0; children != null && i < children.size(); i++) {
     PythonTree t = (PythonTree) children.get(i);
     if (i > 0) {
       buf.append(' ');
     }
     buf.append(t.toStringTree());
   }
   if (!isNil()) {
     buf.append(")");
   }
   return buf.toString();
 }