com.sun.org.apache.xpath.internal.compiler.OpCodes Java Examples

The following examples show how to use com.sun.org.apache.xpath.internal.compiler.OpCodes. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: WalkerFactory.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example #2
Source File: WalkerFactory.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example #3
Source File: WalkerFactory.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example #4
Source File: WalkerFactory.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example #5
Source File: WalkerFactory.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example #6
Source File: WalkerFactory.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example #7
Source File: WalkerFactory.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example #8
Source File: WalkerFactory.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example #9
Source File: WalkerFactory.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example #10
Source File: WalkerFactory.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example #11
Source File: WalkerFactory.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example #12
Source File: WalkerFactory.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example #13
Source File: WalkerFactory.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example #14
Source File: WalkerFactory.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example #15
Source File: WalkerFactory.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
/**
 * 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;
}
 
Example #16
Source File: WalkerFactory.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example #17
Source File: WalkerFactory.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
/**
 * 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;
}
 
Example #18
Source File: WalkerFactory.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example #19
Source File: WalkerFactory.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example #20
Source File: WalkerFactory.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example #21
Source File: WalkerFactory.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example #22
Source File: WalkerFactory.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example #23
Source File: WalkerFactory.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
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;
}
 
Example #24
Source File: WalkerFactory.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
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;
}
 
Example #25
Source File: WalkerFactory.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 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;
}
 
Example #26
Source File: WalkerFactory.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 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;
}
 
Example #27
Source File: WalkerFactory.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 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;
}
 
Example #28
Source File: WalkerFactory.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
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;
}
 
Example #29
Source File: WalkerFactory.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
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;
}
 
Example #30
Source File: WalkerFactory.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
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;
}