Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.11


Classes | Public Types | Public Member Functions | Static Public Member Functions

XPathExpression Class Reference

#include <XPathExpression.hpp>

Collaboration diagram for XPathExpression:
Collaboration graph
[legend]

List of all members.

Classes

Public Types

Public Member Functions

Static Public Member Functions


Detailed Description

Definition at line 62 of file XPathExpression.hpp.


Member Typedef Documentation

Definition at line 76 of file XPathExpression.hpp.

Definition at line 85 of file XPathExpression.hpp.

Definition at line 81 of file XPathExpression.hpp.

Definition at line 72 of file XPathExpression.hpp.

Definition at line 68 of file XPathExpression.hpp.

Definition at line 71 of file XPathExpression.hpp.

Definition at line 74 of file XPathExpression.hpp.

typedef XALAN_STD_QUALIFIER ostream XPathExpression::OstreamType

Definition at line 66 of file XPathExpression.hpp.

Definition at line 88 of file XPathExpression.hpp.

Definition at line 87 of file XPathExpression.hpp.

Definition at line 69 of file XPathExpression.hpp.

Definition at line 86 of file XPathExpression.hpp.


Member Enumeration Documentation

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 719 of file XPathExpression.hpp.

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] (Number literal.

) [3] [index to token]

returns: XString

eOP_ARGUMENT 

[OP_ARGUMENT] (Function argument.

) [length] {expression}

returns: XNodeSet XNumber XString XBoolean XRTree XObject

eOP_EXTFUNCTION 

