/**
  * Detaches the walker from the set which it iterated over, releasing any computational resources
  * and placing the iterator in the INVALID state.
  */
 public void detach() {
   super.detach();
   if (m_canDetachNodeset) {
     m_exprObj.detach();
   }
   m_exprObj = null;
 }
  /**
   * Set the root node of the TreeWalker.
   *
   * @param root non-null reference to the root, or starting point of the query.
   */
  public void setRoot(int root) {

    super.setRoot(root);

    m_exprObj =
        FilterExprIteratorSimple.executeFilterExpr(
            root,
            m_lpi.getXPathContext(),
            m_lpi.getPrefixResolver(),
            m_lpi.getIsTopLevel(),
            m_lpi.m_stackFrame,
            m_expr);
  }
  /**
   * Init a FilterExprWalker.
   *
   * @param compiler non-null reference to the Compiler that is constructing.
   * @param opPos positive opcode position for this step.
   * @param stepType The type of step.
   * @throws javax.xml.transform.TransformerException
   */
  public void init(Compiler compiler, int opPos, int stepType)
      throws javax.xml.transform.TransformerException {

    super.init(compiler, opPos, stepType);

    // Smooth over an anomily in the opcode map...
    switch (stepType) {
      case OpCodes.OP_FUNCTION:
      case OpCodes.OP_EXTFUNCTION:
        m_mustHardReset = true;
      case OpCodes.OP_GROUP:
      case OpCodes.OP_VARIABLE:
        m_expr = compiler.compile(opPos);
        m_expr.exprSetParent(this);
        // if((OpCodes.OP_FUNCTION == stepType) && (m_expr instanceof
        // org.apache.xalan.templates.FuncKey))
        if (m_expr instanceof org.apache.xpath.operations.Variable) {
          // hack/temp workaround
          m_canDetachNodeset = false;
        }
        break;
      default:
        m_expr = compiler.compile(opPos + 2);
        m_expr.exprSetParent(this);
    }
    //    if(m_expr instanceof WalkingIterator)
    //    {
    //      WalkingIterator wi = (WalkingIterator)m_expr;
    //      if(wi.getFirstWalker() instanceof FilterExprWalker)
    //      {
    //      	FilterExprWalker fw = (FilterExprWalker)wi.getFirstWalker();
    //      	if(null == fw.getNextWalker())
    //      	{
    //      		m_expr = fw.m_expr;
    //      		m_expr.exprSetParent(this);
    //      	}
    //      }
    //
    //    }
  }
 /**
  * Detaches the walker from the set which it iterated over, releasing any computational resources
  * and placing the iterator in the INVALID state.
  */
 public void detach() {
   m_iterator = null;
   super.detach();
 }
 /**
  * Set the root node of the TreeWalker. (Not part of the DOM2 TreeWalker interface).
  *
  * @param root The context node of this step.
  */
 public void setRoot(int root) {
   super.setRoot(root);
   m_iterator = getDTM(root).getAxisIterator(m_axis);
   m_iterator.setStartNode(root);
 }
  /**
   * This will traverse the heararchy, calling the visitor for each member. If the called visitor
   * method returns false, the subtree should not be called.
   *
   * @param visitor The visitor whose appropriate method will be called.
   */
  public void callPredicateVisitors(XPathVisitor visitor) {
    m_expr.callVisitors(new filterExprOwner(), visitor);

    super.callPredicateVisitors(visitor);
  }
 /**
  * This function is used to fixup variables from QNames to stack frame indexes at stylesheet build
  * time.
  *
  * @param vars List of QNames that correspond to variables. This list should be searched backwards
  *     for the first qualified name that corresponds to the variable reference qname. The position
  *     of the QName in the vector from the start of the vector will be its position in the stack
  *     frame (but variables above the globalsTop value will need to be offset to the current stack
  *     frame).
  */
 public void fixupVariables(java.util.Vector vars, int globalsSize) {
   super.fixupVariables(vars, globalsSize);
   m_expr.fixupVariables(vars, globalsSize);
 }