Java源码示例:com.sun.org.apache.xpath.internal.compiler.OpCodes

示例1
/**
 * This method is for building an array of possible levels
 * where the target element(s) could be found for a match.
 * @param lpi The owning location path iterator.
 * @param compiler non-null reference to compiler object that has processed
 *                 the XPath operations into an opcode map.
 * @param stepOpCodePos The opcode position for the step.
 *
 * @return non-null AxesWalker derivative.
 *
 * @throws javax.xml.transform.TransformerException
 * @xsl.usage advanced
 */
static AxesWalker loadOneWalker(
        WalkingIterator lpi, Compiler compiler, int stepOpCodePos)
          throws javax.xml.transform.TransformerException
{

  AxesWalker firstWalker = null;
  int stepType = compiler.getOp(stepOpCodePos);

  if (stepType != OpCodes.ENDOP)
  {

    // m_axesWalkers = new AxesWalker[1];
    // As we unwind from the recursion, create the iterators.
    firstWalker = createDefaultWalker(compiler, stepType, lpi, 0);

    firstWalker.init(compiler, stepOpCodePos, stepType);
  }

  return firstWalker;
}
 
示例2
/**
 * Analyze a step and give information about it's predicates.  Right now this
 * just returns true or false if the step has a predicate.
 *
 * @param compiler non-null reference to compiler object that has processed
 *                 the XPath operations into an opcode map.
 * @param opPos The opcode position for the step.
 * @param stepType The type of step, one of OP_GROUP, etc.
 *
 * @return true if step has a predicate.
 *
 * @throws javax.xml.transform.TransformerException
 */
static boolean analyzePredicate(Compiler compiler, int opPos, int stepType)
        throws javax.xml.transform.TransformerException
{

  int argLen;

  switch (stepType)
  {
  case OpCodes.OP_VARIABLE :
  case OpCodes.OP_EXTFUNCTION :
  case OpCodes.OP_FUNCTION :
  case OpCodes.OP_GROUP :
    argLen = compiler.getArgLength(opPos);
    break;
  default :
    argLen = compiler.getArgLengthOfStep(opPos);
  }

  int pos = compiler.getFirstPredicateOpPos(opPos);
  int nPredicates = compiler.countPredicates(pos);

  return (nPredicates > 0) ? true : false;
}
 
示例3
/**
 * This method is for building an array of possible levels
 * where the target element(s) could be found for a match.
 * @param lpi The owning location path iterator.
 * @param compiler non-null reference to compiler object that has processed
 *                 the XPath operations into an opcode map.
 * @param stepOpCodePos The opcode position for the step.
 *
 * @return non-null AxesWalker derivative.
 *
 * @throws javax.xml.transform.TransformerException
 * @xsl.usage advanced
 */
static AxesWalker loadOneWalker(
        WalkingIterator lpi, Compiler compiler, int stepOpCodePos)
          throws javax.xml.transform.TransformerException
{

  AxesWalker firstWalker = null;
  int stepType = compiler.getOp(stepOpCodePos);

  if (stepType != OpCodes.ENDOP)
  {

    // m_axesWalkers = new AxesWalker[1];
    // As we unwind from the recursion, create the iterators.
    firstWalker = createDefaultWalker(compiler, stepType, lpi, 0);

    firstWalker.init(compiler, stepOpCodePos, stepType);
  }

  return firstWalker;
}
 
示例4
/**
 * Analyze a step and give information about it's predicates.  Right now this
 * just returns true or false if the step has a predicate.
 *
 * @param compiler non-null reference to compiler object that has processed
 *                 the XPath operations into an opcode map.
 * @param opPos The opcode position for the step.
 * @param stepType The type of step, one of OP_GROUP, etc.
 *
 * @return true if step has a predicate.
 *
 * @throws javax.xml.transform.TransformerException
 */
static boolean analyzePredicate(Compiler compiler, int opPos, int stepType)
        throws javax.xml.transform.TransformerException
{

  int argLen;

  switch (stepType)
  {
  case OpCodes.OP_VARIABLE :
  case OpCodes.OP_EXTFUNCTION :
  case OpCodes.OP_FUNCTION :
  case OpCodes.OP_GROUP :
    argLen = compiler.getArgLength(opPos);
    break;
  default :
    argLen = compiler.getArgLengthOfStep(opPos);
  }

  int pos = compiler.getFirstPredicateOpPos(opPos);
  int nPredicates = compiler.countPredicates(pos);

  return (nPredicates > 0) ? true : false;
}
 
