dbertoni    2002/09/27 16:32:51

  Modified:    c/src/XPath XPathExpression.cpp XPathExpression.hpp
  Log:
  New XToken code to prepare for string pooling.
  
  Revision  Changes    Path
  1.38      +21 -0     xml-xalan/c/src/XPath/XPathExpression.cpp
  
  Index: XPathExpression.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/XPathExpression.cpp,v
  retrieving revision 1.37
  retrieving revision 1.38
  diff -u -r1.37 -r1.38
  --- XPathExpression.cpp       31 Jul 2002 16:04:06 -0000      1.37
  +++ XPathExpression.cpp       27 Sep 2002 23:32:51 -0000      1.38
  @@ -811,6 +811,27 @@
   
   
   void
  +XPathExpression::pushArgumentOnOpCodeMap(const XToken&       theXToken)
  +{
  +     assert(m_currentPosition != 0);
  +
  +     const TokenQueueSizeType        thePosition = m_currentPosition - 1;
  +
  +     assert(thePosition < tokenQueueSize());
  +
  +     // Set the entry in the token queue to the XObject.
  +     m_tokenQueue[thePosition] = theXToken;
  +
  +     // Push the index onto the op map.
  +     m_opMap.push_back(thePosition);
  +
  +     // Update the op map length.
  +     m_opMap[s_opCodeMapLengthIndex]++;
  +}
  +
  +
  +
  +void
   XPathExpression::pushArgumentOnOpCodeMap(const XalanDOMString&       
theToken)
   {
        assert(m_currentPosition != 0);
  
  
  
  1.28      +33 -1     xml-xalan/c/src/XPath/XPathExpression.hpp
  
  Index: XPathExpression.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/XPathExpression.hpp,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- XPathExpression.hpp       26 Jun 2002 01:20:01 -0000      1.27
  +++ XPathExpression.hpp       27 Sep 2002 23:32:51 -0000      1.28
  @@ -1173,6 +1173,29 @@
                m_tokenQueue.insert(m_tokenQueue.begin() + (m_currentPosition - 
1), XToken(theToken));
        }
   
  +#if 1
  +     /**
  +      * Replace a token in the token queue.
  +      * 
  +      * @param theOffset the offset at which to replace the token.
  +      * @param theToken The new token
  +      */
  +     void
  +     replaceRelativeToken(
  +                     int                             theOffset,
  +                     const XToken&   theToken)
  +     {
  +             const int       thePosition = int(m_currentPosition) + 
theOffset;
  +
  +             if (thePosition < 0 ||
  +                     thePosition >= int(tokenQueueSize()))
  +             {
  +                     throw InvalidRelativeTokenPosition(theOffset);
  +             }
  +
  +             m_tokenQueue[thePosition] = theToken;
  +     }
  +#else
        /**
         * Replace a token in the token queue.
         * 
  @@ -1219,7 +1242,7 @@
   
                m_tokenQueue[thePosition] = theToken;
        }
  -
  +#endif
        /**
         * Diagnostic function to output the operation code map.
         * 
  @@ -1305,6 +1328,15 @@
                // Update the op map length.
                m_opMap[s_opCodeMapLengthIndex]++;
        }
  +
  +     /**
  +      * Push a token onto the token queue and its index onto the operations 
code
  +      * map.
  +      *
  +      * @param theXToken the XToken to push
  +      */
  +     void
  +     pushArgumentOnOpCodeMap(const XToken&   theXToken);
   
        /**
         * Push a token onto the token queue and its index onto the operations 
code
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to