summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 91c9ca3)
raw | patch | inline | side by side (parent: 91c9ca3)
| author | ishmal <ishmal@users.sourceforge.net> | |
| Sun, 30 Apr 2006 00:34:33 +0000 (00:34 +0000) | ||
| committer | ishmal <ishmal@users.sourceforge.net> | |
| Sun, 30 Apr 2006 00:34:33 +0000 (00:34 +0000) |
| src/dom/dom.h | patch | blob | history | |
| src/dom/xpathparser.cpp | patch | blob | history | |
| src/dom/xpathtoken.cpp | patch | blob | history | |
| src/dom/xpathtoken.h | patch | blob | history |
diff --git a/src/dom/dom.h b/src/dom/dom.h
index ab82c429819a95d7f555d3c1ce50e940df9b4426..6741d375dbc5916bc62700348d476f557b828f6b 100644 (file)
--- a/src/dom/dom.h
+++ b/src/dom/dom.h
*/
virtual ~NodeList() {}
+ /**
+ *
+ */
+ virtual void clear()
+ {
+ nodes.clear();
+ }
+
protected:
friend class NodeImpl;
index 47a9a146af80c3f7fe875ef2c2d05d7f77d3f20b..cc6488eed5276b514c6ea9aaf06e88933396c9c9 100644 (file)
--- a/src/dom/xpathparser.cpp
+++ b/src/dom/xpathparser.cpp
if (t.getType() == OPERATOR && t.getIntValue()==DOUBLE_SLASH)\r
{\r
p++;\r
+ // a '//' is an abbreviation for /descendant-or-self:node()/\r
+ tokAdd(new TokAxisDescendantOrSelf());\r
p2 = getRelativeLocationPath(p, depth+1);\r
if (p2 < 0)\r
{\r
tokens.dump();\r
\r
//### Execute the token list\r
- list = tokens.execute(root);\r
+ TokenExecutor executor;\r
+ list = executor.execute(tokens, root);\r
\r
return list;\r
}\r
diff --git a/src/dom/xpathtoken.cpp b/src/dom/xpathtoken.cpp
index 5de011959ee8d5403b7d1c03904ca59cdce3e81a..c9d4898d78a723e9705b52e483b2077ef17ba59f 100644 (file)
--- a/src/dom/xpathtoken.cpp
+++ b/src/dom/xpathtoken.cpp
\r
\r
/**\r
- * Return the enumerated TokenType of this token\r
+ * Return the string TokenType of this token\r
* (in the .cpp file)\r
*/\r
DOMString Token::getTypeString()\r
{\r
- DOMString ret;\r
+ DOMString ret = "unknown";\r
for (TokenStringPair *pair = tokenStrings ; pair->sval ; pair++)\r
{\r
if (pair->ival == type)\r
return ret;\r
}\r
\r
+\r
+\r
//########################################################################\r
-//# X P A T H S T A C K I T E M\r
+//# X P A T H A X I S\r
//########################################################################\r
\r
/**\r
*\r
*/\r
-StackItem::StackItem()\r
+Axis::Axis()\r
{\r
- ival = 0L;\r
- dval = 0.0;\r
+ init();\r
}\r
\r
\r
/**\r
*\r
*/\r
-StackItem::StackItem(const StackItem &other)\r
+Axis::Axis(int tokPos)\r
+{\r
+ init();\r
+ tokenPosition = tokPos;\r
+}\r
+\r
+\r
+/**\r
+ *\r
+ */\r
+Axis::Axis(const Axis &other)\r
{\r
+ init();\r
assign(other);\r
}\r
\r
/**\r
*\r
*/\r
-StackItem::~StackItem()\r
+Axis::~Axis()\r
{\r
}\r
\r
/**\r
*\r
*/\r
-StackItem &StackItem::operator=(const StackItem &other)\r
+Axis &Axis::operator=(const Axis &other)\r
{\r
assign(other);\r
return *this;\r
/**\r
*\r
*/\r
-void StackItem::assign(const StackItem &other)\r
+void Axis::init()\r
{\r
- sval = other.sval;\r
- ival = other.ival;\r
- dval = other.dval;\r
+ tokenPosition = 0;\r
}\r
\r
-\r
-//########################################################################\r
-//# X P A T H S T A C K\r
-//########################################################################\r
-\r
/**\r
*\r
*/\r
-Stack::Stack()\r
+void Axis::assign(const Axis &other)\r
{\r
- size = 0;\r
+ tokenPosition = other.tokenPosition;\r
}\r
\r
-\r
/**\r
*\r
*/\r
-Stack::Stack(const Stack &other)\r
+void Axis::setPosition(unsigned int val)\r
{\r
- assign(other);\r
+ tokenPosition = val;\r
}\r
\r
-\r
/**\r
*\r
*/\r
-Stack::~Stack()\r
+unsigned int Axis::getPosition()\r
{\r
+ return tokenPosition;\r
}\r
\r
-\r
/**\r
*\r
*/\r
-void Stack::assign(const Stack &other)\r
+void Axis::setNode(const Node *val)\r
{\r
- root = other.root;\r
- nodeList = other.nodeList;\r
- size = other.size;\r
- for (int i=0 ; i<size ; i++)\r
- items[i] = other.items[i];\r
+ node = (Node *)val;\r
}\r
\r
-\r
/**\r
*\r
*/\r
-void Stack::reset()\r
+Node *Axis::getNode()\r
{\r
- root = NULL;\r
- NodeList n; /*no "clear" in api*/\r
- nodeList = n;\r
- size = 0;\r
+ return node;\r
}\r
\r
+//########################################################################\r
+//# X P A T H S T A C K I T E M\r
+//########################################################################\r
\r
+/**\r
+ *\r
+ */\r
+StackItem::StackItem()\r
+{\r
+ ival = 0L;\r
+ dval = 0.0;\r
+}\r
\r
\r
/**\r
*\r
*/\r
-void Stack::push(StackItem &item)\r
+StackItem::StackItem(const StackItem &other)\r
{\r
- if (size>=STACK_SIZE)\r
- {\r
- return;\r
- }\r
- items[size++] = item;\r
+ assign(other);\r
}\r
\r
+\r
/**\r
*\r
*/\r
-StackItem Stack::pop()\r
+StackItem::~StackItem()\r
{\r
- if (size<1)\r
- {\r
- StackItem item;\r
- return item;\r
- }\r
- return items[--size];\r
}\r
\r
+\r
/**\r
- * Set the root node\r
+ *\r
*/\r
-void Stack::setRootNode(const Node *node)\r
+StackItem &StackItem::operator=(const StackItem &other)\r
{\r
- root = (Node *)node;\r
+ assign(other);\r
+ return *this;\r
}\r
\r
-\r
/**\r
- * Get the current node list;\r
+ *\r
*/\r
-NodeList &Stack::getNodeList()\r
+void StackItem::assign(const StackItem &other)\r
{\r
- return nodeList;\r
+ sval = other.sval;\r
+ ival = other.ival;\r
+ dval = other.dval;\r
}\r
\r
\r
tokens.push_back(tok);\r
}\r
\r
+\r
/**\r
- * This method "executes" a list of Tokens in the context of a DOM root\r
- * Node, returning a list of Nodes that match the xpath expression.\r
+ *\r
*/\r
-NodeList TokenList::execute(const Node *root)\r
+unsigned int TokenList::size() const\r
{\r
- NodeList list;\r
-\r
- if (!root)\r
- return list;\r
+ return (unsigned int)tokens.size();\r
+}\r
\r
- Stack stack;\r
- stack.setRootNode(root);\r
\r
- //### Execute the token list\r
+/**\r
+ *\r
+ */\r
+void TokenList::dump()\r
+{\r
std::vector<Token *>::iterator iter;\r
+ printf("############# TOKENS\n");\r
for (iter = tokens.begin() ; iter != tokens.end() ; iter++)\r
{\r
Token *tok = *iter;\r
- tok->execute(stack);\r
+ tok->dump();\r
}\r
+}\r
\r
- list = stack.getNodeList();\r
\r
- return list;\r
+//########################################################################\r
+//# X P A T H E X E C U T O R\r
+//########################################################################\r
+\r
+/**\r
+ *\r
+ */\r
+TokenExecutor::TokenExecutor()\r
+{\r
+ reset();\r
}\r
\r
\r
/**\r
*\r
*/\r
-void TokenList::dump()\r
+TokenExecutor::TokenExecutor(const TokenExecutor &other)\r
{\r
- std::vector<Token *>::iterator iter;\r
- printf("############# TOKENS\n");\r
- for (iter = tokens.begin() ; iter != tokens.end() ; iter++)\r
+ reset();\r
+ assign(other);\r
+}\r
+\r
+\r
+/**\r
+ *\r
+ */\r
+TokenExecutor::~TokenExecutor()\r
+{\r
+}\r
+\r
+\r
+/**\r
+ *\r
+ */\r
+void TokenExecutor::assign(const TokenExecutor &other)\r
+{\r
+ axis = other.axis;\r
+ axisStack = other.axisStack;\r
+ stackSize = other.stackSize;\r
+ for (int i=0 ; i<stackSize ; i++)\r
+ stack[i] = other.stack[i];\r
+}\r
+\r
+\r
+/**\r
+ *\r
+ */\r
+void TokenExecutor::reset()\r
+{\r
+ axis.setPosition(0);\r
+ axis.setNode(NULL);\r
+ stackSize = 0;\r
+}\r
+\r
+\r
+\r
+\r
+/**\r
+ * Set the root node\r
+ */\r
+NodeList TokenExecutor::execute(const TokenList &tokens, const Node *node)\r
+{\r
+\r
+ axis.setPosition(0);\r
+ axis.setNode(node);\r
+\r
+ nodeList.clear();\r
+\r
+ while (axis.getPosition() < tokens.size())\r
{\r
- Token *tok = *iter;\r
- tok->dump();\r
}\r
+\r
+ return nodeList;\r
+}\r
+\r
+\r
+\r
+\r
+\r
+/**\r
+ *\r
+ */\r
+void TokenExecutor::push(StackItem &item)\r
+{\r
+ if (stackSize>=STACK_SIZE)\r
+ {\r
+ return;\r
+ }\r
+ stack[stackSize++] = item;\r
}\r
\r
+/**\r
+ *\r
+ */\r
+StackItem TokenExecutor::pop()\r
+{\r
+ if (stackSize<1)\r
+ {\r
+ StackItem item;\r
+ return item;\r
+ }\r
+ return stack[--stackSize];\r
+}\r
+\r
+\r
+\r
+\r
+\r
+\r
\r
\r
\r
diff --git a/src/dom/xpathtoken.h b/src/dom/xpathtoken.h
index 8961f80aa92809ce7620cb6dc4aec0c2ba4bb2e8..d595ad43c7aac9a3d4833607a954778064e91c14 100644 (file)
--- a/src/dom/xpathtoken.h
+++ b/src/dom/xpathtoken.h
\r
typedef org::w3c::dom::DOMString DOMString;\r
\r
+class Axis\r
+{\r
+public:\r
+ /**\r
+ * Constructor\r
+ */\r
+ Axis();\r
+\r
+ /**\r
+ * Constructor\r
+ */\r
+ Axis(int tokPos);\r
+\r
+ /**\r
+ * Copy constructor\r
+ */\r
+ Axis(const Axis &other);\r
+\r
+ /**\r
+ * Destructor\r
+ */\r
+ virtual ~Axis();\r
+\r
+ /**\r
+ *\r
+ */\r
+ Axis &operator=(const Axis &other);\r
+\r
+ /**\r
+ *\r
+ */\r
+ void init();\r
+\r
+ /**\r
+ *\r
+ */\r
+ void assign(const Axis &other);\r
+\r
+ /**\r
+ *\r
+ */\r
+ void setPosition(unsigned int val);\r
+\r
+ /**\r
+ *\r
+ */\r
+ unsigned int getPosition();\r
+\r
+ /**\r
+ *\r
+ */\r
+ void setNode(const Node *node);\r
+\r
+ /**\r
+ *\r
+ */\r
+ Node *getNode();\r
+\r
+private:\r
+\r
+ int tokenPosition;\r
+\r
+ Node *node;\r
+};\r
+\r
+\r
/**\r
* This represents a single value on the evaluation stack\r
*/\r
\r
};\r
\r
+class TokenList;\r
+\r
+//########################################################################\r
+//# T O K E N E X E C U T O R\r
+//########################################################################\r
+\r
#define STACK_SIZE 1024\r
\r
/**\r
- * An evaluation stack\r
+ * A token evaluator, with stack and axis context\r
*/\r
-class Stack\r
+class TokenExecutor\r
{\r
public:\r
\r
/**\r
* Constructor\r
*/\r
- Stack();\r
+ TokenExecutor();\r
\r
/**\r
* Copy constructor\r
*/\r
- Stack(const Stack &other);\r
+ TokenExecutor(const TokenExecutor &other);\r
\r
/**\r
* Destructor\r
*/\r
- virtual ~Stack();\r
+ virtual ~TokenExecutor();\r
\r
/**\r
* Assign our values to those of the other\r
*/\r
- virtual void assign(const Stack &other);\r
+ virtual void assign(const TokenExecutor &other);\r
\r
/**\r
* Reset the stack to its original settings\r
virtual StackItem pop();\r
\r
/**\r
- * Set the root node\r
+ * Execute a token list on the stack\r
*/\r
- virtual void setRootNode(const Node *node);\r
+ NodeList execute(const TokenList &list, const Node *node);\r
\r
/**\r
- * Get the current node list;\r
+ *\r
*/\r
- virtual NodeList &getNodeList();\r
+ Axis axis;\r
\r
+ /**\r
+ *\r
+ */\r
+ std::vector<Axis> axisStack;\r
\r
private:\r
\r
- Node *root;\r
+ /**\r
+ * Contains the StackItem stack;\r
+ */\r
+ StackItem stack[STACK_SIZE];\r
+\r
+ /**\r
+ * Marks the head of the stack, for push() and pop()\r
+ */\r
+ int stackSize;\r
+\r
+ /**\r
+ * Current list of nodes found by the expression\r
+ */\r
NodeList nodeList;\r
\r
- StackItem items[STACK_SIZE];\r
- int size;\r
+\r
};\r
\r
\r
\r
+//########################################################################\r
+//# X P A T H T O K E N\r
+//########################################################################\r
+\r
+\r
\r
/**\r
* This is a pseudocode-type class that executes itself on a stack,\r
virtual int getType()\r
{ return type; }\r
/**\r
- * Return the enumerated TokenType of this token\r
- * (in the .cpp file)\r
+ * Return the string TokenType of this token\r
*/\r
virtual DOMString getTypeString();\r
\r
* Let this token execute itself on the given stack,\r
* possibly adding Nodes to the node list.\r
*/\r
- virtual bool execute(Stack &stack)\r
+ virtual bool execute(TokenExecutor &stack)\r
{ return true; }\r
\r
/**\r
\r
\r
//########################################################################\r
-//# X P A T H T O K E N\r
+//# X P A T H T O K E N T Y P E S\r
//########################################################################\r
\r
\r
type = TOK_STR;\r
sval = val;\r
}\r
- virtual bool execute(Stack &stack)\r
+ virtual bool execute(TokenExecutor &exec)\r
{\r
StackItem item;\r
item.sval = sval;\r
- stack.push(item);\r
+ exec.push(item);\r
return true;\r
}\r
};\r
type = TOK_FLOAT;\r
dval = val;\r
}\r
- virtual bool execute(Stack &stack)\r
+ virtual bool execute(TokenExecutor &exec)\r
{\r
StackItem item;\r
item.dval = dval;\r
- stack.push(item);\r
+ exec.push(item);\r
return true;\r
}\r
};\r
type = TOK_INT;\r
ival = val;\r
}\r
- virtual bool execute(Stack &stack)\r
+ virtual bool execute(TokenExecutor &exec)\r
{\r
StackItem item;\r
item.ival = ival;\r
- stack.push(item);\r
+ exec.push(item);\r
return true;\r
}\r
};\r
{\r
type = TOK_AND;\r
}\r
- virtual bool execute(Stack &stack)\r
+ virtual bool execute(TokenExecutor &exec)\r
{\r
- StackItem item1 = stack.pop();\r
- StackItem item2 = stack.pop();\r
+ StackItem item1 = exec.pop();\r
+ StackItem item2 = exec.pop();\r
item1.ival = item1.ival && item2.ival;\r
- stack.push(item1);\r
+ exec.push(item1);\r
return true;\r
}\r
};\r
{\r
type = TOK_OR;\r
}\r
- virtual bool execute(Stack &stack)\r
+ virtual bool execute(TokenExecutor &exec)\r
{\r
- StackItem item1 = stack.pop();\r
- StackItem item2 = stack.pop();\r
+ StackItem item1 = exec.pop();\r
+ StackItem item2 = exec.pop();\r
item1.ival = item1.ival || item2.ival;\r
- stack.push(item1);\r
+ exec.push(item1);\r
return true;\r
}\r
};\r
{\r
type = TOK_MOD;\r
}\r
- virtual bool execute(Stack &stack)\r
+ virtual bool execute(TokenExecutor &exec)\r
{\r
- StackItem item1 = stack.pop();\r
- StackItem item2 = stack.pop();\r
+ StackItem item1 = exec.pop();\r
+ StackItem item2 = exec.pop();\r
item1.dval = fmod(item1.dval, item2.dval);\r
- stack.push(item1);\r
+ exec.push(item1);\r
return true;\r
}\r
};\r
{\r
type = TOK_DIV;\r
}\r
- virtual bool execute(Stack &stack)\r
+ virtual bool execute(TokenExecutor &exec)\r
{\r
- StackItem item1 = stack.pop();\r
- StackItem item2 = stack.pop();\r
+ StackItem item1 = exec.pop();\r
+ StackItem item2 = exec.pop();\r
item1.dval /= item2.dval;\r
- stack.push(item1);\r
+ exec.push(item1);\r
return true;\r
}\r
};\r
{\r
type = TOK_MULTIPLY;\r
}\r
- virtual bool execute(Stack &stack)\r
+ virtual bool execute(TokenExecutor &exec)\r
{\r
- StackItem item1 = stack.pop();\r
- StackItem item2 = stack.pop();\r
+ StackItem item1 = exec.pop();\r
+ StackItem item2 = exec.pop();\r
item1.dval *= item2.dval;\r
- stack.push(item1);\r
+ exec.push(item1);\r
return true;\r
}\r
};\r
{\r
type = TOK_PLUS;\r
}\r
- virtual bool execute(Stack &stack)\r
+ virtual bool execute(TokenExecutor &exec)\r
{\r
- StackItem item1 = stack.pop();\r
- StackItem item2 = stack.pop();\r
+ StackItem item1 = exec.pop();\r
+ StackItem item2 = exec.pop();\r
item1.dval += item2.dval;\r
- stack.push(item1);\r
+ exec.push(item1);\r
return true;\r
}\r
};\r
{\r
type = TOK_MINUS;\r
}\r
- virtual bool execute(Stack &stack)\r
+ virtual bool execute(TokenExecutor &exec)\r
{\r
- StackItem item1 = stack.pop();\r
- StackItem item2 = stack.pop();\r
+ StackItem item1 = exec.pop();\r
+ StackItem item2 = exec.pop();\r
item1.dval -= item2.dval;\r
- stack.push(item1);\r
+ exec.push(item1);\r
return true;\r
}\r
};\r
{\r
type = TOK_NEG;\r
}\r
- virtual bool execute(Stack &stack)\r
+ virtual bool execute(TokenExecutor &exec)\r
{\r
- StackItem item;\r
- item.dval = -dval;\r
- item.ival = -ival;\r
- stack.push(item);\r
+ StackItem item = exec.pop();\r
+ item.dval = -item.dval;\r
+ item.ival = -item.ival;\r
+ exec.push(item);\r
return true;\r
}\r
};\r
{\r
type = TOK_EQUALS;\r
}\r
- virtual bool execute(Stack &stack)\r
+ virtual bool execute(TokenExecutor &exec)\r
{\r
- StackItem item1 = stack.pop();\r
- StackItem item2 = stack.pop();\r
+ StackItem item1 = exec.pop();\r
+ StackItem item2 = exec.pop();\r
item1.ival = (item1.dval == item2.dval);\r
- stack.push(item1);\r
+ exec.push(item1);\r
return true;\r
}\r
};\r
{\r
type = TOK_NOT_EQUALS;\r
}\r
- virtual bool execute(Stack &stack)\r
+ virtual bool execute(TokenExecutor &exec)\r
{\r
- StackItem item1 = stack.pop();\r
- StackItem item2 = stack.pop();\r
+ StackItem item1 = exec.pop();\r
+ StackItem item2 = exec.pop();\r
item1.ival = (item1.dval != item2.dval);\r
- stack.push(item1);\r
+ exec.push(item1);\r
return true;\r
}\r
};\r
{\r
type = TOK_LESS_THAN_EQUALS;\r
}\r
- virtual bool execute(Stack &stack)\r
+ virtual bool execute(TokenExecutor &exec)\r
{\r
- StackItem item1 = stack.pop();\r
- StackItem item2 = stack.pop();\r
+ StackItem item1 = exec.pop();\r
+ StackItem item2 = exec.pop();\r
item1.ival = (item1.dval <= item2.dval);\r
- stack.push(item1);\r
+ exec.push(item1);\r
return true;\r
}\r
};\r
{\r
type = TOK_LESS_THAN;\r
}\r
- virtual bool execute(Stack &stack)\r
+ virtual bool execute(TokenExecutor &exec)\r
{\r
- StackItem item1 = stack.pop();\r
- StackItem item2 = stack.pop();\r
+ StackItem item1 = exec.pop();\r
+ StackItem item2 = exec.pop();\r
item1.ival = (item1.dval < item2.dval);\r
- stack.push(item1);\r
+ exec.push(item1);\r
return true;\r
}\r
};\r
{\r
type = TOK_GREATER_THAN_EQUALS;\r
}\r
- virtual bool execute(Stack &stack)\r
+ virtual bool execute(TokenExecutor &exec)\r
{\r
- StackItem item1 = stack.pop();\r
- StackItem item2 = stack.pop();\r
+ StackItem item1 = exec.pop();\r
+ StackItem item2 = exec.pop();\r
item1.ival = (item1.dval >= item2.dval);\r
- stack.push(item1);\r
+ exec.push(item1);\r
return true;\r
}\r
};\r
{\r
type = TOK_GREATER_THAN;\r
}\r
- virtual bool execute(Stack &stack)\r
+ virtual bool execute(TokenExecutor &exec)\r
{\r
- StackItem item1 = stack.pop();\r
- StackItem item2 = stack.pop();\r
+ StackItem item1 = exec.pop();\r
+ StackItem item2 = exec.pop();\r
item1.ival = (item1.dval > item2.dval);\r
- stack.push(item1);\r
+ exec.push(item1);\r
return true;\r
}\r
};\r
{\r
type = TOK_ABSOLUTE;\r
}\r
- virtual bool execute(Stack &stack)\r
+ virtual bool execute(TokenExecutor &exec)\r
{\r
+ Node *n = exec.axis.getNode();\r
+ while (n->getParentNode())\r
+ n = n->getParentNode();\r
+ exec.axis.setNode(n);\r
return true;\r
}\r
};\r
{\r
type = TOK_RELATIVE;\r
}\r
- virtual bool execute(Stack &stack)\r
+ virtual bool execute(TokenExecutor &exec)\r
{\r
+ ///exec.axis.currentNode = stack.rootNode;\r
return true;\r
}\r
};\r
{\r
type = TOK_STEP;\r
}\r
- virtual bool execute(Stack &stack)\r
+ virtual bool execute(TokenExecutor &exec)\r
{\r
return true;\r
}\r
type = TOK_NAME_TEST;\r
sval = name;\r
}\r
- virtual bool execute(Stack &stack)\r
+ virtual bool execute(TokenExecutor &exec)\r
{\r
return true;\r
}\r
{\r
type = TOK_EXPR;\r
}\r
- virtual bool execute(Stack &stack)\r
+ virtual bool execute(TokenExecutor &exec)\r
{\r
return true;\r
}\r
{\r
type = TOK_UNION;\r
}\r
- virtual bool execute(Stack &stack)\r
+ virtual bool execute(TokenExecutor &exec)\r
{\r
return true;\r
}\r
{\r
type = TOK_AXIS_ANCESTOR_OR_SELF;\r
}\r
- virtual bool execute(Stack &stack)\r
+ virtual bool execute(TokenExecutor &exec)\r
{\r
return true;\r
}\r
{\r
type = TOK_AXIS_ANCESTOR;\r
}\r
- virtual bool execute(Stack &stack)\r
+ virtual bool execute(TokenExecutor &exec)\r
{\r
return true;\r
}\r
{\r
type = TOK_AXIS_ATTRIBUTE;\r
}\r
- virtual bool execute(Stack &stack)\r
+ virtual bool execute(TokenExecutor &exec)\r
{\r
return true;\r
}\r
{\r
type = TOK_AXIS_CHILD;\r
}\r
- virtual bool execute(Stack &stack)\r
+ virtual bool execute(TokenExecutor &exec)\r
{\r
return true;\r
}\r
{\r
type = TOK_AXIS_DESCENDANT_OR_SELF;\r
}\r
- virtual bool execute(Stack &stack)\r
+ virtual bool execute(TokenExecutor &exec)\r
{\r
return true;\r
}\r
{\r
type = TOK_AXIS_DESCENDANT;\r
}\r
- virtual bool execute(Stack &stack)\r
+ virtual bool execute(TokenExecutor &exec)\r
{\r
return true;\r
}\r
{\r
type = TOK_AXIS_FOLLOWING_SIBLING;\r
}\r
- virtual bool execute(Stack &stack)\r
+ virtual bool execute(TokenExecutor &exec)\r
{\r
return true;\r
}\r
{\r
type = TOK_AXIS_FOLLOWING;\r
}\r
- virtual bool execute(Stack &stack)\r
+ virtual bool execute(TokenExecutor &exec)\r
{\r
return true;\r
}\r
{\r
type = TOK_AXIS_NAMESPACE;\r
}\r
- virtual bool execute(Stack &stack)\r
+ virtual bool execute(TokenExecutor &exec)\r
{\r
return true;\r
}\r
{\r
type = TOK_AXIS_PARENT;\r
}\r
- virtual bool execute(Stack &stack)\r
+ virtual bool execute(TokenExecutor &exec)\r
{\r
return true;\r
}\r
{\r
type = TOK_AXIS_PRECEDING_SIBLING;\r
}\r
- virtual bool execute(Stack &stack)\r
+ virtual bool execute(TokenExecutor &exec)\r
{\r
return true;\r
}\r
{\r
type = TOK_AXIS_PRECEDING;\r
}\r
- virtual bool execute(Stack &stack)\r
+ virtual bool execute(TokenExecutor &exec)\r
{\r
return true;\r
}\r
{\r
type = TOK_AXIS_SELF;\r
}\r
- virtual bool execute(Stack &stack)\r
+ virtual bool execute(TokenExecutor &exec)\r
{\r
return true;\r
}\r
{\r
type = TOK_FUNC_LAST;\r
}\r
- virtual bool execute(Stack &stack)\r
+ virtual bool execute(TokenExecutor &exec)\r
{\r
return true;\r
}\r
{\r
type = TOK_FUNC_POSITION;\r
}\r
- virtual bool execute(Stack &stack)\r
+ virtual bool execute(TokenExecutor &exec)\r
{\r
return true;\r
}\r
{\r
type = TOK_FUNC_COUNT;\r
}\r
- virtual bool execute(Stack &stack)\r
+ virtual bool execute(TokenExecutor &exec)\r
{\r
return true;\r
}\r
{\r
type = TOK_FUNC_ID;\r
}\r
- virtual bool execute(Stack &stack)\r
+ virtual bool execute(TokenExecutor &exec)\r
{\r
return true;\r
}\r
{\r
type = TOK_FUNC_LOCAL_NAME;\r
}\r
- virtual bool execute(Stack &stack)\r
+ virtual bool execute(TokenExecutor &exec)\r
{\r
return true;\r
}\r
{\r
type = TOK_FUNC_NAMESPACE_URI;\r
}\r
- virtual bool execute(Stack &stack)\r
+ virtual bool execute(TokenExecutor &exec)\r
{\r
return true;\r
}\r
{\r
type = TOK_FUNC_NAME;\r
}\r
- virtual bool execute(Stack &stack)\r
+ virtual bool execute(TokenExecutor &exec)\r
{\r
return true;\r
}\r
{\r
type = TOK_FUNC_STRING;\r
}\r
- virtual bool execute(Stack &stack)\r
+ virtual bool execute(TokenExecutor &exec)\r
{\r
return true;\r
}\r
{\r
type = TOK_FUNC_CONCAT;\r
}\r
- virtual bool execute(Stack &stack)\r
+ virtual bool execute(TokenExecutor &exec)\r
{\r
return true;\r
}\r
{\r
type = TOK_FUNC_STARTS_WITH;\r
}\r
- virtual bool execute(Stack &stack)\r
+ virtual bool execute(TokenExecutor &exec)\r
{\r
return true;\r
}\r
{\r
type = TOK_FUNC_CONTAINS;\r
}\r
- virtual bool execute(Stack &stack)\r
+ virtual bool execute(TokenExecutor &exec)\r
{\r
return true;\r
}\r
{\r
type = TOK_FUNC_SUBSTRING_BEFORE;\r
}\r
- virtual bool execute(Stack &stack)\r
+ virtual bool execute(TokenExecutor &exec)\r
{\r
return true;\r
}\r
{\r
type = TOK_FUNC_SUBSTRING_AFTER;\r
}\r
- virtual bool execute(Stack &stack)\r
+ virtual bool execute(TokenExecutor &exec)\r
{\r
return true;\r
}\r
{\r
type = TOK_FUNC_SUBSTRING;\r
}\r
- virtual bool execute(Stack &stack)\r
+ virtual bool execute(TokenExecutor &exec)\r
{\r
return true;\r
}\r
{\r
type = TOK_FUNC_STRING_LENGTH;\r
}\r
- virtual bool execute(Stack &stack)\r
+ virtual bool execute(TokenExecutor &exec)\r
{\r
return true;\r
}\r
{\r
type = TOK_FUNC_NORMALIZE_SPACE;\r
}\r
- virtual bool execute(Stack &stack)\r
+ virtual bool execute(TokenExecutor &exec)\r
{\r
return true;\r
}\r
{\r
type = TOK_FUNC_TRANSLATE;\r
}\r
- virtual bool execute(Stack &stack)\r
+ virtual bool execute(TokenExecutor &exec)\r
{\r
return true;\r
}\r
{\r
type = TOK_FUNC_BOOLEAN;\r
}\r
- virtual bool execute(Stack &stack)\r
+ virtual bool execute(TokenExecutor &exec)\r
{\r
return true;\r
}\r
{\r
type = TOK_FUNC_NOT;\r
}\r
- virtual bool execute(Stack &stack)\r
+ virtual bool execute(TokenExecutor &exec)\r
{\r
return true;\r
}\r
{\r
type = TOK_FUNC_TRUE;\r
}\r
- virtual bool execute(Stack &stack)\r
+ virtual bool execute(TokenExecutor &exec)\r
{\r
return true;\r
}\r
{\r
type = TOK_FUNC_FALSE;\r
}\r
- virtual bool execute(Stack &stack)\r
+ virtual bool execute(TokenExecutor &exec)\r
{\r
return true;\r
}\r
{\r
type = TOK_FUNC_LANG;\r
}\r
- virtual bool execute(Stack &stack)\r
+ virtual bool execute(TokenExecutor &exec)\r
{\r
return true;\r
}\r
{\r
type = TOK_FUNC_NUMBER;\r
}\r
- virtual bool execute(Stack &stack)\r
+ virtual bool execute(TokenExecutor &exec)\r
{\r
return true;\r
}\r
{\r
type = TOK_FUNC_SUM;\r
}\r
- virtual bool execute(Stack &stack)\r
+ virtual bool execute(TokenExecutor &exec)\r
{\r
return true;\r
}\r
{\r
type = TOK_FUNC_FLOOR;\r
}\r
- virtual bool execute(Stack &stack)\r
+ virtual bool execute(TokenExecutor &exec)\r
{\r
return true;\r
}\r
{\r
type = TOK_FUNC_CEILING;\r
}\r
- virtual bool execute(Stack &stack)\r
+ virtual bool execute(TokenExecutor &exec)\r
{\r
return true;\r
}\r
{\r
type = TOK_FUNC_ROUND;\r
}\r
- virtual bool execute(Stack &stack)\r
+ virtual bool execute(TokenExecutor &exec)\r
{\r
return true;\r
}\r
virtual void add(Token *tok);\r
\r
/**\r
- * This method "executes" a list of Tokens in the context of a DOM root\r
- * Node, returning a list of Nodes that match the xpath expression.\r
+ *\r
*/\r
- NodeList execute(const Node *root);\r
+ virtual unsigned int size() const;\r
\r
/**\r
*\r
\r
std::vector<Token *> tokens;\r
\r
+\r
};\r
\r
\r
\r
+\r
+\r
+\r
+\r
} // namespace xpath\r
} // namespace dom\r
} // namespace w3c\r