Xalan-C++ API Reference  1.12.0
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
xalanc::XPathExpression Class Reference

#include <xalanc/XPath/XPathExpression.hpp>

Classes

class  InvalidArgumentCountException
 Exception class thrown when an invalid number of XPath arguments is encountered. More...
 
class  InvalidArgumentException
 Exception class thrown when an invalid XPath argument is encountered. More...
 
class  InvalidOpCodeException
 Exception class thrown when an invalid XPath operation code is encountered. More...
 
class  XPathExpressionException
 Exception class thrown when an invalid XPath expression is encountered. More...
 

Public Types

enum  eOpCodes {
  eELEMWILDCARD = -3, eEMPTY = -2, eENDOP = -1, eOP_XPATH = 1,
  eOP_OR = 2, eOP_AND = 3, eOP_NOTEQUALS = 4, eOP_EQUALS = 5,
  eOP_LTE = 6, eOP_LT = 7, eOP_GTE = 8, eOP_GT = 9,
  eOP_PLUS = 10, eOP_MINUS = 11, eOP_MULT = 12, eOP_DIV = 13,
  eOP_MOD = 14, eOP_NEG = 15, eOP_BOOL = 16, eOP_UNION = 17,
  eOP_LITERAL = 18, eOP_VARIABLE = 19, eOP_GROUP = 20, eOP_NUMBERLIT = 21,
  eOP_ARGUMENT = 22, eOP_EXTFUNCTION = 23, eOP_FUNCTION = 24, eOP_LOCATIONPATH = 25,
  eOP_PREDICATE = 26, eNODETYPE_COMMENT = 27, eNODETYPE_TEXT = 28, eNODETYPE_PI = 29,
  eNODETYPE_NODE = 30, eNODENAME = 31, eNODETYPE_ROOT = 32, eNODETYPE_ANYELEMENT = 33,
  eFROM_ANCESTORS = 34, eFROM_ANCESTORS_OR_SELF = 35, eFROM_ATTRIBUTES = 36, eFROM_CHILDREN = 37,
  eFROM_DESCENDANTS = 38, eFROM_DESCENDANTS_OR_SELF = 39, eFROM_FOLLOWING = 40, eFROM_FOLLOWING_SIBLINGS = 41,
  eFROM_PARENT = 42, eFROM_PRECEDING = 43, eFROM_PRECEDING_SIBLINGS = 44, eFROM_SELF = 45,
  eFROM_NAMESPACE = 46, eFROM_ROOT = 47, eOP_MATCHPATTERN = 48, eOP_LOCATIONPATHPATTERN = 49,
  eMATCH_ATTRIBUTE = 50, eMATCH_ANY_ANCESTOR = 51, eMATCH_IMMEDIATE_ANCESTOR = 52, eMATCH_ANY_ANCESTOR_WITH_PREDICATE = 53,
  eMATCH_ANY_ANCESTOR_WITH_FUNCTION_CALL = 54, eOP_PREDICATE_WITH_POSITION = 55, eOP_FUNCTION_POSITION = 56, eOP_FUNCTION_LAST = 57,
  eOP_FUNCTION_COUNT = 58, eOP_FUNCTION_NOT = 59, eOP_FUNCTION_TRUE = 60, eOP_FUNCTION_FALSE = 61,
  eOP_FUNCTION_BOOLEAN = 62, eOP_FUNCTION_NAME_0 = 63, eOP_FUNCTION_NAME_1 = 64, eOP_FUNCTION_LOCALNAME_0 = 65,
  eOP_FUNCTION_LOCALNAME_1 = 66, eOP_FUNCTION_FLOOR = 67, eOP_FUNCTION_CEILING = 68, eOP_FUNCTION_ROUND = 69,
  eOP_FUNCTION_NUMBER_0 = 70, eOP_FUNCTION_NUMBER_1 = 71, eOP_FUNCTION_STRING_0 = 72, eOP_FUNCTION_STRING_1 = 73,
  eOP_FUNCTION_STRINGLENGTH_0 = 74, eOP_FUNCTION_STRINGLENGTH_1 = 75, eOP_FUNCTION_NAMESPACEURI_0 = 76, eOP_FUNCTION_NAMESPACEURI_1 = 77,
  eOP_FUNCTION_SUM = 78, eOP_FUNCTION_CONCAT = 79, eOpCodeNextAvailable
}
 List of operations codes. More...
 
enum  eDummy { s_opCodeMapLengthIndex = 1 }
 The length is always the opcode position + 1. More...
 
enum  eRelativeDirection { eRelativeBackward, eRelativeForward }
 
typedef std::ostream OstreamType
 
typedef XalanVector< int > OpCodeMapType
 
typedef XalanVector< XTokenTokenQueueType
 
typedef OpCodeMapType::value_type OpCodeMapValueType
 
typedef OpCodeMapValueType OpCodeMapSizeType
 
