You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by db...@apache.org on 2001/01/26 02:23:04 UTC

cvs commit: xml-xalan/c/src/XPath XPathExpression.cpp XPathExpression.hpp

dbertoni    01/01/25 17:23:04

  Modified:    c/src/XPath XPathExpression.cpp XPathExpression.hpp
  Log:
  Added functions to dump to std::ostream.
  
  Revision  Changes    Path
  1.23      +61 -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.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- XPathExpression.cpp	2001/01/25 17:14:19	1.22
  +++ XPathExpression.cpp	2001/01/26 01:23:03	1.23
  @@ -64,6 +64,12 @@
   
   
   
  +#if !defined(XALAN_NO_IOSFWD)
  +#include <ostream>
  +#endif
  +
  +
  +
   #if defined(XALAN_OLD_STREAM_HEADERS)
   #include <strstream.h>
   #else
  @@ -639,7 +645,45 @@
   
   
   void
  +XPathExpression::dumpOpCodeMap(
  +#if defined(XALAN_NO_NAMESPACES)
  +			ostream&			theStream,
  +#else
  +			std::ostream&		theStream,
  +#endif
  +			OpCodeMapSizeType	theStartPosition) const
  +{
  +	for (OpCodeMapSizeType	i = theStartPosition;
  +				i < opCodeMapSize(); i++) 
  +	{
  +		theStream << " '" << m_opMap[i] << "'";
  +	}
  +}
  +
  +
  +
  +void
   XPathExpression::dumpTokenQueue(
  +#if defined(XALAN_NO_NAMESPACES)
  +			ostream&			theStream,
  +#else
  +			std::ostream&		theStream,
  +#endif
  +			TokenQueueSizeType	theStartPosition) const
  +{
  +	for (TokenQueueSizeType	i = theStartPosition;
  +				i < tokenQueueSize(); i++) 
  +	{
  +		assert(getToken(i) != 0);
  +
  +		theStream << " '" << getToken(i)->str() << "'";
  +	}
  +}
  +
  +
  +
  +void
  +XPathExpression::dumpTokenQueue(
   			PrintWriter&		thePrintWriter,
   			TokenQueueSizeType	theStartPosition) const
   {
  @@ -673,6 +717,23 @@
   				   m_currentPosition);
   
   	thePrintWriter.print(")");
  +}
  +
  +
  +
  +void
  +#if defined(XALAN_NO_NAMESPACES)
  +XPathExpression::dumpRemainingTokenQueue(ostream&		theStream) const
  +#else
  +XPathExpression::dumpRemainingTokenQueue(std::ostream&	theStream) const
  +#endif
  +{
  +	theStream << "Remaining tokens: (";
  +
  +	dumpTokenQueue(theStream,
  +				   m_currentPosition);
  +
  +	theStream << ")";
   }
   
   
  
  
  
  1.14      +52 -0     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.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- XPathExpression.hpp	2001/01/16 02:34:46	1.13
  +++ XPathExpression.hpp	2001/01/26 01:23:03	1.14
  @@ -69,6 +69,16 @@
   #include <set>
   #include <vector>
   
  +#if defined(XALAN_NO_IOSFWD)
  +#if defined(XALAN_OLD_STREAM_HEADERS)
  +#include <iostream.h>
  +#else
  +#include <ostream>
  +#endif
  +#else
  +#include <iosfwd>
  +#endif
  +
   
   
   #include <XalanDOM/XalanDOMString.hpp>
  @@ -1230,6 +1240,21 @@
   				  OpCodeMapSizeType		theStartPosition = 0) const;
   
   	/**
  +	 * Diagnostic function to output the operation code map.
  +	 * 
  +	 * @param theStream output stream
  +	 * @param theStartPosition starting position in map
  +	 */
  +	void
  +	dumpOpCodeMap(
  +#if defined(XALAN_NO_NAMESPACES)
  +			ostream&			theStream,
  +#else
  +			std::ostream&		theStream,
  +#endif
  +			OpCodeMapSizeType	theStartPosition = 0) const;
  +
  +	/**
   	 * Diagnostic function to output the token queue.
   	 * 
   	 * @param thePrintWriter   output device
  @@ -1240,12 +1265,39 @@
   				   TokenQueueSizeType	theStartPosition = 0) const;
   
   	/**
  +	 * Diagnostic function to output the token queue.
  +	 * 
  +	 * @param thePrintWriter   output device
  +	 * @param theStartPosition starting position in token queue
  +	 */
  +	void
  +	dumpTokenQueue(
  +#if defined(XALAN_NO_NAMESPACES)
  +			ostream&			theStream,
  +#else
  +			std::ostream&		theStream,
  +#endif
  +			TokenQueueSizeType	theStartPosition = 0) const;
  +
  +	/**
   	 * Diagnostic function to output the remaining tokens in the token queue.
   	 * 
   	 * @param thePrintWriter   output device
   	 */
   	void
   	dumpRemainingTokenQueue(PrintWriter&	thePrintWriter) const;
  +
  +	/**
  +	 * Diagnostic function to output the remaining tokens in the token queue.
  +	 * 
  +	 * @param theStream The output stream
  +	 */
  +	void
  +#if defined(XALAN_NO_NAMESPACES)
  +	dumpRemainingTokenQueue(ostream&		theStream) const;
  +#else
  +	dumpRemainingTokenQueue(std::ostream&	theStream) const;
  +#endif
   
   	/**
   	 * Push a token onto the token queue and its index onto the operations code