示例5
/**
 * This method is for building an array of possible levels
 * where the target element(s) could be found for a match.
 * @param lpi The owning location path iterator.
 * @param compiler non-null reference to compiler object that has processed
 *                 the XPath operations into an opcode map.
 * @param stepOpCodePos The opcode position for the step.
 *
 * @return non-null AxesWalker derivative.
 *
 * @throws javax.xml.transform.TransformerException
 * @xsl.usage advanced
 */
static AxesWalker loadOneWalker(
        WalkingIterator lpi, Compiler compiler, int stepOpCodePos)
          throws javax.xml.transform.TransformerException
{

  AxesWalker firstWalker = null;
  int stepType = compiler.getOp(stepOpCodePos);

  if (stepType != OpCodes.ENDOP)
  {

    // m_axesWalkers = new AxesWalker[1];
    // As we unwind from the recursion, create the iterators.
    firstWalker = createDefaultWalker(compiler, stepType, lpi, 0);

    firstWalker.init(compiler, stepOpCodePos, stepType);
  }

  return firstWalker;
}
 
示例6
/**
 * Analyze a step and give information about it's predicates.  Right now this
 * just returns true or false if the step has a predicate.
 *
 * @param compiler non-null reference to compiler object that has processed
 *                 the XPath operations into an opcode map.
 * @param opPos The opcode position for the step.
 * @param stepType The type of step, one of OP_GROUP, etc.
 *
 * @return true if step has a predicate.
 *
 * @throws javax.xml.transform.TransformerException
 */
static boolean analyzePredicate(Compiler compiler, int opPos, int stepType)
        throws javax.xml.transform.TransformerException
{

  int argLen;

  switch (stepType)
  {
  case OpCodes.OP_VARIABLE :
  case OpCodes.OP_EXTFUNCTION :
  case OpCodes.OP_FUNCTION :
  case OpCodes.OP_GROUP :
    argLen = compiler.getArgLength(opPos);
    break;
  default :
    argLen = compiler.getArgLengthOfStep(opPos);
  }

  int pos = compiler.getFirstPredicateOpPos(opPos);
  int nPredicates = compiler.countPredicates(pos);

  return (nPredicates > 0) ? true : false;
}
 
示例7
/**
 * This method is for building an array of possible levels
 * where the target element(s) could be found for a match.
 * @param lpi The owning location path iterator.
 * @param compiler non-null reference to compiler object that has processed
 *                 the XPath operations into an opcode map.
 * @param stepOpCodePos The opcode position for the step.
 *
 * @return non-null AxesWalker derivative.
 *
 * @throws javax.xml.transform.TransformerException
 * @xsl.usage advanced
 */
static AxesWalker loadOneWalker(
        WalkingIterator lpi, Compiler compiler, int stepOpCodePos)
          throws javax.xml.transform.TransformerException
{

  AxesWalker firstWalker = null;
  int stepType = compiler.getOp(stepOpCodePos);

  if (stepType != OpCodes.ENDOP)
  {

    // m_axesWalkers = new AxesWalker[1];
    // As we unwind from the recursion, create the iterators.
    firstWalker = createDefaultWalker(compiler, stepType, lpi, 0);

    firstWalker.init(compiler, stepOpCodePos, stepType);
  }

  return firstWalker;
}
 
示例8
/**
 * Analyze a step and give information about it's predicates.  Right now this
 * just returns true or false if the step has a predicate.
 *
 * @param compiler non-null reference to compiler object that has processed
 *                 the XPath operations into an opcode map.
 * @param opPos The opcode position for the step.
 * @param stepType The type of step, one of OP_GROUP, etc.
 *
 * @return true if step has a predicate.
 *
 * @throws javax.xml.transform.TransformerException
 */
static boolean analyzePredicate(Compiler compiler, int opPos, int stepType)
        throws javax.xml.transform.TransformerException
{

  int argLen;

  switch (stepType)
  {
  case OpCodes.OP_VARIABLE :
  case OpCodes.OP_EXTFUNCTION :
  case OpCodes.OP_FUNCTION :
  case OpCodes.OP_GROUP :
    argLen = compiler.getArgLength(opPos);
    break;
  default :
    argLen = compiler.getArgLengthOfStep(opPos);
  }

  int pos = compiler.getFirstPredicateOpPos(opPos);
  int nPredicates = compiler.countPredicates(pos);

  return (nPredicates > 0) ? true : false;
}
 