typedef XalanVector< OpCodeMapValueTypeOpCodeMapValueVectorType
 
typedef XalanVector< double > NumberLiteralValueVectorType
 
typedef OpCodeMapType::const_iterator OpCodeMapPositionType
 
typedef OpCodeMapType::difference_type OpCodeMapDifferenceType
 
typedef TokenQueueType::value_type TokenQueueValueType
 
typedef int TokenQueueSizeType
 
typedef TokenQueueSizeType TokenQueuePositionType
 

Public Member Functions

 XPathExpression (MemoryManager &theManager)
 
 ~XPathExpression ()
 
MemoryManager & getMemoryManager ()
 
void reset ()
 Reset the expression. More...
 
void shrink ()
 Shrink internal tables. More...
 
OpCodeMapSizeType opCodeMapSize () const
 Retrieve number of elements in the operations code map. More...
 
OpCodeMapValueType opCodeMapLength () const
 Retrieve length of the operations code map stored in the map. More...
 
OpCodeMapPositionType getInitialOpCodePosition () const
 
bool isValidOpCodePosition (OpCodeMapPositionType opPos) const
 
bool isValidOpCodePosition (OpCodeMapSizeType theIndex) const
 
OpCodeMapValueType getOpCodeMapValue (OpCodeMapSizeType theIndex) const
 Retrieve the value of an operation code at a specified index in the op code map. More...
 
OpCodeMapValueType getOpCodeMapValue (OpCodeMapPositionType opPos) const
 Retrieve the value of an operation code at a specified position in the list. More...
 
void setOpCodeMapValue (OpCodeMapSizeType theOpCodeMapIndex, const OpCodeMapValueType &theValue)
 Set the value of an operation code at a specified index in the OpCode map. More...
 
OpCodeMapValueType getOpCodeArgumentLength (OpCodeMapPositionType opPos) const
 
OpCodeMapValueType getOpCodeLengthFromOpMap (OpCodeMapPositionType opPos, MemoryManager &theManager) const
 Retrieve the length of an operation code at a specified position in the op map. More...
 
OpCodeMapValueType getOpCodeLengthFromOpMap (OpCodeMapSizeType theIndex, MemoryManager &theManager) const
 Retrieve the length of an operation code at a specified index in the op map. More...
 
OpCodeMapPositionType getNextOpCodePosition (OpCodeMapPositionType opPos) const
 Retrieve the position of the next operation code at a specified position in the list. More...
 
OpCodeMapSizeType getNextOpCodePosition (OpCodeMapSizeType theIndex) const
 Retrieve the position of the next operation code at a specified index in the list. More...
 
void setOpCodeArgs (eOpCodes theOpCode, OpCodeMapSizeType theIndex, const OpCodeMapValueVectorType &theArgs)
 Set the arguments for an operation code at a specified index in the list. More...
 
OpCodeMapSizeType appendOpCode (eOpCodes theOpCode)
 Add an operation code to the list. More...
 
OpCodeMapSizeType appendOpCode (eOpCodes theOpCode, const OpCodeMapValueVectorType &theArgs)
 Add an operation code with supplied arguments to the list. More...
 
void replaceOpCode (OpCodeMapSizeType theIndex, eOpCodes theOldOpCode, eOpCodes theNewOpCode)
 Replace an operation code with supplied code. More...
 
OpCodeMapValueType insertOpCode (eOpCodes theOpCode, OpCodeMapSizeType theIndex)
 Insert an operation code at a specified index in the list. More...
 
void updateOpCodeLength (OpCodeMapSizeType theIndex)
 Update the length of an operation code at a specified index in the list. More...
 
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. More...
 
void updateOpCodeLength (OpCodeMapValueType theOpCode, OpCodeMapSizeType theIndex)
 Update the length of an operation code at a specified index in the list. More...
 
void updateOpCodeLengthAfterNodeTest (OpCodeMapSizeType theIndex)
 Update the length of an operation code after a node test code. More...
 
bool hasMoreTokens () const
 Whether there are any more tokens in the token queue. More...
 
TokenQueueSizeType tokenQueueSize () const
 Retrieve number of elements in the token queue. More...
 
bool isValidTokenQueuePosition (TokenQueueSizeType thePosition) const
 
TokenQueueSizeType getTokenPosition () const
 Retrieve the current position in the token queue. More...
 
void resetTokenPosition ()
 Set the current position in the token queue to zero. More...
 
const XTokengetToken (TokenQueuePositionType thePosition) const
 Retrieve a token at the specified position in the token queue. More...
 
const XTokengetNextToken ()
 Retrieve the next token in the token queue. More...
 
const XTokengetPreviousToken ()
 Retrieve the previous token in the token queue. More...
 
const XTokengetRelativeToken (TokenQueuePositionType theOffset, eRelativeDirection theDirection) const
 Retrieve a token at the specified offset relative to the current position in the token queue. More...
 