[OP_EXTFUNCTION] (Extension function.

) [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 108 of file XPathExpression.hpp.

Enumerator:
eRelativeBackward 
eRelativeForward 

Definition at line 1167 of file XPathExpression.hpp.


Constructor & Destructor Documentation

XPathExpression::XPathExpression ( MemoryManager &  theManager  )  [explicit]
XPathExpression::~XPathExpression (  ) 

Member Function Documentation

OpCodeMapSizeType XPathExpression::appendOpCode ( eOpCodes  theOpCode  ) 

Add an operation code to the list.

Parameters:
theOpCode operation code
Returns:
the position of the op code
OpCodeMapSizeType XPathExpression::appendOpCode ( eOpCodes  theOpCode,
const OpCodeMapValueVectorType theArgs 
) [inline]

Add an operation code with supplied arguments to the list.

Parameters:
theOpCode operation code
theArgs vector or arguments to supply

Definition at line 968 of file XPathExpression.hpp.

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

Diagnostic function to output the operation code map.

Parameters:
thePrintWriter output device
theStartPosition starting position in map
void XPathExpression::dumpOpCodeMap ( OstreamType theStream,
OpCodeMapSizeType  theStartPosition = 0 
) const

Diagnostic function to output the operation code map.

Parameters:
theStream output stream
theStartPosition starting position in map
void XPathExpression::dumpRemainingTokenQueue ( PrintWriter thePrintWriter  )  const

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

Parameters:
thePrintWriter output device
void XPathExpression::dumpRemainingTokenQueue ( OstreamType theStream,
MemoryManager &  theMemoryManager 
) const

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

Parameters:
theStream The output stream
theMemoryManager The MemoryManager instance.
void XPathExpression::dumpTokenQueue ( PrintWriter thePrintWriter,
TokenQueueSizeType  theStartPosition = 0 
) const

Diagnostic function to output the token queue.

Parameters:
thePrintWriter output device
theStartPosition starting position in token queue
void XPathExpression::dumpTokenQueue ( OstreamType theStream,
TokenQueueSizeType  theStartPosition = 0 
) const

Diagnostic function to output the token queue.

Parameters:
thePrintWriter output device
theStartPosition starting position in token queue
const XalanDOMString& XPathExpression::getCurrentPattern (  )  const [inline]

Retrieve the current pattern in the pattern map.

Returns:
string for current match pattern

Definition at line 1447 of file XPathExpression.hpp.

OpCodeMapPositionType XPathExpression::getInitialOpCodePosition (  )  const [inline]

Definition at line 789 of file XPathExpression.hpp.

MemoryManager& XPathExpression::getMemoryManager (  )  [inline]

Definition at line 731 of file XPathExpression.hpp.

OpCodeMapSizeType XPathExpression::getNextOpCodePosition ( OpCodeMapSizeType  theIndex  )  const [inline]

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

Parameters:
theIndex theIndex in list
Returns:
position of next operation code

Definition at line 924 of file XPathExpression.hpp.

OpCodeMapPositionType XPathExpression::getNextOpCodePosition ( OpCodeMapPositionType  opPos  )  const [inline]

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

Parameters:
opPos position in list
Returns:
position of next operation code

Definition at line 907 of file XPathExpression.hpp.

const XToken* XPathExpression::getNextToken (  )  [inline]

Retrieve the next token in the token queue.

Returns:
pointer to XObject token

Definition at line 1137 of file XPathExpression.hpp.

double XPathExpression::getNumberLiteral ( int  theIndex  )  const [inline]

Get a number literal from the vector of number literals.

Parameters:
theIndex The index of the desired value.

Definition at line 1415 of file XPathExpression.hpp.

OpCodeMapValueType XPathExpression::getOpCodeArgumentLength ( OpCodeMapPositionType  opPos  )  const [inline]

Definition at line 869 of file XPathExpression.hpp.

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

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

Parameters:
opPos position in the op map
Returns:
length of operation code
OpCodeMapValueType XPathExpression::getOpCodeLengthFromOpMap ( OpCodeMapSizeType  theIndex,
MemoryManager &  theManager 
) const

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

Parameters:
theIndex The index in the op map
Returns:
length of operation code
OpCodeMapValueType XPathExpression::getOpCodeMapValue ( OpCodeMapSizeType  theIndex  )  const [inline]

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

Parameters:
theIndex The index in list
Returns:
value of operation code

Definition at line 823 of file XPathExpression.hpp.

OpCodeMapValueType XPathExpression::getOpCodeMapValue ( OpCodeMapPositionType  opPos  )  const [inline]

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

Parameters:
opPos position in list
Returns:
value of operation code

Definition at line 839 of file XPathExpression.hpp.

const XToken* XPathExpression::getPreviousToken (  )  [inline]

Retrieve the previous token in the token queue.

Returns:
pointer to XObject token

Definition at line 1155 of file XPathExpression.hpp.

const XToken* 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:
theOffset offset from current position
theDirection the direction in which to move
Returns:
pointer to XObject token

Definition at line 1182 of file XPathExpression.hpp.

const XToken* XPathExpression::getToken ( TokenQueuePositionType  thePosition  )  const [inline]

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

Parameters:
thePosition position in queue
Returns:
pointer to XObject token

Definition at line 1124 of file XPathExpression.hpp.

TokenQueueSizeType XPathExpression::getTokenPosition (  )  const [inline]

Retrieve the current position in the token queue.

Returns:
position in queue

Definition at line 1103 of file XPathExpression.hpp.

bool XPathExpression::hasMoreTokens (  )  const [inline]

Whether there are any more tokens in the token queue.

Returns:
true if there are more tokens

Definition at line 1075 of file XPathExpression.hpp.

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

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

Parameters:
theOpCode operation code
theIndex index in list
void XPathExpression::insertToken ( const XalanDOMString theToken  )  [inline]

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

Parameters:
theToken the string value to push

Definition at line 1240 of file XPathExpression.hpp.

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

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

Parameters:
theNumber the number value to push
theString the string value to push

Definition at line 1258 of file XPathExpression.hpp.

static bool XPathExpression::isNodeTestOpCode ( OpCodeMapValueType  theOpCode  )  [static]

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

Parameters:
theOpCode operation code
Returns:
true if code represents a node test
bool XPathExpression::isValidOpCodePosition ( OpCodeMapSizeType  theIndex  )  const [inline]

Definition at line 810 of file XPathExpression.hpp.

bool XPathExpression::isValidOpCodePosition ( OpCodeMapPositionType  opPos  )  const [inline]

Definition at line 799 of file XPathExpression.hpp.

bool XPathExpression::isValidTokenQueuePosition ( TokenQueueSizeType  thePosition  )  const [inline]

Definition at line 1092 of file XPathExpression.hpp.

OpCodeMapValueType 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 770 of file XPathExpression.hpp.

OpCodeMapSizeType XPathExpression::opCodeMapSize (  )  const [inline]

Retrieve number of elements in the operations code map.

Returns:
size of operations code map

Definition at line 753 of file XPathExpression.hpp.

void XPathExpression::pushArgumentOnOpCodeMap ( const XalanDOMString theString  ) 

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

Parameters:
theString The string data for the token. The instance will keep a pointer to this string, so it must be persistent.
void XPathExpression::pushArgumentOnOpCodeMap ( const XToken theXToken  ) 

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

Parameters:
theXToken the XToken to push
void XPathExpression::pushArgumentOnOpCodeMap ( double  theNumber,
const XalanDOMString theString 
)

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

Parameters:
theNumber The numeric data for the token. This must be consistent with the lexical value in theString.
theString The string data for the token. The instance will keep a pointer to this string, so it must be persistent.
void XPathExpression::pushCurrentTokenOnOpCodeMap (  ) 

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

void XPathExpression::pushNumberLiteralOnOpCodeMap ( double  theNumber  ) 

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

Parameters:
theToken number value of the token to push
void XPathExpression::pushToken ( const XalanDOMString theToken  )  [inline]

Push a token onto the token queue.

Parameters:
theToken the string value to push

Definition at line 1205 of file XPathExpression.hpp.

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

Push a token onto the token queue.

Parameters:
theNumber the number value to push
theString the string value to push

Definition at line 1222 of file XPathExpression.hpp.

void XPathExpression::pushValueOnOpCodeMap ( const OpCodeMapType::value_type theValue  )  [inline]

Push a value onto the operations code map.

Parameters:
theToken string value of the token to push

Definition at line 1361 of file XPathExpression.hpp.

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

Replace an operation code with supplied code.

Parameters:
theIndex The index of the old operation code
theOldOpCode The old operation code
theNewOpCode The new operation code
void XPathExpression::replaceRelativeToken ( TokenQueuePositionType  theOffset,
eRelativeDirection  theDirection,
const XalanDOMString theString 
) [inline]

Replace a token in the token queue.

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

Definition at line 1277 of file XPathExpression.hpp.

void XPathExpression::reset (  ) 

Reset the expression.

void XPathExpression::resetTokenPosition (  )  [inline]

Set the current position in the token queue to zero.

Definition at line 1112 of file XPathExpression.hpp.

void XPathExpression::setCurrentPattern ( const XalanDOMString thePattern  )  [inline]

Change the current pattern in the pattern map.

Parameters:
thePattern match pattern to make current

Definition at line 1436 of file XPathExpression.hpp.

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

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

Parameters:
opPos position in list
theOpCode operation code
theIndex index in list
theArgs vector or arguments to supply
void XPathExpression::setOpCodeMapValue ( OpCodeMapSizeType  theOpCodeMapIndex,
const OpCodeMapValueType theValue 
) [inline]

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

Parameters:
theOpCodeMapIndex The index in the OpCode map
theValue value of operation code

Definition at line 859 of file XPathExpression.hpp.

void XPathExpression::shrink (  ) 

Shrink internal tables.

TokenQueueSizeType XPathExpression::tokenQueueSize (  )  const [inline]

Retrieve number of elements in the token queue.

Returns:
size of token queue

Definition at line 1086 of file XPathExpression.hpp.

void 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:
theIndex index in list

Definition at line 1015 of file XPathExpression.hpp.

void 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:
theOpCode operation code at specified index
theIndex index in list
void XPathExpression::updateOpCodeLengthAfterNodeTest ( OpCodeMapSizeType  theIndex  ) 

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

Parameters:
theIndex index in list
void 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:
theOpCode operation code
theOriginalIndex original index in list
theNewIndex new index in list

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

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.

Apache Logo