#include <XPathExpression.hpp>
Collaboration diagram for XPathExpression:
|
|
|
|
|
|
|
|
|
|
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.
|
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.
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}. |
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}. |
eOP_NUMBERLIT |
[OP_NUMBERLIT] (Number literal.) [3] [index to token].
returns: XString |
eOP_ARGUMENT | [OP_ARGUMENT] (Function argument.) [length] {expression}. |
eOP_EXTFUNCTION | [OP_EXTFUNCTION] (Extension function.) [length] [index to namespace token] [index to function name token] {OP_ARGUMENT}*. |
eOP_FUNCTION | [OP_FUNCTION] [length] [FUNC_ID] [arg count] {OP_ARGUMENT}* [ENDOP]. |
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). |
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). |
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 |
|
|
|
Add an operation code with supplied arguments to the list.
theOpCode | operation code |
theArgs | vector or arguments to supply |
|
Add an operation code to the list.
theOpCode | operation code |
|
Diagnostic function to output the operation code map.
theStream | output stream |
theStartPosition | starting position in map |
|
Diagnostic function to output the operation code map.
thePrintWriter | output device |
theStartPosition | starting position in map |
|
Diagnostic function to output the remaining tokens in the token queue.
theStream | The output stream |
|
Diagnostic function to output the remaining tokens in the token queue.
thePrintWriter | output device |
|
Diagnostic function to output the token queue.
thePrintWriter | output device |
theStartPosition | starting position in token queue |
|
Diagnostic function to output the token queue.
thePrintWriter | output device |
theStartPosition | starting position in token queue |
|
Retrieve the current pattern in the pattern map.
|
Retrieve the position of the next operation code at a specified position in the list.
opPos | position in list |
|
|
Get a number literal from the vector of number literals.
theIndex | The index of the desired value. |
|
|
Retrieve the length of an operation code at a specified position in the op map.
opPos | position in the op map |
|
Retrieve the value of an operation code at a specified position in the list.
opPos | position in list |
|
|
Retrieve a token at the specified offset relative to the current position in the token queue.
theOffset | offset from current position |
|
Retrieve a token at the specified position in the token queue.
thePosition | position in queue |
|
Retrieve the current position in the token queue.
|
Whether there are any more tokens in the token queue.
|
Insert an operation code at a specified index in the list.
theOpCode | operation code |
theIndex | index in list |
|
Insert a token onto the token queue at the current position.
theNumber | the number value to push |
theString | the string value to push |
|
Insert a token onto the token queue at the current position.
theToken | the string value to push |
|
Whether the operation code is one of the node test types, for example, "ancestor::" or "child::".
theOpCode | operation code |
|
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.
|
Retrieve number of elements in the operations code map.
|
Push a token onto the token queue and its index onto the operations code map.
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 point to this string, so it must be persistent. |
|
Push a token onto the token queue and its index onto the operations code map.
theString | The string data for the token. The instance will keep a point to this string, so it must be persistent. |
|
Push a token onto the token queue and its index onto the operations code map.
theXToken | the XToken to push |
|
Push the current position in the token queue onto the operations code map.
|
Push a number literal onto the vector of number literals and its index onto the operations code map.
theToken | number value of the token to push |
|
Push a token onto the token queue.
theNumber | the number value to push |
theString | the string value to push |
|
Push a token onto the token queue.
theToken | the string value to push |
|
Push a value onto the operations code map.
theToken | string value of the token to push |
|
Replace an operation code with supplied code.
theIndex | The index of the old operation code |
theOldOpCode | The old operation code |
theNewOpCode | The new operation code |
|
Replace a token in the token queue.
theOffset | the offset at which to replace the token. |
theString | The string data for the token. The instance will keep a point to this string, so it must be persistent. |
|
Replace a token in the token queue.
theOffset | the offset at which to replace the token. |
theToken | The new token |
|
Reset the expression.
|
Set the current position in the token queue to zero.
|
Change the current pattern in the pattern map.
thePattern | match pattern to make current |
|
Set the arguments for an operation code at a specified index in the list.
opPos | position in list |
theOpCode | operation code |
theIndex | index in list |
theArgs | vector or arguments to supply |
|
Set the current position in the token queue to a specified value.
thePosition | value of position to set |
|
Set the current position in the token queue to a specified value.
thePosition | value of position to set |
|
Shrink internal tables.
|
Retrieve number of elements in the token queue.
|
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.
theOpCode | operation code at specified index |
theIndex | index in list |
|
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.
theIndex | index in list |
|
Update the length of an operation code after a node test code.
theIndex | index in list |
|
Update the length of an operation code that has moved to a new index in the list.
theOpCode | operation code |
theOriginalIndex | original index in list |
theNewIndex | new index in list |
|
The current pattern string, for diagnostics purposes.
|
The current position in the token queue.
|
The index of the last opcode that was appended or inserted.
|
An operations map is used instead of a proper parse tree.
It contains operations codes and indexes into the m_tokenQueue. We use an array instead of a full parse tree in order to cut down on the number of objects created.
|
The queue of used tokens.
The current token is the token at the end of the m_tokenQueue. The idea is that the queue can be marked and a sequence of tokens can be reused.
The documentation for this class was generated from the following file:
Doxygen and GraphViz are used to generate this API documentation from the Xalan-C header files.
![]() |
Xalan-C++ XSLT Processor Version 1.7 |
|