void pushToken (const XalanDOMString &theToken)
 Push a token onto the token queue. More...
 
void pushToken (double theNumber, const XalanDOMString &theString)
 Push a token onto the token queue. More...
 
void insertToken (const XalanDOMString &theToken)
 Insert a token onto the token queue at the current position. More...
 
void insertToken (double theNumber, const XalanDOMString &theString)
 Insert a token onto the token queue at the current position. More...
 
void replaceRelativeToken (TokenQueuePositionType theOffset, eRelativeDirection theDirection, const XalanDOMString &theString)
 Replace a token in the token queue. More...
 
void dumpOpCodeMap (PrintWriter &thePrintWriter, OpCodeMapSizeType theStartPosition=0) const
 Diagnostic function to output the operation code map. More...
 
void dumpOpCodeMap (OstreamType &theStream, OpCodeMapSizeType theStartPosition=0) const
 Diagnostic function to output the operation code map. More...
 
void dumpTokenQueue (PrintWriter &thePrintWriter, TokenQueueSizeType theStartPosition=0) const
 Diagnostic function to output the token queue. More...
 
void dumpTokenQueue (OstreamType &theStream, TokenQueueSizeType theStartPosition=0) const
 Diagnostic function to output the token queue. More...
 
void dumpRemainingTokenQueue (PrintWriter &thePrintWriter) const
 Diagnostic function to output the remaining tokens in the token queue. More...
 
void dumpRemainingTokenQueue (OstreamType &theStream, MemoryManager &theMemoryManager) const
 Diagnostic function to output the remaining tokens in the token queue. More...
 
void pushValueOnOpCodeMap (const OpCodeMapType::value_type &theValue)
 Push a value onto the operations code map. More...
 
void pushArgumentOnOpCodeMap (const XToken &theXToken)
 Push a token onto the token queue and its index onto the operations code map. More...
 
void pushArgumentOnOpCodeMap (const XalanDOMString &theString)
 Push a token onto the token queue and its index onto the operations code map. More...
 
void pushArgumentOnOpCodeMap (double theNumber, const XalanDOMString &theString)
 Push a token onto the token queue and its index onto the operations code map. More...
 
void pushNumberLiteralOnOpCodeMap (double theNumber)
 Push a number literal onto the vector of number literals and its index onto the operations code map. More...
 
double getNumberLiteral (int theIndex) const
 Get a number literal from the vector of number literals. More...
 
void pushCurrentTokenOnOpCodeMap ()
 Push the current position in the token queue onto the operations code map. More...
 
void setCurrentPattern (const XalanDOMString &thePattern)
 Change the current pattern in the pattern map. More...
 
const XalanDOMStringgetCurrentPattern () const
 Retrieve the current pattern in the pattern map. More...
 

Static Public Member Functions

static bool isNodeTestOpCode (OpCodeMapValueType theOpCode)
 Whether the operation code is one of the node test types, for example, "ancestor::" or "child::". More...
 

Detailed Description

Definition at line 58 of file XPathExpression.hpp.

Member Typedef Documentation

◆ NumberLiteralValueVectorType

Definition at line 72 of file XPathExpression.hpp.

◆ OpCodeMapDifferenceType

Definition at line 81 of file XPathExpression.hpp.

◆ OpCodeMapPositionType

Definition at line 77 of file XPathExpression.hpp.

◆ OpCodeMapSizeType

Definition at line 68 of file XPathExpression.hpp.

◆ OpCodeMapType

Definition at line 64 of file XPathExpression.hpp.

◆ OpCodeMapValueType

Definition at line 67 of file XPathExpression.hpp.

◆ OpCodeMapValueVectorType

Definition at line 70 of file XPathExpression.hpp.

◆ OstreamType

Definition at line 62 of file XPathExpression.hpp.

◆ TokenQueuePositionType

Definition at line 84 of file XPathExpression.hpp.

◆ TokenQueueSizeType

Definition at line 83 of file XPathExpression.hpp.

◆ TokenQueueType

Definition at line 65 of file XPathExpression.hpp.

◆ TokenQueueValueType

Definition at line 82 of file XPathExpression.hpp.

Member Enumeration Documentation

◆ eDummy

The length is always the opcode position + 1.

Length is always expressed as the opcode+length bytes, so it is always 2 or greater. This is the offset from the op code where the length is stored. It will always remain one.

Enumerator
s_opCodeMapLengthIndex 

Definition at line 712 of file XPathExpression.hpp.

◆ eOpCodes

List of operations codes.

Code for the descriptions of the operations codes: [UPPER CASE] indicates a literal value, [lower case] is a description of a value, ([length] always indicates the length of the operation, including the operations code and the length integer.) {UPPER CASE} indicates the given production, {description} is the description of a new production, (For instance, {boolean expression} means some expression that should be resolved to a boolean.)

  • means that it occurs zero or more times,
  • means that it occurs one or more times, ? means that it is optional.

