code: public Tree readTree() throws IOException {
      Tree t = null;
  
      while (tokenizer.hasNext() && t == null) {
  
        //Setup PDA
        this.currentTree = null;
        this.stack = new ArrayList<Tree>();
  
        try {
          t = getTreeFromInputStream();
        } catch (NoSuchElementException e) {
          throw new IOException("End of token stream encountered before parsing could complete.");
        }
  
        if (t != null) {
          // cdm 20100618: Don't do this!  This was never the historical behavior!!!
          // Escape empty trees e.g. (())
          // while(t != null && (t.value() == null || t.value().equals("")) && t.numChildren() <= 1)
          //   t = t.firstChild();
  
          if (t != null && treeNormalizer != null && treeFactory != null)
            t = treeNormalizer.normalizeWholeTree(t, treeFactory);
        }
      }
  
      return t;
    }
docs: Reads a single tree in standard Penn Treebank format from the
  input stream. The method supports additional parentheses around the
  tree (an unnamed ROOT node) so long as they are balanced. If the token stream
  ends before the current tree is complete, then the method will throw an
  <code>IOException</code>.
  <p>
  Note that the method will skip malformed trees and attempt to
  read additional trees from the input stream. It is possible, however,
  that a malformed tree will corrupt the token stream. In this case,
  an <code>IOException</code> will eventually be thrown.
  
  @return A single tree, or <code>null</code> at end of token stream.