示例9
/**
 * This method is for building an array of possible levels
 * where the target element(s) could be found for a match.
 * @param lpi The owning location path iterator.
 * @param compiler non-null reference to compiler object that has processed
 *                 the XPath operations into an opcode map.
 * @param stepOpCodePos The opcode position for the step.
 *
 * @return non-null AxesWalker derivative.
 *
 * @throws javax.xml.transform.TransformerException
 * @xsl.usage advanced
 */
static AxesWalker loadOneWalker(
        WalkingIterator lpi, Compiler compiler, int stepOpCodePos)
          throws javax.xml.transform.TransformerException
{

  AxesWalker firstWalker = null;
  int stepType = compiler.getOp(stepOpCodePos);

  if (stepType != OpCodes.ENDOP)
  {

    // m_axesWalkers = new AxesWalker[1];
    // As we unwind from the recursion, create the iterators.
    firstWalker = createDefaultWalker(compiler, stepType, lpi, 0);

    firstWalker.init(compiler, stepOpCodePos, stepType);
  }

  return firstWalker;
}
 
示例10
/**
 * Analyze a step and give information about it's predicates.  Right now this
 * just returns true or false if the step has a predicate.
 *
 * @param compiler non-null reference to compiler object that has processed
 *                 the XPath operations into an opcode map.
 * @param opPos The opcode position for the step.
 * @param stepType The type of step, one of OP_GROUP, etc.
 *
 * @return true if step has a predicate.
 *
 * @throws javax.xml.transform.TransformerException
 */
static boolean analyzePredicate(Compiler compiler, int opPos, int stepType)
        throws javax.xml.transform.TransformerException
{

  int argLen;

  switch (stepType)
  {
  case OpCodes.OP_VARIABLE :
  case OpCodes.OP_EXTFUNCTION :
  case OpCodes.OP_FUNCTION :
  case OpCodes.OP_GROUP :
    argLen = compiler.getArgLength(opPos);
    break;
  default :
    argLen = compiler.getArgLengthOfStep(opPos);
  }

  int pos = compiler.getFirstPredicateOpPos(opPos);
  int nPredicates = compiler.countPredicates(pos);

  return (nPredicates > 0) ? true : false;
}
 
示例11
/**
 * This method is for building an array of possible levels
 * where the target element(s) could be found for a match.
 * @param lpi The owning location path iterator.
 * @param compiler non-null reference to compiler object that has processed
 *                 the XPath operations into an opcode map.
 * @param stepOpCodePos The opcode position for the step.
 *
 * @return non-null AxesWalker derivative.
 *
 * @throws javax.xml.transform.TransformerException
 * @xsl.usage advanced
 */
static AxesWalker loadOneWalker(
        WalkingIterator lpi, Compiler compiler, int stepOpCodePos)
          throws javax.xml.transform.TransformerException
{

  AxesWalker firstWalker = null;
  int stepType = compiler.getOp(stepOpCodePos);

  if (stepType != OpCodes.ENDOP)
  {

    // m_axesWalkers = new AxesWalker[1];
    // As we unwind from the recursion, create the iterators.
    firstWalker = createDefaultWalker(compiler, stepType, lpi, 0);

    firstWalker.init(compiler, stepOpCodePos, stepType);
  }

  return firstWalker;
}
 
示例12
/**
 * Analyze a step and give information about it's predicates.  Right now this
 * just returns true or false if the step has a predicate.
 *
 * @param compiler non-null reference to compiler object that has processed
 *                 the XPath operations into an opcode map.
 * @param opPos The opcode position for the step.
 * @param stepType The type of step, one of OP_GROUP, etc.
 *
 * @return true if step has a predicate.
 *
 * @throws javax.xml.transform.TransformerException
 */
static boolean analyzePredicate(Compiler compiler, int opPos, int stepType)
        throws javax.xml.transform.TransformerException
{

  int argLen;

  switch (stepType)
  {
  case OpCodes.OP_VARIABLE :
  case OpCodes.OP_EXTFUNCTION :
  case OpCodes.OP_FUNCTION :
  case OpCodes.OP_GROUP :
    argLen = compiler.getArgLength(opPos);
    break;
  default :
    argLen = compiler.getArgLengthOfStep(opPos);
  }

  int pos = compiler.getFirstPredicateOpPos(opPos);
  int nPredicates = compiler.countPredicates(pos);

  return (nPredicates > 0) ? true : false;
}
 