returns: indicates what the production should return.

Enumerator
eELEMWILDCARD 

[ELEMWILDCARD] Means ELEMWILDCARD ("*"), used instead of string index in some places.

eEMPTY 

[EMPTY] Empty slot to indicate NULL.

eENDOP 

[ENDOP] Some operators may like to have a terminator.

eOP_XPATH 

[OP_XPATH] [length] {expression}

returns: XNodeSet XNumber XString XBoolean XRTree XObject

eOP_OR 

[OP_OR] [length] {boolean expression} {boolean expression}

returns: XBoolean

eOP_AND 

[OP_AND] [length] {boolean expression} {boolean expression}

returns: XBoolean

eOP_NOTEQUALS 

[OP_NOTEQUALS] [length] {expression} {expression}

returns: XBoolean

eOP_EQUALS 

[OP_EQUALS] [length] {expression} {expression}

returns: XBoolean

eOP_LTE 

[OP_LTE] (less-than-or-equals) [length] {number expression} {number expression}

returns: XBoolean

eOP_LT 

[OP_LT] (less-than) [length] {number expression} {number expression}

returns: XBoolean

eOP_GTE 

[OP_GTE] (greater-than-or-equals) [length] {number expression} {number expression}

returns: XBoolean

eOP_GT 

[OP_GT] (greater-than) [length] {number expression} {number expression}

returns: XBoolean

eOP_PLUS 

[OP_PLUS] [length] {number expression} {number expression}

returns: XNumber

eOP_MINUS 

[OP_MINUS] [length] {number expression} {number expression}

returns: XNumber

eOP_MULT 

[OP_MULT] [length] {number expression} {number expression}

returns: XNumber

eOP_DIV 

[OP_DIV] [length] {number expression} {number expression}

returns: XNumber

eOP_MOD 

[OP_MOD] [length] {number expression} {number expression}

returns: XNumber

eOP_NEG 

[OP_NEG] [length] {number expression}

returns: XNumber

eOP_BOOL 

[OP_BOOL] (cast operation) [length] {expression}

returns: XBoolean

eOP_UNION 

[OP_UNION] [length] {PathExpr}+

returns: XNodeSet

eOP_LITERAL 

[OP_LITERAL] [3] [index to token]

returns: XString

eOP_VARIABLE 

[OP_VARIABLE] [3] [index to token]

returns: XString

eOP_GROUP 

[OP_GROUP] [length] {expression}

returns: XNodeSet XNumber XString XBoolean XRTree XObject

eOP_NUMBERLIT 

OP_NUMBERLIT [3] [index to token]

returns: XString

eOP_ARGUMENT 

OP_ARGUMENT [length] {expression}

returns: XNodeSet XNumber XString XBoolean XRTree XObject

eOP_EXTFUNCTION 

OP_EXTFUNCTION [length] [index to namespace token] [index to function name token] {OP_ARGUMENT}*

returns: XNodeSet XNumber XString XBoolean XRTree XObject

eOP_FUNCTION 

[OP_FUNCTION] [length] [FUNC_ID] [arg count] {OP_ARGUMENT}* [ENDOP]

returns: XNodeSet XNumber XString XBoolean XRTree XObject

eOP_LOCATIONPATH 

[OP_LOCATIONPATH] [length] {FROM_stepType} | {function}{predicate}* [ENDOP]

(Note that element and attribute namespaces and names can be wildcarded '*'.)

returns: XNodeSet

eOP_PREDICATE 

[OP_PREDICATE] [length] {expression} [ENDOP] (For safety)

returns: XBoolean or XNumber

eNODETYPE_COMMENT 

[NODETYPE_COMMENT] No size or arguments.

returns: XBoolean

eNODETYPE_TEXT 

[NODETYPE_TEXT] No size or arguments.

returns: XBoolean

eNODETYPE_PI 

[NODETYPE_PI] [index to token]

returns: XBoolean

eNODETYPE_NODE 

[NODETYPE_NODE] No size or arguments.

returns: XBoolean

eNODENAME 

[NODENAME] [index to ns token or EMPTY] [index to name token]

returns: XBoolean

eNODETYPE_ROOT 

[NODETYPE_ROOT] No size or arguments.

returns: XBoolean

eNODETYPE_ANYELEMENT 

[NODETYPE_ANY] No size or arguments.

returns: XBoolean

eFROM_ANCESTORS 

[FROM_stepType] [length, including predicates] [length of just the step, without the predicates] {node test} {predicates}?

returns: XBoolean

eFROM_ANCESTORS_OR_SELF 
eFROM_ATTRIBUTES 
eFROM_CHILDREN 
eFROM_DESCENDANTS 
eFROM_DESCENDANTS_OR_SELF 
eFROM_FOLLOWING 
eFROM_FOLLOWING_SIBLINGS 
eFROM_PARENT 
eFROM_PRECEDING 
eFROM_PRECEDING_SIBLINGS 
eFROM_SELF 
eFROM_NAMESPACE 
eFROM_ROOT 
eOP_MATCHPATTERN 

