blob: 4ccebbd7dc128ad8cd5da999d99b733fe5c8b424 [file] [log] [blame]
<HTML><HEAD><TITLE>Xalan-C++ API Documentation</TITLE></HEAD>
<BODY>
<h2 align="center">Xalan-C++ API Documentation</h2>
<h3 align="center">The Xalan C++ XSLT Processor Version 1.10</h3>
</BODY>
<!-- Generated by Doxygen 1.2.8.1 -->
<center>
<a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="hierarchy.html">Class Hierarchy</a> &nbsp; <a class="qindex" href="classes.html">Alphabetical List</a> &nbsp; <a class="qindex" href="annotated.html">Compound List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; <a class="qindex" href="globals.html">File Members</a> &nbsp; </center>
<hr><h1>XPathExpression.hpp</h1><a href="XPathExpression_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <font class="comment">/*</font>
00002 <font class="comment"> * Copyright 1999-2004 The Apache Software Foundation.</font>
00003 <font class="comment"> *</font>
00004 <font class="comment"> * Licensed under the Apache License, Version 2.0 (the "License");</font>
00005 <font class="comment"> * you may not use this file except in compliance with the License.</font>
00006 <font class="comment"> * You may obtain a copy of the License at</font>
00007 <font class="comment"> *</font>
00008 <font class="comment"> * http://www.apache.org/licenses/LICENSE-2.0</font>
00009 <font class="comment"> *</font>
00010 <font class="comment"> * Unless required by applicable law or agreed to in writing, software</font>
00011 <font class="comment"> * distributed under the License is distributed on an "AS IS" BASIS,</font>
00012 <font class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</font>
00013 <font class="comment"> * See the License for the specific language governing permissions and</font>
00014 <font class="comment"> * limitations under the License.</font>
00015 <font class="comment"> */</font>
00016 <font class="preprocessor">#if !defined(XPATHEXPRESSION_HEADER_GUARD_1357924680)</font>
<a name="l00017"></a><a class="code" href="XPathExpression_8hpp.html#a0">00017</a> <font class="preprocessor"></font><font class="preprocessor">#define XPATHEXPRESSION_HEADER_GUARD_1357924680</font>
00018 <font class="preprocessor"></font>
00019
00020
00021 <font class="comment">// Base header file. Must be first.</font>
00022 <font class="preprocessor">#include &lt;<a class="code" href="XPathDefinitions_8hpp.html">xalanc/XPath/XPathDefinitions.hpp</a>&gt;</font>
00023
00024
00025
00026 <font class="preprocessor">#include &lt;<a class="code" href="XalanVector_8hpp.html">xalanc/Include/XalanVector.hpp</a>&gt;</font>
00027
00028
00029
00030 <font class="preprocessor">#if defined(XALAN_CLASSIC_IOSTREAMS)</font>
00031 <font class="preprocessor"></font><font class="preprocessor">#include &lt;iostream.h&gt;</font>
00032 <font class="preprocessor">#else</font>
00033 <font class="preprocessor"></font><font class="preprocessor">#include &lt;iosfwd&gt;</font>
00034 <font class="preprocessor">#endif</font>
00035 <font class="preprocessor"></font>
00036
00037
00038 <font class="preprocessor">#include &lt;<a class="code" href="XalanDOMString_8hpp.html">xalanc/XalanDOM/XalanDOMString.hpp</a>&gt;</font>
00039
00040
00041
00042 <font class="preprocessor">#include &lt;<a class="code" href="DOMStringHelper_8hpp.html">xalanc/PlatformSupport/DOMStringHelper.hpp</a>&gt;</font>
00043 <font class="preprocessor">#include &lt;<a class="code" href="PrintWriter_8hpp.html">xalanc/PlatformSupport/PrintWriter.hpp</a>&gt;</font>
00044
00045
00046
00047 <font class="preprocessor">#include &lt;<a class="code" href="XToken_8hpp.html">xalanc/XPath/XToken.hpp</a>&gt;</font>
00048 <font class="preprocessor">#include &lt;<a class="code" href="XalanXPathException_8hpp.html">xalanc/XPath/XalanXPathException.hpp</a>&gt;</font>
00049
00050
00051
00052 XALAN_CPP_NAMESPACE_BEGIN
00053
00054
00055
<a name="l00056"></a><a class="code" href="XPathExpression_8hpp.html#a3">00056</a> <a class="code" href="XSLTInputSource_8hpp.html#a3">XALAN_USING_XERCES</a>(MemoryManager)
00057
00058
00059
00060 <font class="keyword">class </font>XALAN_XPATH_EXPORT XPathExpression
00061 {
00062 <font class="keyword">public</font>:
00063
00064 <font class="keyword">typedef</font> XALAN_STD_QUALIFIER ostream OstreamType;
00065
00066 <font class="keyword">typedef</font> XalanVector&lt;int&gt; OpCodeMapType;
00067 <font class="keyword">typedef</font> XalanVector&lt;XToken&gt; TokenQueueType;
00068
00069 <font class="keyword">typedef</font> OpCodeMapType::value_type OpCodeMapValueType;
00070 <font class="keyword">typedef</font> OpCodeMapValueType OpCodeMapSizeType;
00071
00072 <font class="keyword">typedef</font> XalanVector&lt;OpCodeMapValueType&gt; OpCodeMapValueVectorType;
00073
00074 <font class="keyword">typedef</font> XalanVector&lt;double&gt; NumberLiteralValueVectorType;
00075
00076 <font class="preprocessor">#define XALAN_XPATH_EXPRESSION_USE_ITERATORS</font>
00077 <font class="preprocessor"></font>
00078 <font class="preprocessor">#if defined(XALAN_XPATH_EXPRESSION_USE_ITERATORS)</font>
00079 <font class="preprocessor"></font> <font class="keyword">typedef</font> OpCodeMapType::const_iterator OpCodeMapPositionType;
00080 <font class="preprocessor">#else</font>
00081 <font class="preprocessor"></font> <font class="keyword">typedef</font> OpCodeMapSizeType OpCodeMapPositionType;
00082 <font class="preprocessor">#endif</font>
00083 <font class="preprocessor"></font> <font class="keyword">typedef</font> OpCodeMapType::difference_type OpCodeMapDifferenceType;
00084 <font class="keyword">typedef</font> TokenQueueType::value_type TokenQueueValueType;
00085 <font class="keyword">typedef</font> <font class="keywordtype">int</font> TokenQueueSizeType;
00086 <font class="keyword">typedef</font> TokenQueueSizeType TokenQueuePositionType;
00087
00106 <font class="keyword">enum</font> eOpCodes
00107 {
00113 eELEMWILDCARD = -3,
00114
00119 eEMPTY = -2,
00120
00125 eENDOP = -1,
00126
00140 eOP_XPATH = 1,
00141
00151 eOP_OR = 2,
00152
00162 eOP_AND = 3,
00163
00173 eOP_NOTEQUALS = 4,
00174
00184 eOP_EQUALS = 5,
00185
00195 eOP_LTE = 6,
00196
00206 eOP_LT = 7,
00207
00217 eOP_GTE = 8,
00218
00228 eOP_GT = 9,
00229
00239 eOP_PLUS = 10,
00240
00250 eOP_MINUS = 11,
00251
00261 eOP_MULT = 12,
00262
00272 eOP_DIV = 13,
00273
00283 eOP_MOD = 14,
00284
00293 eOP_NEG = 15,
00294
00303 eOP_BOOL = 16,
00304
00313 eOP_UNION = 17,
00314
00323 eOP_LITERAL = 18,
00324
00333 eOP_VARIABLE = 19,
00334
00348 eOP_GROUP = 20,
00349
00358 eOP_NUMBERLIT = 21,
00359
00373 eOP_ARGUMENT = 22,
00374
00390 eOP_EXTFUNCTION = 23,
00391
00408 eOP_FUNCTION = 24,
00409
00423 eOP_LOCATIONPATH = 25,
00424
00434 eOP_PREDICATE = 26,
00435
00443 eNODETYPE_COMMENT = 27,
00444
00452 eNODETYPE_TEXT = 28,
00453
00461 eNODETYPE_PI = 29,
00462
00470 eNODETYPE_NODE = 30,
00471
00480 eNODENAME = 31,
00481
00489 eNODETYPE_ROOT = 32,
00490
00498 eNODETYPE_ANYELEMENT = 33,
00499
00510 eFROM_ANCESTORS = 34,
00511 eFROM_ANCESTORS_OR_SELF = 35,
00512 eFROM_ATTRIBUTES = 36,
00513 eFROM_CHILDREN = 37,
00514 eFROM_DESCENDANTS = 38,
00515 eFROM_DESCENDANTS_OR_SELF = 39,
00516 eFROM_FOLLOWING = 40,
00517 eFROM_FOLLOWING_SIBLINGS = 41,
00518 eFROM_PARENT = 42,
00519 eFROM_PRECEDING = 43,
00520 eFROM_PRECEDING_SIBLINGS = 44,
00521 eFROM_SELF = 45,
00522 eFROM_NAMESPACE = 46,
00523 eFROM_ROOT = 47,
00524
00533 eOP_MATCHPATTERN = 48,
00534
00543 eOP_LOCATIONPATHPATTERN = 49,
00544
00545 <font class="comment">// For match patterns</font>
00546 eMATCH_ATTRIBUTE = 50,
00547 eMATCH_ANY_ANCESTOR = 51,
00548 eMATCH_IMMEDIATE_ANCESTOR = 52,
00549 eMATCH_ANY_ANCESTOR_WITH_PREDICATE = 53,
00550 eMATCH_ANY_ANCESTOR_WITH_FUNCTION_CALL = 54,
00551
00561 eOP_PREDICATE_WITH_POSITION = 55,
00562
00567 eOP_FUNCTION_POSITION = 56,
00568 eOP_FUNCTION_LAST = 57,
00569 eOP_FUNCTION_COUNT = 58,
00570 eOP_FUNCTION_NOT = 59,
00571 eOP_FUNCTION_TRUE = 60,
00572 eOP_FUNCTION_FALSE = 61,
00573 eOP_FUNCTION_BOOLEAN = 62,
00574 eOP_FUNCTION_NAME_0 = 63,
00575 eOP_FUNCTION_NAME_1 = 64,
00576 eOP_FUNCTION_LOCALNAME_0 = 65,
00577 eOP_FUNCTION_LOCALNAME_1 = 66,
00578 eOP_FUNCTION_FLOOR = 67,
00579 eOP_FUNCTION_CEILING = 68,
00580 eOP_FUNCTION_ROUND = 69,
00581 eOP_FUNCTION_NUMBER_0 = 70,
00582 eOP_FUNCTION_NUMBER_1 = 71,
00583 eOP_FUNCTION_STRING_0 = 72,
00584 eOP_FUNCTION_STRING_1 = 73,
00585 eOP_FUNCTION_STRINGLENGTH_0 = 74,
00586 eOP_FUNCTION_STRINGLENGTH_1 = 75,
00587 eOP_FUNCTION_NAMESPACEURI_0 = 76,
00588 eOP_FUNCTION_NAMESPACEURI_1 = 77,
00589 eOP_FUNCTION_SUM = 78,
00590 eOP_FUNCTION_CONCAT = 79,
00591
00592 <font class="comment">// Always add _before_ this one and update</font>
00593 <font class="comment">// s_opCodeLengthArray.</font>
00594 eOpCodeNextAvailable
00595 }; <font class="comment">// enum eOpCodes</font>
00596
00600 <font class="keyword">class </font>XALAN_XPATH_EXPORT XPathExpressionException : <font class="keyword">public</font> <a class="code" href="classXalanXPathException.html">XalanXPathException</a>
00601 {
00602 <font class="keyword">public</font>:
00603
00609 XPathExpressionException(<font class="keyword">const</font> <a class="code" href="classXalanDOMString.html">XalanDOMString</a>&amp; theMessage,
00610 MemoryManagerType&amp; theManager);
00611
00612 <font class="keyword">virtual</font>~
00613 XPathExpressionException();
00614 };
00615
00619 <font class="keyword">class </font>XALAN_XPATH_EXPORT InvalidOpCodeException : <font class="keyword">public</font> XPathExpressionException
00620 {
00621 <font class="keyword">public</font>:
00622
00628 InvalidOpCodeException(OpCodeMapValueType theOpCode,
00629 <a class="code" href="classXalanDOMString.html">XalanDOMString</a>&amp; theResult);
00630
00631 <font class="keyword">virtual</font>~
00632 InvalidOpCodeException();
00633
00634 <font class="keyword">private</font>:
00635
00636 <font class="keyword">static</font> <a class="code" href="classXalanDOMString.html">XalanDOMString</a>&amp;
00637 FormatErrorMessage(OpCodeMapValueType theOpCode,
00638 <a class="code" href="classXalanDOMString.html">XalanDOMString</a>&amp; theResult);
00639 };
00640
00645 <font class="keyword">class </font>XALAN_XPATH_EXPORT InvalidArgumentCountException : <font class="keyword">public</font> XPathExpressionException
00646 {
00647 <font class="keyword">public</font>:
00648
00656 InvalidArgumentCountException(
00657 OpCodeMapValueType theOpCode,
00658 OpCodeMapValueType theExpectedCount,
00659 OpCodeMapValueType theSuppliedCount,
00660 <a class="code" href="classXalanDOMString.html">XalanDOMString</a>&amp; theResult);
00661
00662 <font class="keyword">virtual</font>~
00663 InvalidArgumentCountException();
00664
00665 <font class="keyword">private</font>:
00666
00667 <font class="keyword">static</font> <a class="code" href="classXalanDOMString.html">XalanDOMString</a>&amp;
00668 FormatErrorMessage(
00669 OpCodeMapValueType theOpCode,
00670 OpCodeMapValueType theExpectedCount,
00671 OpCodeMapValueType theSuppliedCount,
00672 <a class="code" href="classXalanDOMString.html">XalanDOMString</a>&amp; theResult);
00673 };
00674
00678 <font class="keyword">class </font>XALAN_XPATH_EXPORT InvalidArgumentException : <font class="keyword">public</font> XPathExpressionException
00679 {
00680 <font class="keyword">public</font>:
00681
00688 InvalidArgumentException(
00689 OpCodeMapValueType theOpCode,
00690 OpCodeMapValueType theValue,
00691 <a class="code" href="classXalanDOMString.html">XalanDOMString</a>&amp; theResult);
00692
00693 <font class="keyword">virtual</font>~
00694 InvalidArgumentException();
00695
00696 <font class="keyword">private</font>:
00697
00698 <font class="keyword">static</font> <a class="code" href="classXalanDOMString.html">XalanDOMString</a>&amp;
00699 FormatErrorMessage(
00700 OpCodeMapValueType theOpCode,
00701 OpCodeMapValueType theValue,
00702 <a class="code" href="classXalanDOMString.html">XalanDOMString</a>&amp; theResult);
00703 };
00704
00705
00712 <font class="preprocessor">#if defined(XALAN_INLINE_INITIALIZATION)</font>
00713 <font class="preprocessor"></font> <font class="keyword">static</font> <font class="keyword">const</font> TokenQueueSizeType s_opCodeMapLengthIndex = 1;
00714 <font class="preprocessor">#else</font>
00715 <font class="preprocessor"></font> <font class="keyword">enum</font> eDummy
00716 {
00717 s_opCodeMapLengthIndex = 1
00718 };
00719 <font class="preprocessor">#endif</font>
00720 <font class="preprocessor"></font>
00721 <font class="keyword">explicit</font>
00722 XPathExpression(MemoryManagerType&amp; theManager);
00723
00724 ~XPathExpression();
00725
00726 MemoryManagerType&amp;
00727 getMemoryManager()<font class="keyword"></font>
00728 <font class="keyword"> </font>{
00729 <font class="keywordflow">return</font> m_opMap.getMemoryManager();
00730 }
00734 <font class="keywordtype">void</font>
00735 reset();
00736
00740 <font class="keywordtype">void</font>
00741 shrink();
00742
00748 OpCodeMapSizeType
00749 opCodeMapSize()<font class="keyword"> const</font>
00750 <font class="keyword"> </font>{
00751 <font class="keywordflow">return</font> OpCodeMapSizeType(m_opMap.size());
00752 }
00753
00765 OpCodeMapValueType
00766 opCodeMapLength()<font class="keyword"> const</font>
00767 <font class="keyword"> </font>{
00768 <font class="keyword">const</font> OpCodeMapSizeType theSize = opCodeMapSize();
00769
00770 <font class="keywordflow">if</font> (theSize &gt; s_opCodeMapLengthIndex)
00771 {
00772 assert(theSize == OpCodeMapSizeType(m_opMap[s_opCodeMapLengthIndex]));
00773
00774 <font class="keywordflow">return</font> m_opMap[s_opCodeMapLengthIndex];
00775 }
00776 <font class="keywordflow">else</font>
00777 {
00778 assert(theSize == OpCodeMapValueType(theSize));
00779
00780 <font class="keywordflow">return</font> OpCodeMapValueType(theSize);
00781 }
00782 }
00783
00784 OpCodeMapPositionType
00785 getInitialOpCodePosition()<font class="keyword"> const</font>
00786 <font class="keyword"> </font>{
00787 <font class="preprocessor">#if defined(XALAN_XPATH_EXPRESSION_USE_ITERATORS)</font>
00788 <font class="preprocessor"></font> <font class="keywordflow">return</font> m_opMap.begin();
00789 <font class="preprocessor">#else</font>
00790 <font class="preprocessor"></font> <font class="keywordflow">return</font> 0;
00791 <font class="preprocessor">#endif</font>
00792 <font class="preprocessor"></font> }
00793
00794 <font class="keywordtype">bool</font>
00795 isValidOpCodePosition(OpCodeMapPositionType opPos)<font class="keyword"> const</font>
00796 <font class="keyword"> </font>{
00797 <font class="keyword">const</font> OpCodeMapDifferenceType theDifference =
00798 OpCodeMapDifferenceType(opPos - getInitialOpCodePosition());
00799
00800 <font class="keywordflow">return</font> theDifference &gt;= 0 &amp;&amp;
00801 theDifference &lt; opCodeMapSize();
00802 }
00803
00804 <font class="preprocessor">#if defined(XALAN_XPATH_EXPRESSION_USE_ITERATORS)</font>
00805 <font class="preprocessor"></font> <font class="keywordtype">bool</font>
00806 isValidOpCodePosition(OpCodeMapSizeType theIndex)<font class="keyword"> const</font>
00807 <font class="keyword"> </font>{
00808 <font class="keywordflow">return</font> theIndex &gt;= 0 &amp;&amp; theIndex &lt; opCodeMapSize();
00809 }
00810
00818 OpCodeMapValueType
00819 getOpCodeMapValue(OpCodeMapSizeType theIndex)<font class="keyword"> const</font>
00820 <font class="keyword"> </font>{
00821 assert(theIndex &lt; opCodeMapLength());
00822
00823 <font class="keywordflow">return</font> m_opMap[theIndex];
00824 }
00825 <font class="preprocessor">#endif</font>
00826 <font class="preprocessor"></font>
00834 OpCodeMapValueType
00835 getOpCodeMapValue(OpCodeMapPositionType opPos)<font class="keyword"> const</font>
00836 <font class="keyword"> </font>{
00837 assert(opPos &lt; getInitialOpCodePosition() + opCodeMapLength());
00838
00839 <font class="preprocessor">#if defined(XALAN_XPATH_EXPRESSION_USE_ITERATORS)</font>
00840 <font class="preprocessor"></font> <font class="keywordflow">return</font> *opPos;
00841 <font class="preprocessor">#else</font>
00842 <font class="preprocessor"></font>
00843 <font class="keywordflow">return</font> m_opMap[opPos];
00844 <font class="preprocessor">#endif</font>
00845 <font class="preprocessor"></font> }
00846
00854 <font class="keywordtype">void</font>
00855 setOpCodeMapValue(
00856 OpCodeMapSizeType theOpCodeMapIndex,
00857 <font class="keyword">const</font> OpCodeMapValueType&amp; theValue)<font class="keyword"></font>
00858 <font class="keyword"> </font>{
00859 assert(theOpCodeMapIndex &lt; opCodeMapLength());
00860
00861 m_opMap[theOpCodeMapIndex] = theValue;
00862 }
00863
00864 OpCodeMapValueType
00865 getOpCodeArgumentLength(OpCodeMapPositionType opPos)<font class="keyword"> const</font>
00866 <font class="keyword"> </font>{
00867 <font class="keywordflow">return</font> getOpCodeMapValue(opPos + XPathExpression::s_opCodeMapLengthIndex + 1) - 3;
00868 }
00869
00877 OpCodeMapValueType
00878 getOpCodeLengthFromOpMap(OpCodeMapPositionType opPos,
00879 MemoryManagerType&amp; theManager) <font class="keyword">const</font>;
00880
00881 <font class="preprocessor">#if defined(XALAN_XPATH_EXPRESSION_USE_ITERATORS)</font>
00882 <font class="preprocessor"></font>
00889 OpCodeMapValueType
00890 getOpCodeLengthFromOpMap(OpCodeMapSizeType theIndex,
00891 MemoryManagerType&amp; theManager) <font class="keyword">const</font>;
00892 <font class="preprocessor">#endif</font>
00893 <font class="preprocessor"></font>
00894 <font class="preprocessor">#if defined(XALAN_XPATH_EXPRESSION_USE_ITERATORS)</font>
00895 <font class="preprocessor"></font>
00902 OpCodeMapPositionType
00903 getNextOpCodePosition(OpCodeMapPositionType opPos)<font class="keyword"> const</font>
00904 <font class="keyword"> </font>{
00905 assert(opPos &lt; getInitialOpCodePosition() + opCodeMapLength());
00906
00907 <font class="keywordflow">return</font> opPos + *(opPos + s_opCodeMapLengthIndex);
00908 }
00909 <font class="preprocessor">#endif</font>
00910 <font class="preprocessor"></font>
00918 OpCodeMapSizeType
00919 <font class="preprocessor">#if defined(XALAN_XPATH_EXPRESSION_USE_ITERATORS)</font>
00920 <font class="preprocessor"></font> getNextOpCodePosition(OpCodeMapSizeType theIndex) <font class="keyword">const</font>
00921 <font class="preprocessor">#else</font>
00922 <font class="preprocessor"></font> getNextOpCodePosition(OpCodeMapPositionType theIndex) <font class="keyword">const</font>
00923 <font class="preprocessor">#endif</font>
00924 <font class="preprocessor"></font> {
00925 assert(theIndex &lt; opCodeMapLength());
00926
00927 assert(theIndex + m_opMap[theIndex + s_opCodeMapLengthIndex] ==
00928 OpCodeMapSizeType(theIndex + m_opMap[theIndex + s_opCodeMapLengthIndex]));
00929
00930 <font class="keywordflow">return</font> OpCodeMapSizeType(theIndex + m_opMap[theIndex + s_opCodeMapLengthIndex]);
00931 }
00932
00942 <font class="keywordtype">void</font>
00943 setOpCodeArgs(
00944 eOpCodes theOpCode,
00945 OpCodeMapSizeType theIndex,
00946 <font class="keyword">const</font> OpCodeMapValueVectorType&amp; theArgs);
00947
00954 OpCodeMapSizeType
00955 appendOpCode(eOpCodes theOpCode);
00956
00963 OpCodeMapSizeType
00964 appendOpCode(
00965 eOpCodes theOpCode,
00966 <font class="keyword">const</font> OpCodeMapValueVectorType&amp; theArgs)<font class="keyword"></font>
00967 <font class="keyword"> </font>{
00968 <font class="keyword">const</font> OpCodeMapSizeType thePosition = appendOpCode(theOpCode);
00969
00970 setOpCodeArgs(theOpCode,
00971 thePosition,
00972 theArgs);
00973
00974 <font class="keywordflow">return</font> thePosition;
00975 }
00976
00984 <font class="keywordtype">void</font>
00985 replaceOpCode(
00986 OpCodeMapSizeType theIndex,
00987 eOpCodes theOldOpCode,
00988 eOpCodes theNewOpCode);
00989
00996 OpCodeMapValueType
00997 insertOpCode(
00998 eOpCodes theOpCode,
00999 OpCodeMapSizeType theIndex);
01000
01010 <font class="keywordtype">void</font>
01011 updateOpCodeLength(OpCodeMapSizeType theIndex)<font class="keyword"></font>
01012 <font class="keyword"> </font>{
01013 assert(theIndex &lt; opCodeMapSize());
01014
01015 updateOpCodeLength(m_opMap[theIndex], theIndex);
01016 }
01017
01026 <font class="keywordtype">void</font>
01027 updateShiftedOpCodeLength(
01028 OpCodeMapValueType theOpCode,
01029 OpCodeMapSizeType theOriginalIndex,
01030 OpCodeMapSizeType theNewIndex);
01031
01042 <font class="keywordtype">void</font>
01043 updateOpCodeLength(
01044 OpCodeMapValueType theOpCode,
01045 OpCodeMapSizeType theIndex);
01046
01054 <font class="keyword">static</font> <font class="keywordtype">bool</font>
01055 isNodeTestOpCode(OpCodeMapValueType theOpCode);
01056
01062 <font class="keywordtype">void</font>
01063 updateOpCodeLengthAfterNodeTest(OpCodeMapSizeType theIndex);
01064
01070 <font class="keywordtype">bool</font>
01071 hasMoreTokens()<font class="keyword"> const</font>
01072 <font class="keyword"> </font>{
01073 <font class="keywordflow">return</font> tokenQueueSize() &gt; m_currentPosition ? <font class="keyword">true</font> : <font class="keyword">false</font>;
01074 }
01075
01081 TokenQueueSizeType
01082 tokenQueueSize()<font class="keyword"> const</font>
01083 <font class="keyword"> </font>{
01084 <font class="keywordflow">return</font> TokenQueueSizeType(m_tokenQueue.size());
01085 }
01086
01087 <font class="keywordtype">bool</font>
01088 isValidTokenQueuePosition(TokenQueueSizeType thePosition)<font class="keyword"> const</font>
01089 <font class="keyword"> </font>{
01090 <font class="keywordflow">return</font> thePosition &lt; tokenQueueSize();
01091 }
01092
01098 TokenQueueSizeType
01099 getTokenPosition()<font class="keyword"> const</font>
01100 <font class="keyword"> </font>{
01101 <font class="keywordflow">return</font> m_currentPosition;
01102 }
01103
01107 <font class="keywordtype">void</font>
01108 resetTokenPosition()<font class="keyword"></font>
01109 <font class="keyword"> </font>{
01110 m_currentPosition = 0;
01111 }
01112
01119 <font class="keyword">const</font> <a class="code" href="classXToken.html">XToken</a>*
01120 getToken(TokenQueuePositionType thePosition)<font class="keyword"> const</font>
01121 <font class="keyword"> </font>{
01122 assert(thePosition &lt; tokenQueueSize());
01123
01124 <font class="keywordflow">return</font> &amp;m_tokenQueue[thePosition];
01125 }
01126
01132 <font class="keyword">const</font> <a class="code" href="classXToken.html">XToken</a>*
01133 getNextToken()<font class="keyword"></font>
01134 <font class="keyword"> </font>{
01135 <font class="keywordflow">if</font> (hasMoreTokens() == <font class="keyword">true</font>)
01136 {
01137 <font class="keywordflow">return</font> getToken(m_currentPosition++);
01138 }
01139 <font class="keywordflow">else</font>
01140 {
01141 <font class="keywordflow">return</font> 0;
01142 }
01143 }
01144
01150 <font class="keyword">const</font> <a class="code" href="classXToken.html">XToken</a>*
01151 getPreviousToken()<font class="keyword"></font>
01152 <font class="keyword"> </font>{
01153 <font class="keywordflow">if</font> (m_currentPosition &gt; 0)
01154 {
01155 <font class="keywordflow">return</font> getToken(--m_currentPosition);
01156 }
01157 <font class="keywordflow">else</font>
01158 {
01159 <font class="keywordflow">return</font> 0;
01160 }
01161 }
01162
01163 <font class="keyword">enum</font> eRelativeDirection
01164 {
01165 eRelativeBackward,
01166 eRelativeForward
01167 };
01168
01177 <font class="keyword">const</font> <a class="code" href="classXToken.html">XToken</a>*
01178 getRelativeToken(
01179 TokenQueuePositionType theOffset,
01180 eRelativeDirection theDirection)<font class="keyword"> const</font>
01181 <font class="keyword"> </font>{
01182 <font class="keyword">const</font> TokenQueuePositionType thePosition =
01183 calculateRelativePosition(theOffset, theDirection);
01184
01185 <font class="keywordflow">if</font> (thePosition == tokenQueueSize())
01186 {
01187 <font class="keywordflow">return</font> 0;
01188 }
01189 <font class="keywordflow">else</font>
01190 {
01191 <font class="keywordflow">return</font> getToken(thePosition);
01192 }
01193 }
01194
01200 <font class="keywordtype">void</font>
01201 pushToken(<font class="keyword">const</font> <a class="code" href="classXalanDOMString.html">XalanDOMString</a>&amp; theToken)<font class="keyword"></font>
01202 <font class="keyword"> </font>{
01203 m_tokenQueue.push_back(<a class="code" href="XTokenStringAdapter_8hpp.html#a1">XToken</a>(theToken, getMemoryManager()));
01204 }
01205
01212 <font class="keywordtype">void</font>
01213 pushToken(
01214 <font class="keywordtype">double</font> theNumber,
01215 <font class="keyword">const</font> <a class="code" href="classXalanDOMString.html">XalanDOMString</a>&amp; theString)<font class="keyword"></font>
01216 <font class="keyword"> </font>{
01217 m_tokenQueue.push_back(<a class="code" href="XTokenStringAdapter_8hpp.html#a1">XToken</a>(theNumber, theString));
01218 }
01219
01226 <font class="keywordtype">void</font>
01227 insertToken(<font class="keyword">const</font> <a class="code" href="classXalanDOMString.html">XalanDOMString</a>&amp; theToken)<font class="keyword"></font>
01228 <font class="keyword"> </font>{
01229 m_tokenQueue.insert(m_tokenQueue.begin() + (m_currentPosition - 1), <a class="code" href="XTokenStringAdapter_8hpp.html#a1">XToken</a>(theToken, getMemoryManager()));
01230 }
01231
01239 <font class="keywordtype">void</font>
01240 insertToken(
01241 <font class="keywordtype">double</font> theNumber,
01242 <font class="keyword">const</font> <a class="code" href="classXalanDOMString.html">XalanDOMString</a>&amp; theString)<font class="keyword"></font>
01243 <font class="keyword"> </font>{
01244 m_tokenQueue.insert(m_tokenQueue.begin() + (m_currentPosition - 1), <a class="code" href="XTokenStringAdapter_8hpp.html#a1">XToken</a>(theNumber, theString));
01245 }
01246
01253 <font class="keywordtype">void</font>
01254 replaceRelativeToken(
01255 TokenQueuePositionType theOffset,
01256 eRelativeDirection theDirection,
01257 <font class="keyword">const</font> <a class="code" href="classXalanDOMString.html">XalanDOMString</a>&amp; theString)<font class="keyword"></font>
01258 <font class="keyword"> </font>{
01259 <font class="keyword">const</font> TokenQueuePositionType thePosition =
01260 calculateRelativePosition(theOffset, theDirection);
01261 assert(thePosition &lt; tokenQueueSize());
01262
01263 m_tokenQueue[thePosition].set(theString, getMemoryManager());
01264 }
01265
01272 <font class="keywordtype">void</font>
01273 dumpOpCodeMap(
01274 <a class="code" href="classPrintWriter.html">PrintWriter</a>&amp; thePrintWriter,
01275 OpCodeMapSizeType theStartPosition = 0) <font class="keyword">const</font>;
01276
01283 <font class="keywordtype">void</font>
01284 dumpOpCodeMap(
01285 OstreamType&amp; theStream,
01286 OpCodeMapSizeType theStartPosition = 0) <font class="keyword">const</font>;
01287
01294 <font class="keywordtype">void</font>
01295 dumpTokenQueue(
01296 <a class="code" href="classPrintWriter.html">PrintWriter</a>&amp; thePrintWriter,
01297 TokenQueueSizeType theStartPosition = 0) <font class="keyword">const</font>;
01298
01305 <font class="keywordtype">void</font>
01306 dumpTokenQueue(
01307 OstreamType&amp; theStream,
01308 TokenQueueSizeType theStartPosition = 0) <font class="keyword">const</font>;
01309
01315 <font class="keywordtype">void</font>
01316 dumpRemainingTokenQueue(<a class="code" href="classPrintWriter.html">PrintWriter</a>&amp; thePrintWriter) <font class="keyword">const</font>;
01317
01324 <font class="keywordtype">void</font>
01325 dumpRemainingTokenQueue(
01326 OstreamType&amp; theStream,
01327 MemoryManager&amp; theMemoryManager) <font class="keyword">const</font>;
01328
01335 <font class="keywordtype">void</font>
01336 pushValueOnOpCodeMap(<font class="keyword">const</font> OpCodeMapType::value_type&amp; theValue)<font class="keyword"></font>
01337 <font class="keyword"> </font>{
01338 <font class="comment">// Push the index onto the op map.</font>
01339 m_opMap.push_back(theValue);
01340
01341 <font class="comment">// Update the op map length.</font>
01342 ++m_opMap[s_opCodeMapLengthIndex];
01343 }
01344
01351 <font class="keywordtype">void</font>
01352 pushArgumentOnOpCodeMap(<font class="keyword">const</font> <a class="code" href="classXToken.html">XToken</a>&amp; theXToken);
01353
01360 <font class="keywordtype">void</font>
01361 pushArgumentOnOpCodeMap(<font class="keyword">const</font> <a class="code" href="classXalanDOMString.html">XalanDOMString</a>&amp; theString);
01362
01370 <font class="keywordtype">void</font>
01371 pushArgumentOnOpCodeMap(
01372 <font class="keywordtype">double</font> theNumber,
01373 <font class="keyword">const</font> <a class="code" href="classXalanDOMString.html">XalanDOMString</a>&amp; theString);
01374
01381 <font class="keywordtype">void</font>
01382 pushNumberLiteralOnOpCodeMap(<font class="keywordtype">double</font> theNumber);
01383
01389 <font class="keywordtype">double</font>
01390 getNumberLiteral(<font class="keywordtype">int</font> theIndex)<font class="keyword"> const</font>
01391 <font class="keyword"> </font>{
01392 assert(theIndex &gt;= 0 &amp;&amp;
01393 NumberLiteralValueVectorType::size_type(theIndex) &lt; m_numberLiteralValues.size());
01394
01395 <font class="keywordflow">return</font> m_numberLiteralValues[<a class="code" href="XalanMap_8hpp.html#a1">NumberLiteralValueVectorType::size_type</a>(theIndex)];
01396 }
01397
01402 <font class="keywordtype">void</font>
01403 pushCurrentTokenOnOpCodeMap();
01404
01410 <font class="keywordtype">void</font>
01411 setCurrentPattern(<font class="keyword">const</font> <a class="code" href="classXalanDOMString.html">XalanDOMString</a>&amp; thePattern)<font class="keyword"></font>
01412 <font class="keyword"> </font>{
01413 m_currentPattern = &amp;thePattern;
01414 }
01415
01421 <font class="keyword">const</font> <a class="code" href="classXalanDOMString.html">XalanDOMString</a>&amp;
01422 getCurrentPattern()<font class="keyword"> const</font>
01423 <font class="keyword"> </font>{
01424 assert(m_currentPattern != 0);
01425
01426 <font class="keywordflow">return</font> *m_currentPattern;
01427 }
01428
01429 <font class="keyword">private</font>:
01430
01440 TokenQueuePositionType
01441 calculateRelativePosition(
01442 TokenQueuePositionType theOffset,
01443 eRelativeDirection theDirection)<font class="keyword"> const</font>
01444 <font class="keyword"> </font>{
01445 <font class="keywordflow">if</font> (theDirection == eRelativeBackward &amp;&amp;
01446 theOffset &lt;= m_currentPosition)
01447 {
01448 <font class="keywordflow">return</font> m_currentPosition - theOffset;
01449 }
01450 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (theDirection == eRelativeForward &amp;&amp;
01451 m_currentPosition + theOffset &lt; tokenQueueSize())
01452 {
01453 <font class="keywordflow">return</font> m_currentPosition + theOffset;
01454 }
01455 <font class="keywordflow">else</font>
01456 {
01457 <font class="keywordflow">return</font> tokenQueueSize();
01458 }
01459 }
01460
01467 OpCodeMapType m_opMap;
01468
01473 OpCodeMapSizeType m_lastOpCodeIndex;
01474
01480 TokenQueueType m_tokenQueue;
01481
01485 TokenQueueSizeType m_currentPosition;
01486
01490 <font class="keyword">const</font> <a class="code" href="classXalanDOMString.html">XalanDOMString</a>* m_currentPattern;
01491
01492 <font class="comment">// Default vector allocation sizes.</font>
01493 <font class="keyword">enum</font>
01494 {
01495 eDefaultOpMapSize = 100,
01496 eDefaultTokenQueueSize = 30
01497 };
01498
01499 NumberLiteralValueVectorType m_numberLiteralValues;
01500 };
01501
01502
01503
01504 XALAN_CPP_NAMESPACE_END
01505
01506
01507
01508 <font class="preprocessor">#endif // XPATHEXPRESSION_HEADER_GUARD_1357924680</font>
</font></pre></div><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="../resources/dot.gif" width="1" alt="dot"></TD></TR></TABLE>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="80%">
<TR>
<TD WIDTH="80%" VALIGN="TOP">
<P ALIGN="CENTER"><B>Xalan-C++ XSLT Processor Version 1.10</B><BR>
Copyright &copy; 1999-2004 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" ALT="Apache Logo">
</TD>
</TR>
</TABLE>