示例13
/**
 * This method is for building an array of possible levels
 * where the target element(s) could be found for a match.
 * @param lpi The owning location path iterator.
 * @param compiler non-null reference to compiler object that has processed
 *                 the XPath operations into an opcode map.
 * @param stepOpCodePos The opcode position for the step.
 *
 * @return non-null AxesWalker derivative.
 *
 * @throws javax.xml.transform.TransformerException
 * @xsl.usage advanced
 */
static AxesWalker loadOneWalker(
        WalkingIterator lpi, Compiler compiler, int stepOpCodePos)
          throws javax.xml.transform.TransformerException
{

  AxesWalker firstWalker = null;
  int stepType = compiler.getOp(stepOpCodePos);

  if (stepType != OpCodes.ENDOP)
  {

    // m_axesWalkers = new AxesWalker[1];
    // As we unwind from the recursion, create the iterators.
    firstWalker = createDefaultWalker(compiler, stepType, lpi, 0);

    firstWalker.init(compiler, stepOpCodePos, stepType);
  }

  return firstWalker;
}
 
示例14
/**
 * Analyze a step and give information about it's predicates.  Right now this
 * just returns true or false if the step has a predicate.
 *
 * @param compiler non-null reference to compiler object that has processed
 *                 the XPath operations into an opcode map.
 * @param opPos The opcode position for the step.
 * @param stepType The type of step, one of OP_GROUP, etc.
 *
 * @return true if step has a predicate.
 *
 * @throws javax.xml.transform.TransformerException
 */
static boolean analyzePredicate(Compiler compiler, int opPos, int stepType)
        throws javax.xml.transform.TransformerException
{

  int argLen;

  switch (stepType)
  {
  case OpCodes.OP_VARIABLE :
  case OpCodes.OP_EXTFUNCTION :
  case OpCodes.OP_FUNCTION :
  case OpCodes.OP_GROUP :
    argLen = compiler.getArgLength(opPos);
    break;
  default :
    argLen = compiler.getArgLengthOfStep(opPos);
  }

  int pos = compiler.getFirstPredicateOpPos(opPos);
  int nPredicates = compiler.countPredicates(pos);

  return (nPredicates > 0) ? true : false;
}
 
示例15
/**
 * This method is for building an array of possible levels
 * where the target element(s) could be found for a match.
 * @param lpi The owning location path iterator.
 * @param compiler non-null reference to compiler object that has processed
 *                 the XPath operations into an opcode map.
 * @param stepOpCodePos The opcode position for the step.
 *
 * @return non-null AxesWalker derivative.
 *
 * @throws javax.xml.transform.TransformerException
 * @xsl.usage advanced
 */
static AxesWalker loadOneWalker(
        WalkingIterator lpi, Compiler compiler, int stepOpCodePos)
          throws javax.xml.transform.TransformerException
{

  AxesWalker firstWalker = null;
  int stepType = compiler.getOp(stepOpCodePos);

  if (stepType != OpCodes.ENDOP)
  {

    // m_axesWalkers = new AxesWalker[1];
    // As we unwind from the recursion, create the iterators.
    firstWalker = createDefaultWalker(compiler, stepType, lpi, 0);

    firstWalker.init(compiler, stepOpCodePos, stepType);
  }

  return firstWalker;
}
 
示例16
/**
 * Analyze a step and give information about it's predicates.  Right now this
 * just returns true or false if the step has a predicate.
 *
 * @param compiler non-null reference to compiler object that has processed
 *                 the XPath operations into an opcode map.
 * @param opPos The opcode position for the step.
 * @param stepType The type of step, one of OP_GROUP, etc.
 *
 * @return true if step has a predicate.
 *
 * @throws javax.xml.transform.TransformerException
 */
static boolean analyzePredicate(Compiler compiler, int opPos, int stepType)
        throws javax.xml.transform.TransformerException
{

  int argLen;

  switch (stepType)
  {
  case OpCodes.OP_VARIABLE :
  case OpCodes.OP_EXTFUNCTION :
  case OpCodes.OP_FUNCTION :
  case OpCodes.OP_GROUP :
    argLen = compiler.getArgLength(opPos);
    break;
  default :
    argLen = compiler.getArgLengthOfStep(opPos);
  }

  int pos = compiler.getFirstPredicateOpPos(opPos);
  int nPredicates = compiler.countPredicates(pos);

  return (nPredicates > 0) ? true : false;
}
 
示例17
/**
 * This method is for building an array of possible levels
 * where the target element(s) could be found for a match.
 * @param lpi The owning location path iterator.
 * @param compiler non-null reference to compiler object that has processed
 *                 the XPath operations into an opcode map.
 * @param stepOpCodePos The opcode position for the step.
 *
 * @return non-null AxesWalker derivative.
 *
 * @throws javax.xml.transform.TransformerException
 * @xsl.usage advanced
 */