[OP_UNION] [length] {PathExpr}+

returns: XNodeSet

eOP_LOCATIONPATHPATTERN 

[OP_UNION] [length] {PathExpr}+

returns: XNodeSet

eMATCH_ATTRIBUTE 
eMATCH_ANY_ANCESTOR 
eMATCH_IMMEDIATE_ANCESTOR 
eMATCH_ANY_ANCESTOR_WITH_PREDICATE 
eMATCH_ANY_ANCESTOR_WITH_FUNCTION_CALL 
eOP_PREDICATE_WITH_POSITION 

[OP_PREDICATE_WITH_POSITION] [length] {expression} [ENDOP] (For safety)

returns: XBoolean or XNumber

eOP_FUNCTION_POSITION 

These are values for intrinsic functions which have been compiled directly into the op map.

eOP_FUNCTION_LAST 
eOP_FUNCTION_COUNT 
eOP_FUNCTION_NOT 
eOP_FUNCTION_TRUE 
eOP_FUNCTION_FALSE 
eOP_FUNCTION_BOOLEAN 
eOP_FUNCTION_NAME_0 
eOP_FUNCTION_NAME_1 
eOP_FUNCTION_LOCALNAME_0 
eOP_FUNCTION_LOCALNAME_1 
eOP_FUNCTION_FLOOR 
eOP_FUNCTION_CEILING 
eOP_FUNCTION_ROUND 
eOP_FUNCTION_NUMBER_0 
eOP_FUNCTION_NUMBER_1 
eOP_FUNCTION_STRING_0 
eOP_FUNCTION_STRING_1 
eOP_FUNCTION_STRINGLENGTH_0 
eOP_FUNCTION_STRINGLENGTH_1 
eOP_FUNCTION_NAMESPACEURI_0 
eOP_FUNCTION_NAMESPACEURI_1 
eOP_FUNCTION_SUM 
eOP_FUNCTION_CONCAT 
eOpCodeNextAvailable 

Definition at line 104 of file XPathExpression.hpp.

◆ eRelativeDirection

Enumerator
eRelativeBackward 
eRelativeForward 

Definition at line 1159 of file XPathExpression.hpp.

Constructor & Destructor Documentation

◆ XPathExpression()

xalanc::XPathExpression::XPathExpression ( MemoryManager &  theManager)
explicit

◆ ~XPathExpression()

xalanc::XPathExpression::~XPathExpression ( )

Member Function Documentation

◆ appendOpCode() [1/2]

OpCodeMapSizeType xalanc::XPathExpression::appendOpCode ( eOpCodes  theOpCode)

Add an operation code to the list.

Parameters
theOpCodeoperation code
Returns
the position of the op code

◆ appendOpCode() [2/2]

OpCodeMapSizeType xalanc::XPathExpression::appendOpCode ( eOpCodes  theOpCode,
const OpCodeMapValueVectorType theArgs 
)
inline

Add an operation code with supplied arguments to the list.

Parameters
theOpCodeoperation code
theArgsvector or arguments to supply

Definition at line 960 of file XPathExpression.hpp.

◆ dumpOpCodeMap() [1/2]

void xalanc::XPathExpression::dumpOpCodeMap ( OstreamType theStream,
OpCodeMapSizeType  theStartPosition = 0 
) const

Diagnostic function to output the operation code map.

Parameters
theStreamoutput stream
theStartPositionstarting position in map

◆ dumpOpCodeMap() [2/2]

void xalanc::XPathExpression::dumpOpCodeMap ( PrintWriter thePrintWriter,
OpCodeMapSizeType  theStartPosition = 0 
) const

Diagnostic function to output the operation code map.

Parameters
thePrintWriteroutput device
theStartPositionstarting position in map

◆ dumpRemainingTokenQueue() [1/2]

void xalanc::XPathExpression::dumpRemainingTokenQueue ( OstreamType theStream,
MemoryManager &  theMemoryManager 
) const

Diagnostic function to output the remaining tokens in the token queue.

Parameters
theStreamThe output stream
theMemoryManagerThe MemoryManager instance.

◆ dumpRemainingTokenQueue() [2/2]

void xalanc::XPathExpression::dumpRemainingTokenQueue ( PrintWriter thePrintWriter) const

Diagnostic function to output the remaining tokens in the token queue.

Parameters
thePrintWriteroutput device

◆ dumpTokenQueue() [1/2]

void xalanc::XPathExpression::dumpTokenQueue ( OstreamType theStream,
TokenQueueSizeType  theStartPosition = 0 
) const

Diagnostic function to output the token queue.

