Xalan-C++ API Documentation
Go to the documentation of this file.
18 #if !defined(XPATHEXPRESSION_HEADER_GUARD_1357924680)
19 #define XPATHEXPRESSION_HEADER_GUARD_1357924680
32 #if defined(XALAN_CLASSIC_IOSTREAMS)
54 XALAN_CPP_NAMESPACE_BEGIN
78 #define XALAN_XPATH_EXPRESSION_USE_ITERATORS
80 #if defined(XALAN_XPATH_EXPRESSION_USE_ITERATORS)
392 eOP_EXTFUNCTION = 23,
425 eOP_LOCATIONPATH = 25,
445 eNODETYPE_COMMENT = 27,
500 eNODETYPE_ANYELEMENT = 33,
512 eFROM_ANCESTORS = 34,
513 eFROM_ANCESTORS_OR_SELF = 35,
514 eFROM_ATTRIBUTES = 36,
516 eFROM_DESCENDANTS = 38,
517 eFROM_DESCENDANTS_OR_SELF = 39,
518 eFROM_FOLLOWING = 40,
519 eFROM_FOLLOWING_SIBLINGS = 41,
521 eFROM_PRECEDING = 43,
522 eFROM_PRECEDING_SIBLINGS = 44,
524 eFROM_NAMESPACE = 46,
535 eOP_MATCHPATTERN = 48,
545 eOP_LOCATIONPATHPATTERN = 49,
548 eMATCH_ATTRIBUTE = 50,
549 eMATCH_ANY_ANCESTOR = 51,
550 eMATCH_IMMEDIATE_ANCESTOR = 52,
551 eMATCH_ANY_ANCESTOR_WITH_PREDICATE = 53,
552 eMATCH_ANY_ANCESTOR_WITH_FUNCTION_CALL = 54,
563 eOP_PREDICATE_WITH_POSITION = 55,
569 eOP_FUNCTION_POSITION = 56,
570 eOP_FUNCTION_LAST = 57,
571 eOP_FUNCTION_COUNT = 58,
572 eOP_FUNCTION_NOT = 59,
573 eOP_FUNCTION_TRUE = 60,
574 eOP_FUNCTION_FALSE = 61,
575 eOP_FUNCTION_BOOLEAN = 62,
576 eOP_FUNCTION_NAME_0 = 63,
577 eOP_FUNCTION_NAME_1 = 64,
578 eOP_FUNCTION_LOCALNAME_0 = 65,
579 eOP_FUNCTION_LOCALNAME_1 = 66,
580 eOP_FUNCTION_FLOOR = 67,
581 eOP_FUNCTION_CEILING = 68,
582 eOP_FUNCTION_ROUND = 69,
583 eOP_FUNCTION_NUMBER_0 = 70,
584 eOP_FUNCTION_NUMBER_1 = 71,
585 eOP_FUNCTION_STRING_0 = 72,
586 eOP_FUNCTION_STRING_1 = 73,
587 eOP_FUNCTION_STRINGLENGTH_0 = 74,
588 eOP_FUNCTION_STRINGLENGTH_1 = 75,
589 eOP_FUNCTION_NAMESPACEURI_0 = 76,
590 eOP_FUNCTION_NAMESPACEURI_1 = 77,
591 eOP_FUNCTION_SUM = 78,
592 eOP_FUNCTION_CONCAT = 79,
612 MemoryManager& theManager);
716 #if defined(XALAN_INLINE_INITIALIZATION)
721 s_opCodeMapLengthIndex = 1
733 return m_opMap.getMemoryManager();
774 if (theSize > s_opCodeMapLengthIndex)
778 return m_opMap[s_opCodeMapLengthIndex];
788 OpCodeMapPositionType
791 #if defined(XALAN_XPATH_EXPRESSION_USE_ITERATORS)
792 return m_opMap.begin();
804 return theDifference >= 0 &&
805 theDifference < opCodeMapSize();
808 #if defined(XALAN_XPATH_EXPRESSION_USE_ITERATORS)
812 return theIndex >= 0 && theIndex < opCodeMapSize();
825 assert(theIndex < opCodeMapLength());
827 return m_opMap[theIndex];
841 assert(opPos < getInitialOpCodePosition() + opCodeMapLength());
843 #if defined(XALAN_XPATH_EXPRESSION_USE_ITERATORS)
847 return m_opMap[opPos];
863 assert(theOpCodeMapIndex < opCodeMapLength());
865 m_opMap[theOpCodeMapIndex] = theValue;
883 MemoryManager& theManager)
const;
885 #if defined(XALAN_XPATH_EXPRESSION_USE_ITERATORS)
895 MemoryManager& theManager)
const;
898 #if defined(XALAN_XPATH_EXPRESSION_USE_ITERATORS)
909 assert(opPos < getInitialOpCodePosition() + opCodeMapLength());
911 return opPos + *(opPos + s_opCodeMapLengthIndex);
923 #if defined(XALAN_XPATH_EXPRESSION_USE_ITERATORS)
929 assert(theIndex < opCodeMapLength());
931 assert(theIndex + m_opMap[theIndex + s_opCodeMapLengthIndex] ==
974 setOpCodeArgs(theOpCode,
1017 assert(theIndex < opCodeMapSize());
1019 updateOpCodeLength(m_opMap[theIndex], theIndex);
1077 return tokenQueueSize() > m_currentPosition ? true :
false;
1094 return thePosition < tokenQueueSize();
1105 return m_currentPosition;
1114 m_currentPosition = 0;
1126 assert(thePosition < tokenQueueSize());
1128 return &m_tokenQueue[thePosition];
1139 if (hasMoreTokens() ==
true)
1141 return getToken(m_currentPosition++);
1157 if (m_currentPosition > 0)
1159 return getToken(--m_currentPosition);
1187 calculateRelativePosition(theOffset, theDirection);
1189 if (thePosition == tokenQueueSize())
1195 return getToken(thePosition);
1207 m_tokenQueue.push_back(
1212 getMemoryManager()));
1226 m_tokenQueue.push_back(
1230 getMemoryManager()));
1242 m_tokenQueue.insert(
1243 m_tokenQueue.begin() + (m_currentPosition - 1),
1247 getMemoryManager()));
1262 m_tokenQueue.insert(
1263 m_tokenQueue.begin() + (m_currentPosition - 1),
1267 getMemoryManager()));
1283 calculateRelativePosition(theOffset, theDirection);
1284 assert(thePosition < tokenQueueSize());
1286 m_tokenQueue[thePosition].set(
1352 MemoryManager& theMemoryManager)
const;
1364 m_opMap.push_back(theValue);
1367 ++m_opMap[s_opCodeMapLengthIndex];
1417 assert(theIndex >= 0 &&
1438 m_currentPattern = &thePattern;
1449 assert(m_currentPattern != 0);
1451 return *m_currentPattern;
1465 TokenQueuePositionType
1466 calculateRelativePosition(
1467 TokenQueuePositionType theOffset,
1468 eRelativeDirection theDirection)
const
1470 if (theDirection == eRelativeBackward &&
1471 theOffset <= m_currentPosition)
1473 return m_currentPosition - theOffset;
1475 else if (theDirection == eRelativeForward &&
1476 m_currentPosition + theOffset < tokenQueueSize())
1478 return m_currentPosition + theOffset;
1482 return tokenQueueSize();
1492 OpCodeMapType m_opMap;
1498 OpCodeMapSizeType m_lastOpCodeIndex;
1505 TokenQueueType m_tokenQueue;
1510 TokenQueueSizeType m_currentPosition;
1520 eDefaultOpMapSize = 100,
1521 eDefaultTokenQueueSize = 30
1524 NumberLiteralValueVectorType m_numberLiteralValues;
1529 XALAN_CPP_NAMESPACE_END
1533 #endif // XPATHEXPRESSION_HEADER_GUARD_1357924680
void replaceOpCode(OpCodeMapSizeType theIndex, eOpCodes theOldOpCode, eOpCodes theNewOpCode)
Replace an operation code with supplied code.
void setCurrentPattern(const XalanDOMString &thePattern)
Change the current pattern in the pattern map.
InvalidArgumentCountException(OpCodeMapValueType theOpCode, OpCodeMapValueType theExpectedCount, OpCodeMapValueType theSuppliedCount, XalanDOMString &theBuffer)
Construct an InvalidArgumentCountException object.
InvalidArgumentException(OpCodeMapValueType theOpCode, OpCodeMapValueType theValue, XalanDOMString &theBuffer)
Construct an InvalidArgumentException object.
InvalidOpCodeException(OpCodeMapValueType theOpCode, XalanDOMString &theBuffer)
Construct an InvalidOpCodeException object.
OpCodeMapType::difference_type OpCodeMapDifferenceType
XalanVector< double > NumberLiteralValueVectorType
eDummy
The length is always the opcode position + 1.
bool isValidOpCodePosition(OpCodeMapPositionType opPos) const
OpCodeMapValueType insertOpCode(eOpCodes theOpCode, OpCodeMapSizeType theIndex)
Insert an operation code at a specified index in the list.
Exception class thrown when an invalid XPath expression is encountered.
XPathExpressionException(const XalanDOMString &theMessage, MemoryManager &theManager)
Construct an XPathExpressionException object.
OpCodeMapType::value_type OpCodeMapValueType
const XalanDOMString & getCurrentPattern() const
Retrieve the current pattern in the pattern map.
OpCodeMapPositionType getNextOpCodePosition(OpCodeMapPositionType opPos) const
Retrieve the position of the next operation code at a specified position in the list.
TokenQueueType::value_type TokenQueueValueType
void updateOpCodeLength(OpCodeMapValueType theOpCode, OpCodeMapSizeType theIndex)
Update the length of an operation code at a specified index in the list.
void updateOpCodeLength(OpCodeMapSizeType theIndex)
Update the length of an operation code at a specified index in the list.
const XToken * getNextToken()
Retrieve the next token in the token queue.
OpCodeMapValueType getOpCodeMapValue(OpCodeMapPositionType opPos) const
Retrieve the value of an operation code at a specified position in the list.
void updateOpCodeLengthAfterNodeTest(OpCodeMapSizeType theIndex)
Update the length of an operation code after a node test code.
void pushCurrentTokenOnOpCodeMap()
Push the current position in the token queue onto the operations code map.
TokenQueueSizeType TokenQueuePositionType
void dumpOpCodeMap(OstreamType &theStream, OpCodeMapSizeType theStartPosition=0) const
Diagnostic function to output the operation code map.
void pushArgumentOnOpCodeMap(const XalanDOMString &theString)
Push a token onto the token queue and its index onto the operations code map.
bool isValidOpCodePosition(OpCodeMapSizeType theIndex) const
ptrdiff_t difference_type
void pushToken(double theNumber, const XalanDOMString &theString)
Push a token onto the token queue.
OpCodeMapValueType getOpCodeMapValue(OpCodeMapSizeType theIndex) const
Retrieve the value of an operation code at a specified index in the op code map.
#define XALAN_XPATH_EXPORT
void dumpRemainingTokenQueue(OstreamType &theStream, MemoryManager &theMemoryManager) const
Diagnostic function to output the remaining tokens in the token queue.
bool hasMoreTokens() const
Whether there are any more tokens in the token queue.
OpCodeMapValueType opCodeMapLength() const
Retrieve length of the operations code map stored in the map.
void insertToken(const XalanDOMString &theToken)
Insert a token onto the token queue at the current position.
OpCodeMapPositionType getInitialOpCodePosition() const
Exception class thrown when an invalid XPath argument is encountered.
void dumpOpCodeMap(PrintWriter &thePrintWriter, OpCodeMapSizeType theStartPosition=0) const
Diagnostic function to output the operation code map.
XalanVector< OpCodeMapValueType > OpCodeMapValueVectorType
OpCodeMapValueType OpCodeMapSizeType
OpCodeMapValueType getOpCodeLengthFromOpMap(OpCodeMapSizeType theIndex, MemoryManager &theManager) const
Retrieve the length of an operation code at a specified index in the op map.
bool isValidTokenQueuePosition(TokenQueueSizeType thePosition) const
void pushArgumentOnOpCodeMap(const XToken &theXToken)
Push a token onto the token queue and its index onto the operations code map.
static double toDouble(const XalanDOMString &theString, MemoryManager &theManager)
Convert a string to a double value.
void reset()
Reset the expression.
eOpCodes
List of operations codes.
void dumpTokenQueue(OstreamType &theStream, TokenQueueSizeType theStartPosition=0) const
Diagnostic function to output the token queue.
void setOpCodeArgs(eOpCodes theOpCode, OpCodeMapSizeType theIndex, const OpCodeMapValueVectorType &theArgs)
Set the arguments for an operation code at a specified index in the list.
void pushNumberLiteralOnOpCodeMap(double theNumber)
Push a number literal onto the vector of number literals and its index onto the operations code map.
void pushToken(const XalanDOMString &theToken)
Push a token onto the token queue.
void setOpCodeMapValue(OpCodeMapSizeType theOpCodeMapIndex, const OpCodeMapValueType &theValue)
Set the value of an operation code at a specified index in the OpCode map.
void shrink()
Shrink internal tables.
void insertToken(double theNumber, const XalanDOMString &theString)
Insert a token onto the token queue at the current position.
XALAN_CPP_NAMESPACE_BEGIN XALAN_USING_XERCES(Locator)
OpCodeMapSizeType opCodeMapSize() const
Retrieve number of elements in the operations code map.
OpCodeMapType::const_iterator OpCodeMapPositionType
OpCodeMapValueType getOpCodeLengthFromOpMap(OpCodeMapPositionType opPos, MemoryManager &theManager) const
Retrieve the length of an operation code at a specified position in the op map.
XALAN_CPP_NAMESPACE_BEGIN typedef size_t size_type
TokenQueueSizeType tokenQueueSize() const
Retrieve number of elements in the token queue.
XalanVector< XToken > TokenQueueType
void resetTokenPosition()
Set the current position in the token queue to zero.
Exception class thrown when an invalid XPath operation code is encountered.
void pushValueOnOpCodeMap(const OpCodeMapType::value_type &theValue)
Push a value onto the operations code map.
TokenQueueSizeType getTokenPosition() const
Retrieve the current position in the token queue.
XPathExpression(MemoryManager &theManager)
const XToken * getRelativeToken(TokenQueuePositionType theOffset, eRelativeDirection theDirection) const
Retrieve a token at the specified offset relative to the current position in the token queue.
void updateShiftedOpCodeLength(OpCodeMapValueType theOpCode, OpCodeMapSizeType theOriginalIndex, OpCodeMapSizeType theNewIndex)
Update the length of an operation code that has moved to a new index in the list.
static bool isNodeTestOpCode(OpCodeMapValueType theOpCode)
Whether the operation code is one of the node test types, for example, "ancestor::" or "child::".
OpCodeMapSizeType getNextOpCodePosition(OpCodeMapSizeType theIndex) const
Retrieve the position of the next operation code at a specified index in the list.
const XToken * getToken(TokenQueuePositionType thePosition) const
Retrieve a token at the specified position in the token queue.
void replaceRelativeToken(TokenQueuePositionType theOffset, eRelativeDirection theDirection, const XalanDOMString &theString)
Replace a token in the token queue.
XalanVector< int > OpCodeMapType
double getNumberLiteral(int theIndex) const
Get a number literal from the vector of number literals.
const value_type * const_iterator
OpCodeMapSizeType appendOpCode(eOpCodes theOpCode)
Add an operation code to the list.
const XToken * getPreviousToken()
Retrieve the previous token in the token queue.
void dumpRemainingTokenQueue(PrintWriter &thePrintWriter) const
Diagnostic function to output the remaining tokens in the token queue.
void dumpTokenQueue(PrintWriter &thePrintWriter, TokenQueueSizeType theStartPosition=0) const
Diagnostic function to output the token queue.
XALAN_STD_QUALIFIER ostream OstreamType
void pushArgumentOnOpCodeMap(double theNumber, const XalanDOMString &theString)
Push a token onto the token queue and its index onto the operations code map.
OpCodeMapSizeType appendOpCode(eOpCodes theOpCode, const OpCodeMapValueVectorType &theArgs)
Add an operation code with supplied arguments to the list.
OpCodeMapValueType getOpCodeArgumentLength(OpCodeMapPositionType opPos) const
Exception class thrown when an invalid number of XPath arguments is encountered.
MemoryManager & getMemoryManager()
Interpreting class diagrams
Doxygen and
GraphViz are
used to generate this API documentation from the Xalan-C header files.
Xalan-C++ XSLT Processor Version 1.11
Copyright © 1999-2012 The Apache Software Foundation.
All Rights Reserved.
|
|