static AxesWalker loadOneWalker(
        WalkingIterator lpi, Compiler compiler, int stepOpCodePos)
          throws javax.xml.transform.TransformerException
{

  AxesWalker firstWalker = null;
  int stepType = compiler.getOp(stepOpCodePos);

  if (stepType != OpCodes.ENDOP)
  {

    // m_axesWalkers = new AxesWalker[1];
    // As we unwind from the recursion, create the iterators.
    firstWalker = createDefaultWalker(compiler, stepType, lpi, 0);

    firstWalker.init(compiler, stepOpCodePos, stepType);
  }

  return firstWalker;
}
 
示例18
/**
 * Analyze a step and give information about it's predicates.  Right now this
 * just returns true or false if the step has a predicate.
 *
 * @param compiler non-null reference to compiler object that has processed
 *                 the XPath operations into an opcode map.
 * @param opPos The opcode position for the step.
 * @param stepType The type of step, one of OP_GROUP, etc.
 *
 * @return true if step has a predicate.
 *
 * @throws javax.xml.transform.TransformerException
 */
static boolean analyzePredicate(Compiler compiler, int opPos, int stepType)
        throws javax.xml.transform.TransformerException
{

  int argLen;

  switch (stepType)
  {
  case OpCodes.OP_VARIABLE :
  case OpCodes.OP_EXTFUNCTION :
  case OpCodes.OP_FUNCTION :
  case OpCodes.OP_GROUP :
    argLen = compiler.getArgLength(opPos);
    break;
  default :
    argLen = compiler.getArgLengthOfStep(opPos);
  }

  int pos = compiler.getFirstPredicateOpPos(opPos);
  int nPredicates = compiler.countPredicates(pos);

  return (nPredicates > 0) ? true : false;
}
 
示例19
/**
 * This method is for building an array of possible levels
 * where the target element(s) could be found for a match.
 * @param lpi The owning location path iterator.
 * @param compiler non-null reference to compiler object that has processed
 *                 the XPath operations into an opcode map.
 * @param stepOpCodePos The opcode position for the step.
 *
 * @return non-null AxesWalker derivative.
 *
 * @throws javax.xml.transform.TransformerException
 * @xsl.usage advanced
 */
static AxesWalker loadOneWalker(
        WalkingIterator lpi, Compiler compiler, int stepOpCodePos)
          throws javax.xml.transform.TransformerException
{

  AxesWalker firstWalker = null;
  int stepType = compiler.getOp(stepOpCodePos);

  if (stepType != OpCodes.ENDOP)
  {

    // m_axesWalkers = new AxesWalker[1];
    // As we unwind from the recursion, create the iterators.
    firstWalker = createDefaultWalker(compiler, stepType, lpi, 0);

    firstWalker.init(compiler, stepOpCodePos, stepType);
  }

  return firstWalker;
}
 
示例20
/**
 * Analyze a step and give information about it's predicates.  Right now this
 * just returns true or false if the step has a predicate.
 *
 * @param compiler non-null reference to compiler object that has processed
 *                 the XPath operations into an opcode map.
 * @param opPos The opcode position for the step.
 * @param stepType The type of step, one of OP_GROUP, etc.
 *
 * @return true if step has a predicate.
 *
 * @throws javax.xml.transform.TransformerException
 */
static boolean analyzePredicate(Compiler compiler, int opPos, int stepType)
        throws javax.xml.transform.TransformerException
{

  int argLen;

  switch (stepType)
  {
  case OpCodes.OP_VARIABLE :
  case OpCodes.OP_EXTFUNCTION :
  case OpCodes.OP_FUNCTION :
  case OpCodes.OP_GROUP :
    argLen = compiler.getArgLength(opPos);
    break;
  default :
    argLen = compiler.getArgLengthOfStep(opPos);
  }

  int pos = compiler.getFirstPredicateOpPos(opPos);
  int nPredicates = compiler.countPredicates(pos);

  return (nPredicates > 0) ? true : false;
}
 
示例21
/**
 * This method is for building an array of possible levels
 * where the target element(s) could be found for a match.
 * @param lpi The owning location path iterator.
 * @param compiler non-null reference to compiler object that has processed
 *                 the XPath operations into an opcode map.
 * @param stepOpCodePos The opcode position for the step.
 *
 * @return non-null AxesWalker derivative.
 *
 * @throws javax.xml.transform.TransformerException
 * @xsl.usage advanced
 */