Parameters
thePrintWriteroutput device
theStartPositionstarting position in token queue

◆ dumpTokenQueue() [2/2]

void xalanc::XPathExpression::dumpTokenQueue ( PrintWriter thePrintWriter,
TokenQueueSizeType  theStartPosition = 0 
) const

Diagnostic function to output the token queue.

Parameters
thePrintWriteroutput device
theStartPositionstarting position in token queue

◆ getCurrentPattern()

const XalanDOMString& xalanc::XPathExpression::getCurrentPattern ( ) const
inline

Retrieve the current pattern in the pattern map.

Returns
string for current match pattern

Definition at line 1439 of file XPathExpression.hpp.

◆ getInitialOpCodePosition()

OpCodeMapPositionType xalanc::XPathExpression::getInitialOpCodePosition ( ) const
inline

Definition at line 781 of file XPathExpression.hpp.

◆ getMemoryManager()

MemoryManager& xalanc::XPathExpression::getMemoryManager ( )
inline

Definition at line 723 of file XPathExpression.hpp.

◆ getNextOpCodePosition() [1/2]

OpCodeMapPositionType xalanc::XPathExpression::getNextOpCodePosition ( OpCodeMapPositionType  opPos) const
inline

Retrieve the position of the next operation code at a specified position in the list.

Parameters
opPosposition in list
Returns
position of next operation code

Definition at line 899 of file XPathExpression.hpp.

◆ getNextOpCodePosition() [2/2]

OpCodeMapSizeType xalanc::XPathExpression::getNextOpCodePosition ( OpCodeMapSizeType  theIndex) const
inline

Retrieve the position of the next operation code at a specified index in the list.

Parameters
theIndextheIndex in list
Returns
position of next operation code

Definition at line 916 of file XPathExpression.hpp.

◆ getNextToken()

const XToken* xalanc::XPathExpression::getNextToken ( )
inline

Retrieve the next token in the token queue.

Returns
pointer to XObject token

Definition at line 1129 of file XPathExpression.hpp.

◆ getNumberLiteral()

double xalanc::XPathExpression::getNumberLiteral ( int  theIndex) const
inline

Get a number literal from the vector of number literals.

Parameters
theIndexThe index of the desired value.

Definition at line 1407 of file XPathExpression.hpp.

◆ getOpCodeArgumentLength()

OpCodeMapValueType xalanc::XPathExpression::getOpCodeArgumentLength ( OpCodeMapPositionType  opPos) const
inline

Definition at line 861 of file XPathExpression.hpp.

◆ getOpCodeLengthFromOpMap() [1/2]

OpCodeMapValueType xalanc::XPathExpression::getOpCodeLengthFromOpMap ( OpCodeMapPositionType  opPos,
MemoryManager &  theManager 
) const

Retrieve the length of an operation code at a specified position in the op map.

Parameters
opPosposition in the op map
Returns
length of operation code

◆ getOpCodeLengthFromOpMap() [2/2]

OpCodeMapValueType xalanc::XPathExpression::getOpCodeLengthFromOpMap ( OpCodeMapSizeType  theIndex,
MemoryManager &  theManager 
) const

Retrieve the length of an operation code at a specified index in the op map.

Parameters
theIndexThe index in the op map
Returns
length of operation code

◆ getOpCodeMapValue() [1/2]

OpCodeMapValueType xalanc::XPathExpression::getOpCodeMapValue ( OpCodeMapPositionType  opPos) const
inline

Retrieve the value of an operation code at a specified position in the list.

Parameters
opPosposition in list
Returns
value of operation code

Definition at line 831 of file XPathExpression.hpp.

◆ getOpCodeMapValue() [2/2]

OpCodeMapValueType xalanc::XPathExpression::getOpCodeMapValue ( OpCodeMapSizeType  theIndex) const
inline

Retrieve the value of an operation code at a specified index in the op code map.

Parameters
theIndexThe index in list
Returns
value of operation code

Definition at line 815 of file XPathExpression.hpp.

◆ getPreviousToken()

const XToken* xalanc::XPathExpression::getPreviousToken ( )
inline

Retrieve the previous token in the token queue.

Returns
pointer to XObject token

Definition at line 1147 of file XPathExpression.hpp.

◆ getRelativeToken()

const XToken* xalanc::XPathExpression::getRelativeToken ( TokenQueuePositionType  theOffset,
eRelativeDirection  theDirection 
) const
inline

Retrieve a token at the specified offset relative to the current position in the token queue.

Parameters
theOffsetoffset from current position
theDirectionthe direction in which to move
Returns
pointer to XObject token

Definition at line 1174 of file XPathExpression.hpp.

◆ getToken()

const XToken* xalanc::XPathExpression::getToken ( TokenQueuePositionType  thePosition) const
inline

Retrieve a token at the specified position in the token queue.

Parameters
thePositionposition in queue
Returns
pointer to XObject token

