code: private void normalizeParents(ParseTreeNode tree) throws ParserException {
  	try {
  	    final Field parentField = ParseTreeNode.class.getDeclaredField("parent");
  	    parentField.setAccessible(true);
  	    TreeVisitor<ParseTreeNode> visitor = new TreeVisitor<ParseTreeNode>() {
  
  		@Override
  		public WalkingAction visit(ParseTreeNode tree) {
  		    try {
  			for (ParseTreeNode child : tree.getChildren()) {
  			    parentField.set(child, tree);
  			}
  			return WalkingAction.PROCEED;
  		    } catch (IllegalArgumentException e) {
  			throw new IllegalStateException("Could not set new parent!", e);
  		    } catch (IllegalAccessException e) {
  			throw new IllegalStateException("Could not set new parent!", e);
  		    }
  		}
  	    };
  	    new TreeWalker<ParseTreeNode>(tree).walk(visitor);
  	    parentField.setAccessible(false);
  	} catch (SecurityException e) {
  	    throw new ParserException("Could not normalize the parser tree.", e);
  	} catch (NoSuchFieldException e) {
  	    throw new ParserException("Could not normalize the parser tree.", e);
  	} catch (IllegalStateException e) {
  	    throw new ParserException("Could not normalize the parser tree.", e);
  	}
      }
docs: <p>
  This method walks the whole tree and normalizes all children to point to
  their new parents. This is needed due to continuous changes of subtrees
  during packrat parsing. The answers from the memoization are added several
  times to different nodes. So the parent gets set to the latest parent, but
  this is not necessarily the right.
  </p>
  <p>
  For the parsing process itself it is not a big deal due to it is always
  looked from the parent to the child, but not upward. For later tree
  processing we need this normalization.
  </p>
  
  @param tree
  is the tree to be normalized.
  @throws ParserException