code: public int getFirstPredicateOpPos(int opPos)
       throws javax.xml.transform.TransformerException
    {
  
      int stepType = m_opMap.elementAt(opPos);
  
      if ((stepType >= OpCodes.AXES_START_TYPES)
              && (stepType <= OpCodes.AXES_END_TYPES))
      {
        return opPos + m_opMap.elementAt(opPos + 2);
      }
      else if ((stepType >= OpCodes.FIRST_NODESET_OP)
               && (stepType <= OpCodes.LAST_NODESET_OP))
      {
        return opPos + m_opMap.elementAt(opPos + 1);
      }
      else if(-2 == stepType)
      {
        return -2;
      }
      else
      {
        error(org.apache.xpath.res.XPATHErrorResources.ER_UNKNOWN_OPCODE,
              new Object[]{ String.valueOf(stepType) });  //"ERROR! Unknown op code: "+m_opMap[opPos]);
        return -1;
      }
    }
docs: Given an FROM_stepType position, return the position of the
  first predicate, if there is one, or else this will point
  to the end of the FROM_stepType.
  Example:
  int posOfPredicate = xpath.getNextOpPos(stepPos);
  boolean hasPredicates =
  OpCodes.OP_PREDICATE == xpath.getOp(posOfPredicate);
  
  @param opPos position of FROM_stepType op.
  @return position of predicate in FROM_stepType structure.