@Override
  protected void walk(Node nd) throws SemanticException {
    opStack.push(nd);
    dispatch(nd, opStack);

    // move all the children to the front of queue
    if (nd.getChildren() != null) {
      for (Node n : nd.getChildren()) {
        walk(n);
      }
    } else if (nd instanceof ConditionalTask) {
      for (Task n : ((ConditionalTask) nd).getListTasks()) {
        if (n.getParentTasks() == null || n.getParentTasks().isEmpty()) {
          walk(n);
        }
      }
    }

    opStack.pop();
  }
Walk the current operator and its descendants.

@param nd
         current operator in the graph
@throws SemanticException
ql/src/java/org/apache/hadoop/hive/ql/lib/PreOrderWalker.java