static AxesWalker loadOneWalker(
        WalkingIterator lpi, Compiler compiler, int stepOpCodePos)
          throws javax.xml.transform.TransformerException
{

  AxesWalker firstWalker = null;
  int stepType = compiler.getOp(stepOpCodePos);

  if (stepType != OpCodes.ENDOP)
  {

    // m_axesWalkers = new AxesWalker[1];
    // As we unwind from the recursion, create the iterators.
    firstWalker = createDefaultWalker(compiler, stepType, lpi, 0);

    firstWalker.init(compiler, stepOpCodePos, stepType);
  }

  return firstWalker;
}
 
示例22
/**
 * Analyze a step and give information about it's predicates.  Right now this
 * just returns true or false if the step has a predicate.
 *
 * @param compiler non-null reference to compiler object that has processed
 *                 the XPath operations into an opcode map.
 * @param opPos The opcode position for the step.
 * @param stepType The type of step, one of OP_GROUP, etc.
 *
 * @return true if step has a predicate.
 *
 * @throws javax.xml.transform.TransformerException
 */
static boolean analyzePredicate(Compiler compiler, int opPos, int stepType)
        throws javax.xml.transform.TransformerException
{

  int argLen;

  switch (stepType)
  {
  case OpCodes.OP_VARIABLE :
  case OpCodes.OP_EXTFUNCTION :
  case OpCodes.OP_FUNCTION :
  case OpCodes.OP_GROUP :
    argLen = compiler.getArgLength(opPos);
    break;
  default :
    argLen = compiler.getArgLengthOfStep(opPos);
  }

  int pos = compiler.getFirstPredicateOpPos(opPos);
  int nPredicates = compiler.countPredicates(pos);

  return (nPredicates > 0) ? true : false;
}
 
示例23
/**
 * This method is for building an array of possible levels
 * where the target element(s) could be found for a match.
 * @param lpi The owning location path iterator object.
 * @param compiler non-null reference to compiler object that has processed
 *                 the XPath operations into an opcode map.
 * @param stepOpCodePos The opcode position for the step.
 * @param stepIndex The top-level step index withing the iterator.
 *
 * @return non-null AxesWalker derivative.
 *
 * @throws javax.xml.transform.TransformerException
 * @xsl.usage advanced
 */
static AxesWalker loadWalkers(
        WalkingIterator lpi, Compiler compiler, int stepOpCodePos, int stepIndex)
          throws javax.xml.transform.TransformerException
{

  int stepType;
  AxesWalker firstWalker = null;
  AxesWalker walker, prevWalker = null;

  int analysis = analyze(compiler, stepOpCodePos, stepIndex);

  while (OpCodes.ENDOP != (stepType = compiler.getOp(stepOpCodePos)))
  {
    walker = createDefaultWalker(compiler, stepOpCodePos, lpi, analysis);

    walker.init(compiler, stepOpCodePos, stepType);
    walker.exprSetParent(lpi);

    // walker.setAnalysis(analysis);
    if (null == firstWalker)
    {
      firstWalker = walker;
    }
    else
    {
      prevWalker.setNextWalker(walker);
      walker.setPrevWalker(prevWalker);
    }

    prevWalker = walker;
    stepOpCodePos = compiler.getNextStepPos(stepOpCodePos);

    if (stepOpCodePos < 0)
      break;
  }

  return firstWalker;
}
 
示例24
static boolean isProximateInnerExpr(Compiler compiler, int opPos)
{
  int op = compiler.getOp(opPos);
  int innerExprOpPos = opPos+2;
  switch(op)
  {
    case OpCodes.OP_ARGUMENT:
      if(isProximateInnerExpr(compiler, innerExprOpPos))
        return true;
      break;
    case OpCodes.OP_VARIABLE:
    case OpCodes.OP_NUMBERLIT:
    case OpCodes.OP_LITERAL:
    case OpCodes.OP_LOCATIONPATH:
      break; // OK
    case OpCodes.OP_FUNCTION:
      boolean isProx = functionProximateOrContainsProximate(compiler, opPos);
      if(isProx)
        return true;
      break;
    case OpCodes.OP_GT:
    case OpCodes.OP_GTE:
    case OpCodes.OP_LT:
    case OpCodes.OP_LTE:
    case OpCodes.OP_EQUALS:
      int leftPos = OpMap.getFirstChildPos(op);
      int rightPos = compiler.getNextOpPos(leftPos);
      isProx = isProximateInnerExpr(compiler, leftPos);
      if(isProx)
        return true;
      isProx = isProximateInnerExpr(compiler, rightPos);
      if(isProx)
        return true;
      break;
    default:
      return true; // be conservative...
  }
  return false;
}
 
