summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 29ff8d1)
raw | patch | inline | side by side (parent: 29ff8d1)
author | ishmal <ishmal@users.sourceforge.net> | |
Thu, 27 Apr 2006 09:53:08 +0000 (09:53 +0000) | ||
committer | ishmal <ishmal@users.sourceforge.net> | |
Thu, 27 Apr 2006 09:53:08 +0000 (09:53 +0000) |
diff --git a/src/dom/dom.h b/src/dom/dom.h
index 4117f91b70a977eefcc450b767595c14231edd45..ab82c429819a95d7f555d3c1ce50e940df9b4426 100644 (file)
--- a/src/dom/dom.h
+++ b/src/dom/dom.h
strings = other.strings;
}
+ /**
+ *
+ */
+ DOMStringList &operator=(const DOMStringList &other)
+ {
+ strings = other.strings;
+ return *this;
+ }
+
/**
*
*/
namespaceURI = other.namespaceURI;
name = other.name;
}
+ NamePair &operator=(const NamePair &other)
+ {
+ namespaceURI = other.namespaceURI;
+ name = other.name;
+ return *this;
+ }
virtual ~NamePair() {}
DOMString namespaceURI;
namePairs = other.namePairs;
}
+ /**
+ *
+ */
+ NameList &operator=(const NameList &other)
+ {
+ namePairs = other.namePairs;
+ return *this;
+ }
+
/**
*
*/
implementations = other.implementations;
}
+ /**
+ *
+ */
+ DOMImplementationList &operator=(const DOMImplementationList &other)
+ {
+ implementations = other.implementations;
+ return *this;
+ }
+
/**
*
*/
}
NamedNodeMapEntry(const NamedNodeMapEntry &other)
{
- namespaceURI = other.namespaceURI;
- name = other.name;
- node = other.node;
+ assign(other);
+ }
+ NamedNodeMapEntry &operator=(const NamedNodeMapEntry &other)
+ {
+ assign(other);
+ return *this;
}
virtual ~NamedNodeMapEntry()
{
}
+ void assign(const NamedNodeMapEntry &other)
+ {
+ namespaceURI = other.namespaceURI;
+ name = other.name;
+ node = other.node;
+ }
DOMString namespaceURI;
DOMString name;
Node *node;
entries = other.entries;
}
+ /**
+ *
+ */
+ NamedNodeMap &operator=(const NamedNodeMap &other)
+ {
+ entries = other.entries;
+ return *this;
+ }
+
/**
*
diff --git a/src/dom/domimpl.cpp b/src/dom/domimpl.cpp
index e9da6291fb3dadec082bb97ef7b639c2b90f47e1..644c6567c37a7330437c8306c9dda0d94428a0d0 100644 (file)
--- a/src/dom/domimpl.cpp
+++ b/src/dom/domimpl.cpp
}
+/**
+ *
+ */
+NodeImpl::NodeImpl(const NodeImpl &other)
+{
+ init();
+ assign(other);
+}
+
+/**
+ *
+ */
+NodeImpl &NodeImpl::operator=(const NodeImpl &other)
+{
+ init();
+ assign(other);
+ return *this;
+}
/**
diff --git a/src/dom/domimpl.h b/src/dom/domimpl.h
index 677f5eb8cd63ec705bd30ff7b1d28bb0788d3eb8..bbd1693ef8dd574266465f1c268f9b29a710370a 100644 (file)
--- a/src/dom/domimpl.h
+++ b/src/dom/domimpl.h
*/
NodeImpl();
+ /**
+ *
+ */
+ NodeImpl(const NodeImpl &other);
+
+ /**
+ *
+ */
+ NodeImpl &operator=(const NodeImpl &other);
+
/**
*
*/
index f3c57f6f51bbfbc50eb72bd09c18d18789de27f9..18d62d40a36bcd345d9b184ebbdfc20a021cefbf 100644 (file)
--- a/src/dom/xpathparser.cpp
+++ b/src/dom/xpathparser.cpp
//# X P A T H G R A M M A R P A R S I N G\r
//#########################################################################\r
\r
+\r
+void XPathParser::tokAdd(Token *tok)\r
+{\r
+ tokens.add(tok);\r
+}\r
+\r
/**\r
* [1] LocationPath ::=\r
* RelativeLocationPath\r
if (t.getType() == NAME_TEST)\r
{\r
p++;\r
- printf("xxx\n");\r
+ tokAdd(new TokNameTest(t.getStringValue()));\r
return p;\r
}\r
if (t.getType() == NODE_TYPE)\r
diff --git a/src/dom/xpathparser.h b/src/dom/xpathparser.h
index 32127f89b0411dae90588a1958556fd8d97aa856..4b4e79fcc78ced0acf3a54e81b9814bca6becbfc 100644 (file)
--- a/src/dom/xpathparser.h
+++ b/src/dom/xpathparser.h
//# GRAMMAR PARSING\r
//#################################\r
\r
+ /**\r
+ * Add a newly derived token to the token list;\r
+ */\r
+ void tokAdd(Token *token);\r
+\r
/**\r
* The grammar definitions marked [1]-[39] are directly\r
* from the W3C XPath grammar spacification.\r
diff --git a/src/dom/xpathtoken.cpp b/src/dom/xpathtoken.cpp
index 0254266d0a4c1271c1fb21f961a4adf915e0dc3e..bed02294333e2d6144caa3fa13e05e5325e483e0 100644 (file)
--- a/src/dom/xpathtoken.cpp
+++ b/src/dom/xpathtoken.cpp
*/\r
StackItem::StackItem(const StackItem &other)\r
{\r
- sval = other.sval;\r
- ival = other.ival;\r
- dval = other.dval;\r
+ assign(other);\r
}\r
\r
\r
}\r
\r
\r
+/**\r
+ *\r
+ */\r
+StackItem &StackItem::operator=(const StackItem &other)\r
+{\r
+ assign(other);\r
+ return *this;\r
+}\r
+\r
+/**\r
+ *\r
+ */\r
+void StackItem::assign(const StackItem &other)\r
+{\r
+ sval = other.sval;\r
+ ival = other.ival;\r
+ dval = other.dval;\r
+}\r
+\r
+\r
//########################################################################\r
//# X P A T H S T A C K\r
//########################################################################\r
}\r
\r
\r
+/**\r
+ *\r
+ */\r
+TokenList::TokenList(const TokenList &other)\r
+{\r
+ assign(other);\r
+}\r
+\r
+/**\r
+ *\r
+ */\r
+TokenList &TokenList::operator=(const TokenList &other)\r
+{\r
+ assign(other);\r
+ return *this;\r
+}\r
+\r
+/**\r
+ *\r
+ */\r
+void TokenList::assign(const TokenList &other)\r
+{\r
+ tokens = other.tokens;\r
+}\r
+\r
/**\r
*\r
*/\r
diff --git a/src/dom/xpathtoken.h b/src/dom/xpathtoken.h
index 9b9259e06c5a2f5eae075d49d43c363010c2235e..f551bee3c193ff81d864c52841a4be6e169512f5 100644 (file)
--- a/src/dom/xpathtoken.h
+++ b/src/dom/xpathtoken.h
*/\r
virtual ~StackItem();\r
\r
+ /**\r
+ *\r
+ */\r
+ StackItem &operator=(const StackItem &other);\r
+\r
+ /**\r
+ *\r
+ */\r
+ void assign(const StackItem &other);\r
+\r
+\r
//treat the stack item like an union of string, integer, and double\r
\r
/**\r
TOK_ABSOLUTE,\r
TOK_RELATIVE,\r
TOK_STEP,\r
+ TOK_NAME_TEST,\r
TOK_EXPR,\r
TOK_UNION,\r
//function types\r
}\r
};\r
\r
+class TokNameTest : public Token\r
+{\r
+public:\r
+ TokNameTest(const DOMString &name)\r
+ {\r
+ type = TOK_NAME_TEST;\r
+ stype = "step";\r
+ sval = name;\r
+ }\r
+ virtual bool execute(Stack &stack)\r
+ {\r
+ return true;\r
+ }\r
+};\r
+\r
class TokExpr : public Token\r
{\r
public:\r
*/\r
TokenList();\r
\r
+ /**\r
+ *\r
+ */\r
+ TokenList(const TokenList &other);\r
+\r
+ /**\r
+ *\r
+ */\r
+ TokenList &operator=(const TokenList &other);\r
+\r
+ /**\r
+ *\r
+ */\r
+ void assign(const TokenList &other);\r
+\r
/**\r
*\r
*/\r