<HTML><HEAD><TITLE>Xalan-C++ API Documentation</TITLE></HEAD> <BODY> <h2 align="center">Xalan-C++ API Documentation</h2> <h3 align="center">The Xalan C++ XSL Transformer Version 1.1</h3> </BODY> <!-- Generated by Doxygen 1.2.0 on Thu Feb 15 10:44:16 2001 --> <center> <a class="qindex" href="index.html">Main Page</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center> <hr><h1>XPathExpression.hpp</h1><a href="XPathExpression.hpp.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <font class="comment">/* </font>00002 <font class="comment"> * The Apache Software License, Version 1.1 </font>00003 <font class="comment"> * </font>00004 <font class="comment"> * </font>00005 <font class="comment"> * Copyright (c) 1999 The Apache Software Foundation. All rights </font>00006 <font class="comment"> * reserved. </font>00007 <font class="comment"> * </font>00008 <font class="comment"> * Redistribution and use in source and binary forms, with or without </font>00009 <font class="comment"> * modification, are permitted provided that the following conditions </font>00010 <font class="comment"> * are met: </font>00011 <font class="comment"> * </font>00012 <font class="comment"> * 1. Redistributions of source code must retain the above copyright </font>00013 <font class="comment"> * notice, this list of conditions and the following disclaimer. </font>00014 <font class="comment"> * </font>00015 <font class="comment"> * 2. Redistributions in binary form must reproduce the above copyright </font>00016 <font class="comment"> * notice, this list of conditions and the following disclaimer in </font>00017 <font class="comment"> * the documentation and/or other materials provided with the </font>00018 <font class="comment"> * distribution. </font>00019 <font class="comment"> * </font>00020 <font class="comment"> * 3. The end-user documentation included with the redistribution, </font>00021 <font class="comment"> * if any, must include the following acknowledgment: </font>00022 <font class="comment"> * "This product includes software developed by the </font>00023 <font class="comment"> * Apache Software Foundation (http://www.apache.org/)." </font>00024 <font class="comment"> * Alternately, this acknowledgment may appear in the software itself, </font>00025 <font class="comment"> * if and wherever such third-party acknowledgments normally appear. </font>00026 <font class="comment"> * </font>00027 <font class="comment"> * 4. The names "Xalan" and "Apache Software Foundation" must </font>00028 <font class="comment"> * not be used to endorse or promote products derived from this </font>00029 <font class="comment"> * software without prior written permission. For written </font>00030 <font class="comment"> * permission, please contact apache@apache.org. </font>00031 <font class="comment"> * </font>00032 <font class="comment"> * 5. Products derived from this software may not be called "Apache", </font>00033 <font class="comment"> * nor may "Apache" appear in their name, without prior written </font>00034 <font class="comment"> * permission of the Apache Software Foundation. </font>00035 <font class="comment"> * </font>00036 <font class="comment"> * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED </font>00037 <font class="comment"> * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES </font>00038 <font class="comment"> * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE </font>00039 <font class="comment"> * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR </font>00040 <font class="comment"> * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, </font>00041 <font class="comment"> * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT </font>00042 <font class="comment"> * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF </font>00043 <font class="comment"> * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND </font>00044 <font class="comment"> * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, </font>00045 <font class="comment"> * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT </font>00046 <font class="comment"> * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF </font>00047 <font class="comment"> * SUCH DAMAGE. </font>00048 <font class="comment"> * ==================================================================== </font>00049 <font class="comment"> * </font>00050 <font class="comment"> * This software consists of voluntary contributions made by many </font>00051 <font class="comment"> * individuals on behalf of the Apache Software Foundation and was </font>00052 <font class="comment"> * originally based on software copyright (c) 1999, International </font>00053 <font class="comment"> * Business Machines, Inc., http://www.ibm.com. For more </font>00054 <font class="comment"> * information on the Apache Software Foundation, please see </font>00055 <font class="comment"> * <http://www.apache.org/>. </font>00056 <font class="comment"> */</font> 00057 <font class="preprocessor">#if !defined(XPATHEXPRESSION_HEADER_GUARD_1357924680) </font><a name="l00058"></a><a class="code" href="XPathExpression.hpp.html#a0">00058</a> <font class="preprocessor"></font><font class="preprocessor">#define XPATHEXPRESSION_HEADER_GUARD_1357924680 </font>00059 <font class="preprocessor"></font> 00060 00061 00062 <font class="comment">// Base header file. Must be first.</font> 00063 <font class="preprocessor">#include <<a class="code" href="XPathDefinitions.hpp.html">XPath/XPathDefinitions.hpp</a>></font> 00064 00065 00066 00067 <font class="preprocessor">#include <deque></font> 00068 <font class="preprocessor">#include <map></font> 00069 <font class="preprocessor">#include <set></font> 00070 <font class="preprocessor">#include <vector></font> 00071 00072 <font class="preprocessor">#if defined(XALAN_NO_IOSFWD) </font>00073 <font class="preprocessor"></font><font class="preprocessor">#if defined(XALAN_OLD_STREAM_HEADERS) </font>00074 <font class="preprocessor"></font><font class="preprocessor">#include <iostream.h></font> 00075 <font class="preprocessor">#else </font>00076 <font class="preprocessor"></font><font class="preprocessor">#include <ostream></font> 00077 <font class="preprocessor">#endif </font>00078 <font class="preprocessor"></font><font class="preprocessor">#else </font>00079 <font class="preprocessor"></font><font class="preprocessor">#include <iosfwd></font> 00080 <font class="preprocessor">#endif </font>00081 <font class="preprocessor"></font> 00082 00083 00084 <font class="preprocessor">#include <<a class="code" href="XalanDOMString.hpp.html">XalanDOM/XalanDOMString.hpp</a>></font> 00085 00086 00087 00088 <font class="preprocessor">#include <<a class="code" href="DOMStringHelper.hpp.html">PlatformSupport/DOMStringHelper.hpp</a>></font> 00089 <font class="preprocessor">#include <<a class="code" href="PrintWriter.hpp.html">PlatformSupport/PrintWriter.hpp</a>></font> 00090 00091 00092 00093 <font class="preprocessor">#include <<a class="code" href="XToken.hpp.html">XPath/XToken.hpp</a>></font> 00094 <font class="preprocessor">#include <<a class="code" href="XPathException.hpp.html">XPath/XPathException.hpp</a>></font> 00095 00096 00097 <a name="l00098"></a><a class="code" href="class_xpathexpression.html">00098</a> <font class="keyword">class </font>XALAN_XPATH_EXPORT <a class="code" href="class_xpathexpression.html">XPathExpression</a> 00099 { 00100 <font class="keyword">public</font>: 00101 <a name="l00120"></a><a class="code" href="class_xpathexpression.html#s74">00120</a> <font class="keyword">enum</font> eOpCodes 00121 { 00126 eENDOP = -1, 00127 00132 eEMPTY = -2, 00133 00139 eELEMWILDCARD = -3, 00140 00154 eOP_XPATH = 1, 00155 00165 eOP_OR = 2, 00166 00176 eOP_AND = 3, 00177 00187 eOP_NOTEQUALS = 4, 00188 00198 eOP_EQUALS = 5, 00199 00209 eOP_LTE = 6, 00210 00220 eOP_LT = 7, 00221 00231 eOP_GTE = 8, 00232 00242 eOP_GT = 9, 00243 00253 eOP_PLUS = 10, 00254 00264 eOP_MINUS = 11, 00265 00275 eOP_MULT = 12, 00276 00286 eOP_DIV = 13, 00287 00297 eOP_MOD = 14, 00298 00308 eOP_QUO = 15, 00309 00318 eOP_NEG = 16, 00319 00328 eOP_STRING = 17, 00329 00338 eOP_BOOL = 18, 00339 00348 eOP_NUMBER = 19, 00349 00358 eOP_UNION = 20, 00359 00368 eOP_LITERAL = 21, 00369 00378 eOP_VARIABLE = 22, 00379 00393 eOP_GROUP = 23, 00394 00403 eOP_NUMBERLIT = 24, 00404 00418 eOP_ARGUMENT = 25, 00419 00435 eOP_EXTFUNCTION = 26, 00436 00452 eOP_FUNCTION = 27, 00453 00467 eOP_LOCATIONPATH = 28, 00468 00478 eOP_PREDICATE = 29, 00479 00487 eNODETYPE_COMMENT = 1030, 00488 00496 eNODETYPE_TEXT = 1031, 00497 00505 eNODETYPE_PI = 1032, 00506 00514 eNODETYPE_NODE = 1033, 00515 00524 eNODENAME = 34, 00525 00533 eNODETYPE_ROOT = 35, 00534 00542 eNODETYPE_ANYELEMENT = 36, 00543 00554 eFROM_ANCESTORS = 37, 00555 eFROM_ANCESTORS_OR_SELF = 38, 00556 eFROM_ATTRIBUTES = 39, 00557 eFROM_CHILDREN = 40, 00558 eFROM_DESCENDANTS = 41, 00559 eFROM_DESCENDANTS_OR_SELF = 42, 00560 eFROM_FOLLOWING = 43, 00561 eFROM_FOLLOWING_SIBLINGS = 44, 00562 eFROM_PARENT = 45, 00563 eFROM_PRECEDING = 46, 00564 eFROM_PRECEDING_SIBLINGS = 47, 00565 eFROM_SELF = 48, 00566 eFROM_NAMESPACE = 49, 00567 <font class="comment">// eFROM_ATTRIBUTE = 50,</font> 00568 <font class="comment">// eFROM_DOC = 51,</font> 00569 <font class="comment">// eFROM_DOCREF = 52,</font> 00570 <font class="comment">// eFROM_ID = 53,</font> 00571 <font class="comment">// eFROM_IDREF = 54,</font> 00572 eFROM_ROOT = 55, 00573 00582 eOP_MATCHPATTERN = 92, 00583 00592 eOP_LOCATIONPATHPATTERN = 93, 00593 00594 <font class="comment">// For match patterns</font> 00595 eMATCH_ATTRIBUTE = 94, 00596 eMATCH_ANY_ANCESTOR = 95, 00597 eMATCH_IMMEDIATE_ANCESTOR = 96, 00598 eMATCH_ANY_ANCESTOR_WITH_PREDICATE = 97, 00599 eMATCH_ANY_ANCESTOR_WITH_FUNCTION_CALL = 98, 00600 00601 <font class="comment">// Always add _before_ this one.</font> 00602 eOpCodeNextAvailable 00603 }; <font class="comment">// enum eOpCodes</font> 00604 00611 <font class="preprocessor">#if defined(XALAN_INLINE_INITIALIZATION) </font>00612 <font class="preprocessor"></font> <font class="keyword">const</font> <font class="keywordtype">int</font> s__opCodeMapLengthIndex = 1; 00613 <font class="preprocessor">#else </font><a name="l00614"></a><a class="code" href="class_xpathexpression.html#s75">00614</a> <font class="preprocessor"></font> <font class="keyword">enum</font> eDummy 00615 { 00616 s__opCodeMapLengthIndex = 1 00617 }; 00618 <font class="preprocessor">#endif </font>00619 <font class="preprocessor"></font> <a name="l00623"></a><a class="code" href="class_xpathexpression__xpathexpressionexception.html">00623</a> <font class="keyword">class </font>XALAN_XPATH_EXPORT XPathExpressionException : <font class="keyword">public</font> <a class="code" href="class_xpathexception.html">XPathException</a> 00624 { 00625 <font class="keyword">public</font>: 00626 00632 XPathExpressionException(<font class="keyword">const</font> <a class="code" href="class_xalandomstring.html">XalanDOMString</a>& theMessage); 00633 00634 <font class="keyword">virtual</font>~ 00635 XPathExpressionException(); 00636 }; 00637 <a name="l00641"></a><a class="code" href="class_xpathexpression__invalidopcodeexception.html">00641</a> <font class="keyword">class </font>XALAN_XPATH_EXPORT InvalidOpCodeException : <font class="keyword">public</font> XPathExpressionException 00642 { 00643 <font class="keyword">public</font>: 00644 00650 InvalidOpCodeException(<font class="keywordtype">int</font> theOpCode); 00651 00652 <font class="keyword">virtual</font>~ 00653 InvalidOpCodeException(); 00654 00655 <font class="keyword">private</font>: 00656 00657 <font class="keyword">static</font> <a class="code" href="class_xalandomstring.html">XalanDOMString</a> 00658 FormatErrorMessage(<font class="keywordtype">int</font> theOpCode); 00659 }; 00660 <a name="l00665"></a><a class="code" href="class_xpathexpression__invalidargumentcountexception.html">00665</a> <font class="keyword">class </font>XALAN_XPATH_EXPORT InvalidArgumentCountException : <font class="keyword">public</font> XPathExpressionException 00666 { 00667 <font class="keyword">public</font>: 00668 00676 InvalidArgumentCountException( 00677 <font class="keywordtype">int</font> theOpCode, 00678 <font class="keywordtype">int</font> theExpectedCount, 00679 <font class="keywordtype">int</font> theSuppliedCount); 00680 00681 <font class="keyword">virtual</font>~ 00682 InvalidArgumentCountException(); 00683 00684 <font class="keyword">private</font>: 00685 00686 <font class="keyword">static</font> <a class="code" href="class_xalandomstring.html">XalanDOMString</a> 00687 FormatErrorMessage( 00688 <font class="keywordtype">int</font> theOpCode, 00689 <font class="keywordtype">int</font> theExpectedCount, 00690 <font class="keywordtype">int</font> theSuppliedCount); 00691 }; 00692 <a name="l00696"></a><a class="code" href="class_xpathexpression__invalidargumentexception.html">00696</a> <font class="keyword">class </font>XALAN_XPATH_EXPORT InvalidArgumentException : <font class="keyword">public</font> XPathExpressionException 00697 { 00698 <font class="keyword">public</font>: 00699 00706 InvalidArgumentException( 00707 <font class="keywordtype">int</font> theOpCode, 00708 <font class="keywordtype">int</font> theValue); 00709 00710 <font class="keyword">virtual</font>~ 00711 InvalidArgumentException(); 00712 00713 <font class="keyword">private</font>: 00714 00715 <font class="keyword">static</font> <a class="code" href="class_xalandomstring.html">XalanDOMString</a> 00716 FormatErrorMessage( 00717 <font class="keywordtype">int</font> theOpCode, 00718 <font class="keywordtype">int</font> theValue); 00719 }; 00720 <a name="l00724"></a><a class="code" href="class_xpathexpression__invalidrelativetokenposition.html">00724</a> <font class="keyword">class </font>XALAN_XPATH_EXPORT InvalidRelativeTokenPosition : <font class="keyword">public</font> XPathExpressionException 00725 { 00726 <font class="keyword">public</font>: 00727 00733 InvalidRelativeTokenPosition(<font class="keywordtype">int</font> theOffset); 00734 00735 <font class="keyword">virtual</font>~ 00736 InvalidRelativeTokenPosition(); 00737 00738 <font class="keyword">private</font>: 00739 00740 <font class="keyword">static</font> <a class="code" href="class_xalandomstring.html">XalanDOMString</a> 00741 FormatErrorMessage(<font class="keywordtype">int</font> theOffset); 00742 }; 00743 00744 00745 <font class="preprocessor">#if defined(XALAN_NO_NAMESPACES) </font>00746 <font class="preprocessor"></font> 00747 <font class="keyword">typedef</font> vector<<font class="keywordtype">int</font>> OpCodeMapType; 00748 <font class="keyword">typedef</font> deque<<a class="code" href="class_xtoken.html">XToken</a>> TokenQueueType; 00749 <font class="keyword">typedef</font> vector<<font class="keywordtype">int</font>> PatternMapType; 00750 00751 <font class="keyword">typedef</font> map<<font class="keywordtype">int</font>, <font class="keywordtype">int</font>, less<<font class="keywordtype">int</font>> > OpCodeLengthMapType; 00752 00753 <font class="keyword">typedef</font> OpCodeMapType::value_type OpCodeMapValueType; 00754 <font class="keyword">typedef</font> OpCodeMapType::size_type OpCodeMapSizeType; 00755 00756 <font class="keyword">typedef</font> set<OpCodeMapValueType, less<OpCodeMapValueType> > NodeTestSetType; 00757 00758 <font class="keyword">typedef</font> vector<OpCodeMapValueType> OpCodeMapValueVectorType; 00759 00760 <font class="preprocessor">#else </font>00761 <font class="preprocessor"></font> <a name="l00762"></a><a class="code" href="class_xpathexpression.html#s0">00762</a> <font class="keyword">typedef</font> std::vector<<font class="keywordtype">int</font>> OpCodeMapType; <a name="l00763"></a><a class="code" href="class_xpathexpression.html#s1">00763</a> <font class="keyword">typedef</font> std::deque<<a class="code" href="class_xtoken.html">XToken</a>> TokenQueueType; <a name="l00764"></a><a class="code" href="class_xpathexpression.html#s2">00764</a> <font class="keyword">typedef</font> std::vector<<font class="keywordtype">int</font>> PatternMapType; <a name="l00765"></a><a class="code" href="class_xpathexpression.html#s3">00765</a> <font class="keyword">typedef</font> std::map<<font class="keywordtype">int</font>, <font class="keywordtype">int</font>> OpCodeLengthMapType; 00766 <a name="l00767"></a><a class="code" href="class_xpathexpression.html#s4">00767</a> <font class="keyword">typedef</font> OpCodeMapType::value_type OpCodeMapValueType; <a name="l00768"></a><a class="code" href="class_xpathexpression.html#s5">00768</a> <font class="keyword">typedef</font> OpCodeMapType::size_type OpCodeMapSizeType; 00769 <a name="l00770"></a><a class="code" href="class_xpathexpression.html#s6">00770</a> <font class="keyword">typedef</font> std::set<OpCodeMapValueType> NodeTestSetType; <a name="l00771"></a><a class="code" href="class_xpathexpression.html#s7">00771</a> <font class="keyword">typedef</font> std::vector<OpCodeMapValueType> OpCodeMapValueVectorType; 00772 00773 <font class="preprocessor">#endif </font>00774 <font class="preprocessor"></font> <a name="l00775"></a><a class="code" href="class_xpathexpression.html#s8">00775</a> <font class="keyword">typedef</font> TokenQueueType::value_type TokenQueueValueType; <a name="l00776"></a><a class="code" href="class_xpathexpression.html#s9">00776</a> <font class="keyword">typedef</font> TokenQueueType::size_type TokenQueueSizeType; <a name="l00777"></a><a class="code" href="class_xpathexpression.html#s10">00777</a> <font class="keyword">typedef</font> PatternMapType::value_type PatternMapValueType; <a name="l00778"></a><a class="code" href="class_xpathexpression.html#s11">00778</a> <font class="keyword">typedef</font> PatternMapType::size_type PatternMapSizeType; 00779 00780 <font class="keyword">explicit</font> 00781 XPathExpression(); 00782 00783 ~XPathExpression(); 00784 00788 <font class="keywordtype">void</font> 00789 reset(); 00790 00794 <font class="keywordtype">void</font> 00795 shrink(); 00796 00802 OpCodeMapSizeType <a name="l00803"></a><a class="code" href="class_xpathexpression.html#a4">00803</a> opCodeMapSize()<font class="keyword"> const </font>00804 <font class="keyword"> </font>{ 00805 <font class="keywordflow">return</font> m_opMap.size(); 00806 } 00807 00819 OpCodeMapValueType <a name="l00820"></a><a class="code" href="class_xpathexpression.html#a5">00820</a> opCodeMapLength()<font class="keyword"> const </font>00821 <font class="keyword"> </font>{ 00822 <font class="keyword">const</font> OpCodeMapSizeType theSize = opCodeMapSize(); 00823 00824 <font class="keywordflow">if</font> (theSize > s__opCodeMapLengthIndex) 00825 { 00826 assert(theSize == 00827 OpCodeMapSizeType(m_opMap[s__opCodeMapLengthIndex])); 00828 00829 <font class="keywordflow">return</font> m_opMap[s__opCodeMapLengthIndex]; 00830 } 00831 <font class="keywordflow">else</font> 00832 { 00833 <font class="keywordflow">return</font> theSize; 00834 } 00835 } 00836 00842 TokenQueueSizeType <a name="l00843"></a><a class="code" href="class_xpathexpression.html#a6">00843</a> tokenQueueSize()<font class="keyword"> const </font>00844 <font class="keyword"> </font>{ 00845 <font class="keywordflow">return</font> m_tokenQueue.size(); 00846 } 00847 00853 PatternMapSizeType <a name="l00854"></a><a class="code" href="class_xpathexpression.html#a7">00854</a> patternMapSize()<font class="keyword"> const </font>00855 <font class="keyword"> </font>{ 00856 <font class="keywordflow">return</font> m_patternMap.size(); 00857 } 00858 00866 OpCodeMapValueType <a name="l00867"></a><a class="code" href="class_xpathexpression.html#a8">00867</a> getOpCodeMapValue(OpCodeMapSizeType opPos)<font class="keyword"> const </font>00868 <font class="keyword"> </font>{ 00869 <font class="keywordflow">return</font> m_opMap[opPos]; 00870 } 00871 00879 OpCodeMapValueType 00880 getOpCodeLength(OpCodeMapSizeType opPos) <font class="keyword">const</font>; 00881 00889 OpCodeMapValueType <a name="l00890"></a><a class="code" href="class_xpathexpression.html#a10">00890</a> getNextOpCodePosition(OpCodeMapSizeType opPos)<font class="keyword"> const </font>00891 <font class="keyword"> </font>{ 00892 assert(opPos < opCodeMapSize()); 00893 00894 <font class="keywordflow">return</font> opPos + m_opMap[opPos + s__opCodeMapLengthIndex]; 00895 } 00896 00906 <font class="keywordtype">void</font> 00907 setOpCodeArgs( 00908 eOpCodes theOpCode, 00909 OpCodeMapSizeType theIndex, 00910 <font class="keyword">const</font> OpCodeMapValueVectorType& theArgs); 00911 00917 <font class="keywordtype">void</font> 00918 appendOpCode(eOpCodes theOpCode); 00919 00926 <font class="keywordtype">void</font> <a name="l00927"></a><a class="code" href="class_xpathexpression.html#a13">00927</a> appendOpCode(eOpCodes theOpCode, 00928 <font class="keyword">const</font> OpCodeMapValueVectorType& theArgs)<font class="keyword"> </font>00929 <font class="keyword"> </font>{ 00930 appendOpCode(theOpCode); 00931 00932 setOpCodeArgs(theOpCode, 00933 m_lastOpCodeIndex, 00934 theArgs); 00935 } 00936 00943 OpCodeMapValueType 00944 insertOpCode( 00945 eOpCodes theOpCode, 00946 OpCodeMapSizeType theIndex); 00947 00957 <font class="keywordtype">void</font> <a name="l00958"></a><a class="code" href="class_xpathexpression.html#a15">00958</a> updateOpCodeLength(OpCodeMapSizeType theIndex)<font class="keyword"> </font>00959 <font class="keyword"> </font>{ 00960 assert(theIndex < opCodeMapSize()); 00961 00962 updateOpCodeLength(m_opMap[theIndex], theIndex); 00963 } 00964 00973 <font class="keywordtype">void</font> 00974 updateShiftedOpCodeLength( 00975 OpCodeMapValueType theOpCode, 00976 OpCodeMapSizeType theOriginalIndex, 00977 OpCodeMapSizeType theNewIndex); 00978 00989 <font class="keywordtype">void</font> 00990 updateOpCodeLength( 00991 OpCodeMapValueType theOpCode, 00992 OpCodeMapSizeType theIndex); 00993 01001 <font class="keyword">static</font> <font class="keywordtype">bool</font> 01002 isNodeTestOpCode(OpCodeMapValueType theOpCode); 01003 01009 <font class="keywordtype">void</font> 01010 updateOpCodeLengthAfterNodeTest(OpCodeMapSizeType theIndex); 01011 01017 <font class="keywordtype">bool</font> <a name="l01018"></a><a class="code" href="class_xpathexpression.html#a19">01018</a> hasMoreTokens()<font class="keyword"> const </font>01019 <font class="keyword"> </font>{ 01020 <font class="keywordflow">return</font> tokenQueueSize() - m_currentPosition > 0 ? <font class="keyword">true</font> : <font class="keyword">false</font>; 01021 } 01022 01028 TokenQueueSizeType <a name="l01029"></a><a class="code" href="class_xpathexpression.html#a20">01029</a> getTokenPosition()<font class="keyword"> const </font>01030 <font class="keyword"> </font>{ 01031 <font class="keywordflow">return</font> m_currentPosition; 01032 } 01033 01037 <font class="keywordtype">void</font> <a name="l01038"></a><a class="code" href="class_xpathexpression.html#a21">01038</a> resetTokenPosition()<font class="keyword"> </font>01039 <font class="keyword"> </font>{ 01040 m_currentPosition = 0; 01041 } 01042 01048 <font class="keywordtype">void</font> <a name="l01049"></a><a class="code" href="class_xpathexpression.html#a22">01049</a> setTokenPosition(TokenQueueSizeType thePosition)<font class="keyword"> </font>01050 <font class="keyword"> </font>{ 01051 <font class="keyword">const</font> TokenQueueSizeType theSize = tokenQueueSize(); 01052 01053 m_currentPosition = thePosition > theSize ? theSize : thePosition; 01054 } 01055 01061 <font class="keywordtype">void</font> <a name="l01062"></a><a class="code" href="class_xpathexpression.html#a23">01062</a> setTokenPosition(<font class="keywordtype">int</font> thePosition)<font class="keyword"> </font>01063 <font class="keyword"> </font>{ 01064 setTokenPosition(thePosition > 0 ? TokenQueueSizeType(thePosition) : 0); 01065 } 01066 01073 <font class="keyword">const</font> <a class="code" href="class_xobject.html">XObject</a>* <a name="l01074"></a><a class="code" href="class_xpathexpression.html#a24">01074</a> getToken(TokenQueueSizeType thePosition)<font class="keyword"> const </font>01075 <font class="keyword"> </font>{ 01076 assert(thePosition < tokenQueueSize()); 01077 01078 <font class="keywordflow">return</font> &m_tokenQueue[thePosition]; 01079 } 01080 01086 <font class="keyword">const</font> <a class="code" href="class_xobject.html">XObject</a>* <a name="l01087"></a><a class="code" href="class_xpathexpression.html#a25">01087</a> getNextToken()<font class="keyword"> </font>01088 <font class="keyword"> </font>{ 01089 <font class="keywordflow">if</font> (hasMoreTokens() == <font class="keyword">true</font>) 01090 { 01091 <font class="keywordflow">return</font> getToken(m_currentPosition++); 01092 } 01093 <font class="keywordflow">else</font> 01094 { 01095 <font class="keywordflow">return</font> 0; 01096 } 01097 } 01098 01104 <font class="keyword">const</font> <a class="code" href="class_xobject.html">XObject</a>* <a name="l01105"></a><a class="code" href="class_xpathexpression.html#a26">01105</a> getPreviousToken()<font class="keyword"> </font>01106 <font class="keyword"> </font>{ 01107 <font class="keywordflow">if</font> (m_currentPosition > 0) 01108 { 01109 <font class="keywordflow">return</font> getToken(--m_currentPosition); 01110 } 01111 <font class="keywordflow">else</font> 01112 { 01113 <font class="keywordflow">return</font> 0; 01114 } 01115 } 01116 01124 <font class="keyword">const</font> <a class="code" href="class_xobject.html">XObject</a>* <a name="l01125"></a><a class="code" href="class_xpathexpression.html#a27">01125</a> getRelativeToken(<font class="keywordtype">int</font> theOffset)<font class="keyword"> const </font>01126 <font class="keyword"> </font>{ 01127 <font class="keyword">const</font> <font class="keywordtype">int</font> thePosition = int(m_currentPosition) + theOffset; 01128 01129 <font class="keywordflow">if</font> (thePosition < 0 || 01130 thePosition >= int(tokenQueueSize())) 01131 { 01132 <font class="keywordflow">return</font> 0; 01133 } 01134 <font class="keywordflow">else</font> 01135 { 01136 <font class="keywordflow">return</font> getToken(thePosition); 01137 } 01138 } 01139 01145 <font class="keywordtype">void</font> <a name="l01146"></a><a class="code" href="class_xpathexpression.html#a28">01146</a> pushToken(<font class="keyword">const</font> <a class="code" href="class_xalandomstring.html">XalanDOMString</a>& theToken)<font class="keyword"> </font>01147 <font class="keyword"> </font>{ 01148 m_tokenQueue.push_back(XToken(theToken)); 01149 } 01150 01156 <font class="keywordtype">void</font> <a name="l01157"></a><a class="code" href="class_xpathexpression.html#a29">01157</a> pushToken(<font class="keywordtype">double</font> theToken)<font class="keyword"> </font>01158 <font class="keyword"> </font>{ 01159 m_tokenQueue.push_back(XToken(theToken)); 01160 } 01161 01168 <font class="keywordtype">void</font> <a name="l01169"></a><a class="code" href="class_xpathexpression.html#a30">01169</a> insertToken(<font class="keyword">const</font> <a class="code" href="class_xalandomstring.html">XalanDOMString</a>& theToken)<font class="keyword"> </font>01170 <font class="keyword"> </font>{ 01171 m_tokenQueue.insert(m_tokenQueue.begin() + (m_currentPosition - 1), XToken(theToken)); 01172 } 01173 01180 <font class="keywordtype">void</font> <a name="l01181"></a><a class="code" href="class_xpathexpression.html#a31">01181</a> insertToken(<font class="keywordtype">double</font> theToken)<font class="keyword"> </font>01182 <font class="keyword"> </font>{ 01183 m_tokenQueue.insert(m_tokenQueue.begin() + (m_currentPosition - 1), XToken(theToken)); 01184 } 01185 01192 <font class="keywordtype">void</font> <a name="l01193"></a><a class="code" href="class_xpathexpression.html#a32">01193</a> replaceRelativeToken( 01194 <font class="keywordtype">int</font> theOffset, 01195 <font class="keyword">const</font> <a class="code" href="class_xalandomstring.html">XalanDOMString</a>& theToken)<font class="keyword"> </font>01196 <font class="keyword"> </font>{ 01197 assert(<a class="code" href="DOMStringHelper.hpp.html#a4">c_wstr</a>(theToken) != 0); 01198 01199 <font class="keyword">const</font> <font class="keywordtype">int</font> thePosition = int(m_currentPosition) + theOffset; 01200 01201 <font class="keywordflow">if</font> (thePosition < 0 || 01202 thePosition >= int(tokenQueueSize())) 01203 { 01204 <font class="keywordflow">throw</font> InvalidRelativeTokenPosition(theOffset); 01205 } 01206 01207 m_tokenQueue[thePosition] = theToken; 01208 } 01209 01216 <font class="keywordtype">void</font> <a name="l01217"></a><a class="code" href="class_xpathexpression.html#a33">01217</a> replaceRelativeToken( 01218 <font class="keywordtype">int</font> theOffset, 01219 <font class="keywordtype">double</font> theToken)<font class="keyword"> </font>01220 <font class="keyword"> </font>{ 01221 assert(theToken != 0); 01222 01223 <font class="keyword">const</font> <font class="keywordtype">int</font> thePosition = int(m_currentPosition) + theOffset; 01224 01225 <font class="keywordflow">if</font> (thePosition < 0 || thePosition >= int(tokenQueueSize())) 01226 { 01227 <font class="keywordflow">throw</font> InvalidRelativeTokenPosition(theOffset); 01228 } 01229 01230 m_tokenQueue[thePosition] = theToken; 01231 } 01232 01239 <font class="keywordtype">void</font> 01240 dumpOpCodeMap(<a class="code" href="class_printwriter.html">PrintWriter</a>& thePrintWriter, 01241 OpCodeMapSizeType theStartPosition = 0) <font class="keyword">const</font>; 01242 01249 <font class="keywordtype">void</font> 01250 dumpOpCodeMap( 01251 #<font class="keywordflow">if</font> defined(XALAN_NO_NAMESPACES) 01252 ostream& theStream, 01253 <font class="preprocessor">#else </font>01254 <font class="preprocessor"></font> std::ostream& theStream, 01255 <font class="preprocessor">#endif </font>01256 <font class="preprocessor"></font> OpCodeMapSizeType theStartPosition = 0) <font class="keyword">const</font>; 01257 01264 <font class="keywordtype">void</font> 01265 dumpTokenQueue(<a class="code" href="class_printwriter.html">PrintWriter</a>& thePrintWriter, 01266 TokenQueueSizeType theStartPosition = 0) <font class="keyword">const</font>; 01267 01274 <font class="keywordtype">void</font> 01275 dumpTokenQueue( 01276 #<font class="keywordflow">if</font> defined(XALAN_NO_NAMESPACES) 01277 ostream& theStream, 01278 <font class="preprocessor">#else </font>01279 <font class="preprocessor"></font> std::ostream& theStream, 01280 <font class="preprocessor">#endif </font>01281 <font class="preprocessor"></font> TokenQueueSizeType theStartPosition = 0) <font class="keyword">const</font>; 01282 01288 <font class="keywordtype">void</font> 01289 dumpRemainingTokenQueue(<a class="code" href="class_printwriter.html">PrintWriter</a>& thePrintWriter) <font class="keyword">const</font>; 01290 01296 <font class="keywordtype">void</font> 01297 <font class="preprocessor">#if defined(XALAN_NO_NAMESPACES) </font>01298 <font class="preprocessor"></font> dumpRemainingTokenQueue(ostream& theStream) <font class="keyword">const</font>; 01299 <font class="preprocessor">#else </font>01300 <font class="preprocessor"></font> dumpRemainingTokenQueue(std::ostream& theStream) <font class="keyword">const</font>; 01301 <font class="preprocessor">#endif </font>01302 <font class="preprocessor"></font> 01309 <font class="keywordtype">void</font> 01310 pushArgumentOnOpCodeMap(<font class="keyword">const</font> <a class="code" href="class_xalandomstring.html">XalanDOMString</a>& theToken); 01311 01318 <font class="keywordtype">void</font> 01319 pushArgumentOnOpCodeMap(<font class="keywordtype">double</font> theToken); 01320 01325 <font class="keywordtype">void</font> 01326 pushCurrentTokenOnOpCodeMap(); 01327 01335 PatternMapValueType <a name="l01336"></a><a class="code" href="class_xpathexpression.html#a43">01336</a> getPattern(<font class="keywordtype">int</font> thePatternPosition)<font class="keyword"> const </font>01337 <font class="keyword"> </font>{ 01338 assert(<font class="keywordtype">int</font>(patternMapSize()) > thePatternPosition); 01339 01340 <font class="keywordflow">return</font> m_patternMap[thePatternPosition]; 01341 } 01342 01350 PatternMapValueType <a name="l01351"></a><a class="code" href="class_xpathexpression.html#a44">01351</a> getPattern(PatternMapSizeType thePatternPosition)<font class="keyword"> const </font>01352 <font class="keyword"> </font>{ 01353 assert(patternMapSize() > thePatternPosition); 01354 01355 <font class="keywordflow">return</font> m_patternMap[thePatternPosition]; 01356 } 01357 01363 <font class="keywordtype">void</font> <a name="l01364"></a><a class="code" href="class_xpathexpression.html#a45">01364</a> pushPattern(PatternMapValueType thePattern)<font class="keyword"> </font>01365 <font class="keyword"> </font>{ 01366 m_patternMap.push_back(thePattern); 01367 } 01368 01375 <font class="keywordtype">void</font> <a name="l01376"></a><a class="code" href="class_xpathexpression.html#a46">01376</a> adjustPattern( 01377 OpCodeMapSizeType theIndex, 01378 PatternMapValueType theAdjustment)<font class="keyword"> </font>01379 <font class="keyword"> </font>{ 01380 m_patternMap[theIndex] += theAdjustment; 01381 } 01382 01388 <font class="keywordtype">void</font> <a name="l01389"></a><a class="code" href="class_xpathexpression.html#a47">01389</a> setCurrentPattern(<font class="keyword">const</font> <a class="code" href="class_xalandomstring.html">XalanDOMString</a>& thePattern)<font class="keyword"> </font>01390 <font class="keyword"> </font>{ 01391 m_currentPattern = thePattern; 01392 } 01393 01399 <font class="keyword">const</font> <a class="code" href="class_xalandomstring.html">XalanDOMString</a>& <a name="l01400"></a><a class="code" href="class_xpathexpression.html#a48">01400</a> getCurrentPattern()<font class="keyword"> const </font>01401 <font class="keyword"> </font>{ 01402 <font class="keywordflow">return</font> m_currentPattern; 01403 } 01404 <a name="l01411"></a><a class="code" href="class_xpathexpression.html#m0">01411</a> OpCodeMapType m_opMap; 01412 <a name="l01417"></a><a class="code" href="class_xpathexpression.html#m1">01417</a> OpCodeMapSizeType m_lastOpCodeIndex; 01418 <a name="l01424"></a><a class="code" href="class_xpathexpression.html#m2">01424</a> TokenQueueType m_tokenQueue; 01425 <a name="l01429"></a><a class="code" href="class_xpathexpression.html#m3">01429</a> TokenQueueSizeType m_currentPosition; 01430 01438 <font class="comment">// Ignore this, it is going away.</font> <a name="l01439"></a><a class="code" href="class_xpathexpression.html#m4">01439</a> PatternMapType m_patternMap; 01440 <a name="l01444"></a><a class="code" href="class_xpathexpression.html#m5">01444</a> <a class="code" href="class_xalandomstring.html">XalanDOMString</a> m_currentPattern; 01445 01446 <font class="keyword">private</font>: 01447 01448 <font class="comment">// Default vector allocation sizes.</font> 01449 <font class="keyword">enum</font> 01450 { 01451 eDefaultOpMapSize = 100, 01452 eDefaultPatternMapSize = 100 01453 }; 01454 01455 <font class="comment">// A map of Op codes to op code lengths.</font> 01456 <font class="keyword">const</font> <font class="keyword">static</font> OpCodeLengthMapType s_opCodeLengths; 01457 01458 <font class="keyword">static</font> OpCodeLengthMapType 01459 IntializeOpCodeLengthMap(); 01460 01461 <font class="comment">// A static set of Op codes that are node tests.</font> 01462 <font class="keyword">const</font> <font class="keyword">static</font> NodeTestSetType s_NodeTestOpCodes; 01463 01464 <font class="keyword">static</font> NodeTestSetType 01465 InitializeNodeTestSet(); 01466 }; 01467 01468 01469 01470 <font class="preprocessor">#endif // XPATHEXPRESSION_HEADER_GUARD_1357924680 </font></div></pre><p align="center"><a href="diagramnotes.html">Interpreting class diagrams</a></p> <p><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"> <i><A href="http://www.stack.nl/~dimitri/doxygen/">Doxygen</A> and <A href="http://www.research.att.com/sw/tools/graphviz/">GraphViz</A> are used to generate this API documentation from the Xalan-C header files.</I></FONT></p> <TABLE border="0" cellpadding="0" cellspacing="0" width="820"><TR><TD bgcolor="#0086b2"><IMG height="1" src="images/dot.gif" width="1"></TD></TR></TABLE> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="80%"> <TR> <TD WIDTH="80%" VALIGN="TOP"> <P ALIGN="CENTER"><B>Xalan-C++ XSL Transformer Version 1.1</B><BR> Copyright © 2000, 2001 The Apache Software Foundation. All Rights Reserved.</i></p> </TD> </TR> <TR> <TD WIDTH="100%"> <P ALIGN="CENTER"><IMG SRC="ApacheLogo.jpg" WIDTH="387" HEIGHT="100" ALIGN="BOTTOM" BORDER="0"> </TD> </TR> </TABLE>