示例25
/**
 * This method is for building an array of possible levels
 * where the target element(s) could be found for a match.
 * @param lpi The owning location path iterator object.
 * @param compiler non-null reference to compiler object that has processed
 *                 the XPath operations into an opcode map.
 * @param stepOpCodePos The opcode position for the step.
 * @param stepIndex The top-level step index withing the iterator.
 *
 * @return non-null AxesWalker derivative.
 *
 * @throws javax.xml.transform.TransformerException
 * @xsl.usage advanced
 */
static AxesWalker loadWalkers(
        WalkingIterator lpi, Compiler compiler, int stepOpCodePos, int stepIndex)
          throws javax.xml.transform.TransformerException
{

  int stepType;
  AxesWalker firstWalker = null;
  AxesWalker walker, prevWalker = null;

  int analysis = analyze(compiler, stepOpCodePos, stepIndex);

  while (OpCodes.ENDOP != (stepType = compiler.getOp(stepOpCodePos)))
  {
    walker = createDefaultWalker(compiler, stepOpCodePos, lpi, analysis);

    walker.init(compiler, stepOpCodePos, stepType);
    walker.exprSetParent(lpi);

    // walker.setAnalysis(analysis);
    if (null == firstWalker)
    {
      firstWalker = walker;
    }
    else
    {
      prevWalker.setNextWalker(walker);
      walker.setPrevWalker(prevWalker);
    }

    prevWalker = walker;
    stepOpCodePos = compiler.getNextStepPos(stepOpCodePos);

    if (stepOpCodePos < 0)
      break;
  }

  return firstWalker;
}
 
示例26
static boolean isProximateInnerExpr(Compiler compiler, int opPos)
{
  int op = compiler.getOp(opPos);
  int innerExprOpPos = opPos+2;
  switch(op)
  {
    case OpCodes.OP_ARGUMENT:
      if(isProximateInnerExpr(compiler, innerExprOpPos))
        return true;
      break;
    case OpCodes.OP_VARIABLE:
    case OpCodes.OP_NUMBERLIT:
    case OpCodes.OP_LITERAL:
    case OpCodes.OP_LOCATIONPATH:
      break; // OK
    case OpCodes.OP_FUNCTION:
      boolean isProx = functionProximateOrContainsProximate(compiler, opPos);
      if(isProx)
        return true;
      break;
    case OpCodes.OP_GT:
    case OpCodes.OP_GTE:
    case OpCodes.OP_LT:
    case OpCodes.OP_LTE:
    case OpCodes.OP_EQUALS:
      int leftPos = OpMap.getFirstChildPos(op);
      int rightPos = compiler.getNextOpPos(leftPos);
      isProx = isProximateInnerExpr(compiler, leftPos);
      if(isProx)
        return true;
      isProx = isProximateInnerExpr(compiler, rightPos);
      if(isProx)
        return true;
      break;
    default:
      return true; // be conservative...
  }
  return false;
}
 
示例27
/**
 * This method is for building an array of possible levels
 * where the target element(s) could be found for a match.
 * @param lpi The owning location path iterator object.
 * @param compiler non-null reference to compiler object that has processed
 *                 the XPath operations into an opcode map.
 * @param stepOpCodePos The opcode position for the step.
 * @param stepIndex The top-level step index withing the iterator.
 *
 * @return non-null AxesWalker derivative.
 *
 * @throws javax.xml.transform.TransformerException
 * @xsl.usage advanced
 */
static AxesWalker loadWalkers(
        WalkingIterator lpi, Compiler compiler, int stepOpCodePos, int stepIndex)
          throws javax.xml.transform.TransformerException
{

  int stepType;
  AxesWalker firstWalker = null;
  AxesWalker walker, prevWalker = null;

  int analysis = analyze(compiler, stepOpCodePos, stepIndex);

  while (OpCodes.ENDOP != (stepType = compiler.getOp(stepOpCodePos)))
  {
    walker = createDefaultWalker(compiler, stepOpCodePos, lpi, analysis);

    walker.init(compiler, stepOpCodePos, stepType);
    walker.exprSetParent(lpi);

    // walker.setAnalysis(analysis);
    if (null == firstWalker)
    {
      firstWalker = walker;
    }
    else
    {
      prevWalker.setNextWalker(walker);
      walker.setPrevWalker(prevWalker);
    }

    prevWalker = walker;
    stepOpCodePos = compiler.getNextStepPos(stepOpCodePos);

    if (stepOpCodePos < 0)
      break;
  }

  return firstWalker;
}
 