Definition at line 1116 of file XPathExpression.hpp.

◆ getTokenPosition()

TokenQueueSizeType xalanc::XPathExpression::getTokenPosition ( ) const
inline

Retrieve the current position in the token queue.

Returns
position in queue

Definition at line 1095 of file XPathExpression.hpp.

◆ hasMoreTokens()

bool xalanc::XPathExpression::hasMoreTokens ( ) const
inline

Whether there are any more tokens in the token queue.

Returns
true if there are more tokens

Definition at line 1067 of file XPathExpression.hpp.

◆ insertOpCode()

OpCodeMapValueType xalanc::XPathExpression::insertOpCode ( eOpCodes  theOpCode,
OpCodeMapSizeType  theIndex 
)

Insert an operation code at a specified index in the list.

Parameters
theOpCodeoperation code
theIndexindex in list

◆ insertToken() [1/2]

void xalanc::XPathExpression::insertToken ( const XalanDOMString theToken)
inline

Insert a token onto the token queue at the current position.

Parameters
theTokenthe string value to push

Definition at line 1232 of file XPathExpression.hpp.

◆ insertToken() [2/2]

void xalanc::XPathExpression::insertToken ( double  theNumber,
const XalanDOMString theString 
)
inline

Insert a token onto the token queue at the current position.

Parameters
theNumberthe number value to push
theStringthe string value to push

Definition at line 1250 of file XPathExpression.hpp.

◆ isNodeTestOpCode()

static bool xalanc::XPathExpression::isNodeTestOpCode ( OpCodeMapValueType  theOpCode)
static

Whether the operation code is one of the node test types, for example, "ancestor::" or "child::".

Parameters
theOpCodeoperation code
Returns
true if code represents a node test

◆ isValidOpCodePosition() [1/2]

bool xalanc::XPathExpression::isValidOpCodePosition ( OpCodeMapPositionType  opPos) const
inline

Definition at line 791 of file XPathExpression.hpp.

◆ isValidOpCodePosition() [2/2]

bool xalanc::XPathExpression::isValidOpCodePosition ( OpCodeMapSizeType  theIndex) const
inline

Definition at line 802 of file XPathExpression.hpp.

◆ isValidTokenQueuePosition()

bool xalanc::XPathExpression::isValidTokenQueuePosition ( TokenQueueSizeType  thePosition) const
inline

Definition at line 1084 of file XPathExpression.hpp.

◆ opCodeMapLength()

OpCodeMapValueType xalanc::XPathExpression::opCodeMapLength ( ) const
inline

Retrieve length of the operations code map stored in the map.

The length of the entire map is stored after the first op code. That offset is determined by this const static member. Note that as expressions are defined recursively, this is really just the length of the first expression in the map, which is the top of the parse tree. Any subexpression will also have a length entry at the same offset from the beginning of the subexpression.

Returns
length of operations code map

Definition at line 762 of file XPathExpression.hpp.

◆ opCodeMapSize()

OpCodeMapSizeType xalanc::XPathExpression::opCodeMapSize ( ) const
inline

Retrieve number of elements in the operations code map.

Returns
size of operations code map

Definition at line 745 of file XPathExpression.hpp.

◆ pushArgumentOnOpCodeMap() [1/3]

void xalanc::XPathExpression::pushArgumentOnOpCodeMap ( const XalanDOMString theString)

Push a token onto the token queue and its index onto the operations code map.

Parameters
theStringThe string data for the token. The instance will keep a pointer to this string, so it must be persistent.

◆ pushArgumentOnOpCodeMap() [2/3]

void xalanc::XPathExpression::pushArgumentOnOpCodeMap ( const XToken theXToken)

Push a token onto the token queue and its index onto the operations code map.

Parameters
theXTokenthe XToken to push

◆ pushArgumentOnOpCodeMap() [3/3]

void xalanc::XPathExpression::pushArgumentOnOpCodeMap ( double  theNumber,
const XalanDOMString theString 
)

Push a token onto the token queue and its index onto the operations code map.

Parameters
theNumberThe numeric data for the token. This must be consistent with the lexical value in theString.
theStringThe string data for the token. The instance will keep a pointer to this string, so it must be persistent.

◆ pushCurrentTokenOnOpCodeMap()

void xalanc::XPathExpression::pushCurrentTokenOnOpCodeMap ( )

Push the current position in the token queue onto the operations code map.

◆ pushNumberLiteralOnOpCodeMap()

void xalanc::XPathExpression::pushNumberLiteralOnOpCodeMap ( double  theNumber)

Push a number literal onto the vector of number literals and its index onto the operations code map.

Parameters
theTokennumber value of the token to push

◆ pushToken() [1/2]

void xalanc::XPathExpression::pushToken ( const XalanDOMString theToken)
inline

Push a token onto the token queue.

Parameters
theTokenthe string value to push

Definition at line 1197 of file XPathExpression.hpp.