示例28
static boolean isProximateInnerExpr(Compiler compiler, int opPos)
{
  int op = compiler.getOp(opPos);
  int innerExprOpPos = opPos+2;
  switch(op)
  {
    case OpCodes.OP_ARGUMENT:
      if(isProximateInnerExpr(compiler, innerExprOpPos))
        return true;
      break;
    case OpCodes.OP_VARIABLE:
    case OpCodes.OP_NUMBERLIT:
    case OpCodes.OP_LITERAL:
    case OpCodes.OP_LOCATIONPATH:
      break; // OK
    case OpCodes.OP_FUNCTION:
      boolean isProx = functionProximateOrContainsProximate(compiler, opPos);
      if(isProx)
        return true;
      break;
    case OpCodes.OP_GT:
    case OpCodes.OP_GTE:
    case OpCodes.OP_LT:
    case OpCodes.OP_LTE:
    case OpCodes.OP_EQUALS:
      int leftPos = OpMap.getFirstChildPos(op);
      int rightPos = compiler.getNextOpPos(leftPos);
      isProx = isProximateInnerExpr(compiler, leftPos);
      if(isProx)
        return true;
      isProx = isProximateInnerExpr(compiler, rightPos);
      if(isProx)
        return true;
      break;
    default:
      return true; // be conservative...
  }
  return false;
}
 
示例29
/**
 * This method is for building an array of possible levels
 * where the target element(s) could be found for a match.
 * @param lpi The owning location path iterator object.
 * @param compiler non-null reference to compiler object that has processed
 *                 the XPath operations into an opcode map.
 * @param stepOpCodePos The opcode position for the step.
 * @param stepIndex The top-level step index withing the iterator.
 *
 * @return non-null AxesWalker derivative.
 *
 * @throws javax.xml.transform.TransformerException
 * @xsl.usage advanced
 */
static AxesWalker loadWalkers(
        WalkingIterator lpi, Compiler compiler, int stepOpCodePos, int stepIndex)
          throws javax.xml.transform.TransformerException
{

  int stepType;
  AxesWalker firstWalker = null;
  AxesWalker walker, prevWalker = null;

  int analysis = analyze(compiler, stepOpCodePos, stepIndex);

  while (OpCodes.ENDOP != (stepType = compiler.getOp(stepOpCodePos)))
  {
    walker = createDefaultWalker(compiler, stepOpCodePos, lpi, analysis);

    walker.init(compiler, stepOpCodePos, stepType);
    walker.exprSetParent(lpi);

    // walker.setAnalysis(analysis);
    if (null == firstWalker)
    {
      firstWalker = walker;
    }
    else
    {
      prevWalker.setNextWalker(walker);
      walker.setPrevWalker(prevWalker);
    }

    prevWalker = walker;
    stepOpCodePos = compiler.getNextStepPos(stepOpCodePos);

    if (stepOpCodePos < 0)
      break;
  }

  return firstWalker;
}
 
示例30
static boolean isProximateInnerExpr(Compiler compiler, int opPos)
{
  int op = compiler.getOp(opPos);
  int innerExprOpPos = opPos+2;
  switch(op)
  {
    case OpCodes.OP_ARGUMENT:
      if(isProximateInnerExpr(compiler, innerExprOpPos))
        return true;
      break;
    case OpCodes.OP_VARIABLE:
    case OpCodes.OP_NUMBERLIT:
    case OpCodes.OP_LITERAL:
    case OpCodes.OP_LOCATIONPATH:
      break; // OK
    case OpCodes.OP_FUNCTION:
      boolean isProx = functionProximateOrContainsProximate(compiler, opPos);
      if(isProx)
        return true;
      break;
    case OpCodes.OP_GT:
    case OpCodes.OP_GTE:
    case OpCodes.OP_LT:
    case OpCodes.OP_LTE:
    case OpCodes.OP_EQUALS:
      int leftPos = OpMap.getFirstChildPos(op);
      int rightPos = compiler.getNextOpPos(leftPos);
      isProx = isProximateInnerExpr(compiler, leftPos);
      if(isProx)
        return true;
      isProx = isProximateInnerExpr(compiler, rightPos);
      if(isProx)
        return true;
      break;
    default:
      return true; // be conservative...
  }
  return false;
}