◆ pushToken() [2/2]

void xalanc::XPathExpression::pushToken ( double  theNumber,
const XalanDOMString theString 
)
inline

Push a token onto the token queue.

Parameters
theNumberthe number value to push
theStringthe string value to push

Definition at line 1214 of file XPathExpression.hpp.

◆ pushValueOnOpCodeMap()

void xalanc::XPathExpression::pushValueOnOpCodeMap ( const OpCodeMapType::value_type theValue)
inline

Push a value onto the operations code map.

Parameters
theTokenstring value of the token to push

Definition at line 1353 of file XPathExpression.hpp.

◆ replaceOpCode()

void xalanc::XPathExpression::replaceOpCode ( OpCodeMapSizeType  theIndex,
eOpCodes  theOldOpCode,
eOpCodes  theNewOpCode 
)

Replace an operation code with supplied code.

Parameters
theIndexThe index of the old operation code
theOldOpCodeThe old operation code
theNewOpCodeThe new operation code

◆ replaceRelativeToken()

void xalanc::XPathExpression::replaceRelativeToken ( TokenQueuePositionType  theOffset,
eRelativeDirection  theDirection,
const XalanDOMString theString 
)
inline

Replace a token in the token queue.

Parameters
theOffsetthe offset at which to replace the token.
theStringThe string data for the token. The instance will keep a pointer to this string, so it must be persistent.

Definition at line 1269 of file XPathExpression.hpp.

◆ reset()

void xalanc::XPathExpression::reset ( )

Reset the expression.

◆ resetTokenPosition()

void xalanc::XPathExpression::resetTokenPosition ( )
inline

Set the current position in the token queue to zero.

Definition at line 1104 of file XPathExpression.hpp.

◆ setCurrentPattern()

void xalanc::XPathExpression::setCurrentPattern ( const XalanDOMString thePattern)
inline

Change the current pattern in the pattern map.

Parameters
thePatternmatch pattern to make current

Definition at line 1428 of file XPathExpression.hpp.

◆ setOpCodeArgs()

void xalanc::XPathExpression::setOpCodeArgs ( eOpCodes  theOpCode,
OpCodeMapSizeType  theIndex,
const OpCodeMapValueVectorType theArgs 
)

Set the arguments for an operation code at a specified index in the list.

Parameters
opPosposition in list
theOpCodeoperation code
theIndexindex in list
theArgsvector or arguments to supply

◆ setOpCodeMapValue()

void xalanc::XPathExpression::setOpCodeMapValue ( OpCodeMapSizeType  theOpCodeMapIndex,
const OpCodeMapValueType theValue 
)
inline

Set the value of an operation code at a specified index in the OpCode map.

Parameters
theOpCodeMapIndexThe index in the OpCode map
theValuevalue of operation code

Definition at line 851 of file XPathExpression.hpp.

◆ shrink()

void xalanc::XPathExpression::shrink ( )

Shrink internal tables.

◆ tokenQueueSize()

TokenQueueSizeType xalanc::XPathExpression::tokenQueueSize ( ) const
inline

Retrieve number of elements in the token queue.

Returns
size of token queue

Definition at line 1078 of file XPathExpression.hpp.

◆ updateOpCodeLength() [1/2]

void xalanc::XPathExpression::updateOpCodeLength ( OpCodeMapSizeType  theIndex)
inline

Update the length of an operation code at a specified index in the list.

This presumes that the other opcodes have been appended to the expression, and that the specified op code's length needs to be set. The size includes the normal length of the opcode, plus the length of its subexpressions.

Parameters
theIndexindex in list

Definition at line 1007 of file XPathExpression.hpp.

◆ updateOpCodeLength() [2/2]

void xalanc::XPathExpression::updateOpCodeLength ( OpCodeMapValueType  theOpCode,
OpCodeMapSizeType  theIndex 
)

Update the length of an operation code at a specified index in the list.

This presumes that the other opcodes have been appended to the expression, and that the specified op code's length needs to be set. The size includes the normal length of the opcode, plus the length of its subexpressions.

Parameters
theOpCodeoperation code at specified index
theIndexindex in list

◆ updateOpCodeLengthAfterNodeTest()

void xalanc::XPathExpression::updateOpCodeLengthAfterNodeTest ( OpCodeMapSizeType  theIndex)

Update the length of an operation code after a node test code.

Parameters
theIndexindex in list

◆ updateShiftedOpCodeLength()

void xalanc::XPathExpression::updateShiftedOpCodeLength ( OpCodeMapValueType  theOpCode,
OpCodeMapSizeType  theOriginalIndex,
OpCodeMapSizeType  theNewIndex 
)

Update the length of an operation code that has moved to a new index in the list.

Parameters
theOpCodeoperation code
theOriginalIndexoriginal index in list
theNewIndexnew index in list

The documentation for this class was generated from the following file: